From 7210e7ce1a9cee12fd297de068c199b25820c7d4 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 19 May 2023 11:43:44 +0200 Subject: [PATCH 0001/1862] NEW : TakePOS - add constant to sho line subprices --- htdocs/takepos/invoice.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 6f5e829ca47..0ca2155feb1 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1347,6 +1347,9 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e print $hookmanager->resPrint; if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) { + if ($conf->global->TAKEPOS_SHOW_SUBPRICE) { + print ''.$langs->trans('PriceUHT').''; + } print ''.$langs->trans('ReductionShort').''; print ''.$langs->trans('Qty').''; if (getDolGlobalString('TAKEPOS_SHOW_HT')) { @@ -1602,6 +1605,9 @@ if ($placeid > 0) { if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $htmlforlines .= $hookmanager->resPrint; + if ($conf->global->TAKEPOS_SHOW_SUBPRICE) { + $htmlforlines .= ''.price($line->subprice).''; + } $htmlforlines .= ''.vatrate($line->remise_percent, true).''; $htmlforlines .= ''; if (isModEnabled('stock') && !empty($user->rights->stock->mouvement->lire)) { From 8e7d1a9f23a2691384161c0579e7186067ae7475 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 19 May 2023 11:54:21 +0200 Subject: [PATCH 0002/1862] NEW : TAkePOS - dont allow payment if no thirdparty selected --- htdocs/takepos/index.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 7e1c648d460..c2bde7b3dc2 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -532,6 +532,17 @@ function Reduction() { function CloseBill() { invoiceid = $("#invoiceid").val(); console.log("Open popup to enter payment on invoiceid="+invoiceid); + global->TAKEPOS_NO_GENERIC_THIRDPARTY) { ?> + if ($("#idcustomer").val() == "") { + alert("trans('TakePosCustomerMandatory'); ?>"); + global->TAKEPOS_CHOOSE_CONTACT) { ?> + Contact(); + + Customer(); + + return; + } + global->TAKEPOS_HIDE_HEAD_BAR)) {
+
From 482b9756a28e2d2dbd3e9fb32212cbf3c8a074e5 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 19 May 2023 11:54:51 +0200 Subject: [PATCH 0003/1862] typo --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index c2bde7b3dc2..7b284762ba1 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -542,7 +542,7 @@ function CloseBill() { return; } - $.colorbox({href:"pay.php?place="+place+"&invoiceid="+invoiceid, width:"80%", height:"90%", transition:"none", iframe:"true", title:""}); } From 5de555222c423569b99f1cfd665d7567d54bd395 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 19 May 2023 16:37:41 +0200 Subject: [PATCH 0004/1862] add missing trans --- htdocs/langs/en_US/cashdesk.lang | 1 + htdocs/langs/fr_FR/cashdesk.lang | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 9cde66460d3..c8fb62e1d45 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -145,3 +145,4 @@ ShowProductReference=Show reference of products UsePriceHT=Use price excl. taxes and not price incl. taxes TerminalName=Terminal %s TerminalNameDesc=Terminal name +TakePosCustomerMandatory=You must choose a customer diff --git a/htdocs/langs/fr_FR/cashdesk.lang b/htdocs/langs/fr_FR/cashdesk.lang index 049ee169cef..91496e9ccf2 100644 --- a/htdocs/langs/fr_FR/cashdesk.lang +++ b/htdocs/langs/fr_FR/cashdesk.lang @@ -145,3 +145,4 @@ ShowProductReference=Afficher la référence des produits UsePriceHT=Utiliser le prix HT et non le prix TTC TerminalName=Terminal %s TerminalNameDesc=Nom du terminal +TakePosCustomerMandatory=Vous devez choisir un client From b2dd9bfb40de2a27a16d0cd33792cd0d1c2811c1 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Sun, 21 May 2023 09:51:56 +0200 Subject: [PATCH 0005/1862] fix php8 --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 0ca2155feb1..9eb94b9c9ee 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1347,7 +1347,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e print $hookmanager->resPrint; if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) { - if ($conf->global->TAKEPOS_SHOW_SUBPRICE) { + if (getDolGlobalString("TAKEPOS_SHOW_SUBPRICE")) { print ''.$langs->trans('PriceUHT').''; } print ''.$langs->trans('ReductionShort').''; From 3f337000d9f6c2d8fbc0881006f28ea2886198b6 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Sun, 21 May 2023 09:52:59 +0200 Subject: [PATCH 0006/1862] fix php8 --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 9eb94b9c9ee..d97eb5e6f0d 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1605,7 +1605,7 @@ if ($placeid > 0) { if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $htmlforlines .= $hookmanager->resPrint; - if ($conf->global->TAKEPOS_SHOW_SUBPRICE) { + if (getDolGlobalString("TAKEPOS_SHOW_SUBPRICE")) { $htmlforlines .= ''.price($line->subprice).''; } $htmlforlines .= ''.vatrate($line->remise_percent, true).''; From 823b479908091d581813189fd554054ab599dc12 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Sun, 21 May 2023 10:26:44 +0200 Subject: [PATCH 0007/1862] fix php8 --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 7b284762ba1..93d0c478312 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -532,7 +532,7 @@ function Reduction() { function CloseBill() { invoiceid = $("#invoiceid").val(); console.log("Open popup to enter payment on invoiceid="+invoiceid); - global->TAKEPOS_NO_GENERIC_THIRDPARTY) { ?> + if ($("#idcustomer").val() == "") { alert("trans('TakePosCustomerMandatory'); ?>"); global->TAKEPOS_CHOOSE_CONTACT) { ?> From cdf16d965c107605ac0d5fa2dee279833e14b0cd Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Sun, 21 May 2023 19:01:50 +0200 Subject: [PATCH 0008/1862] fix --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 93d0c478312..cf9e8732951 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -532,7 +532,7 @@ function Reduction() { function CloseBill() { invoiceid = $("#invoiceid").val(); console.log("Open popup to enter payment on invoiceid="+invoiceid); - + if ($("#idcustomer").val() == "") { alert("trans('TakePosCustomerMandatory'); ?>"); global->TAKEPOS_CHOOSE_CONTACT) { ?> From d9fd46caed3fb41b8415b5e4ed01428d527779b3 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Sun, 21 May 2023 19:03:00 +0200 Subject: [PATCH 0009/1862] fix --- htdocs/takepos/invoice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index d97eb5e6f0d..577205621bb 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1347,7 +1347,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e print $hookmanager->resPrint; if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) { - if (getDolGlobalString("TAKEPOS_SHOW_SUBPRICE")) { + if (getDolGlobalInt("TAKEPOS_SHOW_SUBPRICE")) { print ''.$langs->trans('PriceUHT').''; } print ''.$langs->trans('ReductionShort').''; @@ -1605,7 +1605,7 @@ if ($placeid > 0) { if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $htmlforlines .= $hookmanager->resPrint; - if (getDolGlobalString("TAKEPOS_SHOW_SUBPRICE")) { + if (getDolGlobalInt("TAKEPOS_SHOW_SUBPRICE")) { $htmlforlines .= ''.price($line->subprice).''; } $htmlforlines .= ''.vatrate($line->remise_percent, true).''; From 382f9ce95dd6d3def274c467bd3fa3b46cfda0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Lukas?= Date: Fri, 8 Dec 2023 00:24:44 +0100 Subject: [PATCH 0010/1862] Fix #27029 --- htdocs/core/lib/security.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 2f4d4fe2f83..deb14e0b06d 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -1051,7 +1051,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql .= " WHERE dbt.rowid IN (".$db->sanitize($objectid, 1).")"; $sql .= " AND dbt.".$dbt_keyfield." = ".((int) $user->socid); - } elseif (isModEnabled("societe") && empty($user->rights->societe->client->voir)) { + } elseif (isModEnabled("societe") && empty($user->rights->societe->client->voir)&& ($feature != 'knowledgemanagement')) { // If internal user without permission to see all thirdparties: Check permission for internal users that are restricted on their objects if ($feature != 'ticket') { if (empty($dbt_keyfield)) { From 28769a13ebeec17db4745a949a9d6747a0c247f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Lukas?= Date: Wed, 27 Dec 2023 00:08:18 +0100 Subject: [PATCH 0011/1862] Update security.lib.php Better fix as proposed by eldy --- htdocs/core/lib/security.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index deb14e0b06d..893cb3d8355 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -892,7 +892,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $checkonentitydone = 0; // Array to define rules of checks to do - $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales'); // Test on entity only (Objects with no link to company) + $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales', 'knowledgemanagement'); // Test on entity only (Objects with no link to company) $checksoc = array('societe'); // Test for object Societe $checkparentsoc = array('agenda', 'contact', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...). $checkproject = array('projet', 'project'); // Test for project object @@ -1051,7 +1051,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql .= " WHERE dbt.rowid IN (".$db->sanitize($objectid, 1).")"; $sql .= " AND dbt.".$dbt_keyfield." = ".((int) $user->socid); - } elseif (isModEnabled("societe") && empty($user->rights->societe->client->voir)&& ($feature != 'knowledgemanagement')) { + } elseif (isModEnabled("societe") && empty($user->rights->societe->client->voir)) { // If internal user without permission to see all thirdparties: Check permission for internal users that are restricted on their objects if ($feature != 'ticket') { if (empty($dbt_keyfield)) { From ab206910ab509c76bd592501463688a2a9154d7f Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 15 Jan 2024 09:40:59 +0100 Subject: [PATCH 0012/1862] change to receptiondet_batch into scripts --- ...php => receptiondet_batch_extrafields.php} | 4 ++-- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/lib/reception.lib.php | 6 ++--- htdocs/core/modules/modReception.class.php | 6 ++--- htdocs/expedition/dispatch.php | 2 +- .../class/fournisseur.commande.class.php | 8 +++---- .../fournisseur.commande.dispatch.class.php | 2 +- htdocs/fourn/commande/dispatch.php | 4 ++-- htdocs/product/class/product.class.php | 2 +- .../product/stock/class/productlot.class.php | 4 ++-- .../product/stock/lib/replenishment.lib.php | 2 +- htdocs/product/stock/replenish.php | 2 +- .../stock/stats/commande_fournisseur.php | 2 +- htdocs/product/stock/stats/reception.php | 2 +- htdocs/reception/card.php | 4 ++-- htdocs/reception/class/reception.class.php | 24 +++++++++---------- htdocs/reception/dispatch.php | 4 ++-- 17 files changed, 40 insertions(+), 40 deletions(-) rename htdocs/admin/{commande_fournisseur_dispatch_extrafields.php => receptiondet_batch_extrafields.php} (94%) diff --git a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php b/htdocs/admin/receptiondet_batch_extrafields.php similarity index 94% rename from htdocs/admin/commande_fournisseur_dispatch_extrafields.php rename to htdocs/admin/receptiondet_batch_extrafields.php index 277d61e1b2f..ea98618dda0 100644 --- a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php +++ b/htdocs/admin/receptiondet_batch_extrafields.php @@ -25,7 +25,7 @@ */ /** - * \file htdocs/admin/commande_fournisseur_dispatch_extrafields.php + * \file htdocs/admin/receptiondet_batch.php * \ingroup reception * \brief Page to setup extra fields of reception */ @@ -56,7 +56,7 @@ foreach ($tmptype2label as $key => $val) { $action = GETPOST('action', 'aZ09'); $attrname = GETPOST('attrname', 'alpha'); -$elementtype = 'commande_fournisseur_dispatch'; //Must be the $table_element of the class that manage extrafield +$elementtype = 'receptiondet_batch'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) { accessforbidden(); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 75fd4a5e47a..4dc6a6dad58 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4535,7 +4535,7 @@ abstract class CommonObject if ($elementTable == 'expensereport') { $fieldstatus = "fk_statut"; } - if ($elementTable == 'commande_fournisseur_dispatch') { + if ($elementTable == 'receptiondet_batch') { $fieldstatus = "status"; } if ($elementTable == 'prelevement_bons') { diff --git a/htdocs/core/lib/reception.lib.php b/htdocs/core/lib/reception.lib.php index 2dce74e6a11..b5f5a0c7067 100644 --- a/htdocs/core/lib/reception.lib.php +++ b/htdocs/core/lib/reception.lib.php @@ -122,7 +122,7 @@ function reception_admin_prepare_head() $extrafields = new ExtraFields($db); $extrafields->fetch_name_optionals_label('reception'); - $extrafields->fetch_name_optionals_label('commande_fournisseur_dispatch'); + $extrafields->fetch_name_optionals_label('receptiondet_batch'); $h = 0; $head = array(); @@ -146,9 +146,9 @@ function reception_admin_prepare_head() } if (getDolGlobalString('MAIN_SUBMODULE_RECEPTION')) { - $head[$h][0] = DOL_URL_ROOT.'/admin/commande_fournisseur_dispatch_extrafields.php'; + $head[$h][0] = DOL_URL_ROOT.'/admin/receptiondet_batch_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); - $nbExtrafields = $extrafields->attributes['commande_fournisseur_dispatch']['count']; + $nbExtrafields = $extrafields->attributes['receptiondet_batch']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ''.$nbExtrafields.''; } diff --git a/htdocs/core/modules/modReception.class.php b/htdocs/core/modules/modReception.class.php index f5f8429f5db..f0327612b7d 100644 --- a/htdocs/core/modules/modReception.class.php +++ b/htdocs/core/modules/modReception.class.php @@ -218,7 +218,7 @@ class modReception extends DolibarrModules $keyforelement = 'reception'; $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - $keyforselect = 'commande_fournisseur_dispatch'; + $keyforselect = 'receptiondet_batch'; $keyforelement = 'reception_line'; $keyforaliasextra = 'extra2'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; @@ -232,8 +232,8 @@ class modReception extends DolibarrModules } $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,'; - $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch as ed'; - $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch_extrafields as extra2 ON ed.rowid = extra2.fk_object'; + $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'receptiondet_batch as ed'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'receptiondet_batch_extrafields as extra2 ON ed.rowid = extra2.fk_object'; $this->export_sql_end[$r] .= ' , '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid'; if ($idcontacts && getDolGlobalString('RECEPTION_ADD_CONTACTS_IN_EXPORT')) { diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php index 8ba6e6d7768..1daba85e87f 100644 --- a/htdocs/expedition/dispatch.php +++ b/htdocs/expedition/dispatch.php @@ -774,7 +774,7 @@ if ($object->id > 0 || !empty($object->ref)) { print ''; // Warehouse column /*$sql = "SELECT cfd.rowid, cfd.qty, cfd.fk_entrepot, cfd.batch, cfd.eatby, cfd.sellby, cfd.fk_product"; - $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd"; + $sql .= " FROM ".MAIN_DB_PREFIX."receptiondet_batch as cfd"; $sql .= " WHERE cfd.fk_commandefourndet = ".(int) $objp->rowid;*/ $sql = "SELECT ed.rowid, ed.qty, ed.fk_entrepot,"; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 81570e7e320..102399eb4d9 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2103,7 +2103,7 @@ class CommandeFournisseur extends CommonOrder /** - * Save a receiving into the tracking table of receiving (commande_fournisseur_dispatch) and add product into stock warehouse. + * Save a receiving into the tracking table of receiving (receptiondet_batch) and add product into stock warehouse. * * @param User $user User object making change * @param int $product Id of product to dispatch @@ -2148,7 +2148,7 @@ class CommandeFournisseur extends CommonOrder if (($this->statut == self::STATUS_ORDERSENT || $this->statut == self::STATUS_RECEIVED_PARTIALLY || $this->statut == self::STATUS_RECEIVED_COMPLETELY)) { $this->db->begin(); - $sql = "INSERT INTO ".$this->db->prefix()."commande_fournisseur_dispatch"; + $sql = "INSERT INTO ".$this->db->prefix()."receptiondet_batch"; $sql .= " (fk_commande, fk_product, qty, fk_entrepot, fk_user, datec, fk_commandefourndet, status, comment, eatby, sellby, batch, fk_reception) VALUES"; $sql .= " ('".$this->id."','".$product."','".$qty."',".($entrepot > 0 ? "'".$entrepot."'" : "null").",'".$user->id."','".$this->db->idate($now)."','".$fk_commandefourndet."', ".$dispatchstatus.", '".$this->db->escape($comment)."', "; $sql .= ($eatby ? "'".$this->db->idate($eatby)."'" : "null").", ".($sellby ? "'".$this->db->idate($sellby)."'" : "null").", ".($batch ? "'".$this->db->escape($batch)."'" : "null").", ".($fk_reception > 0 ? "'".$this->db->escape($fk_reception)."'" : "null"); @@ -2395,7 +2395,7 @@ class CommandeFournisseur extends CommonOrder $sql .= " e.rowid as warehouse_id, e.ref as entrepot,"; $sql .= " cfd.rowid as dispatchedlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.fk_commandefourndet"; $sql .= " FROM ".$this->db->prefix()."product as p,"; - $sql .= " ".$this->db->prefix()."commande_fournisseur_dispatch as cfd"; + $sql .= " ".$this->db->prefix()."receptiondet_batch as cfd"; $sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e ON cfd.fk_entrepot = e.rowid"; $sql .= " WHERE cfd.fk_commande = ".((int) $this->id); $sql .= " AND cfd.fk_product = p.rowid"; @@ -3556,7 +3556,7 @@ class CommandeFournisseur extends CommonOrder $sql = 'SELECT cd.rowid, cd.fk_product,'; $sql .= ' sum(cfd.qty) as qty'; - $sql .= ' FROM '.$this->db->prefix().'commande_fournisseur_dispatch as cfd,'; + $sql .= ' FROM '.$this->db->prefix().'receptiondet_batch as cfd,'; if ($filtre_statut >= 0) { $sql .= ' '.$this->db->prefix().'reception as e,'; } diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 044a14119c9..7374ccb9111 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -56,7 +56,7 @@ class CommandeFournisseurDispatch extends CommonObjectLine /** * @var string Name of table without prefix where object is stored */ - public $table_element = 'commande_fournisseur_dispatch'; //!< Name of table without prefix where object is stored + public $table_element = 'receptiondet_batch'; //!< Name of table without prefix where object is stored public $lines = array(); /** diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 6241d2bd202..5c0a245310e 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -655,7 +655,7 @@ if ($id > 0 || !empty($ref)) { // Set $products_dispatched with qty dispatched for each product id $products_dispatched = array(); $sql = "SELECT l.rowid, cfd.fk_product, sum(cfd.qty) as qty"; - $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd"; + $sql .= " FROM ".MAIN_DB_PREFIX."receptiondet_batch as cfd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_fournisseurdet as l on l.rowid = cfd.fk_commandefourndet"; $sql .= " WHERE cfd.fk_commande = ".((int) $object->id); $sql .= " GROUP BY l.rowid, cfd.fk_product"; @@ -1158,7 +1158,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " ,cfd.fk_reception, r.date_delivery"; } $sql .= " FROM ".MAIN_DB_PREFIX."product as p,"; - $sql .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd"; + $sql .= " ".MAIN_DB_PREFIX."receptiondet_batch as cfd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_fournisseurdet as cd ON cd.rowid = cfd.fk_commandefourndet"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e ON cfd.fk_entrepot = e.rowid"; if ($conf->reception->enabled) { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5a7ae18ee1d..99279e0b173 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3427,7 +3427,7 @@ class Product extends CommonObject $sql = "SELECT COUNT(DISTINCT cf.fk_soc) as nb_suppliers, COUNT(DISTINCT cf.rowid) as nb,"; $sql .= " COUNT(fd.rowid) as nb_rows, SUM(fd.qty) as qty"; - $sql .= " FROM ".$this->db->prefix()."commande_fournisseur_dispatch as fd"; + $sql .= " FROM ".$this->db->prefix()."receptiondet_batch as fd"; $sql .= ", ".$this->db->prefix()."commande_fournisseur as cf"; $sql .= ", ".$this->db->prefix()."societe as s"; if (!$user->hasRight('societe', 'client', 'voir') && !$forVirtualStock) { diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 0e9852fba82..9c145073f94 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -835,7 +835,7 @@ class Productlot extends CommonObject $sql = "SELECT COUNT(DISTINCT cf.fk_soc) as nb_customers, COUNT(DISTINCT cf.rowid) as nb,"; $sql .= " COUNT(cfd.rowid) as nb_rows, SUM(cfdi.qty) as qty"; - $sql .= " FROM ".$this->db->prefix()."commande_fournisseur_dispatch as cfdi"; + $sql .= " FROM ".$this->db->prefix()."receptiondet_batch as cfdi"; $sql .= " INNER JOIN ".$this->db->prefix()."commande_fournisseurdet as cfd ON (cfd.rowid = cfdi.fk_commandefourndet)"; $sql .= " INNER JOIN ".$this->db->prefix()."commande_fournisseur as cf ON (cf.rowid = cfd.fk_commande)"; // $sql .= ", ".$this->db->prefix()."societe as s"; @@ -910,7 +910,7 @@ class Productlot extends CommonObject $sql = "SELECT COUNT(DISTINCT recep.fk_soc) as nb_customers, COUNT(DISTINCT recep.rowid) as nb,"; $sql .= " COUNT(cfdi.rowid) as nb_rows, SUM(cfdi.qty) as qty"; - $sql .= " FROM ".$this->db->prefix()."commande_fournisseur_dispatch as cfdi"; + $sql .= " FROM ".$this->db->prefix()."receptiondet_batch as cfdi"; $sql .= " INNER JOIN ".$this->db->prefix()."reception as recep ON (recep.rowid = cfdi.fk_reception)"; // $sql .= ", ".$this->db->prefix()."societe as s"; if (!$user->hasRight('societe', 'client', 'voir')) { diff --git a/htdocs/product/stock/lib/replenishment.lib.php b/htdocs/product/stock/lib/replenishment.lib.php index 8751935cb13..e6bf9d8a060 100644 --- a/htdocs/product/stock/lib/replenishment.lib.php +++ b/htdocs/product/stock/lib/replenishment.lib.php @@ -38,7 +38,7 @@ function dolDispatchToDo($order_id) $ordered = array(); // Count nb of quantity dispatched per product - $sql = 'SELECT fk_product, SUM(qty) as qtydispatched FROM '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch'; + $sql = 'SELECT fk_product, SUM(qty) as qtydispatched FROM '.MAIN_DB_PREFIX.'receptiondet_batch'; $sql .= ' WHERE fk_commande = '.((int) $order_id); $sql .= ' GROUP BY fk_product'; $sql .= ' ORDER by fk_product'; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index a9ae3c62195..b3e9b4aa510 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -451,7 +451,7 @@ if ($usevirtualstock) { $sqlReceptionFourn = "(SELECT ".$db->ifsql("SUM(fd4.qty) IS NULL", "0", "SUM(fd4.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL $sqlReceptionFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf4,"; - $sqlReceptionFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as fd4"; + $sqlReceptionFourn .= " ".MAIN_DB_PREFIX."receptiondet_batch as fd4"; $sqlReceptionFourn .= " WHERE fd4.fk_commande = cf4.rowid AND cf4.entity IN (".getEntity(getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'supplier_order').")"; $sqlReceptionFourn .= " AND fd4.fk_product = p.rowid"; $sqlReceptionFourn .= " AND cf4.fk_statut IN (3,4))"; diff --git a/htdocs/product/stock/stats/commande_fournisseur.php b/htdocs/product/stock/stats/commande_fournisseur.php index 756f814f575..4365c91e460 100644 --- a/htdocs/product/stock/stats/commande_fournisseur.php +++ b/htdocs/product/stock/stats/commande_fournisseur.php @@ -224,7 +224,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."commande_fournisseur as cf ON (cf.fk_soc = s.rowid)"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."commande_fournisseurdet as cfd ON (cfd.fk_commande = cf.rowid)"; - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfdi ON (cfdi.fk_commandefourndet = cfd.rowid)"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."receptiondet_batch as cfdi ON (cfdi.fk_commandefourndet = cfd.rowid)"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } diff --git a/htdocs/product/stock/stats/reception.php b/htdocs/product/stock/stats/reception.php index 63c4b942310..cc7165e3f4b 100644 --- a/htdocs/product/stock/stats/reception.php +++ b/htdocs/product/stock/stats/reception.php @@ -223,7 +223,7 @@ if ($id > 0 || !empty($ref)) { } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."reception as recep ON (recep.fk_soc = s.rowid)"; - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as d ON (d.fk_reception = recep.rowid)"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."receptiondet_batch as d ON (d.fk_reception = recep.rowid)"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 0498c8d06bc..96835b53dc5 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1035,7 +1035,7 @@ if ($action == 'create') { // Note that if an extrafield with the same name exists in the origin supplier order line, the value // from the HTTP query will be ignored foreach ($suffix2numAsked as $suffix => $n) { - $dispatchLines[$n]['array_options'] = $extrafields->getOptionalsFromPost('commande_fournisseur_dispatch', '_' . $suffix, ''); + $dispatchLines[$n]['array_options'] = $extrafields->getOptionalsFromPost('receptiondet_batch', '_' . $suffix, ''); } print ''."\n"; } $filter .= ""; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index d603986da72..685acf120c2 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1272,4 +1272,4 @@ Settings=Settings FillMessageWithALayout=Fill message with a layout FillMessageWithAIContent=Fill message with AI content EnterYourAIPromptHere=Enter your AI prompt here -UseOrOperatorShort=Use 'or' +UseOrOperatorShort=or From 1141cdca18e1b09285b765cba81dd73ada39951a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Feb 2024 14:16:24 +0100 Subject: [PATCH 0215/1862] Link to whatsapp --- htdocs/install/mysql/data/llx_c_socialnetworks.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_socialnetworks.sql b/htdocs/install/mysql/data/llx_c_socialnetworks.sql index 2283832a98f..a5800230cab 100644 --- a/htdocs/install/mysql/data/llx_c_socialnetworks.sql +++ b/htdocs/install/mysql/data/llx_c_socialnetworks.sql @@ -57,7 +57,7 @@ INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'viadeo', 'Viadeo', 'https://fr.viadeo.com/fr/{socialid}', 'fa-viadeo', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'viber', 'Viber', '{socialid}', '', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'vimeo', 'Vimeo', '{socialid}', 'fa-vimeo', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'whatsapp', 'Whatsapp', '{socialid}', 'fa-whatsapp', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'whatsapp', 'Whatsapp', 'https://web.whatsapp.com/send?phone={socialid}', 'fa-whatsapp', 1); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'wikipedia', 'Wikipedia', '{socialid}', 'fa-wikipedia-w', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'xing', 'Xing', '{socialid}', 'fa-xing', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'youtube', 'Youtube', 'https://www.youtube.com/{socialid}', 'fa-youtube', 1); From fa2cfb97b16aa950ccf08c947989fd88f3022609 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Feb 2024 15:02:39 +0100 Subject: [PATCH 0216/1862] Fix bad parameter for GETPOST --- htdocs/admin/mails.php | 4 ++-- htdocs/admin/mails_emailing.php | 4 ++-- htdocs/admin/mails_ticket.php | 8 ++++---- htdocs/admin/menus/edit.php | 2 +- htdocs/comm/propal/stats/index.php | 4 ++-- htdocs/commande/stats/index.php | 4 ++-- htdocs/compta/facture/card.php | 4 ++-- htdocs/compta/facture/stats/index.php | 4 ++-- htdocs/core/actions_massactions.inc.php | 2 +- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- htdocs/modulebuilder/admin/setup.php | 2 +- htdocs/mrp/mo_card.php | 2 +- htdocs/projet/tasks/time.php | 2 +- htdocs/reception/card.php | 2 +- htdocs/webportal/class/controller.class.php | 6 +++--- .../webportal/controllers/document.controller.class.php | 2 ++ 16 files changed, 28 insertions(+), 26 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 443e5eb2e8f..cdda45c2a90 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -99,10 +99,10 @@ if ($action == 'update' && !$cancel) { dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", GETPOST("MAIN_MAIL_SMTPS_PW", 'none'), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET("MAIN_MAIL_SMTPS_AUTH_TYPE")) { - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_AUTH_TYPE", GETPOST("MAIN_MAIL_SMTPS_AUTH_TYPE", 'chaine'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_AUTH_TYPE", GETPOST("MAIN_MAIL_SMTPS_AUTH_TYPE", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET("MAIN_MAIL_SMTPS_OAUTH_SERVICE")) { - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_OAUTH_SERVICE", GETPOST("MAIN_MAIL_SMTPS_OAUTH_SERVICE", 'chaine'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_OAUTH_SERVICE", GETPOST("MAIN_MAIL_SMTPS_OAUTH_SERVICE", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOST("MAIN_MAIL_EMAIL_TLS", 'int'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS", GETPOST("MAIN_MAIL_EMAIL_STARTTLS", 'int'), 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index bf619d5f554..059a99a7a1b 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -88,10 +88,10 @@ if ($action == 'update' && !$cancel) { dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW_EMAILING", GETPOST("MAIN_MAIL_SMTPS_PW_EMAILING", 'none'), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET("MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING")) { - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING", GETPOST("MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING", 'chaine'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING", GETPOST("MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET("MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING")) { - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING", GETPOST("MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING", 'chaine'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING", GETPOST("MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_TLS_EMAILING"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_EMAILING"), 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index fbb5edddfc3..dd9f63c3ef6 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -86,10 +86,10 @@ if ($action == 'update' && !$cancel) { dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW_TICKET", GETPOST("MAIN_MAIL_SMTPS_PW_TICKET", 'none'), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET("MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET")) { - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET", GETPOST("MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET", 'chaine'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET", GETPOST("MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET("MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET")) { - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET", GETPOST("MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET", 'chaine'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET", GETPOST("MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS_TICKET", GETPOST("MAIN_MAIL_EMAIL_TLS_TICKET"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_TICKET", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_TICKET"), 'chaine', 0, '', $conf->entity); @@ -672,8 +672,8 @@ if ($action == 'edit') { // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); - $formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM); - $formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM); + $formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : getDolGlobalString('MAIN_MAIL_EMAIL_FROM')); + $formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : getDolGlobalString('MAIN_MAIL_EMAIL_FROM')); $formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test"); $formmail->fromid = $user->id; $formmail->fromalsorobot = 1; diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 95de2e96b99..3b680f93a7b 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -362,7 +362,7 @@ if ($action == 'create') { // Picto print ''.$langs->trans('Image').''; - print ''.$langs->trans('Example').': fa-global'; + print ''.$langs->trans('Example').': fa-global'; // URL print ''.$langs->trans('URL').''; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 4e0a4071ae0..3603f89af2a 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -41,8 +41,8 @@ $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); $mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer'; $object_status = GETPOST('object_status', 'intcomma'); -$typent_id = GETPOST('typent_id', 'int'); -$categ_id = GETPOST('categ_id', 'categ_id'); +$typent_id = GETPOSTINT('typent_id'); +$categ_id = GETPOSTINT('categ_id'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index f7da50833e1..1a06944f272 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -62,8 +62,8 @@ if ($mode == 'supplier') { } -$typent_id = GETPOST('typent_id', 'int'); -$categ_id = GETPOST('categ_id', 'categ_id'); +$typent_id = GETPOSTINT('typent_id'); +$categ_id = GETPOSTINT('categ_id'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 091af287d69..f1ae8948052 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -442,13 +442,13 @@ if (empty($reshook)) { } } elseif ($action == 'setretainedwarranty' && $user->hasRight('facture', 'creer')) { $object->fetch($id); - $result = $object->setRetainedWarranty(GETPOST('retained_warranty', 'float')); + $result = $object->setRetainedWarranty(GETPOSTFLOAT('retained_warranty')); if ($result < 0) { dol_print_error($db, $object->error); } } elseif ($action == 'setretainedwarrantydatelimit' && $user->hasRight('facture', 'creer')) { $object->fetch($id); - $result = $object->setRetainedWarrantyDateLimit(GETPOST('retained_warranty_date_limit', 'float')); + $result = $object->setRetainedWarrantyDateLimit(GETPOSTFLOAT('retained_warranty_date_limit')); if ($result < 0) { dol_print_error($db, $object->error); } diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 4ae358d682d..f98216140f9 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -52,8 +52,8 @@ if ($mode == 'supplier' && !$user->hasRight('fournisseur', 'facture', 'lire')) { } $object_status = GETPOST('object_status', 'intcomma'); -$typent_id = GETPOST('typent_id', 'int'); -$categ_id = GETPOST('categ_id', 'categ_id'); +$typent_id = GETPOSTINT('typent_id'); +$categ_id = GETPOSTINT('categ_id'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index e1762456dce..551c7b7c069 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1684,7 +1684,7 @@ if (!$error && ($massaction == 'increaseholiday' || ($action == 'increaseholiday $objecttmp = new $objectclass($db); $nbok = 0; $typeholiday = GETPOST('typeholiday', 'alpha'); - $nbdaysholidays = GETPOST('nbdaysholidays', 'double'); + $nbdaysholidays = GETPOSTFLOAT('nbdaysholidays'); // May be 1.5 if ($nbdaysholidays <= 0) { setEventMessages($langs->trans("WrongAmount"), "", 'errors'); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 957a57c9f39..a810b92a8d3 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -217,7 +217,7 @@ class pdf_einstein extends ModelePDFCommandes // Possibility to use suffix for proforma $suffix = ''; if (getDolGlobalString('PROFORMA_PDF_WITH_SUFFIX')) { - $suffix = (GETPOST('model', 2)=='proforma') ? $conf->global->PROFORMA_PDF_WITH_SUFFIX : ''; + $suffix = (GETPOST('model') == 'proforma') ? $conf->global->PROFORMA_PDF_WITH_SUFFIX : ''; $suffix = dol_sanitizeFileName($suffix); } diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index 02513e697be..3b189f9908a 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -45,7 +45,7 @@ if ($action == "update") { $res4 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_EDITOR_NAME', GETPOST('MODULEBUILDER_SPECIFIC_EDITOR_NAME', 'alphanohtml'), 'chaine', 0, '', $conf->entity); $res5 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_EDITOR_URL', GETPOST('MODULEBUILDER_SPECIFIC_EDITOR_URL', 'alphanohtml'), 'chaine', 0, '', $conf->entity); $res6 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_FAMILY', GETPOST('MODULEBUILDER_SPECIFIC_FAMILY', 'alphanohtml'), 'chaine', 0, '', $conf->entity); - $res7 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_AUTHOR', GETPOST('MODULEBUILDER_SPECIFIC_AUTHOR', 'html'), 'chaine', 0, '', $conf->entity); + $res7 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_AUTHOR', GETPOST('MODULEBUILDER_SPECIFIC_AUTHOR', 'restricthtml'), 'chaine', 0, '', $conf->entity); $res8 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_VERSION', GETPOST('MODULEBUILDER_SPECIFIC_VERSION', 'alphanohtml'), 'chaine', 0, '', $conf->entity); if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0 || $res7 < 0 || $res8 < 0) { setEventMessages('ErrorFailedToSaveDate', null, 'errors'); diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 39ae023c7c3..5f6a90f964e 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -203,7 +203,7 @@ if (empty($reshook)) { } $error = 0; - $deleteChilds = GETPOST('deletechilds', 'boolean'); + $deleteChilds = GETPOST('deletechilds', 'aZ'); // Start the database transaction $db->begin(); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index e050fc44c1d..bc970a38fd5 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -425,7 +425,7 @@ if ($action == 'confirm_generateinvoice') { $db->begin(); $idprod = GETPOST('productid', 'int'); - $generateinvoicemode = GETPOST('generateinvoicemode', 'string'); + $generateinvoicemode = GETPOST('generateinvoicemode', 'alphanohtml'); $invoiceToUse = GETPOST('invoiceid', 'int'); $prodDurationHoursBase = 1.0; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 73d31b376b8..79a9fe082ad 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -414,7 +414,7 @@ if (empty($reshook)) { $sellbydate = str_replace('/', '-', $sellby); if (getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION') || getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION_CLOSE')) { - $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha'), price2num(GETPOST($cost_price, 'double'), 'MU')); + $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha'), GETPOSTFLOAT($cost_price, 'MU')); } else { $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha')); } diff --git a/htdocs/webportal/class/controller.class.php b/htdocs/webportal/class/controller.class.php index 6c2c0aed3b3..0904b664847 100644 --- a/htdocs/webportal/class/controller.class.php +++ b/htdocs/webportal/class/controller.class.php @@ -164,11 +164,11 @@ class Controller } /** - * Load a template + * Load a template .tpl file * - * @param string $templateName Template name + * @param string $templateName Template file name (without the .tpl.php) * @param mixed $vars Data to transmit to template - * @return bool True if template found, else false + * @return bool True if template found, else false */ public function loadTemplate($templateName, $vars = false) { diff --git a/htdocs/webportal/controllers/document.controller.class.php b/htdocs/webportal/controllers/document.controller.class.php index 92cc37e9ad7..9f5cd408867 100644 --- a/htdocs/webportal/controllers/document.controller.class.php +++ b/htdocs/webportal/controllers/document.controller.class.php @@ -95,9 +95,11 @@ class DocumentController extends Controller // Security check if (empty($modulepart)) { httponly_accessforbidden('Bad link. Bad value for parameter modulepart', 400); + exit; } if (empty($original_file)) { httponly_accessforbidden('Bad link. Missing identification to find file (original_file)', 400); + exit; } // get original file From 182d5eba5bbcde66ce57698223736bf7b6ae6b44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Feb 2024 15:15:08 +0100 Subject: [PATCH 0217/1862] Fix warnings --- htdocs/comm/action/card.php | 2 +- htdocs/compta/facture/card.php | 6 +++--- htdocs/contrat/card.php | 2 +- htdocs/fichinter/card.php | 2 +- htdocs/fourn/facture/card.php | 4 ++-- htdocs/user/card.php | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index be75149de77..cc5c5c1c8dd 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1666,7 +1666,7 @@ if ($action == 'create') { //Reminder print ''.$langs->trans("ReminderTime").''; - print ' '; + print ' '; print $form->selectTypeDuration('offsetunit', 'i', array('y', 'm')); print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index f1ae8948052..28a7c1a39fc 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1372,7 +1372,7 @@ if (empty($reshook)) { $object->ref_client = $object->ref_customer; $object->model_pdf = GETPOST('model'); $object->fk_project = GETPOST('projectid', 'int'); - $object->cond_reglement_id = (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id')); + $object->cond_reglement_id = (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id')); $object->mode_reglement_id = GETPOST('mode_reglement_id', 'int'); $object->fk_account = GETPOST('fk_account', 'int'); $object->amount = price2num(GETPOST('amount')); @@ -1459,7 +1459,7 @@ if (empty($reshook)) { $object->ref_customer = GETPOST('ref_client'); $object->model_pdf = GETPOST('model'); $object->fk_project = GETPOST('projectid', 'int'); - $object->cond_reglement_id = (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id')); + $object->cond_reglement_id = (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id')); $object->mode_reglement_id = GETPOST('mode_reglement_id'); $object->fk_account = GETPOST('fk_account', 'int'); $object->amount = price2num(GETPOST('amount')); @@ -3496,7 +3496,7 @@ if ($action == 'create') { // Deposit - Down payment if (!getDolGlobalString('INVOICE_DISABLE_DEPOSIT')) { print '
'; - $tmp = ' '; + $tmp = ' '; print ''; -} -print '
'; + // Select object + print '
'; + print '
'.$langs->trans("StatisticsOn").'
'; + print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', 'minwidth200', 1, '', 0, 1); + if (empty($conf->use_javascript_ajax)) { + print ''; + } else { + print ' + '; + } + print '
'; -// Filter (you can use param &show_search_component_params_hidden=1 for debug) -if (!empty($object)) { - print '
'; - print $form->searchComponent(array($object->element => $object->fields), $search_component_params, array(), $search_component_params_hidden); + // Filter (you can use param &show_search_component_params_hidden=1 for debug) + if (!empty($object)) { + print '
'; + print $form->searchComponent(array($object->element => $object->fields), $search_component_params, array(), $search_component_params_hidden); + print '
'; + } + + // YAxis (add measures into array) + $count = 0; + //var_dump($arrayofmesures); + print '
'; + print '
'; + $simplearrayofmesures = array(); + foreach ($arrayofmesures as $key => $val) { + $simplearrayofmesures[$key] = $arrayofmesures[$key]['label']; + } + print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300', 1, 0, '', '', $langs->trans("Measures")); // Fill the array $arrayofmeasures with possible fields print '
'; -} -// YAxis (add measures into array) -$count = 0; -//var_dump($arrayofmesures); -print '
'; -print '
'; -$simplearrayofmesures = array(); -foreach ($arrayofmesures as $key => $val) { - $simplearrayofmesures[$key] = $arrayofmesures[$key]['label']; -} -print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300', 1, 0, '', '', $langs->trans("Measures")); // Fill the array $arrayofmeasures with possible fields -print '
'; - -// XAxis -$count = 0; -print '
'; -print '
'; -//var_dump($arrayofxaxis); -print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400'); // Fill the array $arrayofxaxis with possible fields -print '
'; - -// Group by -$count = 0; -print '
'; -print '
'; -print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields -print '
'; - - -if ($mode == 'grid') { - // YAxis + // XAxis + $count = 0; print '
'; - foreach ($object->fields as $key => $val) { - if (empty($val['measure']) && (!isset($val['enabled']) || dol_eval($val['enabled'], 1, 1, '1'))) { - if (in_array($key, array('id', 'rowid', 'entity', 'last_main_doc', 'extraparams'))) { - continue; - } - if (preg_match('/^fk_/', $key)) { - continue; - } - if (in_array($val['type'], array('html', 'text'))) { - continue; - } - if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) { - $arrayofyaxis['t.'.$key.'-year'] = array( - 'label' => $langs->trans($val['label']).' ('.$YYYY.')', - 'position' => $val['position'], - 'table' => $object->table_element - ); - $arrayofyaxis['t.'.$key.'-month'] = array( - 'label' => $langs->trans($val['label']).' ('.$YYYY.'-'.$MM.')', - 'position' => $val['position'], - 'table' => $object->table_element - ); - $arrayofyaxis['t.'.$key.'-day'] = array( - 'label' => $langs->trans($val['label']).' ('.$YYYY.'-'.$MM.'-'.$DD.')', - 'position' => $val['position'], - 'table' => $object->table_element - ); - } else { - $arrayofyaxis['t.'.$key] = array( - 'label' => $val['label'], - 'position' => (int) $val['position'], - 'table' => $object->table_element - ); - } - } - } - // Add measure from extrafields - if ($object->isextrafieldmanaged) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { - $arrayofyaxis['te.'.$key] = array( - 'label' => $extrafields->attributes[$object->table_element]['label'][$key], - 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key], - 'table' => $object->table_element - ); - } - } - } - $arrayofyaxis = dol_sort_array($arrayofyaxis, 'position'); - $arrayofyaxislabel = array(); - foreach ($arrayofyaxis as $key => $val) { - $arrayofyaxislabel[$key] = $val['label']; - } - print '
'.$langs->trans("YAxis").'
'; - print $form->multiselectarray('search_yaxis', $arrayofyaxislabel, $search_yaxis, 0, 0, 'minwidth100', 1); + print '
'; + //var_dump($arrayofxaxis); + print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400'); // Fill the array $arrayofxaxis with possible fields print '
'; -} -if ($mode == 'graph') { - // -} + // Group by + $count = 0; + print '
'; + print '
'; + print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields + print '
'; -print '
'; -print ''; -print '
'; -print '
'; -print ''; + + if ($mode == 'grid') { + // YAxis + print '
'; + foreach ($object->fields as $key => $val) { + if (empty($val['measure']) && (!isset($val['enabled']) || dol_eval($val['enabled'], 1, 1, '1'))) { + if (in_array($key, array('id', 'rowid', 'entity', 'last_main_doc', 'extraparams'))) { + continue; + } + if (preg_match('/^fk_/', $key)) { + continue; + } + if (in_array($val['type'], array('html', 'text'))) { + continue; + } + if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) { + $arrayofyaxis['t.'.$key.'-year'] = array( + 'label' => $langs->trans($val['label']).' ('.$YYYY.')', + 'position' => $val['position'], + 'table' => $object->table_element + ); + $arrayofyaxis['t.'.$key.'-month'] = array( + 'label' => $langs->trans($val['label']).' ('.$YYYY.'-'.$MM.')', + 'position' => $val['position'], + 'table' => $object->table_element + ); + $arrayofyaxis['t.'.$key.'-day'] = array( + 'label' => $langs->trans($val['label']).' ('.$YYYY.'-'.$MM.'-'.$DD.')', + 'position' => $val['position'], + 'table' => $object->table_element + ); + } else { + $arrayofyaxis['t.'.$key] = array( + 'label' => $val['label'], + 'position' => (int) $val['position'], + 'table' => $object->table_element + ); + } + } + } + // Add measure from extrafields + if ($object->isextrafieldmanaged) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { + $arrayofyaxis['te.'.$key] = array( + 'label' => $extrafields->attributes[$object->table_element]['label'][$key], + 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key], + 'table' => $object->table_element + ); + } + } + } + $arrayofyaxis = dol_sort_array($arrayofyaxis, 'position'); + $arrayofyaxislabel = array(); + foreach ($arrayofyaxis as $key => $val) { + $arrayofyaxislabel[$key] = $val['label']; + } + print '
'.$langs->trans("YAxis").'
'; + print $form->multiselectarray('search_yaxis', $arrayofyaxislabel, $search_yaxis, 0, 0, 'minwidth100', 1); + print '
'; + } + + if ($mode == 'graph') { + // + } + + print '
'; + print ''; + print '
'; + print '
'; + print ''; +} // Generate the SQL request $sql = ''; @@ -1117,7 +1123,7 @@ if ($mode == 'graph') { } } -if ($sql) { +if ($sql && !defined('MAIN_CUSTOM_REPORT_KEEP_GRAPH_ONLY')) { // Show admin info print '
'.info_admin($langs->trans("SQLUsedForExport").':
'.$sql, 0, 0, 1, '', 'TechnicalInformation'); } From d4c1896552ade9e4071ca7636535120b496e31fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Feb 2024 21:47:12 +0100 Subject: [PATCH 0226/1862] Fix edit website css content --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 9453d1b403c..0cf1abe101e 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -25,7 +25,7 @@ /** @phan-file-suppress PhanPluginSuspiciousParamPosition */ // We allow POST of rich content with js and style, but only for this php file and if into some given POST variable -define('NOSCANPOSTFORINJECTION', array('PAGE_CONTENT', 'WEBSITE_JS_INLINE', 'WEBSITE_HTML_HEADER', 'htmlheader')); +define('NOSCANPOSTFORINJECTION', array('PAGE_CONTENT', 'WEBSITE_CSS_INLINE', 'WEBSITE_JS_INLINE', 'WEBSITE_HTML_HEADER', 'htmlheader')); define('USEDOLIBARREDITOR', 1); define('FORCE_CKEDITOR', 1); // We need CKEditor, even if module is off. From e969ddc386cf3e3900d4207a6f3338e937bc3b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 22:34:17 +0100 Subject: [PATCH 0227/1862] fix phpstan (#28436) --- htdocs/core/lib/barcode.lib.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index 5b00a1eabd1..9f3ce7d3468 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -405,7 +405,7 @@ function barcode_encode_genbarcode($code, $encoding) * @param string $mode png,gif,jpg (default='png') * @param int $total_y the total height of the image ( default: scale * 60 ) * @param array $space default: $space[top] = 2 * $scale; $space[bottom]= 2 * $scale; $space[left] = 2 * $scale; $space[right] = 2 * $scale; - * @return string|null + * @return string|void */ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, $space = '') { @@ -413,9 +413,6 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, global $font_loc, $filebarcode; //print "$text, $bars, $scale, $mode, $total_y, $space, $font_loc, $filebarcode
"; - //var_dump($text); - //var_dump($bars); - //var_dump($font_loc); /* set defaults */ if ($scale < 1) { @@ -504,7 +501,7 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, header("Content-Type: image/gif; name=\"barcode.gif\""); imagegif($im); } elseif (!empty($filebarcode)) { - // To write into a file onto disk + // To write into a file onto disk imagepng($im, $filebarcode); } else { header("Content-Type: image/png; name=\"barcode.png\""); From 1692dad347957fbeeed677a1acd9e7114fe0ef5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 22:52:09 +0100 Subject: [PATCH 0228/1862] fix #28431 (#28439) --- htdocs/contact/list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 26f1c8c2f89..a9878be3a28 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -9,7 +9,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019 Frédéric France * Copyright (C) 2019 Josep Lluís Amador * Copyright (C) 2020 Open-Dsi * @@ -1629,6 +1629,8 @@ while ($i < $imaxinloop) { $option_link = 'customer'; if ($objsoc->client == 0 && $objsoc->fournisseur > 0) { $option_link = 'supplier'; + } elseif ($objsoc->client == 0 && $objsoc->fournisseur == 0) { + $option_link = ''; } if ($contextpage == 'poslist') { print $objsoc->name; From 8262fb96057c02017ca738d8ede3a7c788f1a6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 22:53:21 +0100 Subject: [PATCH 0229/1862] fix phpstan (#28440) --- .../eventorganization/class/conferenceorboothattendee.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index c54d8238da4..011c176e2f2 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -48,7 +48,7 @@ class ConferenceOrBoothAttendee extends CommonObject public $table_element = 'eventorganization_conferenceorboothattendee'; /** - * @var int Does this object support multicompany module ? + * @var int|string Does this object support multicompany module ? * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table */ public $ismultientitymanaged = 'fk_project@projet'; From f0209f1b66e70dacf9b42a26ec74a71024c8ddb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 22:54:32 +0100 Subject: [PATCH 0230/1862] fix phpstan (#28441) --- .../class/conferenceorboothattendee.class.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 011c176e2f2..b137fd538ad 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -258,7 +258,7 @@ class ConferenceOrBoothAttendee extends CommonObject if ($result > 0) { $result = $this->fetch($result); if ($result > 0) { - $this->ref = $this->id; + $this->ref = (string) $this->id; $result = $this->update($user); } } @@ -333,10 +333,9 @@ class ConferenceOrBoothAttendee extends CommonObject $result = $object->createCommon($user); if ($result < 0) { $error++; - $this->error = $object->error; - $this->errors = $object->errors; + $this->setErrorsFromObject($object); } else { - $object->ref = $object->id; + $object->ref = (string) $object->id; $result = $object->update($user); } From 52d1fe8c6744b0e3a88b8522812a6241d1d42bc6 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Mon, 26 Feb 2024 23:55:42 +0200 Subject: [PATCH 0231/1862] fix translation for non latin languages (#28437) * fix translation for non latin languages * fix translation for non latin languages --- htdocs/compta/resultat/index.php | 2 +- htdocs/core/class/html.formaccounting.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index c55dec68b4a..871b096e4bd 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -178,7 +178,7 @@ if ($modecompta == 'CREANCES-DETTES') { $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); $description = $langs->trans("RulesAmountOnInOutBookkeepingRecord"); - $description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->trans("Chartofaccounts")).')'; + $description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->transnoentitiesnoconv("Chartofaccounts")).')'; $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 90b17804022..b8b6cabe6c1 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -302,7 +302,7 @@ class FormAccounting extends Form $out .= ''; //if ($user->admin && $help) $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); } else { - $out = $langs->trans("ErrorNoAccountingCategoryForThisCountry", $mysoc->country_code, $langs->trans("Accounting"), $langs->trans("Setup"), $langs->trans("AccountingCategories")); + $out = $langs->trans("ErrorNoAccountingCategoryForThisCountry", $mysoc->country_code, $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("AccountingCategories")); } } else { dol_print_error($this->db); From bb12b0c8b957e0e2e5e11061f3d731a5c423d8c6 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Mon, 26 Feb 2024 22:59:27 +0100 Subject: [PATCH 0232/1862] fix: display root account according root label in balance bookkeeping (#28435) --- htdocs/accountancy/bookkeeping/balance.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 01d89f1168d..af317e7a361 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -427,7 +427,7 @@ if ($action != 'export_csv') { // Show first line of a break print ''; - print ''.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').''; + print ''.$root_account_number.($root_account_description ? ' - '.$root_account_description : '').''; print ''; $displayed_account = $root_account_number; From 96a727d1f00c39f70c14c963dec33f8ab639604a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 23:00:28 +0100 Subject: [PATCH 0233/1862] fix phpstan (#28434) Default value of the parameter #5 $id (string) of function print_fiche_titre() is incompatible with type int. --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 391dbe2e0b4..5246e9554f8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13,7 +13,7 @@ * Copyright (C) 2014 Cédric GROSS * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2019-2023 Thibault Foucart * Copyright (C) 2020 Open-Dsi * Copyright (C) 2021 Gauthier VERDOL @@ -5841,7 +5841,7 @@ function print_titre($title) * @param string $mesg Added message to show on right * @param string $picto Icon to use before title (should be a 32x32 transparent png file) * @param int $pictoisfullpath 1=Icon name is a full absolute url of image - * @param int $id To force an id on html objects + * @param string $id To force an id on html objects by example id="name" where name is id * @return void * @deprecated Use print load_fiche_titre instead */ From f0dc1358f96b0591d4ab88328e09c0a555b244e8 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+BB2A-Anthony@users.noreply.github.com> Date: Mon, 26 Feb 2024 23:01:08 +0100 Subject: [PATCH 0234/1862] Order list det change to eprimental (#28438) Co-authored-by: Anthony Berton --- htdocs/core/menus/init_menu_auguria.sql | 2 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 5b975bca59e..b17ec92127d 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -183,7 +183,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1207__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=4', 'StatusOrderProcessed', 1, 'orders', '$user->hasRight("commande", "lire")', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1208__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=-1', 'StatusOrderCanceledShort', 1, 'orders', '$user->hasRight("commande", "lire")', '', 2, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders', 'Statistics', 1, 'orders', '(!empty($conf->global->MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS)?$user->hasRight("commande", "commande", "export"):$user->hasRight("commande", "lire"))', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($user->socid)', __HANDLER__, 'left', 1210__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list_det.php?mainmenu=commercial&leftmenu=orders', 'ListOrderLigne', 1, 'orders', '$user->hasRight("commande", "lire")', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $conf->global->MAIN_FEATURES_LEVEL >= 1 && empty($user->socid)', __HANDLER__, 'left', 1210__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list_det.php?mainmenu=commercial&leftmenu=orders', 'ListOrderLigne', 1, 'orders', '$user->hasRight("commande", "lire")', '', 2, 1, __ENTITY__); -- Commercial - Supplier's proposals insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_proposal")', __HANDLER__, 'left', 1650__+MAX_llx_menu__, 'commercial', 'propals_supplier', 3__+MAX_llx_menu__, '/supplier_proposal/index.php?leftmenu=propals_supplier', 'SupplierProposalsShort', 0, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 4, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index ef2581aed68..e489f415fe0 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1378,7 +1378,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left //$newmenu->add("/commande/list.php?leftmenu=orders&search_status=4", $langs->trans("StatusOrderProcessed"), 2, $user->hasRight('commande', 'lire')); $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->hasRight('commande', 'lire')); } - if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 && empty($user->socid)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1 && empty($user->socid)) { $newmenu->add("/commande/list_det.php?leftmenu=orders", $langs->trans("ListOrderLigne"), 1, $user->hasRight('commande', 'lire')); } if (getDolGlobalInt('MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS')) { From 84b01dc1f8d4bb2bbfffe22a03068884c2c56fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 23:02:53 +0100 Subject: [PATCH 0235/1862] fix phpstan (#28433) Default value of the parameter #2 $mesgarray (string) of function get_htmloutput_mesg() is incompatible with type array. --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5246e9554f8..045798228c0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9348,7 +9348,7 @@ function dol_htmloutput_events($disabledoutputofmessages = 0) * @see dol_htmloutput_errors() * @see setEventMessages() */ -function get_htmloutput_mesg($mesgstring = '', $mesgarray = '', $style = 'ok', $keepembedded = 0) +function get_htmloutput_mesg($mesgstring = '', $mesgarray = [], $style = 'ok', $keepembedded = 0) { global $conf, $langs; From ac328d6acb93a25118a45b77aaab1e1067f536cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 23:03:42 +0100 Subject: [PATCH 0236/1862] fix phpstan (#28432) Default value of the parameter #6 $noreplace (int) of function GETPOST() is incompatible with type string. --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 045798228c0..42d1f1df716 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -656,7 +656,7 @@ function GETPOSTISARRAY($paramname, $method = 0) * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get) * @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails) * @param mixed $options Options to pass to filter_var when $check is set to 'custom' - * @param string $noreplace Force disable of replacement of __xxx__ strings. + * @param int $noreplace Force disable of replacement of __xxx__ strings. * @return string|array Value found (string or array), or '' if check fails */ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null, $options = null, $noreplace = 0) From 1d1e6ac562d8d77910273209a7676c164e297d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 23:04:07 +0100 Subject: [PATCH 0237/1862] fix typo (#28430) --- htdocs/adherents/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index d7f94aa0908..5ab338489de 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -820,7 +820,7 @@ $moreforfilter = ''; if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedlength"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1, $langs->trans("MembersCategoriesShort")); + $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1, $langs->trans("MembersCategoriesShort")); $moreforfilter .= '
'; } $parameters = array(); From 1c3a035ae5ae8bc71777067bfc9fc51c859d0cb8 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 26 Feb 2024 23:10:16 +0100 Subject: [PATCH 0238/1862] Qual: New Phan plugin for testing that argument matches regex (#28424) * Qual: New Phan plugin for testing that argument matches regex # Qual: New Phan plugin for testing that argument matches regex This Plugin - currently applied to GETPOST - allows verifying that a selected argument of a function matches a regular expression. * Qual: Add isModEnabled verification to phan # Qual: Add isModEnabled verification in phan Using ParamMatchRegexPlugin, add isModEnabled parameter verification. * Qual: Verify sanitizeVal check value # Qual: Verify sanitizeVal check value Use ParamMatchPlugin to check sanitizeVal check value * Qual: Extend ParamMatchRegexPlugin with class_method # Qual: Extend ParamMatchRegexPlugin with class_method Allow matching class methods for argument verification. * Update config.php * Qual: New Phan plugin for testing that argument matches regex # Qual: New Phan plugin for testing that argument matches regex This Plugin - currently applied to GETPOST - allows verifying that a selected argument of a function matches a regular expression. * Qual: Add isModEnabled verification to phan # Qual: Add isModEnabled verification in phan Using ParamMatchRegexPlugin, add isModEnabled parameter verification. * Qual: Verify sanitizeVal check value # Qual: Verify sanitizeVal check value Use ParamMatchPlugin to check sanitizeVal check value * Qual: Extend ParamMatchRegexPlugin with class_method # Qual: Extend ParamMatchRegexPlugin with class_method Allow matching class methods for argument verification. * Report scalar values (see null, etc) * Qual: Ignore false Phan Notification * Qual: Ignore false Phan Notification * Qual: Fix Phan needs specific message keys for coloring. --------- Co-authored-by: Laurent Destailleur --- dev/tools/phan/config.php | 188 +++++++++++++ dev/tools/phan/config_extended.php | 187 +++++++++++++ dev/tools/phan/config_fixer.php | 203 ++++++++++++++ .../phan/plugins/ParamMatchRegexPlugin.php | 248 ++++++++++++++++++ htdocs/core/lib/functions.lib.php | 1 + htdocs/modulebuilder/index.php | 1 + 6 files changed, 828 insertions(+) create mode 100644 dev/tools/phan/config_fixer.php create mode 100644 dev/tools/phan/plugins/ParamMatchRegexPlugin.php diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 1dc71344d2d..b5ac3bfafd8 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -4,6 +4,187 @@ define('DOL_PROJECT_ROOT', __DIR__.'/../../..'); define('DOL_DOCUMENT_ROOT', DOL_PROJECT_ROOT.'/htdocs'); define('PHAN_DIR', __DIR__); +$sanitizeRegex + = '/^(array:)?(?:'.implode( + '|', + array( + // Documented: + 'none', + 'array', + 'int', + 'intcomma', + 'alpha', + 'alphawithlgt', + 'alphanohtml', + 'MS', + 'aZ', + 'aZ09', + 'aZ09arobase', + 'aZ09comma', + 'san_alpha', + 'restricthtml', + 'nohtml', + 'custom', + // Not documented: + 'email', + 'restricthtmlallowclass', + 'restricthtmlallowunvalid', + 'restricthtmlnolink', + //'ascii', + //'categ_id', + //'chaine', + + //'html', + //'boolean', + //'double', + //'float', + //'string', + ) + ).')*$/'; + +/** + * Map deprecated module names to new module names + */ +$DEPRECATED_MODULE_MAPPING = array( + 'actioncomm' => 'agenda', + 'adherent' => 'member', + 'adherent_type' => 'member_type', + 'banque' => 'bank', + 'categorie' => 'category', + 'commande' => 'order', + 'contrat' => 'contract', + 'entrepot' => 'stock', + 'expedition' => 'delivery_note', + 'facture' => 'invoice', + 'ficheinter' => 'intervention', + 'product_fournisseur_price' => 'productsupplierprice', + 'product_price' => 'productprice', + 'projet' => 'project', + 'propale' => 'propal', + 'socpeople' => 'contact', +); + +/** + * Map module names to the 'class' name (the class is: mod) + * Value is null when the module is not internal to the default + * Dolibarr setup. + */ +$VALID_MODULE_MAPPING = array( + 'accounting' => 'Accounting', + 'agenda' => 'Agenda', + 'ai' => 'Ai', + 'anothermodule' => null, + 'api' => 'Api', + 'asset' => 'Asset', + 'bank' => 'Banque', + 'barcode' => 'Barcode', + 'blockedlog' => 'BlockedLog', + 'bom' => 'Bom', + 'bookcal' => 'BookCal', + 'bookmark' => 'Bookmark', + 'cashdesk' => null, // TODO: fill in proper class + 'category' => 'Categorie', + 'clicktodial' => 'ClickToDial', + 'collab' => 'Collab', + 'comptabilite' => 'Comptabilite', + 'contact' => null, // TODO: fill in proper class + 'contract' => 'Contrat', + 'cron' => 'Cron', + 'datapolicy' => 'DataPolicy', + 'dav' => 'Dav', + 'debugbar' => 'DebugBar', + 'delivery_note' => 'Expedition', + 'deplacement' => 'Deplacement', + "documentgeneration" => 'DocumentGeneration', + 'don' => 'Don', + 'dynamicprices' => 'DynamicPrices', + 'ecm' => 'ECM', + 'ecotax' => null, // TODO: External module ? + 'emailcollector' => 'EmailCollector', + 'eventorganization' => 'EventOrganization', + 'expensereport' => 'ExpenseReport', + 'export' => 'Export', + 'externalrss' => 'ExternalRss', + 'externalsite' => 'ExternalSite', + 'fckeditor' => 'Fckeditor', + 'fournisseur' => 'Fournisseur', + 'ftp' => 'FTP', + 'geoipmaxmind' => 'GeoIPMaxmind', + 'google' => null, // External ? + 'gravatar' => 'Gravatar', + 'holiday' => 'Holiday', + 'hrm' => 'HRM', + 'import' => 'Import', + 'incoterm' => 'Incoterm', + 'intervention' => 'Ficheinter', + 'intracommreport' => 'Intracommreport', + 'invoice' => 'Facture', + 'knowledgemanagement' => 'KnowledgeManagement', + 'label' => 'Label', + 'ldap' => 'Ldap', + 'loan' => 'Loan', + 'mailing' => 'Mailing', + 'mailman' => null, // Same module as mailmanspip -> MailmanSpip ?? + 'mailmanspip' => 'MailmanSpip', + 'margin' => 'Margin', + 'member' => 'Adherent', + 'memcached' => null, // TODO: External module? + 'modulebuilder' => 'ModuleBuilder', + 'mrp' => 'Mrp', + 'multicompany' => null, // Not provided by default, no module tests + 'multicurrency' => 'MultiCurrency', + 'mymodule' => null, // modMyModule - Name used in module builder (avoid false positives) + 'notification' => 'Notification', + 'numberwords' => null, // Not provided by default, no module tests + 'oauth' => 'Oauth', + 'openstreetmap' => null, // External module? + 'opensurvey' => 'OpenSurvey', + 'order' => 'Commande', + 'partnership' => 'Partnership', + 'paybox' => 'Paybox', + 'paymentbybanktransfer' => 'PaymentByBankTransfer', + 'paypal' => 'Paypal', + 'paypalplus' => null, + 'prelevement' => 'Prelevement', + 'printing' => 'Printing', + 'product' => 'Product', + 'productbatch' => 'ProductBatch', + 'productprice' => null, + 'productsupplierprice' => null, + 'project' => 'Projet', + 'propal' => 'Propale', + 'receiptprinter' => 'ReceiptPrinter', + 'reception' => 'Reception', + 'recruitment' => 'Recruitment', + 'resource' => 'Resource', + 'salaries' => 'Salaries', + 'service' => 'Service', + 'socialnetworks' => 'SocialNetworks', + 'societe' => 'Societe', + 'stock' => 'Stock', + 'stocktransfer' => 'StockTransfer', + 'stripe' => 'Stripe', + 'supplier_invoice' => null, // Special case, uses invoice + 'supplier_order' => null, // Special case, uses invoice + 'supplier_proposal' => 'SupplierProposal', + 'syslog' => 'Syslog', + 'takepos' => 'TakePos', + 'tax' => 'Tax', + 'ticket' => 'Ticket', + 'user' => 'User', + 'variants' => 'Variants', + 'webhook' => 'Webhook', + 'webportal' => 'WebPortal', + 'webservices' => 'WebServices', + 'webservicesclient' => 'WebServicesClient', + 'website' => 'Website', + 'workflow' => 'Workflow', + 'workstation' => 'Workstation', + 'zapier' => 'Zapier', +); + +$moduleNameRegex = '/^(?:'.implode('|', array_merge(array_keys($DEPRECATED_MODULE_MAPPING), array_keys($VALID_MODULE_MAPPING), array('\$modulename'))).')$/'; + /** * This configuration will be read and overlaid on top of the * default configuration. Command line arguments will be applied @@ -71,6 +252,7 @@ return [ .'|htdocs/includes/restler/.*' // @phpstan-ignore-line // Included as stub (did not seem properly analysed by phan without it) .'|htdocs/includes/stripe/.*' // @phpstan-ignore-line + // .'|htdocs/[^h].*/.*' // For testing @phpstan-ignore-line .')@', // @phpstan-ignore-line // A list of plugin files to execute. @@ -82,8 +264,14 @@ return [ // // Alternately, you can pass in the full path to a PHP file // with the plugin's implementation (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php') + 'ParamMatchRegexPlugin' => [ + '/^GETPOST$/' => [1, $sanitizeRegex], + '/^isModEnabled$/' => [0, $moduleNameRegex], + '/^sanitizeVal$/' => [1, $sanitizeRegex], + ], 'plugins' => [ __DIR__.'/plugins/NoVarDumpPlugin.php', + __DIR__.'/plugins/ParamMatchRegexPlugin.php', // checks if a function, closure or method unconditionally returns. // can also be written as 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php' //'DeprecateAliasPlugin', diff --git a/dev/tools/phan/config_extended.php b/dev/tools/phan/config_extended.php index 9a721355daf..3b46fa7a49d 100644 --- a/dev/tools/phan/config_extended.php +++ b/dev/tools/phan/config_extended.php @@ -4,6 +4,187 @@ define('DOL_PROJECT_ROOT', __DIR__.'/../../..'); define('DOL_DOCUMENT_ROOT', DOL_PROJECT_ROOT.'/htdocs'); define('PHAN_DIR', __DIR__); +$sanitizeRegex + = '/^(array:)?(?:'.implode( + '|', + array( + // Documented: + 'none', + 'array', + 'int', + 'intcomma', + 'alpha', + 'alphawithlgt', + 'alphanohtml', + 'MS', + 'aZ', + 'aZ09', + 'aZ09arobase', + 'aZ09comma', + 'san_alpha', + 'restricthtml', + 'nohtml', + 'custom', + // Not documented: + 'email', + 'restricthtmlallowclass', + 'restricthtmlallowunvalid', + 'restricthtmlnolink', + //'ascii', + //'categ_id', + //'chaine', + + //'html', + //'boolean', + //'double', + //'float', + //'string', + ) + ).')*$/'; + +/** + * Map deprecated module names to new module names + */ +$DEPRECATED_MODULE_MAPPING = array( + 'actioncomm' => 'agenda', + 'adherent' => 'member', + 'adherent_type' => 'member_type', + 'banque' => 'bank', + 'categorie' => 'category', + 'commande' => 'order', + 'contrat' => 'contract', + 'entrepot' => 'stock', + 'expedition' => 'delivery_note', + 'facture' => 'invoice', + 'ficheinter' => 'intervention', + 'product_fournisseur_price' => 'productsupplierprice', + 'product_price' => 'productprice', + 'projet' => 'project', + 'propale' => 'propal', + 'socpeople' => 'contact', +); + +/** + * Map module names to the 'class' name (the class is: mod) + * Value is null when the module is not internal to the default + * Dolibarr setup. + */ +$VALID_MODULE_MAPPING = array( + 'accounting' => 'Accounting', + 'agenda' => 'Agenda', + 'ai' => 'Ai', + 'anothermodule' => null, + 'api' => 'Api', + 'asset' => 'Asset', + 'bank' => 'Banque', + 'barcode' => 'Barcode', + 'blockedlog' => 'BlockedLog', + 'bom' => 'Bom', + 'bookcal' => 'BookCal', + 'bookmark' => 'Bookmark', + 'cashdesk' => null, // TODO: fill in proper class + 'category' => 'Categorie', + 'clicktodial' => 'ClickToDial', + 'collab' => 'Collab', + 'comptabilite' => 'Comptabilite', + 'contact' => null, // TODO: fill in proper class + 'contract' => 'Contrat', + 'cron' => 'Cron', + 'datapolicy' => 'DataPolicy', + 'dav' => 'Dav', + 'debugbar' => 'DebugBar', + 'delivery_note' => 'Expedition', + 'deplacement' => 'Deplacement', + "documentgeneration" => 'DocumentGeneration', + 'don' => 'Don', + 'dynamicprices' => 'DynamicPrices', + 'ecm' => 'ECM', + 'ecotax' => null, // TODO: External module ? + 'emailcollector' => 'EmailCollector', + 'eventorganization' => 'EventOrganization', + 'expensereport' => 'ExpenseReport', + 'export' => 'Export', + 'externalrss' => 'ExternalRss', + 'externalsite' => 'ExternalSite', + 'fckeditor' => 'Fckeditor', + 'fournisseur' => 'Fournisseur', + 'ftp' => 'FTP', + 'geoipmaxmind' => 'GeoIPMaxmind', + 'google' => null, // External ? + 'gravatar' => 'Gravatar', + 'holiday' => 'Holiday', + 'hrm' => 'HRM', + 'import' => 'Import', + 'incoterm' => 'Incoterm', + 'intervention' => 'Ficheinter', + 'intracommreport' => 'Intracommreport', + 'invoice' => 'Facture', + 'knowledgemanagement' => 'KnowledgeManagement', + 'label' => 'Label', + 'ldap' => 'Ldap', + 'loan' => 'Loan', + 'mailing' => 'Mailing', + 'mailman' => null, // Same module as mailmanspip -> MailmanSpip ?? + 'mailmanspip' => 'MailmanSpip', + 'margin' => 'Margin', + 'member' => 'Adherent', + 'memcached' => null, // TODO: External module? + 'modulebuilder' => 'ModuleBuilder', + 'mrp' => 'Mrp', + 'multicompany' => null, // Not provided by default, no module tests + 'multicurrency' => 'MultiCurrency', + 'mymodule' => null, // modMyModule - Name used in module builder (avoid false positives) + 'notification' => 'Notification', + 'numberwords' => null, // Not provided by default, no module tests + 'oauth' => 'Oauth', + 'openstreetmap' => null, // External module? + 'opensurvey' => 'OpenSurvey', + 'order' => 'Commande', + 'partnership' => 'Partnership', + 'paybox' => 'Paybox', + 'paymentbybanktransfer' => 'PaymentByBankTransfer', + 'paypal' => 'Paypal', + 'paypalplus' => null, + 'prelevement' => 'Prelevement', + 'printing' => 'Printing', + 'product' => 'Product', + 'productbatch' => 'ProductBatch', + 'productprice' => null, + 'productsupplierprice' => null, + 'project' => 'Projet', + 'propal' => 'Propale', + 'receiptprinter' => 'ReceiptPrinter', + 'reception' => 'Reception', + 'recruitment' => 'Recruitment', + 'resource' => 'Resource', + 'salaries' => 'Salaries', + 'service' => 'Service', + 'socialnetworks' => 'SocialNetworks', + 'societe' => 'Societe', + 'stock' => 'Stock', + 'stocktransfer' => 'StockTransfer', + 'stripe' => 'Stripe', + 'supplier_invoice' => null, // Special case, uses invoice + 'supplier_order' => null, // Special case, uses invoice + 'supplier_proposal' => 'SupplierProposal', + 'syslog' => 'Syslog', + 'takepos' => 'TakePos', + 'tax' => 'Tax', + 'ticket' => 'Ticket', + 'user' => 'User', + 'variants' => 'Variants', + 'webhook' => 'Webhook', + 'webportal' => 'WebPortal', + 'webservices' => 'WebServices', + 'webservicesclient' => 'WebServicesClient', + 'website' => 'Website', + 'workflow' => 'Workflow', + 'workstation' => 'Workstation', + 'zapier' => 'Zapier', +); + +$moduleNameRegex = '/^(?:'.implode('|', array_merge(array_keys($DEPRECATED_MODULE_MAPPING), array_keys($VALID_MODULE_MAPPING))).')$/'; + /** * This configuration will be read and overlaid on top of the * default configuration. Command line arguments will be applied @@ -82,8 +263,14 @@ return [ // // Alternately, you can pass in the full path to a PHP file // with the plugin's implementation (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php') + 'ParamMatchRegexPlugin' => [ + '/^GETPOST$/' => [1, $sanitizeRegex], + '/^isModEnabled$/' => [0, $moduleNameRegex], + '/^sanitizeVal$/' => [1, $sanitizeRegex], + ], 'plugins' => [ __DIR__.'/plugins/NoVarDumpPlugin.php', + __DIR__.'/plugins/ParamMatchRegexPlugin.php', 'DeprecateAliasPlugin', //'EmptyMethodAndFunctionPlugin', 'InvalidVariableIssetPlugin', diff --git a/dev/tools/phan/config_fixer.php b/dev/tools/phan/config_fixer.php new file mode 100644 index 00000000000..d5607844f26 --- /dev/null +++ b/dev/tools/phan/config_fixer.php @@ -0,0 +1,203 @@ + + */ +define('DOL_PROJECT_ROOT', __DIR__.'/../../..'); +define('DOL_DOCUMENT_ROOT', DOL_PROJECT_ROOT.'/htdocs'); +define('PHAN_DIR', __DIR__); +/** + * This configuration will be read and overlaid on top of the + * default configuration. Command line arguments will be applied + * after this file is read. + */ +return [ + // 'processes' => 6, + 'backward_compatibility_checks' => false, + 'simplify_ast' => true, + 'analyzed_file_extensions' => ['php','inc'], + 'globals_type_map' => [ + 'conf' => '\Conf', + 'db' => '\DoliDB', + 'extrafields' => '\ExtraFields', + 'hookmanager' => '\HookManager', + 'langs' => '\Translate', + 'mysoc' => '\Societe', + 'nblines' => '\int', + 'user' => '\User', + ], + + // Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`, `'7.4'`, `null`. + // If this is set to `null`, + // then Phan assumes the PHP version which is closest to the minor version + // of the php executable used to execute Phan. + //"target_php_version" => null, + "target_php_version" => '8.2', + //"target_php_version" => '7.3', + //"target_php_version" => '5.6', + + // A list of directories that should be parsed for class and + // method information. After excluding the directories + // defined in exclude_analysis_directory_list, the remaining + // files will be statically analyzed for errors. + // + // Thus, both first-party and third-party code being used by + // your application should be included in this list. + 'directory_list' => [ + 'htdocs', + PHAN_DIR . '/stubs/', + ], + + // A directory list that defines files that will be excluded + // from static analysis, but whose class and method + // information should be included. + // + // Generally, you'll want to include the directories for + // third-party code (such as "vendor/") in this list. + // + // n.b.: If you'd like to parse but not analyze 3rd + // party code, directories containing that code + // should be added to the `directory_list` as + // to `exclude_analysis_directory_list`. + "exclude_analysis_directory_list" => [ + 'htdocs/includes/', + 'htdocs/core/class/lessc.class.php', // External library + PHAN_DIR . '/stubs/', + ], + //'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@', + 'exclude_file_regex' => '@^(' // @phpstan-ignore-line + .'dummy' // @phpstan-ignore-line + .'|htdocs/.*/canvas/.*/tpl/.*.tpl.php' // @phpstan-ignore-line + .'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line + // Included as stub (old version + incompatible typing hints) + .'|htdocs/includes/restler/.*' // @phpstan-ignore-line + // Included as stub (did not seem properly analysed by phan without it) + .'|htdocs/includes/stripe/.*' // @phpstan-ignore-line + .')@', // @phpstan-ignore-line + + // A list of plugin files to execute. + // Plugins which are bundled with Phan can be added here by providing their name + // (e.g. 'AlwaysReturnPlugin') + // + // Documentation about available bundled plugins can be found + // at https://github.com/phan/phan/tree/master/.phan/plugins + // + // Alternately, you can pass in the full path to a PHP file + // with the plugin's implementation (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php') + 'plugins' => [ + //'DeprecateAliasPlugin', + // __DIR__.'/plugins/NoVarDumpPlugin.php', + //'PHPDocToRealTypesPlugin', + + /* + //'EmptyMethodAndFunctionPlugin', + 'InvalidVariableIssetPlugin', + //'MoreSpecificElementTypePlugin', + 'NoAssertPlugin', + 'NotFullyQualifiedUsagePlugin', + 'PHPDocRedundantPlugin', + 'PHPUnitNotDeadCodePlugin', + //'PossiblyStaticMethodPlugin', + 'PreferNamespaceUsePlugin', + 'PrintfCheckerPlugin', + 'RedundantAssignmentPlugin', + + 'ConstantVariablePlugin', // Warns about values that are actually constant + //'HasPHPDocPlugin', // Requires PHPDoc + 'InlineHTMLPlugin', // html in PHP file, or at end of file + 'NonBoolBranchPlugin', // Requires test on bool, nont on ints + 'NonBoolInLogicalArithPlugin', + 'NumericalComparisonPlugin', + 'PHPDocToRealTypesPlugin', + 'PHPDocInWrongCommentPlugin', // Missing /** (/* was used) + //'ShortArrayPlugin', // Checks that [] is used + //'StrictLiteralComparisonPlugin', + 'UnknownClassElementAccessPlugin', + 'UnknownElementTypePlugin', + 'WhitespacePlugin', + //'RemoveDebugStatementPlugin', // Reports echo, print, ... + //'StrictComparisonPlugin', // Expects === + 'SuspiciousParamOrderPlugin', + 'UnsafeCodePlugin', + //'UnusedSuppressionPlugin', + + 'AlwaysReturnPlugin', + //'DollarDollarPlugin', + 'DuplicateArrayKeyPlugin', + 'DuplicateExpressionPlugin', + 'PregRegexCheckerPlugin', + 'PrintfCheckerPlugin', + 'SleepCheckerPlugin', + // Checks for syntactically unreachable statements in + // the global scope or function bodies. + 'UnreachableCodePlugin', + 'UseReturnValuePlugin', + 'EmptyStatementListPlugin', + 'LoopVariableReusePlugin', + */ + ], + + // Add any issue types (such as 'PhanUndeclaredMethod') + // here to inhibit them from being reported + 'suppress_issue_types' => [ + 'PhanPluginWhitespaceTab', // Dolibarr used tabs + 'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility + 'PhanPluginShortArray', // Dolibarr uses array() + 'PhanPluginShortArrayList', // Dolibarr uses array() + // The following may require that --quick is not used + // Fixers From PHPDocToRealTypesPlugin: + 'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string) + 'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string) + 'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition + 'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition + + 'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences + 'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences + 'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences + 'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences + 'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences + 'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences + 'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences + + ], + // You can put relative paths to internal stubs in this config option. + // Phan will continue using its detailed type annotations, + // but load the constants, classes, functions, and classes (and their Reflection types) + // from these stub files (doubling as valid php files). + // Use a different extension from php (and preferably a separate folder) + // to avoid accidentally parsing these as PHP (includes projects depending on this). + // The 'mkstubs' script can be used to generate your own stubs (compatible with php 7.0+ right now) + // Note: The array key must be the same as the extension name reported by `php -m`, + // so that phan can skip loading the stubs if the extension is actually available. + 'autoload_internal_extension_signatures' => [ + // Stubs may be available at https://github.com/JetBrains/phpstorm-stubs/tree/master + + // Xdebug stubs are bundled with Phan 0.10.1+/0.8.9+ for usage, + // because Phan disables xdebug by default. + //'xdebug' => 'vendor/phan/phan/.phan/internal_stubs/xdebug.phan_php', + //'memcached' => PHAN_DIR . '/your_internal_stubs_folder_name/memcached.phan_php', + //'PDO' => PHAN_DIR . '/stubs/PDO.phan_php', + 'brotli' => PHAN_DIR . '/stubs/brotli.phan_php', + 'curl' => PHAN_DIR . '/stubs/curl.phan_php', + 'calendar' => PHAN_DIR . '/stubs/calendar.phan_php', + 'fileinfo' => PHAN_DIR . '/stubs/fileinfo.phan_php', + 'ftp' => PHAN_DIR . '/stubs/ftp.phan_php', + 'gd' => PHAN_DIR . '/stubs/gd.phan_php', + 'geoip' => PHAN_DIR . '/stubs/geoip.phan_php', + 'imap' => PHAN_DIR . '/stubs/imap.phan_php', + 'intl' => PHAN_DIR . '/stubs/intl.phan_php', + 'ldap' => PHAN_DIR . '/stubs/ldap.phan_php', + 'mcrypt' => PHAN_DIR . '/stubs/mcrypt.phan_php', + 'memcache' => PHAN_DIR . '/stubs/memcache.phan_php', + 'mysqli' => PHAN_DIR . '/stubs/mysqli.phan_php', + 'pdo_cubrid' => PHAN_DIR . '/stubs/pdo_cubrid.phan_php', + 'pdo_mysql' => PHAN_DIR . '/stubs/pdo_mysql.phan_php', + 'pdo_pgsql' => PHAN_DIR . '/stubs/pdo_pgsql.phan_php', + 'pdo_sqlite' => PHAN_DIR . '/stubs/pdo_sqlite.phan_php', + 'pgsql' => PHAN_DIR . '/stubs/pgsql.phan_php', + 'session' => PHAN_DIR . '/stubs/session.phan_php', + 'simplexml' => PHAN_DIR . '/stubs/SimpleXML.phan_php', + 'soap' => PHAN_DIR . '/stubs/soap.phan_php', + 'sockets' => PHAN_DIR . '/stubs/sockets.phan_php', + 'zip' => PHAN_DIR . '/stubs/zip.phan_php', + ], + + ]; diff --git a/dev/tools/phan/plugins/ParamMatchRegexPlugin.php b/dev/tools/phan/plugins/ParamMatchRegexPlugin.php new file mode 100644 index 00000000000..248ed72843e --- /dev/null +++ b/dev/tools/phan/plugins/ParamMatchRegexPlugin.php @@ -0,0 +1,248 @@ + + * + * Phan Plugin to validate that arguments match a regex + * + * + * "ParamMatchRegexPlugin" => [ + * "/^test1$/" => [ 0, "/^OK$/"], // Argument 0 must be 'OK' + * "/^test2$/" => [ 1, "/^NOK$/", "Test2Arg1NokError"], // Argument 1 must be 'NOK', error code + * "/^\\MyTest::mymethod$/" => [ 0, "/^NOK$/"], // Argument 0 must be 'NOK' + * ], + * 'plugins' => [ + * ".phan/plugins/ParamMatchRegexPlugin.php", + * // [...] + * ], + */ +declare(strict_types=1); + + +use ast\Node; +use Phan\Config; +use Phan\AST\UnionTypeVisitor; +//use Phan\Language\Element\FunctionInterface; +use Phan\Language\UnionType; +use Phan\Language\Type; +use Phan\PluginV3; +use Phan\PluginV3\PluginAwarePostAnalysisVisitor; +use Phan\PluginV3\PostAnalyzeNodeCapability; +use Phan\Exception\NodeException; +use Phan\Language\FQSEN\FullyQualifiedClassName; +use Phan\Exception\FQSENException; + +/** + * ParamMatchPlugin hooks into one event: + * + * - getPostAnalyzeNodeVisitorClassName + * This method returns a visitor that is called on every AST node from every + * file being analyzed + * + * A plugin file must + * + * - Contain a class that inherits from \Phan\PluginV3 + * + * - End by returning an instance of that class. + * + * It is assumed without being checked that plugins aren't + * mangling state within the passed code base or context. + * + * Note: When adding new plugins, + * add them to the corresponding section of README.md + */ +class ParamMatchPlugin extends PluginV3 implements PostAnalyzeNodeCapability +{ + /** + * @return string - name of PluginAwarePostAnalysisVisitor subclass + */ + public static function getPostAnalyzeNodeVisitorClassName(): string + { + return ParamMatchVisitor::class; + } +} + +/** + * When __invoke on this class is called with a node, a method + * will be dispatched based on the `kind` of the given node. + * + * Visitors such as this are useful for defining lots of different + * checks on a node based on its kind. + */ +class ParamMatchVisitor extends PluginAwarePostAnalysisVisitor +{ + // A plugin's visitors should not override visit() unless they need to. + + /** + * @override + * @param Node $node Node to analyze + * + * @return void + */ + public function visitMethodCall(Node $node): void + { + $method_name = $node->children['method'] ?? null; + if (!\is_string($method_name)) { + return; // Not handled, TODO: handle variable(?) methods + // throw new NodeException($node); + } + try { + // Fetch the list of valid classes, and warn about any undefined classes. + $union_type = UnionTypeVisitor::unionTypeFromNode($this->code_base, $this->context, $node->children['expr']); + } catch (Exception $_) { + // Phan should already throw for this + return; + } + + $class_list = []; + foreach ($union_type->getTypeSet() as $type) { + $class_fqsen = "NoFSQENType"; + if ($type instanceof Type) { + try { + $class_fqsen = (string) FullyQualifiedClassName::fromFullyQualifiedString($type->getName()); + } catch (FQSENException $_) { + // var_dump([$_, $node]); + continue; + } + } else { + // var_dump( $type) ; + continue; + } + $class_name = (string) $class_fqsen; + $class_list[] = $class_name; + } + + /* May need to check list of classes + */ + + /* + if (!$class->hasMethodWithName($this->code_base, $method_name, true)) { + throw new NodeException($expr, 'does not have method'); + } + $class_name = $class->getName(); + */ + foreach ($class_list as $class_name) { + $this->checkRule($node, "$class_name::$method_name"); + } + } + + /** + * @override + * @param Node $node Node to analyze + * + * @return void + */ + public function visitStaticCall(Node $node): void + { + $class_name = $node->children['class']->children['name'] ?? null; + if (!\is_string($class_name)) { + throw new NodeException($expr, 'does not have class'); + } + try { + $class_name = (string) FullyQualifiedClassName::fromFullyQualifiedString($class_name); + } catch (FQSENException $_) { + } + $method_name = $node->children['method'] ?? null; + + if (!\is_string($method_name)) { + return; + } + $this->checkRule($node, "$class_name::$method_name"); + } + /** + * @override + * + * @param Node $node A node to analyze + * + * @return void + */ + public function visitCall(Node $node): void + { + $name = $node->children['expr']->children['name'] ?? null; + if (!\is_string($name)) { + return; + } + + + $this->checkRule($node, $name); + } + + /** + * + * @param Node $node A node to analyze + * @param string $name function name or fqsn of class:: + * + * @return void + */ + public function checkRule(Node $node, string $name) + { + $rules = Config::getValue('ParamMatchRegexPlugin'); + foreach ($rules as $regex => $rule) { + if (preg_match($regex, $name)) { + $this->checkParam($node, $rule[0], $rule[1], $name, $rule[2] ?? null); + } + } + } + + /** + * Check that argument matches regex at node + * + * @param Node $node Visited node for which to verify arguments match regex + * @param int $argPosition Position of argument to check + * @param string $argRegex Regex to validate against argument + * @param string $functionName Function name for report + * @param string $messageCode Message code to provide in message + * + * @return void + */ + public function checkParam(Node $node, int $argPosition, string $argRegex, $functionName, $messageCode = null): void + { + $args = $node->children['args']->children; + + if (!array_key_exists($argPosition, $args)) { + /* + $this->emitPluginIssue( + $this->code_base, + $this->context, + 'ParamMatchMissingArgument', + "Argument at %s for %s is missing", + [$argPosition, $function_name] + ); + */ + return; + } + $expr = $args[$argPosition]; + try { + $expr_type = UnionTypeVisitor::unionTypeFromNode($this->code_base, $this->context, $expr, false); + } catch (Exception $_) { + return; + } + + $expr_value = $expr_type->getRealUnionType()->asValueOrNullOrSelf(); + if (!is_object($expr_value)) { + $list = [(string) $expr_value]; + } elseif ($expr_value instanceof UnionType) { + $list = $expr_value->asScalarValues(); + } else { + // Note: maybe more types could be supported + return; + } + + foreach ($list as $argValue) { + if (!\preg_match($argRegex, (string) $argValue)) { + // Emit an issue if the argument does not match the expected regex pattern + // var_dump([$node,$expr_value,$expr_type->getRealUnionType()]); // Information about node + $this->emitPluginIssue( + $this->code_base, + $this->context, + $messageCode ?? 'ParamMatchRegexError', + "Argument {INDEX} function {FUNCTION} can have value {STRING_LITERAL} that does not match the expected pattern '{STRING_LITERAL}'", + [$argPosition, $functionName, json_encode($argValue), $argRegex] + ); + } + } + } +} + +// Every plugin needs to return an instance of itself at the +// end of the file in which it's defined. +return new ParamMatchPlugin(); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 42d1f1df716..40e1aa39219 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -932,6 +932,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null $out = preg_replace('/([<>])([-+]?\d)/', '\1 \2', $out); } + // @phan-suppress-next-line ParamMatchRegexError $out = sanitizeVal($out, $check, $filter, $options); } diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index aa0d49399a4..61c41d0782c 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -4186,6 +4186,7 @@ if ($module == 'initmodule') { print ''.img_picto($langs->trans("Delete"), 'delete').''; print $form->textwithpicto('', $langs->trans("InfoForApiFile"), 1, 'warning'); print '   '; + // @phan-suppress-next-line ParamMatchRegexError if (!isModEnabled($modulelowercase)) { // If module is not activated print ''.$langs->trans("ApiExplorer").''; } else { From 39d873287938d5192b38c861595bf10331ab0fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 00:14:22 +0100 Subject: [PATCH 0239/1862] fix missing status if unread (status = 0) (#28443) --- htdocs/ticket/class/ticket.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index d4d498ab18d..186d1ce410f 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1424,8 +1424,8 @@ class Ticket extends CommonObject // phpcs:enable global $langs, $hookmanager; - $labelStatus = !empty($status) ? $this->labelStatus[$status] : ''; - $labelStatusShort = !empty($status) ? $this->labelStatusShort[$status] : ''; + $labelStatus = (isset($status) && !empty($this->labelStatus[$status])) ? $this->labelStatus[$status] : ''; + $labelStatusShort = (isset($status) && !empty($this->labelStatusShort[$status]))? $this->labelStatusShort[$status] : ''; switch ($status) { case self::STATUS_NOT_READ: From 02ec0bcd74944836f6d1aed671a5e12a13971435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 00:14:34 +0100 Subject: [PATCH 0240/1862] fix phan (#28444) --- htdocs/accountancy/admin/account.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index b914ef5f769..5fff15480e0 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -152,6 +152,7 @@ if (empty($reshook)) { $error = 0; if ($chartofaccounts > 0 && $permissiontoadd) { + $country_code = ''; // Get language code for this $chartofaccounts $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a'; $sql .= ' WHERE c.rowid = a.fk_country AND a.rowid = '.(int) $chartofaccounts; From cadbb0cea1f58f35fdf10ec47566ed6ce89daecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 00:14:53 +0100 Subject: [PATCH 0241/1862] fix phpstan (#28445) Default value of the parameter #9 $fk_unit (string) of method BOM::addLine() is incompatible with type int. --- htdocs/bom/class/bom.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 6935ac2594d..e36415b4077 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -600,7 +600,7 @@ class BOM extends CommonObject * @param int $fk_default_workstation Default workstation * @return int Return integer <0 if KO, Id of created object if OK */ - public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null, $fk_unit = '', $array_options = array(), $fk_default_workstation = null) + public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null, $fk_unit = 0, $array_options = array(), $fk_default_workstation = null) { global $mysoc, $conf, $langs, $user; From 148d6d4c39aaf809e90c780728c45f7936797444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 00:15:57 +0100 Subject: [PATCH 0242/1862] add arrayfields in parameters for hook printFieldPreListTitle (#28428) * add search member status if column not displayed * Update list.php --- htdocs/adherents/list.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 5ab338489de..d2297697632 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -5,7 +5,7 @@ * Copyright (C) 2013-2015 Raphaël Doursenaud * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2018 Alexandre Spangaro - * Copyright (C) 2021-2023 Frédéric France + * Copyright (C) 2021-2023 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -815,6 +815,10 @@ if ($search_all) { print '
'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'
'."\n"; } +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + $moreforfilter = ''; // Filter on categories if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { @@ -823,7 +827,9 @@ if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1, $langs->trans("MembersCategoriesShort")); $moreforfilter .= ''; } -$parameters = array(); +$parameters = array( + 'arrayfields' => &$arrayfields, +); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; @@ -839,10 +845,6 @@ if (!empty($moreforfilter)) { print ''; } -$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields -$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); - print '
'; print ''."\n"; From 7d28285ac7f41f9e59d03f8af0be50703080653c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2024 11:29:53 +0100 Subject: [PATCH 0243/1862] CSS --- htdocs/projet/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 5fa292da439..6007b639120 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -277,11 +277,11 @@ if ($resql) { // Label print ''; // Thirdparty - print ''; print ''; - print ''; + print ''; print ''; print '
'; - print $projectstatic->title; + print dol_escape_htmltag($projectstatic->title); print ''; + print ''; if ($companystatic->id > 0) { print $companystatic->getNomUrl(1, 'company', 16); } @@ -344,7 +344,7 @@ if ($resql) { print ''; print ''; print_liste_field_titre("OpenedProjectsByThirdparties", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder); - print_liste_field_titre("NbOfProjects", $_SERVER["PHP_SELF"], "nb", "", "", '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("Number", $_SERVER["PHP_SELF"], "nb", "", "", '', $sortfield, $sortorder, 'right '); print "\n"; } From ce56fee2b46e50648d9a961f038c5be8d62897bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2024 12:28:16 +0100 Subject: [PATCH 0244/1862] Fix fatal error class not found --- htdocs/accountancy/admin/productaccount.php | 9 ++++----- htdocs/compta/bank/list.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_list.php | 13 +++---------- htdocs/product/inventory/list.php | 4 +--- htdocs/product/stock/list.php | 1 - htdocs/projet/list.php | 1 - htdocs/projet/tasks/list.php | 7 ++++--- 7 files changed, 13 insertions(+), 24 deletions(-) diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 8eca43948e6..66b120cf1d5 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -26,17 +26,16 @@ * \brief To define accounting account on product / service */ require '../../main.inc.php'; - +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -if (isModEnabled('categorie')) { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -} +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page $langs->loadLangs(array("companies", "compta", "accountancy", "products")); diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 3c8d4a68aaa..1a66ee4b4bb 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -28,11 +28,11 @@ // Load Dolibarr environment require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; } diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index c56bb6aef75..97d48d8d00d 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -25,20 +25,13 @@ // Load Dolibarr environment require '../main.inc.php'; - -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; - -// load knowledgemanagement libraries require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php'; - -// for other modules -if (isModEnabled('categorie')) { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -} -//dol_include_once('/othermodule/class/otherobject.class.php'); +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page $langs->loadLangs(array("knowledgemanagement", "other")); diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 947de8a3fc9..396aca79e25 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -23,13 +23,11 @@ // Load Dolibarr environment require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php'; -if (isModEnabled('categorie')) { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -} // Load translation files required by the page $langs->loadLangs(array("stocks", "other")); diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 8fc6a31c813..919566195f4 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -29,7 +29,6 @@ // Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; - if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 55937976c50..1d3f9ee94bc 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -37,7 +37,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; - if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 1394d6da1fd..e6ace40c941 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -27,11 +27,12 @@ */ require "../../main.inc.php"; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; // Load translation files required by the page $langs->loadLangs(array('projects', 'users', 'companies')); From 0a345e37a0dca8f1293c9bfc0d86bbc3773d3721 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2024 13:01:42 +0100 Subject: [PATCH 0245/1862] Fix delete not used table --- .../template/sql/llx_c_action_trigger.sql | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 htdocs/modulebuilder/template/sql/llx_c_action_trigger.sql diff --git a/htdocs/modulebuilder/template/sql/llx_c_action_trigger.sql b/htdocs/modulebuilder/template/sql/llx_c_action_trigger.sql deleted file mode 100644 index 432846d122d..00000000000 --- a/htdocs/modulebuilder/template/sql/llx_c_action_trigger.sql +++ /dev/null @@ -1,17 +0,0 @@ --- --- Uncomment and run the script to declare triggers to be used by the agenda module for automatic logging of events into agenda (table llx_actioncomm). --- --- For example --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_DRAFT', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_CREATE', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_VALIDATE', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_MODIFY', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_ACCEPT', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_DENIED', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_REOPEN', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_UNVALIDATE', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_SENTBYMAIL', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- - - ---ADD Call trigger IN TABLE \ No newline at end of file From 2ddfe02e0c1c98106dc6bd5957814b59cc204fe8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2024 13:08:15 +0100 Subject: [PATCH 0246/1862] Doc --- htdocs/core/modules/modWebhook.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php index 505b465bfbc..56697702645 100644 --- a/htdocs/core/modules/modWebhook.class.php +++ b/htdocs/core/modules/modWebhook.class.php @@ -62,9 +62,9 @@ class modWebhook extends DolibarrModules $this->name = preg_replace('/^mod/i', '', get_class($this)); // Module description, used if translation string 'ModuleWebhookDesc' not found (Webhook is name of module). - $this->description = "WebhookDescription"; + $this->description = "WebHook"; // Used only if file README.md and README-LL.md not found. - $this->descriptionlong = "WebhookDescription"; + $this->descriptionlong = "Interface to catch dolibarr triggers and send data of the event to an external URL"; // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' $this->version = 'dolibarr'; From 9e2ae31af742a360860ae1c0f91f73af55154d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 14:00:46 +0100 Subject: [PATCH 0247/1862] fix phpstan (#28453) --- htdocs/product/class/html.formproduct.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 7a563ac4c91..282917f2099 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -627,7 +627,7 @@ class FormProduct * @param string $selected Preselected value * @param int $mode 1=Use label as value, 0=Use code * @param int $showempty 1=show empty value, 0= no - * @return string + * @return string|int */ public function selectProductNature($name = 'finished', $selected = '', $mode = 0, $showempty = 1) { From 1122805bf046403d2741cfd6f563a13fd3953695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 14:01:09 +0100 Subject: [PATCH 0248/1862] fix phpstan (#28454) --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 113d7f8742c..c061fa61c19 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -64,7 +64,7 @@ class pdf_azur extends ModelePDFPropales public $description; /** - * @var string Save the name of generated file as the main doc when generating a doc with this template + * @var int Save the name of generated file as the main doc when generating a doc with this template */ public $update_main_doc_field; From aa37b755e06745752250e55bb8ee51169142dd41 Mon Sep 17 00:00:00 2001 From: PsyCrow <93346975+PsyCrow-code@users.noreply.github.com> Date: Tue, 27 Feb 2024 07:03:53 -0600 Subject: [PATCH 0249/1862] Update paiement.php (#28449) PHP Warning: Undefined variable $totalrecucreditnote PHP Warning: Undefined variable $totalrecudeposits --- htdocs/fourn/facture/paiement.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index de1e9ae45ae..007dd70dea0 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -602,6 +602,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $total = 0; $total_ttc = 0; $totalrecu = 0; + $totalrecucreditnote = 0; // PHP Warning: Undefined variable $totalrecucreditnote + $totalrecudeposits = 0; // PHP Warning: Undefined variable $totalrecudeposits while ($i < $num) { $objp = $db->fetch_object($resql); From 36f890f973d717754ad2cdc20bf68be0c66cc251 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 27 Feb 2024 14:05:53 +0100 Subject: [PATCH 0250/1862] Fix: GETPOST(...,'int') to GETPOSTINT(...) (#28448) * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: Update spelling exceptions * Qual: Ignore Phan Notice --- .../codespell/codespell-lines-ignore.txt | 31 +-- htdocs/accountancy/admin/account.php | 20 +- htdocs/accountancy/admin/accountmodel.php | 6 +- htdocs/accountancy/admin/card.php | 4 +- htdocs/accountancy/admin/categories.php | 10 +- htdocs/accountancy/admin/categories_list.php | 10 +- htdocs/accountancy/admin/defaultaccounts.php | 8 +- htdocs/accountancy/admin/export.php | 2 +- htdocs/accountancy/admin/fiscalyear.php | 4 +- htdocs/accountancy/admin/fiscalyear_card.php | 6 +- htdocs/accountancy/admin/fiscalyear_info.php | 2 +- htdocs/accountancy/admin/index.php | 26 +- htdocs/accountancy/admin/journals_list.php | 6 +- htdocs/accountancy/admin/productaccount.php | 8 +- htdocs/accountancy/admin/subaccount.php | 10 +- htdocs/accountancy/bookkeeping/balance.php | 22 +- htdocs/accountancy/bookkeeping/card.php | 4 +- htdocs/accountancy/bookkeeping/export.php | 78 +++--- htdocs/accountancy/bookkeeping/list.php | 76 +++--- .../accountancy/bookkeeping/listbyaccount.php | 52 ++-- htdocs/accountancy/closure/index.php | 20 +- htdocs/accountancy/customer/card.php | 4 +- htdocs/accountancy/customer/index.php | 8 +- htdocs/accountancy/customer/lines.php | 22 +- htdocs/accountancy/customer/list.php | 20 +- htdocs/accountancy/expensereport/card.php | 4 +- htdocs/accountancy/expensereport/index.php | 8 +- htdocs/accountancy/expensereport/lines.php | 22 +- htdocs/accountancy/expensereport/list.php | 16 +- htdocs/accountancy/index.php | 4 +- htdocs/accountancy/journal/bankjournal.php | 14 +- .../journal/expensereportsjournal.php | 2 +- .../accountancy/journal/purchasesjournal.php | 2 +- htdocs/accountancy/journal/sellsjournal.php | 2 +- htdocs/accountancy/journal/variousjournal.php | 2 +- htdocs/accountancy/supplier/card.php | 4 +- htdocs/accountancy/supplier/index.php | 8 +- htdocs/accountancy/supplier/lines.php | 22 +- htdocs/accountancy/supplier/list.php | 20 +- htdocs/adherents/admin/member_emails.php | 2 +- htdocs/adherents/admin/website.php | 2 +- htdocs/adherents/agenda.php | 6 +- .../actions_adherentcard_common.class.php | 8 +- htdocs/adherents/card.php | 42 ++-- htdocs/adherents/document.php | 6 +- htdocs/adherents/index.php | 4 +- htdocs/adherents/ldap.php | 2 +- htdocs/adherents/list.php | 22 +- htdocs/adherents/note.php | 2 +- htdocs/adherents/partnership.php | 6 +- htdocs/adherents/stats/index.php | 4 +- htdocs/adherents/subscription.php | 50 ++-- htdocs/adherents/subscription/card.php | 6 +- htdocs/adherents/subscription/info.php | 2 +- htdocs/adherents/subscription/list.php | 10 +- htdocs/adherents/type.php | 14 +- htdocs/adherents/type_ldap.php | 2 +- htdocs/adherents/type_translation.php | 4 +- htdocs/adherents/vcard.php | 2 +- htdocs/admin/accountant.php | 8 +- htdocs/admin/agenda_extsites.php | 2 +- htdocs/admin/agenda_xcal.php | 4 +- htdocs/admin/barcode.php | 2 +- htdocs/admin/boxes.php | 8 +- htdocs/admin/company.php | 4 +- htdocs/admin/const.php | 10 +- htdocs/admin/debugbar.php | 4 +- htdocs/admin/defaultvalues.php | 6 +- htdocs/admin/delais.php | 2 +- htdocs/admin/dict.php | 24 +- htdocs/admin/dolistore/ajax/image.php | 4 +- htdocs/admin/emailcollector_card.php | 10 +- htdocs/admin/emailcollector_list.php | 14 +- htdocs/admin/events.php | 4 +- htdocs/admin/expensereport.php | 6 +- htdocs/admin/expensereport_rules.php | 6 +- htdocs/admin/external_rss.php | 18 +- htdocs/admin/facture.php | 2 +- htdocs/admin/hrm.php | 2 +- htdocs/admin/ihm.php | 10 +- htdocs/admin/ldap.php | 4 +- htdocs/admin/limits.php | 4 +- htdocs/admin/mailing.php | 4 +- htdocs/admin/mails.php | 16 +- htdocs/admin/mails_senderprofile_list.php | 34 +-- htdocs/admin/mails_templates.php | 20 +- htdocs/admin/menus/edit.php | 18 +- htdocs/admin/menus/index.php | 14 +- htdocs/admin/modulehelp.php | 2 +- htdocs/admin/modules.php | 8 +- htdocs/admin/multicurrency.php | 4 +- htdocs/admin/payment.php | 2 +- htdocs/admin/paymentbybanktransfer.php | 6 +- htdocs/admin/pdf.php | 2 +- htdocs/admin/pdf_other.php | 8 +- htdocs/admin/perms.php | 4 +- htdocs/admin/prelevement.php | 6 +- htdocs/admin/receiptprinter.php | 8 +- htdocs/admin/supplier_payment.php | 2 +- htdocs/admin/taxes.php | 4 +- htdocs/admin/ticket.php | 8 +- htdocs/admin/ticket_public.php | 2 +- htdocs/admin/tools/dolibarr_export.php | 4 +- htdocs/admin/tools/export.php | 8 +- htdocs/admin/tools/export_files.php | 4 +- htdocs/admin/tools/listevents.php | 14 +- htdocs/admin/tools/listsessions.php | 4 +- htdocs/admin/translation.php | 14 +- htdocs/admin/website.php | 6 +- htdocs/admin/website_options.php | 4 +- htdocs/asset/accountancy_codes.php | 2 +- htdocs/asset/agenda.php | 6 +- htdocs/asset/card.php | 22 +- .../class/assetdepreciationoptions.class.php | 6 +- htdocs/asset/depreciation.php | 2 +- htdocs/asset/depreciation_options.php | 2 +- htdocs/asset/disposal.php | 2 +- htdocs/asset/document.php | 6 +- htdocs/asset/list.php | 14 +- htdocs/asset/model/accountancy_codes.php | 2 +- htdocs/asset/model/agenda.php | 6 +- htdocs/asset/model/card.php | 2 +- htdocs/asset/model/depreciation_options.php | 2 +- htdocs/asset/model/list.php | 14 +- htdocs/asset/model/note.php | 2 +- htdocs/asset/note.php | 2 +- .../tpl/depreciation_options_edit.tpl.php | 2 +- htdocs/barcode/printsheet.php | 18 +- htdocs/blockedlog/admin/blockedlog.php | 2 +- htdocs/blockedlog/admin/blockedlog_list.php | 36 +-- htdocs/blockedlog/ajax/block-add.php | 2 +- htdocs/blockedlog/ajax/block-info.php | 2 +- htdocs/bom/ajax/ajax.php | 2 +- htdocs/bom/bom_agenda.php | 8 +- htdocs/bom/bom_card.php | 22 +- htdocs/bom/bom_document.php | 6 +- htdocs/bom/bom_list.php | 20 +- htdocs/bom/bom_net_needs.php | 4 +- htdocs/bom/bom_note.php | 2 +- htdocs/bom/tpl/objectline_create.tpl.php | 4 +- htdocs/bom/tpl/objectline_edit.tpl.php | 4 +- htdocs/bookcal/availabilities_agenda.php | 6 +- htdocs/bookcal/availabilities_card.php | 12 +- htdocs/bookcal/availabilities_contact.php | 10 +- htdocs/bookcal/availabilities_document.php | 6 +- htdocs/bookcal/availabilities_list.php | 22 +- htdocs/bookcal/availabilities_note.php | 2 +- htdocs/bookcal/bookcalindex.php | 2 +- htdocs/bookcal/booking_list.php | 4 +- htdocs/bookcal/calendar_agenda.php | 6 +- htdocs/bookcal/calendar_card.php | 12 +- htdocs/bookcal/calendar_contact.php | 10 +- htdocs/bookcal/calendar_document.php | 6 +- htdocs/bookcal/calendar_list.php | 22 +- htdocs/bookcal/calendar_note.php | 2 +- htdocs/bookmarks/card.php | 16 +- htdocs/bookmarks/list.php | 10 +- htdocs/categories/card.php | 10 +- htdocs/categories/edit.php | 10 +- htdocs/categories/index.php | 4 +- htdocs/categories/info.php | 2 +- htdocs/categories/photos.php | 2 +- htdocs/categories/traduction.php | 2 +- htdocs/categories/viewcat.php | 12 +- htdocs/collab/index.php | 2 +- htdocs/comm/action/card.php | 120 ++++----- htdocs/comm/action/document.php | 8 +- htdocs/comm/action/index.php | 40 +-- htdocs/comm/action/info.php | 2 +- htdocs/comm/action/list.php | 78 +++--- htdocs/comm/action/pertype.php | 32 +-- htdocs/comm/action/peruser.php | 36 +-- htdocs/comm/action/rapport/index.php | 8 +- htdocs/comm/card.php | 16 +- htdocs/comm/contact.php | 6 +- htdocs/comm/index.php | 4 +- htdocs/comm/mailing/advtargetemailing.php | 28 +-- htdocs/comm/mailing/card.php | 2 +- htdocs/comm/mailing/cibles.php | 14 +- htdocs/comm/mailing/info.php | 2 +- htdocs/comm/mailing/list.php | 8 +- htdocs/comm/mailing/note.php | 2 +- htdocs/comm/multiprix.php | 6 +- htdocs/comm/propal/agenda.php | 6 +- htdocs/comm/propal/card.php | 114 ++++----- htdocs/comm/propal/contact.php | 8 +- htdocs/comm/propal/document.php | 6 +- htdocs/comm/propal/index.php | 2 +- htdocs/comm/propal/list.php | 78 +++--- htdocs/comm/propal/note.php | 2 +- htdocs/comm/propal/stats/index.php | 6 +- htdocs/comm/prospect/index.php | 2 +- htdocs/comm/recap-client.php | 2 +- htdocs/comm/remise.php | 12 +- htdocs/comm/remx.php | 6 +- htdocs/commande/agenda.php | 6 +- htdocs/commande/card.php | 76 +++--- htdocs/commande/contact.php | 8 +- htdocs/commande/customer.php | 4 +- htdocs/commande/document.php | 6 +- htdocs/commande/index.php | 2 +- htdocs/commande/list.php | 60 ++--- htdocs/commande/list_det.php | 52 ++-- htdocs/commande/note.php | 4 +- htdocs/commande/stats/index.php | 4 +- htdocs/compta/accounting-files.php | 36 +-- htdocs/compta/ajaxpayment.php | 2 +- .../bank/account_statement_document.php | 6 +- htdocs/compta/bank/bankentries_list.php | 60 ++--- htdocs/compta/bank/card.php | 44 ++-- htdocs/compta/bank/document.php | 6 +- htdocs/compta/bank/graph.php | 10 +- htdocs/compta/bank/info.php | 4 +- htdocs/compta/bank/line.php | 18 +- htdocs/compta/bank/list.php | 6 +- htdocs/compta/bank/releve.php | 8 +- htdocs/compta/bank/transfer.php | 16 +- htdocs/compta/bank/treso.php | 4 +- .../compta/bank/various_payment/document.php | 8 +- htdocs/compta/bank/various_payment/info.php | 4 +- htdocs/compta/bank/various_payment/list.php | 30 +-- .../compta/cashcontrol/cashcontrol_card.php | 24 +- .../compta/cashcontrol/cashcontrol_list.php | 18 +- htdocs/compta/cashcontrol/report.php | 2 +- htdocs/compta/charges/index.php | 8 +- htdocs/compta/clients.php | 4 +- htdocs/compta/deplacement/card.php | 32 +-- htdocs/compta/deplacement/document.php | 6 +- htdocs/compta/deplacement/index.php | 8 +- htdocs/compta/deplacement/info.php | 2 +- htdocs/compta/deplacement/list.php | 8 +- htdocs/compta/deplacement/stats/index.php | 6 +- htdocs/compta/facture/agenda-rec.php | 6 +- htdocs/compta/facture/agenda.php | 6 +- htdocs/compta/facture/card-rec.php | 52 ++-- htdocs/compta/facture/card.php | 238 +++++++++--------- htdocs/compta/facture/class/facture.class.php | 6 +- htdocs/compta/facture/contact.php | 10 +- htdocs/compta/facture/document.php | 8 +- htdocs/compta/facture/index.php | 2 +- .../compta/facture/invoicetemplate_list.php | 40 +-- htdocs/compta/facture/list.php | 26 +- htdocs/compta/facture/note.php | 4 +- htdocs/compta/facture/prelevement.php | 18 +- htdocs/compta/facture/stats/index.php | 6 +- htdocs/compta/index.php | 2 +- htdocs/compta/localtax/card.php | 10 +- htdocs/compta/localtax/clients.php | 8 +- htdocs/compta/localtax/index.php | 16 +- htdocs/compta/localtax/list.php | 6 +- htdocs/compta/localtax/quadri_detail.php | 16 +- htdocs/compta/paiement.php | 8 +- htdocs/compta/paiement/card.php | 8 +- htdocs/compta/paiement/cheque/card.php | 38 +-- htdocs/compta/paiement/cheque/list.php | 18 +- htdocs/compta/paiement/info.php | 2 +- htdocs/compta/paiement/list.php | 26 +- htdocs/compta/paiement/rapport.php | 6 +- htdocs/compta/paiement/tovalidate.php | 4 +- htdocs/compta/paiement_charge.php | 8 +- htdocs/compta/paiement_vat.php | 16 +- htdocs/compta/payment_sc/card.php | 2 +- htdocs/compta/payment_vat/card.php | 2 +- htdocs/compta/paymentbybanktransfer/index.php | 2 +- htdocs/compta/prelevement/card.php | 16 +- htdocs/compta/prelevement/create.php | 12 +- htdocs/compta/prelevement/demandes.php | 8 +- htdocs/compta/prelevement/factures.php | 10 +- htdocs/compta/prelevement/fiche-rejet.php | 6 +- htdocs/compta/prelevement/fiche-stat.php | 6 +- htdocs/compta/prelevement/index.php | 2 +- htdocs/compta/prelevement/line.php | 18 +- htdocs/compta/prelevement/list.php | 10 +- htdocs/compta/prelevement/orders_list.php | 8 +- htdocs/compta/prelevement/rejets.php | 6 +- htdocs/compta/prelevement/stats.php | 2 +- htdocs/compta/recap-compta.php | 6 +- htdocs/compta/resultat/clientfourn.php | 24 +- htdocs/compta/resultat/index.php | 20 +- htdocs/compta/resultat/result.php | 24 +- htdocs/compta/sociales/card.php | 30 +-- htdocs/compta/sociales/document.php | 6 +- htdocs/compta/sociales/info.php | 4 +- htdocs/compta/sociales/list.php | 42 ++-- htdocs/compta/sociales/note.php | 4 +- htdocs/compta/sociales/payments.php | 8 +- htdocs/compta/stats/byratecountry.php | 10 +- htdocs/compta/stats/cabyprodserv.php | 10 +- htdocs/compta/stats/cabyuser.php | 18 +- htdocs/compta/stats/casoc.php | 22 +- htdocs/compta/stats/index.php | 22 +- htdocs/compta/stats/supplier_turnover.php | 20 +- .../stats/supplier_turnover_by_prodserv.php | 10 +- .../stats/supplier_turnover_by_thirdparty.php | 10 +- htdocs/compta/tva/card.php | 26 +- htdocs/compta/tva/document.php | 6 +- htdocs/compta/tva/index.php | 8 +- htdocs/compta/tva/info.php | 4 +- htdocs/compta/tva/initdatesforvat.inc.php | 10 +- htdocs/compta/tva/list.php | 48 ++-- htdocs/compta/tva/payments.php | 6 +- htdocs/contact/agenda.php | 8 +- .../actions_contactcard_common.class.php | 2 +- htdocs/contact/card.php | 36 +-- htdocs/contact/consumption.php | 10 +- htdocs/contact/document.php | 6 +- htdocs/contact/info.php | 2 +- htdocs/contact/ldap.php | 2 +- htdocs/contact/list.php | 36 +-- htdocs/contact/note.php | 2 +- htdocs/contact/perso.php | 2 +- htdocs/contact/project.php | 2 +- htdocs/contact/vcard.php | 2 +- htdocs/contrat/agenda.php | 6 +- htdocs/contrat/card.php | 52 ++-- htdocs/contrat/contact.php | 8 +- htdocs/contrat/document.php | 6 +- htdocs/contrat/index.php | 4 +- htdocs/contrat/list.php | 64 ++--- htdocs/contrat/messaging.php | 8 +- htdocs/contrat/note.php | 4 +- htdocs/contrat/services_list.php | 28 +-- htdocs/contrat/ticket.php | 4 +- htdocs/core/actions_addupdatedelete.inc.php | 20 +- htdocs/core/actions_builddoc.inc.php | 4 +- htdocs/core/actions_dellink.inc.php | 4 +- htdocs/core/actions_extrafields.inc.php | 4 +- htdocs/core/actions_linkedfiles.inc.php | 12 +- htdocs/core/actions_massactions.inc.php | 8 +- htdocs/core/actions_setmoduleoptions.inc.php | 4 +- htdocs/core/actions_setnotes.inc.php | 6 +- htdocs/core/ajax/ajaxdirpreview.php | 6 +- htdocs/core/ajax/ajaxdirtree.php | 2 +- htdocs/core/ajax/ajaxinvoiceline.php | 2 +- htdocs/core/ajax/ajaxstatusprospect.php | 4 +- htdocs/core/ajax/ajaxtooltip.php | 2 +- htdocs/core/ajax/bankconciliate.php | 16 +- htdocs/core/ajax/box.php | 6 +- htdocs/core/ajax/check_notifications.php | 2 +- htdocs/core/ajax/constantonoff.php | 2 +- htdocs/core/ajax/contacts.php | 4 +- htdocs/core/ajax/extraparams.php | 2 +- htdocs/core/ajax/fileupload.php | 2 +- htdocs/core/ajax/objectonoff.php | 4 +- htdocs/core/ajax/selectobject.php | 2 +- htdocs/core/ajax/vatrates.php | 4 +- htdocs/core/bookmarks_page.php | 6 +- .../boxes/box_graph_invoices_permonth.php | 2 +- .../core/boxes/box_graph_invoices_peryear.php | 2 +- .../box_graph_invoices_supplier_permonth.php | 2 +- .../core/boxes/box_graph_orders_permonth.php | 2 +- .../box_graph_orders_supplier_permonth.php | 2 +- .../boxes/box_graph_product_distribution.php | 2 +- .../boxes/box_graph_propales_permonth.php | 2 +- htdocs/core/class/commonobject.class.php | 8 +- htdocs/core/class/extrafields.class.php | 32 +-- htdocs/core/class/html.formmail.class.php | 2 +- htdocs/core/class/html.formsetup.class.php | 4 +- htdocs/core/class/html.formticket.class.php | 10 +- htdocs/core/datepicker.php | 2 +- htdocs/core/get_info.php | 2 +- htdocs/core/get_menudiv.php | 6 +- htdocs/core/lib/company.lib.php | 22 +- htdocs/core/lib/files.lib.php | 2 +- htdocs/core/lib/security2.lib.php | 16 +- htdocs/core/login/functions_googleoauth.php | 2 +- htdocs/core/login/functions_openid.php | 2 +- htdocs/core/menus/standard/auguria.lib.php | 2 +- htdocs/core/menus/standard/auguria_menu.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 4 +- htdocs/core/menus/standard/eldy_menu.php | 2 +- .../mailings/eventorganization.modules.php | 4 +- .../core/modules/mailings/fraise.modules.php | 12 +- .../modules/mailings/partnership.modules.php | 8 +- .../modules/mailings/thirdparties.modules.php | 12 +- .../thirdparties_services_expired.modules.php | 2 +- .../movement/doc/pdf_standard.modules.php | 14 +- .../modules/oauth/google_oauthcallback.php | 2 +- htdocs/core/multicompany_page.php | 2 +- htdocs/core/photos_resize.php | 6 +- htdocs/core/search_page.php | 8 +- htdocs/core/tpl/admin_extrafields_add.tpl.php | 6 +- htdocs/core/tpl/card_presend.tpl.php | 2 +- htdocs/core/tpl/commonfields_add.tpl.php | 6 +- htdocs/core/tpl/commonfields_edit.tpl.php | 4 +- htdocs/core/tpl/contacts.tpl.php | 2 +- .../tpl/document_actions_post_headers.tpl.php | 4 +- htdocs/core/tpl/extrafields_view.tpl.php | 4 +- htdocs/core/tpl/massactions_pre.tpl.php | 4 +- htdocs/core/tpl/objectline_create.tpl.php | 4 +- htdocs/core/tpl/objectline_edit.tpl.php | 6 +- htdocs/core/tpl/resource_view.tpl.php | 4 +- htdocs/cron/card.php | 20 +- htdocs/cron/info.php | 2 +- htdocs/cron/list.php | 10 +- htdocs/datapolicy/admin/setup.php | 4 +- htdocs/dav/fileserver.php | 4 +- htdocs/delivery/card.php | 8 +- htdocs/document.php | 2 +- htdocs/don/card.php | 20 +- htdocs/don/document.php | 8 +- htdocs/don/info.php | 4 +- htdocs/don/list.php | 6 +- htdocs/don/note.php | 4 +- htdocs/don/paiement/list.php | 22 +- htdocs/don/payment/card.php | 2 +- htdocs/don/payment/payment.php | 8 +- htdocs/don/stats/index.php | 4 +- htdocs/ecm/dir_add_card.php | 8 +- htdocs/ecm/dir_card.php | 6 +- htdocs/ecm/file_card.php | 6 +- htdocs/ecm/file_note.php | 10 +- htdocs/ecm/index.php | 10 +- htdocs/ecm/index_auto.php | 8 +- htdocs/ecm/index_medias.php | 12 +- htdocs/ecm/search.php | 8 +- .../conferenceorbooth_card.php | 14 +- .../conferenceorbooth_contact.php | 12 +- .../conferenceorbooth_document.php | 8 +- .../conferenceorbooth_list.php | 24 +- .../conferenceorboothattendee_card.php | 16 +- .../conferenceorboothattendee_list.php | 26 +- .../conferenceorboothattendee_note.php | 2 +- .../core/actions_massactions_mail.inc.php | 2 +- htdocs/expedition/ajax/searchfrombarcode.php | 10 +- htdocs/expedition/card.php | 116 ++++----- htdocs/expedition/contact.php | 8 +- htdocs/expedition/dispatch.php | 22 +- htdocs/expedition/document.php | 6 +- htdocs/expedition/index.php | 2 +- htdocs/expedition/list.php | 32 +-- htdocs/expedition/note.php | 2 +- htdocs/expedition/shipment.php | 16 +- htdocs/expedition/stats/index.php | 4 +- htdocs/expedition/stats/month.php | 2 +- htdocs/expensereport/ajax/ajaxik.php | 8 +- htdocs/expensereport/card.php | 62 ++--- htdocs/expensereport/document.php | 6 +- htdocs/expensereport/index.php | 8 +- htdocs/expensereport/info.php | 2 +- htdocs/expensereport/list.php | 36 +-- htdocs/expensereport/note.php | 4 +- htdocs/expensereport/payment/card.php | 2 +- htdocs/expensereport/payment/list.php | 20 +- htdocs/expensereport/payment/payment.php | 8 +- htdocs/expensereport/stats/index.php | 8 +- htdocs/exports/export.php | 8 +- htdocs/externalsite/frames.php | 2 +- htdocs/fichinter/agenda.php | 6 +- htdocs/fichinter/card-rec.php | 18 +- htdocs/fichinter/card.php | 68 ++--- htdocs/fichinter/contact.php | 8 +- htdocs/fichinter/document.php | 6 +- htdocs/fichinter/index.php | 2 +- htdocs/fichinter/list.php | 12 +- htdocs/fichinter/note.php | 2 +- htdocs/fichinter/stats/index.php | 6 +- htdocs/fourn/ajax/getSupplierPrices.php | 2 +- htdocs/fourn/card.php | 8 +- .../fourn/class/fournisseur.facture.class.php | 6 +- htdocs/fourn/commande/card.php | 68 ++--- htdocs/fourn/commande/contact.php | 6 +- htdocs/fourn/commande/dispatch.php | 30 +-- htdocs/fourn/commande/document.php | 6 +- htdocs/fourn/commande/info.php | 6 +- htdocs/fourn/commande/list.php | 78 +++--- htdocs/fourn/commande/note.php | 2 +- htdocs/fourn/contact.php | 6 +- htdocs/fourn/facture/card-rec.php | 80 +++--- htdocs/fourn/facture/card.php | 162 ++++++------ htdocs/fourn/facture/contact.php | 6 +- htdocs/fourn/facture/document.php | 6 +- htdocs/fourn/facture/index.php | 2 +- htdocs/fourn/facture/info.php | 2 +- htdocs/fourn/facture/list-rec.php | 40 +-- htdocs/fourn/facture/list.php | 42 ++-- htdocs/fourn/facture/note.php | 2 +- htdocs/fourn/facture/paiement.php | 8 +- htdocs/fourn/facture/rapport.php | 6 +- htdocs/fourn/index.php | 2 +- htdocs/fourn/paiement/card.php | 4 +- htdocs/fourn/paiement/document.php | 6 +- htdocs/fourn/paiement/info.php | 2 +- htdocs/fourn/paiement/list.php | 22 +- htdocs/fourn/product/list.php | 6 +- htdocs/fourn/recap-fourn.php | 2 +- htdocs/ftp/index.php | 4 +- htdocs/holiday/card.php | 22 +- htdocs/holiday/card_group.php | 18 +- htdocs/holiday/define_holiday.php | 8 +- htdocs/holiday/document.php | 6 +- htdocs/holiday/info.php | 2 +- htdocs/holiday/list.php | 36 +-- htdocs/holiday/month_report.php | 14 +- htdocs/holiday/view_log.php | 16 +- htdocs/hrm/admin/admin_establishment.php | 2 +- htdocs/hrm/establishment/card.php | 12 +- htdocs/hrm/establishment/info.php | 6 +- htdocs/hrm/evaluation_agenda.php | 6 +- htdocs/hrm/evaluation_card.php | 12 +- htdocs/hrm/evaluation_contact.php | 10 +- htdocs/hrm/evaluation_document.php | 6 +- htdocs/hrm/evaluation_list.php | 20 +- htdocs/hrm/evaluation_note.php | 2 +- htdocs/hrm/index.php | 2 +- htdocs/hrm/job_agenda.php | 6 +- htdocs/hrm/job_card.php | 12 +- htdocs/hrm/job_document.php | 6 +- htdocs/hrm/job_list.php | 20 +- htdocs/hrm/job_note.php | 2 +- htdocs/hrm/position.php | 20 +- htdocs/hrm/position_agenda.php | 6 +- htdocs/hrm/position_card.php | 10 +- htdocs/hrm/position_document.php | 6 +- htdocs/hrm/position_list.php | 20 +- htdocs/hrm/position_note.php | 2 +- htdocs/hrm/skill_agenda.php | 6 +- htdocs/hrm/skill_card.php | 18 +- htdocs/hrm/skill_document.php | 6 +- htdocs/hrm/skill_list.php | 20 +- htdocs/hrm/skill_note.php | 2 +- htdocs/hrm/skill_tab.php | 4 +- htdocs/imports/import.php | 6 +- htdocs/index.php | 4 +- .../containers/wrapper.php | 4 +- .../containers/wrapper.php | 4 +- .../containers/wrapper.php | 4 +- .../containers/wrapper.php | 4 +- .../containers/wrapper.php | 4 +- .../containers/wrapper.php | 4 +- htdocs/install/step1.php | 2 +- htdocs/intracommreport/card.php | 2 +- htdocs/intracommreport/list.php | 10 +- .../knowledgemanagementindex.php | 2 +- .../knowledgerecord_agenda.php | 8 +- .../knowledgerecord_card.php | 8 +- .../knowledgerecord_contact.php | 10 +- .../knowledgerecord_document.php | 6 +- .../knowledgerecord_list.php | 22 +- .../knowledgerecord_note.php | 2 +- htdocs/loan/calcmens.php | 4 +- htdocs/loan/card.php | 22 +- htdocs/loan/document.php | 6 +- htdocs/loan/info.php | 4 +- htdocs/loan/list.php | 12 +- htdocs/loan/note.php | 2 +- htdocs/loan/payment/card.php | 2 +- htdocs/loan/payment/payment.php | 15 +- htdocs/loan/schedule.php | 6 +- htdocs/main.inc.php | 64 ++--- htdocs/margin/agentMargins.php | 18 +- htdocs/margin/checkMargins.php | 12 +- htdocs/margin/customerMargins.php | 26 +- htdocs/margin/productMargins.php | 26 +- htdocs/margin/tabs/productMargins.php | 6 +- htdocs/margin/tabs/thirdpartyMargins.php | 6 +- htdocs/master.inc.php | 4 +- htdocs/modulebuilder/index.php | 40 +-- htdocs/mrp/ajax/interface.php | 4 +- htdocs/mrp/mo_agenda.php | 6 +- htdocs/mrp/mo_card.php | 18 +- htdocs/mrp/mo_document.php | 6 +- htdocs/mrp/mo_list.php | 14 +- htdocs/mrp/mo_movements.php | 20 +- htdocs/mrp/mo_note.php | 2 +- htdocs/mrp/mo_production.php | 22 +- htdocs/multicurrency/multicurrency_rate.php | 14 +- htdocs/opensurvey/card.php | 2 +- htdocs/opensurvey/list.php | 8 +- htdocs/partnership/admin/setup.php | 2 +- htdocs/partnership/partnership_agenda.php | 8 +- htdocs/partnership/partnership_card.php | 14 +- htdocs/partnership/partnership_contact.php | 8 +- htdocs/partnership/partnership_document.php | 6 +- htdocs/partnership/partnership_list.php | 24 +- htdocs/partnership/partnership_note.php | 2 +- htdocs/paybox/admin/paybox.php | 2 +- htdocs/paypal/admin/paypal.php | 4 +- htdocs/product/admin/dynamic_prices.php | 12 +- htdocs/product/agenda.php | 6 +- htdocs/product/ajax/product_lot.php | 2 +- htdocs/product/ajax/products.php | 26 +- htdocs/product/card.php | 72 +++--- htdocs/product/composition/card.php | 8 +- htdocs/product/document.php | 6 +- htdocs/product/dynamic_price/editor.php | 4 +- htdocs/product/fournisseurs.php | 10 +- htdocs/product/index.php | 2 +- .../inventory/ajax/searchfrombarcode.php | 10 +- htdocs/product/inventory/card.php | 4 +- htdocs/product/inventory/inventory.php | 16 +- htdocs/product/inventory/list.php | 22 +- htdocs/product/list.php | 28 +-- htdocs/product/note.php | 2 +- htdocs/product/popuprop.php | 6 +- htdocs/product/price.php | 42 ++-- htdocs/product/reassort.php | 14 +- htdocs/product/reassortlot.php | 28 +-- htdocs/product/stats/bom.php | 6 +- htdocs/product/stats/card.php | 16 +- htdocs/product/stats/commande.php | 10 +- htdocs/product/stats/commande_fournisseur.php | 10 +- htdocs/product/stats/contrat.php | 6 +- htdocs/product/stats/facture.php | 6 +- htdocs/product/stats/facture_fournisseur.php | 10 +- htdocs/product/stats/facturerec.php | 10 +- htdocs/product/stats/mo.php | 10 +- htdocs/product/stats/propal.php | 10 +- htdocs/product/stats/supplier_proposal.php | 10 +- htdocs/product/stock/card.php | 16 +- htdocs/product/stock/fiche-valo.php | 2 +- htdocs/product/stock/info.php | 2 +- htdocs/product/stock/list.php | 16 +- htdocs/product/stock/massstockmove.php | 10 +- htdocs/product/stock/movement_card.php | 50 ++-- htdocs/product/stock/movement_list.php | 68 ++--- htdocs/product/stock/product.php | 48 ++-- htdocs/product/stock/productlot_card.php | 26 +- htdocs/product/stock/productlot_document.php | 6 +- htdocs/product/stock/productlot_list.php | 20 +- htdocs/product/stock/productlot_note.php | 2 +- htdocs/product/stock/replenish.php | 22 +- htdocs/product/stock/replenishorders.php | 18 +- .../stock/stats/commande_fournisseur.php | 12 +- htdocs/product/stock/stats/expedition.php | 12 +- htdocs/product/stock/stats/mo.php | 10 +- htdocs/product/stock/stats/reception.php | 12 +- htdocs/product/stock/stockatdate.php | 30 +-- .../stocktransfer/stocktransfer_agenda.php | 6 +- .../stocktransfer/stocktransfer_card.php | 20 +- .../stocktransfer/stocktransfer_contact.php | 6 +- .../stocktransfer/stocktransfer_document.php | 6 +- .../stocktransfer/stocktransfer_list.php | 22 +- .../stocktransfer/stocktransfer_note.php | 2 +- .../product/stock/tpl/stockcorrection.tpl.php | 6 +- .../product/stock/tpl/stocktransfer.tpl.php | 6 +- htdocs/product/stock/valo.php | 2 +- htdocs/product/traduction.php | 4 +- htdocs/projet/activity/index.php | 2 +- htdocs/projet/activity/perday.php | 26 +- htdocs/projet/activity/permonth.php | 26 +- htdocs/projet/activity/perweek.php | 26 +- htdocs/projet/admin/website.php | 4 +- htdocs/projet/agenda.php | 10 +- htdocs/projet/ajax/projects.php | 6 +- htdocs/projet/card.php | 30 +-- htdocs/projet/comment.php | 6 +- htdocs/projet/contact.php | 14 +- htdocs/projet/document.php | 6 +- htdocs/projet/element.php | 4 +- htdocs/projet/index.php | 4 +- htdocs/projet/list.php | 94 +++---- htdocs/projet/messaging.php | 10 +- htdocs/projet/note.php | 2 +- htdocs/projet/stats/index.php | 4 +- htdocs/projet/tasks.php | 46 ++-- htdocs/projet/tasks/comment.php | 10 +- htdocs/projet/tasks/contact.php | 12 +- htdocs/projet/tasks/document.php | 8 +- htdocs/projet/tasks/list.php | 42 ++-- htdocs/projet/tasks/note.php | 4 +- htdocs/projet/tasks/stats/index.php | 4 +- htdocs/projet/tasks/task.php | 12 +- htdocs/projet/tasks/time.php | 162 ++++++------ htdocs/public/agenda/agendaexport.php | 26 +- htdocs/public/bookcal/bookcalAjax.php | 4 +- htdocs/public/bookcal/index.php | 22 +- htdocs/public/company/new.php | 2 +- htdocs/public/demo/index.php | 10 +- .../public/eventorganization/attendee_new.php | 4 +- .../eventorganization/subscriptionok.php | 2 +- htdocs/public/members/new.php | 6 +- htdocs/public/members/public_card.php | 2 +- htdocs/public/members/public_list.php | 4 +- htdocs/public/opensurvey/index.php | 6 +- htdocs/public/opensurvey/studs.php | 2 +- htdocs/public/partnership/new.php | 8 +- htdocs/public/payment/newpayment.php | 32 +-- htdocs/public/payment/paymentok.php | 2 +- htdocs/public/project/index.php | 4 +- htdocs/public/project/new.php | 2 +- htdocs/public/project/suggestbooth.php | 8 +- htdocs/public/project/suggestconference.php | 8 +- htdocs/public/project/viewandvote.php | 2 +- htdocs/public/recruitment/index.php | 6 +- htdocs/public/ticket/ajax/ajax.php | 2 +- htdocs/public/ticket/create_ticket.php | 6 +- htdocs/public/ticket/list.php | 6 +- htdocs/public/users/view.php | 2 +- htdocs/public/website/javascript.js.php | 2 +- htdocs/public/website/styles.css.php | 2 +- htdocs/reception/card.php | 114 ++++----- htdocs/reception/contact.php | 8 +- htdocs/reception/dispatch.php | 26 +- htdocs/reception/document.php | 6 +- htdocs/reception/list.php | 44 ++-- htdocs/reception/note.php | 2 +- htdocs/reception/stats/index.php | 4 +- htdocs/reception/stats/month.php | 8 +- htdocs/recruitment/index.php | 2 +- .../recruitmentcandidature_agenda.php | 8 +- .../recruitmentcandidature_card.php | 14 +- .../recruitmentcandidature_document.php | 6 +- .../recruitmentcandidature_list.php | 16 +- .../recruitmentcandidature_note.php | 2 +- .../recruitmentjobposition_agenda.php | 6 +- .../recruitmentjobposition_applications.php | 6 +- .../recruitmentjobposition_card.php | 12 +- .../recruitmentjobposition_document.php | 6 +- .../recruitmentjobposition_list.php | 14 +- .../recruitmentjobposition_note.php | 2 +- htdocs/resource/agenda.php | 6 +- htdocs/resource/contact.php | 8 +- htdocs/resource/document.php | 6 +- htdocs/resource/element_resource.php | 14 +- htdocs/resource/list.php | 14 +- htdocs/resource/note.php | 2 +- htdocs/salaries/ajax/ajaxsalaries.php | 4 +- htdocs/salaries/card.php | 48 ++-- htdocs/salaries/document.php | 8 +- htdocs/salaries/info.php | 6 +- htdocs/salaries/list.php | 30 +-- htdocs/salaries/paiement_salary.php | 14 +- htdocs/salaries/payment_salary/card.php | 4 +- htdocs/salaries/payments.php | 40 +-- htdocs/salaries/stats/index.php | 8 +- htdocs/salaries/virement_request.php | 8 +- htdocs/societe/admin/societe.php | 20 +- htdocs/societe/agenda.php | 6 +- htdocs/societe/ajax/ajaxcompanies.php | 6 +- htdocs/societe/ajax/company.php | 4 +- htdocs/societe/card.php | 114 ++++----- htdocs/societe/consumption.php | 10 +- htdocs/societe/contact.php | 2 +- htdocs/societe/document.php | 6 +- htdocs/societe/index.php | 6 +- htdocs/societe/list.php | 52 ++-- htdocs/societe/messaging.php | 6 +- htdocs/societe/note.php | 2 +- htdocs/societe/notify/card.php | 10 +- htdocs/societe/paymentmodes.php | 34 +-- htdocs/societe/price.php | 24 +- htdocs/societe/project.php | 4 +- htdocs/societe/societecontact.php | 12 +- htdocs/societe/website.php | 10 +- htdocs/stripe/admin/stripe.php | 8 +- htdocs/stripe/ajax/ajax.php | 4 +- htdocs/stripe/charge.php | 6 +- htdocs/stripe/payout.php | 6 +- htdocs/stripe/transaction.php | 6 +- htdocs/supplier_proposal/card.php | 48 ++-- htdocs/supplier_proposal/contact.php | 6 +- htdocs/supplier_proposal/document.php | 6 +- htdocs/supplier_proposal/index.php | 2 +- htdocs/supplier_proposal/info.php | 4 +- htdocs/supplier_proposal/list.php | 44 ++-- htdocs/supplier_proposal/note.php | 2 +- htdocs/takepos/admin/orderprinters.php | 2 +- htdocs/takepos/admin/printqr.php | 2 +- htdocs/takepos/admin/terminal.php | 4 +- htdocs/takepos/ajax/ajax.php | 12 +- htdocs/takepos/floors.php | 4 +- htdocs/takepos/freezone.php | 2 +- htdocs/takepos/genimg/index.php | 6 +- htdocs/takepos/index.php | 2 +- htdocs/takepos/invoice.php | 2 +- htdocs/takepos/pay.php | 2 +- htdocs/takepos/phone.php | 8 +- htdocs/takepos/printbox.php | 2 +- htdocs/takepos/receipt.php | 6 +- htdocs/takepos/reduction.php | 2 +- htdocs/takepos/send.php | 2 +- htdocs/takepos/split.php | 4 +- htdocs/theme/eldy/info-box.inc.php | 2 +- htdocs/theme/eldy/style.css.php | 2 +- htdocs/theme/md/info-box.inc.php | 4 +- htdocs/theme/md/style.css.php | 2 +- htdocs/ticket/agenda.php | 14 +- htdocs/ticket/card.php | 58 ++--- htdocs/ticket/class/ticket.class.php | 2 +- htdocs/ticket/contact.php | 16 +- htdocs/ticket/document.php | 12 +- htdocs/ticket/index.php | 8 +- htdocs/ticket/list.php | 44 ++-- htdocs/ticket/messaging.php | 14 +- htdocs/ticket/stats/index.php | 6 +- htdocs/user/agenda.php | 6 +- htdocs/user/agenda_extsites.php | 2 +- htdocs/user/bank.php | 12 +- htdocs/user/card.php | 48 ++-- htdocs/user/clicktodial.php | 2 +- htdocs/user/document.php | 6 +- htdocs/user/group/card.php | 6 +- htdocs/user/group/ldap.php | 2 +- htdocs/user/group/list.php | 14 +- htdocs/user/group/perms.php | 8 +- htdocs/user/hierarchy.php | 4 +- htdocs/user/home.php | 4 +- htdocs/user/ldap.php | 2 +- htdocs/user/list.php | 18 +- htdocs/user/messaging.php | 4 +- htdocs/user/note.php | 2 +- htdocs/user/notify/card.php | 10 +- htdocs/user/param_ihm.php | 4 +- htdocs/user/passwordforgotten.php | 6 +- htdocs/user/perms.php | 8 +- htdocs/user/vcard.php | 2 +- htdocs/user/virtualcard.php | 2 +- htdocs/variants/ajax/getCombinations.php | 2 +- htdocs/variants/ajax/get_attribute_values.php | 2 +- htdocs/variants/card.php | 6 +- htdocs/variants/combinations.php | 10 +- htdocs/variants/list.php | 20 +- htdocs/viewimage.php | 2 +- htdocs/webhook/target_card.php | 12 +- htdocs/webhook/target_list.php | 14 +- .../class/html.formcardwebportal.class.php | 6 +- .../class/html.formlistwebportal.class.php | 12 +- .../controllers/document.controller.class.php | 4 +- htdocs/website/index.php | 56 ++--- htdocs/website/samples/wrapper.php | 4 +- htdocs/website/websiteaccount_card.php | 2 +- htdocs/workstation/workstation_agenda.php | 6 +- htdocs/workstation/workstation_card.php | 2 +- htdocs/workstation/workstation_document.php | 6 +- htdocs/workstation/workstation_list.php | 22 +- htdocs/workstation/workstation_note.php | 2 +- 827 files changed, 5130 insertions(+), 5136 deletions(-) diff --git a/dev/tools/codespell/codespell-lines-ignore.txt b/dev/tools/codespell/codespell-lines-ignore.txt index d0ebf648c39..5ddee3b9244 100644 --- a/dev/tools/codespell/codespell-lines-ignore.txt +++ b/dev/tools/codespell/codespell-lines-ignore.txt @@ -28,7 +28,7 @@ $tmpprojtime = $element->getSumOfAmount($idofelementuser ? $elementuser : '', $dates, $datee); // $element is a task. $elementuser may be empty $typea = ($data[$j]->typea == 'birth') ? $picb : $pice; //var_dump("$key, $tablename, $datefieldname, $dates, $datee"); - GETPOST("mouvement", 'int'), + GETPOSTINT("mouvement"), dol_syslog("msgid=".$overview[0]->message_id." date=".dol_print_date($overview[0]->udate, 'dayrfc', 'gmt')." from=".$overview[0]->from." to=".$overview[0]->to." subject=".$overview[0]->subject); if ((empty($dates) && empty($datee)) || (intval($dates) <= $element->datestart && intval($datee) >= $element->dateend)) { jQuery("#mouvement option").removeAttr("selected").change(); @@ -59,20 +59,19 @@ $tmp = array('id_users'=>$obj->id_users, 'nom'=>$obj->name, 'reponses'=>$obj->reponses); $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, true); // Disable hook for the moment //si les reponses ne concerne pas la colonne effacée, on concatenate - GETPOST("mouvement", "int"), GETPOST("mouvement", 'alpha'), - GETPOST("mouvement", 'int'), + GETPOSTINT("mouvement"), foreach ($TWeek as $weekIndex => $weekNb) { if (count($arrayfields) > 0 && !empty($arrayfields['t.datee']['checked'])) { if (jQuery("#mouvement").val() == \'0\') jQuery("#unitprice").removeAttr("disabled"); print ''.$langs->trans("TransferStock").''; print ''; $action = 'transfert'; - $date_com = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $date_com = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); $date_next_execution = (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1); $date_next_execution = dol_mktime($rehour, $remin, 0, $remonth, $reday, $reyear); - $datee = dol_get_last_day(GETPOST('yeartoexport', 'int'), GETPOST('monthtoexport', 'int') ? GETPOST('monthtoexport', 'int') : 12); - $datesubscription = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", "int"), GETPOST("reyear", "int")); + $datee = dol_get_last_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 12); + $datesubscription = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); $ensemblereponses = $obj->reponses; $object->datee = $datee; $object->periode = $dateperiod; @@ -114,20 +113,17 @@ $cle_rib = strtolower(checkES($rib, $CCC)); $date_com = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear")); $date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1); - $datefrom = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); - $datesubscription = dol_mktime(0, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int")); + $datefrom = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); + $datesubscription = dol_mktime(0, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); $datetouse = ($this->date_end > 0) ? $this->date_end : ((isset($this->datee) && $this->datee > 0) ? $this->datee : 0); $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, !empty($project_field) ? $project_field : 'fk_projet'); $ensemblereponses = $obj->reponses; $head[$h][1] = $langs->trans("Referers"); $head[$tab][1] = $langs->trans("Referers"); $out .= "".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT) : '')."
\n"; - $reday = GETPOST('reday', 'int'); $reday = GETPOSTINT('reday'); $sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_modification, p.budget_amount"; - $sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount"; $sql = 'SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_modification, p.budget_amount'; - $sql = 'SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount'; $sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= " VALUES (".$conf->entity.", '".$this->db->idate($this->datea)."'"; @@ -187,11 +183,10 @@ $datee = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); $datee = dol_stringtotime($dateerfc); $datepaid = dol_mktime(12, 0, 0, GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear")); - $datepaid = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int')); - $datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int")); - $datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int')); - $datepaye = dol_mktime(GETPOST("rehour", 'int'), GETPOST("remin", 'int'), GETPOST("resec", 'int'), GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int')); - $datepaye = dol_mktime(GETPOST("rehour", 'int'), GETPOST("remin", 'int'), GETPOST("resec", 'int'), GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int'), 'tzuserrel'); + $datepaid = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); + $datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); + $datepaye = dol_mktime(GETPOSTINT("rehour"), GETPOSTINT("remin"), GETPOSTINT("resec"), GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); + $datepaye = dol_mktime(GETPOSTINT("rehour"), GETPOSTINT("remin"), GETPOSTINT("resec"), GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"), 'tzuserrel'); $ensemblereponses = $obj->reponses; $head[$h][1] = $langs->trans('Referers'); $morewherefilterarray[] = " t.datee <= '".$db->idate($search_date_end_end)."'"; @@ -238,8 +233,8 @@ foreach ($TWeek as $week_number) { if (!empty($arrayfields['t.datee']['checked'])) { if ($action == "transfert") { - if (GETPOST("reyear", "int") && GETPOST("remonth", "int") && GETPOST("reday", "int")) { if (GETPOST('reday')) { + if (GETPOSTINT("reyear") && GETPOSTINT("remonth") && GETPOSTINT("reday")) { print $form->selectDate($datee, 'datee', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); print ''; print ''; @@ -977,7 +977,7 @@ function fieldListAccountingCategories($fieldlist, $obj = null, $tabname = '', $ $fieldname = 'country'; if ($context == 'add') { $fieldname = 'country_id'; - $preselectcountrycode = GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : $mysoc->country_code; + $preselectcountrycode = GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : $mysoc->country_code; print $form->select_country($preselectcountrycode, $fieldname, '', 28, 'maxwidth150 maxwidthonsmartphone'); } else { $preselectcountrycode = (empty($obj->country_code) ? (empty($obj->country) ? $mysoc->country_code : $obj->country) : $obj->country_code); diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 3eace908373..65a447811cc 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -143,13 +143,13 @@ if ($action == 'update') { } $constname = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'; - $constvalue = GETPOST($constname, 'int'); + $constvalue = GETPOSTINT($constname); if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { $error++; } $constname = 'ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT'; - $constvalue = GETPOST($constname, 'int'); + $constvalue = GETPOSTINT($constname); if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { $error++; } @@ -163,7 +163,7 @@ if ($action == 'update') { } if ($action == 'setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT') { - $setDisableAuxiliaryAccountOnCustomerDeposit = GETPOST('value', 'int'); + $setDisableAuxiliaryAccountOnCustomerDeposit = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT", $setDisableAuxiliaryAccountOnCustomerDeposit, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -177,7 +177,7 @@ if ($action == 'setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT') { } if ($action == 'setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT') { - $setDisableAuxiliaryAccountOnSupplierDeposit = GETPOST('value', 'int'); + $setDisableAuxiliaryAccountOnSupplierDeposit = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT", $setDisableAuxiliaryAccountOnSupplierDeposit, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 902b184a48c..8a0d6764590 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -84,7 +84,7 @@ $model_option = array( if ($action == 'update') { $error = 0; - $modelcsv = GETPOST('ACCOUNTING_EXPORT_MODELCSV', 'int'); + $modelcsv = GETPOSTINT('ACCOUNTING_EXPORT_MODELCSV'); if (!empty($modelcsv)) { if (!dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) { diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index cb142948096..8f2aff9a587 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php'; $action = GETPOST('action', 'aZ09'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 477fac08eee..e6408d33ab6 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php'; $langs->loadLangs(array("admin", "compta")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); @@ -70,8 +70,8 @@ foreach ($tmpstatus2label as $key => $val) { $status2label[$key] = $langs->trans($val); } -$date_start = dol_mktime(0, 0, 0, GETPOST('fiscalyearmonth', 'int'), GETPOST('fiscalyearday', 'int'), GETPOST('fiscalyearyear', 'int')); -$date_end = dol_mktime(0, 0, 0, GETPOST('fiscalyearendmonth', 'int'), GETPOST('fiscalyearendday', 'int'), GETPOST('fiscalyearendyear', 'int')); +$date_start = dol_mktime(0, 0, 0, GETPOSTINT('fiscalyearmonth'), GETPOSTINT('fiscalyearday'), GETPOSTINT('fiscalyearyear')); +$date_end = dol_mktime(0, 0, 0, GETPOSTINT('fiscalyearendmonth'), GETPOSTINT('fiscalyearendday'), GETPOSTINT('fiscalyearendyear')); $permissiontoadd = $user->hasRight('accounting', 'fiscalyear', 'write'); diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index 39754c0345d..f1ad54d9bb9 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -38,7 +38,7 @@ if (!$user->hasRight('accounting', 'fiscalyear', 'write')) { accessforbidden(); } -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // View diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index ea93f6751fa..748b55ed733 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -45,7 +45,7 @@ if (!$user->hasRight('accounting', 'chartofaccount')) { $action = GETPOST('action', 'aZ09'); -$nbletter = GETPOST('ACCOUNTING_LETTERING_NBLETTERS', 'int'); +$nbletter = GETPOSTINT('ACCOUNTING_LETTERING_NBLETTERS'); // Parameters ACCOUNTING_* and others $list = array( @@ -70,7 +70,7 @@ $error = 0; if (in_array($action, array('setBANK_DISABLE_DIRECT_INPUT', 'setACCOUNTANCY_COMBO_FOR_AUX', 'setACCOUNTING_MANAGE_ZERO'))) { $constname = preg_replace('/^set/', '', $action); - $constvalue = GETPOST('value', 'int'); + $constvalue = GETPOSTINT('value'); $res = dolibarr_set_const($db, $constname, $constvalue, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -102,7 +102,7 @@ if ($action == 'update') { $constvalue = GETPOST($constname, 'alpha'); if ($constname == 'ACCOUNTING_DATE_START_BINDING') { - $constvalue = dol_mktime(0, 0, 0, GETPOST($constname.'month', 'int'), GETPOST($constname.'day', 'int'), GETPOST($constname.'year', 'int')); + $constvalue = dol_mktime(0, 0, 0, GETPOSTINT($constname.'month'), GETPOSTINT($constname.'day'), GETPOSTINT($constname.'year')); } if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { @@ -128,7 +128,7 @@ if ($action == 'update') { } if ($action == 'setmanagezero') { - $setmanagezero = GETPOST('value', 'int'); + $setmanagezero = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -142,7 +142,7 @@ if ($action == 'setmanagezero') { } if ($action == 'setdisabledirectinput') { - $setdisabledirectinput = GETPOST('value', 'int'); + $setdisabledirectinput = GETPOSTINT('value'); $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -156,7 +156,7 @@ if ($action == 'setdisabledirectinput') { } if ($action == 'setenabledraftexport') { - $setenabledraftexport = GETPOST('value', 'int'); + $setenabledraftexport = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -170,7 +170,7 @@ if ($action == 'setenabledraftexport') { } if ($action == 'setenablesubsidiarylist') { - $setenablesubsidiarylist = GETPOST('value', 'int'); + $setenablesubsidiarylist = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -184,7 +184,7 @@ if ($action == 'setenablesubsidiarylist') { } if ($action == 'setdisablebindingonsales') { - $setdisablebindingonsales = GETPOST('value', 'int'); + $setdisablebindingonsales = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -198,7 +198,7 @@ if ($action == 'setdisablebindingonsales') { } if ($action == 'setdisablebindingonpurchases') { - $setdisablebindingonpurchases = GETPOST('value', 'int'); + $setdisablebindingonpurchases = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -212,7 +212,7 @@ if ($action == 'setdisablebindingonpurchases') { } if ($action == 'setdisablebindingonexpensereports') { - $setdisablebindingonexpensereports = GETPOST('value', 'int'); + $setdisablebindingonexpensereports = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -226,7 +226,7 @@ if ($action == 'setdisablebindingonexpensereports') { } if ($action == 'setenablelettering') { - $setenablelettering = GETPOST('value', 'int'); + $setenablelettering = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_LETTERING", $setenablelettering, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -240,7 +240,7 @@ if ($action == 'setenablelettering') { } if ($action == 'setenableautolettering') { - $setenableautolettering = GETPOST('value', 'int'); + $setenableautolettering = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_AUTOLETTERING", $setenableautolettering, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -254,7 +254,7 @@ if ($action == 'setenableautolettering') { } if ($action == 'setenablevatreversecharge') { - $setenablevatreversecharge = GETPOST('value', 'int'); + $setenablevatreversecharge = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE", $setenablevatreversecharge, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 6f001eec6e5..1df04810801 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -56,12 +56,12 @@ $actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"') $actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"'); $listoffset = GETPOST('listoffset', 'alpha'); -$listlimit = GETPOST('listlimit', 'int') > 0 ? GETPOST('listlimit', 'int') : 1000; +$listlimit = GETPOSTINT('listlimit') > 0 ? GETPOSTINT('listlimit') : 1000; $active = 1; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -77,7 +77,7 @@ if (empty($sortorder)) { $error = 0; -$search_country_id = GETPOST('search_country_id', 'int'); +$search_country_id = GETPOSTINT('search_country_id'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('admin')); diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 66b120cf1d5..aa4c4a3eb00 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -57,13 +57,13 @@ $optioncss = GETPOST('optioncss', 'alpha'); $codeventil_buy = GETPOST('codeventil_buy', 'array'); $codeventil_sell = GETPOST('codeventil_sell', 'array'); $chk_prod = GETPOST('chk_prod', 'array'); -$default_account = GETPOST('default_account', 'int'); +$default_account = GETPOSTINT('default_account'); $account_number_buy = GETPOST('account_number_buy'); $account_number_sell = GETPOST('account_number_sell'); $changeaccount = GETPOST('changeaccount', 'array'); $changeaccount_buy = GETPOST('changeaccount_buy', 'array'); $changeaccount_sell = GETPOST('changeaccount_sell', 'array'); -$searchCategoryProductOperator = (GETPOST('search_category_product_operator', 'int') ? GETPOST('search_category_product_operator', 'int') : 0); +$searchCategoryProductOperator = (GETPOSTINT('search_category_product_operator') ? GETPOSTINT('search_category_product_operator') : 0); $searchCategoryProductList = GETPOST('search_category_product_list', 'array'); $search_ref = GETPOST('search_ref', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); @@ -84,10 +84,10 @@ if (empty($accounting_product_mode)) { $accounting_product_mode = 'ACCOUNTANCY_SELL'; } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalInt('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalInt('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index fb9a61e36d0..b048663e405 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -35,8 +35,8 @@ $langs->loadLangs(array("accountancy", "admin", "bills", "compta", "errors", "hr $mesg = ''; $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); -$id = GETPOST('id', 'int'); -$rowid = GETPOST('rowid', 'int'); +$id = GETPOSTINT('id'); +$rowid = GETPOSTINT('rowid'); $massaction = GETPOST('massaction', 'aZ09'); $optioncss = GETPOST('optioncss', 'alpha'); $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) @@ -44,7 +44,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'ac $search_subaccount = GETPOST('search_subaccount', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); -$search_type = GETPOST('search_type', 'int'); +$search_type = GETPOSTINT('search_type'); // Security check if ($user->socid > 0) { @@ -55,10 +55,10 @@ if (!$user->hasRight('accounting', 'chartofaccount')) { } // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index dfbe2a06cff..b04e3f644e2 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -50,8 +50,8 @@ if ($type == 'sub') { } $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : $context_default; $show_subgroup = GETPOST('show_subgroup', 'alpha'); -$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); -$search_date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); +$search_date_start = dol_mktime(0, 0, 0, GETPOSTINT('date_startmonth'), GETPOSTINT('date_startday'), GETPOSTINT('date_startyear')); +$search_date_end = dol_mktime(23, 59, 59, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear')); $search_ledger_code = GETPOST('search_ledger_code', 'array'); $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); if ($search_accountancy_code_start == - 1) { @@ -64,10 +64,10 @@ if ($search_accountancy_code_end == - 1) { $search_not_reconciled = GETPOST('search_not_reconciled', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action @@ -161,15 +161,15 @@ if (empty($reshook)) { if (!empty($search_date_start)) { $filter['t.doc_date>='] = $search_date_start; - $param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int'); + $param .= '&date_startmonth=' . GETPOSTINT('date_startmonth') . '&date_startday=' . GETPOSTINT('date_startday') . '&date_startyear=' . GETPOSTINT('date_startyear'); } if (!empty($search_date_end)) { $filter['t.doc_date<='] = $search_date_end; - $param .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int'); + $param .= '&date_endmonth=' . GETPOSTINT('date_endmonth') . '&date_endday=' . GETPOSTINT('date_endday') . '&date_endyear=' . GETPOSTINT('date_endyear'); } if (!empty($search_doc_date)) { $filter['t.doc_date'] = $search_doc_date; - $param .= '&doc_datemonth=' . GETPOST('doc_datemonth', 'int') . '&doc_dateday=' . GETPOST('doc_dateday', 'int') . '&doc_dateyear=' . GETPOST('doc_dateyear', 'int'); + $param .= '&doc_datemonth=' . GETPOSTINT('doc_datemonth') . '&doc_dateday=' . GETPOSTINT('doc_dateday') . '&doc_dateyear=' . GETPOSTINT('doc_dateyear'); } if (!empty($search_accountancy_code_start)) { if ($type == 'sub') { @@ -587,20 +587,20 @@ if ($action != 'export_csv') { if ($line->subledger_account) { $urlzoom = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&search_accountancy_code_start=' . urlencode($line->subledger_account) . '&search_accountancy_code_end=' . urlencode($line->subledger_account); if (GETPOSTISSET('date_startmonth')) { - $urlzoom .= '&search_date_startmonth=' . GETPOST('date_startmonth', 'int') . '&search_date_startday=' . GETPOST('date_startday', 'int') . '&search_date_startyear=' . GETPOST('date_startyear', 'int'); + $urlzoom .= '&search_date_startmonth=' . GETPOSTINT('date_startmonth') . '&search_date_startday=' . GETPOSTINT('date_startday') . '&search_date_startyear=' . GETPOSTINT('date_startyear'); } if (GETPOSTISSET('date_endmonth')) { - $urlzoom .= '&search_date_endmonth=' . GETPOST('date_endmonth', 'int') . '&search_date_endday=' . GETPOST('date_endday', 'int') . '&search_date_endyear=' . GETPOST('date_endyear', 'int'); + $urlzoom .= '&search_date_endmonth=' . GETPOSTINT('date_endmonth') . '&search_date_endday=' . GETPOSTINT('date_endday') . '&search_date_endyear=' . GETPOSTINT('date_endyear'); } } } else { if ($line->numero_compte) { $urlzoom = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . urlencode($line->numero_compte) . '&search_accountancy_code_end=' . urlencode($line->numero_compte); if (GETPOSTISSET('date_startmonth')) { - $urlzoom .= '&search_date_startmonth=' . GETPOST('date_startmonth', 'int') . '&search_date_startday=' . GETPOST('date_startday', 'int') . '&search_date_startyear=' . GETPOST('date_startyear', 'int'); + $urlzoom .= '&search_date_startmonth=' . GETPOSTINT('date_startmonth') . '&search_date_startday=' . GETPOSTINT('date_startday') . '&search_date_startyear=' . GETPOSTINT('date_startyear'); } if (GETPOSTISSET('date_endmonth')) { - $urlzoom .= '&search_date_endmonth=' . GETPOST('date_endmonth', 'int') . '&search_date_endday=' . GETPOST('date_endday', 'int') . '&search_date_endyear=' . GETPOST('date_endyear', 'int'); + $urlzoom .= '&search_date_endmonth=' . GETPOSTINT('date_endmonth') . '&search_date_endday=' . GETPOSTINT('date_endday') . '&search_date_endyear=' . GETPOSTINT('date_endyear'); } } } diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 4fa8ff92697..444cb44d104 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -250,7 +250,7 @@ if ($action == "confirm_update") { $object->label_compte = ''; $object->debit = 0; $object->credit = 0; - $object->doc_date = $date_start = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); + $object->doc_date = $date_start = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); $object->doc_type = GETPOST('doc_type', 'alpha'); $object->piece_num = GETPOSTINT('next_num_mvt'); $object->doc_ref = GETPOST('doc_ref', 'alpha'); @@ -276,7 +276,7 @@ if ($action == "confirm_update") { } if ($action == 'setdate') { - $datedoc = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); + $datedoc = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); $result = $object->updateByMvt($piece_num, 'doc_date', $db->idate($datedoc), $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index f6d4f4bfd30..b2d205f74eb 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -43,55 +43,55 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; // Load translation files required by the page $langs->loadLangs(array("accountancy", "compta")); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookkeepinglist'; -$search_mvt_num = GETPOST('search_mvt_num', 'int'); +$search_mvt_num = GETPOSTINT('search_mvt_num'); $search_doc_type = GETPOST("search_doc_type", 'alpha'); $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endday = GETPOSTINT('search_date_endday'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); -$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); -$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int'); -$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int'); -$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int'); -$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int'); -$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int'); -$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int'); +$search_doc_date = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); +$search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); +$search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); +$search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); +$search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); +$search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); +$search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); $search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); $search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); -$search_date_modification_startyear = GETPOST('search_date_modification_startyear', 'int'); -$search_date_modification_startmonth = GETPOST('search_date_modification_startmonth', 'int'); -$search_date_modification_startday = GETPOST('search_date_modification_startday', 'int'); -$search_date_modification_endyear = GETPOST('search_date_modification_endyear', 'int'); -$search_date_modification_endmonth = GETPOST('search_date_modification_endmonth', 'int'); -$search_date_modification_endday = GETPOST('search_date_modification_endday', 'int'); +$search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); +$search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); +$search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); +$search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); +$search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); +$search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); $search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear); $search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear); -$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int'); -$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int'); -$search_date_export_startday = GETPOST('search_date_export_startday', 'int'); -$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int'); -$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); -$search_date_export_endday = GETPOST('search_date_export_endday', 'int'); +$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); +$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); +$search_date_export_startday = GETPOSTINT('search_date_export_startday'); +$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); +$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); +$search_date_export_endday = GETPOSTINT('search_date_export_endday'); $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); -$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); -$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); -$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); -$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); -$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); -$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); +$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); +$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); +$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); +$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); +$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); +$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); $search_import_key = GETPOST("search_import_key", 'alpha'); @@ -104,7 +104,7 @@ if (GETPOST("button_export_file_x") || GETPOST("button_export_file.x") || GETPOS $action = 'export_file'; } -$search_account_category = GETPOST('search_account_category', 'int'); +$search_account_category = GETPOSTINT('search_account_category'); $search_accountancy_code = GETPOST("search_accountancy_code", 'alpha'); $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); @@ -134,11 +134,11 @@ $search_lettering_code = GETPOST('search_lettering_code', 'alpha'); $search_not_reconciled = GETPOST('search_not_reconciled', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $optioncss = GETPOST('optioncss', 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } @@ -159,7 +159,7 @@ $hookmanager->initHooks(array('bookkeepingexport')); $formaccounting = new FormAccounting($db); $form = new Form($db); -if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->hasRight('accounting', 'mouvements', 'export')) { +if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOSTINT('page') == '' && !GETPOSTINT('noreset') && $user->hasRight('accounting', 'mouvements', 'export')) { if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values') && !GETPOST('search_accountancy_code_start')) { $query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; $query .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1"; @@ -459,7 +459,7 @@ if (empty($reshook)) { } if ($action == 'setreexport') { - $setreexport = GETPOST('value', 'int'); + $setreexport = GETPOSTINT('value'); if (!dolibarr_set_const($db, "ACCOUNTING_REEXPORT", $setreexport, 'yesno', 0, '', $conf->entity)) { $error++; } @@ -614,7 +614,7 @@ if ($action == 'export_fileconfirm' && $user->hasRight('accounting', 'mouvements $error++; setEventMessages($object->error, $object->errors, 'errors'); } else { - $formatexport = GETPOST('formatexport', 'int'); + $formatexport = GETPOSTINT('formatexport'); $notexportlettering = GETPOST('notexportlettering', 'alpha'); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 990d6e288c0..2c62409c4ae 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php'; $langs->loadLangs(array("accountancy", "compta")); // Get Parameters -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); // action+display Parameters $action = GETPOST('action', 'aZ09'); @@ -53,53 +53,53 @@ $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookkeepinglist'; // Search Parameters -$search_mvt_num = GETPOST('search_mvt_num', 'int'); +$search_mvt_num = GETPOSTINT('search_mvt_num'); $search_doc_type = GETPOST("search_doc_type", 'alpha'); $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endday = GETPOSTINT('search_date_endday'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); -$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); -$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int'); -$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int'); -$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int'); -$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int'); -$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int'); -$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int'); +$search_doc_date = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); +$search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); +$search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); +$search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); +$search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); +$search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); +$search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); $search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); $search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); -$search_date_modification_startyear = GETPOST('search_date_modification_startyear', 'int'); -$search_date_modification_startmonth = GETPOST('search_date_modification_startmonth', 'int'); -$search_date_modification_startday = GETPOST('search_date_modification_startday', 'int'); -$search_date_modification_endyear = GETPOST('search_date_modification_endyear', 'int'); -$search_date_modification_endmonth = GETPOST('search_date_modification_endmonth', 'int'); -$search_date_modification_endday = GETPOST('search_date_modification_endday', 'int'); +$search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); +$search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); +$search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); +$search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); +$search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); +$search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); $search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear); $search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear); -$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int'); -$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int'); -$search_date_export_startday = GETPOST('search_date_export_startday', 'int'); -$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int'); -$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); -$search_date_export_endday = GETPOST('search_date_export_endday', 'int'); +$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); +$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); +$search_date_export_startday = GETPOSTINT('search_date_export_startday'); +$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); +$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); +$search_date_export_endday = GETPOSTINT('search_date_export_endday'); $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); -$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); -$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); -$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); -$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); -$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); -$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); +$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); +$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); +$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); +$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); +$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); +$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); $search_import_key = GETPOST("search_import_key", 'alpha'); -$search_account_category = GETPOST('search_account_category', 'int'); +$search_account_category = GETPOSTINT('search_account_category'); $search_accountancy_code = GETPOST("search_accountancy_code", 'alpha'); $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); @@ -129,11 +129,11 @@ $search_lettering_code = GETPOST('search_lettering_code', 'alpha'); $search_not_reconciled = GETPOST('search_not_reconciled', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $optioncss = GETPOST('optioncss', 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } @@ -154,7 +154,7 @@ $hookmanager->initHooks(array('bookkeepinglist')); $formaccounting = new FormAccounting($db); $form = new Form($db); -if (!in_array($action, array('delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->hasRight('accounting', 'mouvements', 'export')) { +if (!in_array($action, array('delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOSTINT('page') == '' && !GETPOSTINT('noreset') && $user->hasRight('accounting', 'mouvements', 'export')) { if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values') && !GETPOST('search_accountancy_code_start')) { $query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; $query .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1"; @@ -738,7 +738,7 @@ if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accountin if ($user->hasRight('accounting', 'mouvements', 'supprimer')) { $arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('preunletteringauto', 'preunletteringmanual', 'predeletebookkeepingwriting'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('preunletteringauto', 'preunletteringmanual', 'predeletebookkeepingwriting'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction($massaction, $arrayofmassactions); diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index ed423ba1fdb..24856b36ae3 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $langs->loadLangs(array("accountancy", "compta")); $action = GETPOST('action', 'aZ09'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $massaction = GETPOST('massaction', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); @@ -52,34 +52,34 @@ if ($type == 'sub') { $context_default = 'bookkeepingbyaccountlist'; } $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : $context_default; -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endday = GETPOSTINT('search_date_endday'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); -$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); -$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int'); -$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int'); -$search_date_export_startday = GETPOST('search_date_export_startday', 'int'); -$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int'); -$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); -$search_date_export_endday = GETPOST('search_date_export_endday', 'int'); +$search_doc_date = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); +$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); +$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); +$search_date_export_startday = GETPOSTINT('search_date_export_startday'); +$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); +$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); +$search_date_export_endday = GETPOSTINT('search_date_export_endday'); $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); -$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); -$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); -$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); -$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); -$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); -$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); +$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); +$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); +$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); +$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); +$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); +$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); $search_import_key = GETPOST("search_import_key", 'alpha'); -$search_account_category = GETPOST('search_account_category', 'int'); +$search_account_category = GETPOSTINT('search_account_category'); $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); if ($search_accountancy_code_start == - 1) { @@ -91,7 +91,7 @@ if ($search_accountancy_code_end == - 1) { } $search_doc_ref = GETPOST('search_doc_ref', 'alpha'); $search_label_operation = GETPOST('search_label_operation', 'alpha'); -$search_mvt_num = GETPOST('search_mvt_num', 'int'); +$search_mvt_num = GETPOSTINT('search_mvt_num'); $search_direction = GETPOST('search_direction', 'alpha'); $search_ledger_code = GETPOST('search_ledger_code', 'array'); $search_debit = GETPOST('search_debit', 'alpha'); @@ -104,11 +104,11 @@ if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_ } // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $optioncss = GETPOST('optioncss', 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } @@ -282,7 +282,7 @@ if (empty($reshook)) { } if (!empty($search_doc_date)) { $filter['t.doc_date'] = $search_doc_date; - $param .= '&doc_datemonth='.GETPOST('doc_datemonth', 'int').'&doc_dateday='.GETPOST('doc_dateday', 'int').'&doc_dateyear='.GETPOST('doc_dateyear', 'int'); + $param .= '&doc_datemonth='.GETPOSTINT('doc_datemonth').'&doc_dateday='.GETPOSTINT('doc_dateday').'&doc_dateyear='.GETPOSTINT('doc_dateyear'); } if ($search_account_category != '-1' && !empty($search_account_category)) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php'; @@ -650,7 +650,7 @@ if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accountin if ($user->hasRight('accounting', 'mouvements', 'supprimer')) { $arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('preunletteringauto', 'preunletteringmanual', 'predeletebookkeepingwriting'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('preunletteringauto', 'preunletteringmanual', 'predeletebookkeepingwriting'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction($massaction, $arrayofmassactions); diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index 772d1672542..1226ae9d167 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -34,9 +34,9 @@ $langs->loadLangs(array("compta", "bills", "other", "accountancy")); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'aZ09'); -$fiscal_period_id = GETPOST('fiscal_period_id', 'int'); -$validatemonth = GETPOST('validatemonth', 'int'); -$validateyear = GETPOST('validateyear', 'int'); +$fiscal_period_id = GETPOSTINT('fiscal_period_id'); +$validatemonth = GETPOSTINT('validatemonth'); +$validateyear = GETPOSTINT('validateyear'); // Security check if (!isModEnabled('accounting')) { @@ -104,8 +104,8 @@ if ($reshook < 0) { if (empty($reshook)) { if (isset($current_fiscal_period) && $user->hasRight('accounting', 'fiscalyear', 'write')) { if ($action == 'confirm_step_1' && $confirm == "yes") { - $date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); - $date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); + $date_start = dol_mktime(0, 0, 0, GETPOSTINT('date_startmonth'), GETPOSTINT('date_startday'), GETPOSTINT('date_startyear')); + $date_end = dol_mktime(23, 59, 59, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear')); $result = $object->validateMovementForFiscalPeriod($date_start, $date_end); if ($result > 0) { @@ -119,7 +119,7 @@ if (empty($reshook)) { $action = ''; } } elseif ($action == 'confirm_step_2' && $confirm == "yes") { - $new_fiscal_period_id = GETPOST('new_fiscal_period_id', 'int'); + $new_fiscal_period_id = GETPOSTINT('new_fiscal_period_id'); $separate_auxiliary_account = GETPOST('separate_auxiliary_account', 'aZ09'); $generate_bookkeeping_records = GETPOST('generate_bookkeeping_records', 'aZ09'); @@ -133,10 +133,10 @@ if (empty($reshook)) { exit; } } elseif ($action == 'confirm_step_3' && $confirm == "yes") { - $inventory_journal_id = GETPOST('inventory_journal_id', 'int'); - $new_fiscal_period_id = GETPOST('new_fiscal_period_id', 'int'); - $date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); - $date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); + $inventory_journal_id = GETPOSTINT('inventory_journal_id'); + $new_fiscal_period_id = GETPOSTINT('new_fiscal_period_id'); + $date_start = dol_mktime(0, 0, 0, GETPOSTINT('date_startmonth'), GETPOSTINT('date_startday'), GETPOSTINT('date_startyear')); + $date_end = dol_mktime(23, 59, 59, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear')); $result = $object->insertAccountingReversal($current_fiscal_period['id'], $inventory_journal_id, $new_fiscal_period_id, $date_start, $date_end); if ($result < 0) { diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 3102b023015..b2731d981c5 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -34,8 +34,8 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$codeventil = GETPOST('codeventil', 'int'); -$id = GETPOST('id', 'int'); +$codeventil = GETPOSTINT('codeventil'); +$id = GETPOSTINT('id'); // Security check if (!isModEnabled('accounting')) { diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 018f222daf8..391cac7daf4 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -37,8 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; // Load translation files required by the page $langs->loadLangs(array("compta", "bills", "other", "accountancy")); -$validatemonth = GETPOST('validatemonth', 'int'); -$validateyear = GETPOST('validateyear', 'int'); +$validatemonth = GETPOSTINT('validatemonth'); +$validateyear = GETPOSTINT('validateyear'); // Security check if (!isModEnabled('accounting')) { @@ -54,8 +54,8 @@ if (!$user->hasRight('accounting', 'bind', 'write')) { $accountingAccount = new AccountingAccount($db); $month_start = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); -if (GETPOST("year", 'int')) { - $year_start = GETPOST("year", 'int'); +if (GETPOSTINT("year")) { + $year_start = GETPOSTINT("year"); } else { $year_start = dol_print_date(dol_now(), '%Y'); if (dol_print_date(dol_now(), '%m') < $month_start) { diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 2a08eb3986c..5c9457d818f 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -45,7 +45,7 @@ $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); // Search Getpost $search_societe = GETPOST('search_societe', 'alpha'); -$search_lineid = GETPOST('search_lineid', 'int'); +$search_lineid = GETPOSTINT('search_lineid'); $search_ref = GETPOST('search_ref', 'alpha'); $search_invoice = GETPOST('search_invoice', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); @@ -53,22 +53,22 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_country = GETPOST('search_country', 'alpha'); $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } @@ -131,7 +131,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('accounting', 'bind', 'write')) { $error = 0; - if (!(GETPOST('account_parent', 'int') >= 0)) { + if (!(GETPOSTINT('account_parent') >= 0)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors'); } @@ -140,7 +140,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('ac $db->begin(); $sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet"; - $sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0'); + $sql1 .= " SET fk_code_ventilation=".(GETPOSTINT('account_parent') > 0 ? GETPOSTINT('account_parent') : '0'); $sql1 .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')'; dol_syslog('accountancy/customer/lines.php::changeaccount sql= '.$sql1); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index b34f29eef8f..d51b43eccd9 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -48,14 +48,14 @@ $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancycustomerlist'; // To manage different context of search $optioncss = GETPOST('optioncss', 'alpha'); -$default_account = GETPOST('default_account', 'int'); +$default_account = GETPOSTINT('default_account'); // Select Box $mesCasesCochees = GETPOST('toselect', 'array'); // Search Getpost $search_societe = GETPOST('search_societe', 'alpha'); -$search_lineid = GETPOST('search_lineid', 'int'); +$search_lineid = GETPOSTINT('search_lineid'); $search_ref = GETPOST('search_ref', 'alpha'); $search_invoice = GETPOST('search_invoice', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); @@ -63,12 +63,12 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_country = GETPOST('search_country', 'alpha'); @@ -80,10 +80,10 @@ if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDI } // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index 6d2bd442bf8..056dbb3d74e 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -38,8 +38,8 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$codeventil = GETPOST('codeventil', 'int'); -$id = GETPOST('id', 'int'); +$codeventil = GETPOSTINT('codeventil'); +$id = GETPOSTINT('id'); // Security check if (!isModEnabled('accounting')) { diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 703417bb1f5..00f52f0dd49 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -33,12 +33,12 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; // Load translation files required by the page $langs->loadLangs(array("compta", "bills", "other", "accountancy")); -$validatemonth = GETPOST('validatemonth', 'int'); -$validateyear = GETPOST('validateyear', 'int'); +$validatemonth = GETPOSTINT('validatemonth'); +$validateyear = GETPOSTINT('validateyear'); $month_start = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); -if (GETPOST("year", 'int')) { - $year_start = GETPOST("year", 'int'); +if (GETPOSTINT("year")) { + $year_start = GETPOSTINT("year"); } else { $year_start = dol_print_date(dol_now(), '%Y'); if (dol_print_date(dol_now(), '%m') < $month_start) { diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 8d170a557b1..4fbc0642bc9 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -39,7 +39,7 @@ $langs->loadLangs(array("compta", "bills", "other", "accountancy", "trips", "pro $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$account_parent = GETPOST('account_parent', 'int'); +$account_parent = GETPOSTINT('account_parent'); $changeaccount = GETPOST('changeaccount'); // Search Getpost $search_login = GETPOST('search_login', 'alpha'); @@ -49,20 +49,20 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } @@ -121,7 +121,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('accounting', 'bind', 'write')) { $error = 0; - if (!(GETPOST('account_parent', 'int') >= 0)) { + if (!(GETPOSTINT('account_parent') >= 0)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors'); } @@ -130,7 +130,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('ac $db->begin(); $sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd"; - $sql1 .= " SET erd.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0'); + $sql1 .= " SET erd.fk_code_ventilation=".(GETPOSTINT('account_parent') > 0 ? GETPOSTINT('account_parent') : '0'); $sql1 .= ' WHERE erd.rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')'; dol_syslog('accountancy/expensereport/lines.php::changeaccount sql= '.$sql1); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index c688098058f..d70729d4521 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -58,12 +58,12 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); @@ -73,10 +73,10 @@ if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDI } // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 09236110b0e..db569da428c 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -57,8 +57,8 @@ $pcgver = getDolGlobalInt('CHARTOFACCOUNTS'); if (GETPOST('addbox')) { // Add box (when submit is done from a form when ajax disabled) require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; - $zone = GETPOST('areacode', 'int'); - $userid = GETPOST('userid', 'int'); + $zone = GETPOSTINT('areacode'); + $userid = GETPOSTINT('userid'); $boxorder = GETPOST('boxorder', 'aZ09'); $boxorder .= GETPOST('boxcombo', 'aZ09'); diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 993fce3899f..c091abb5b48 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -66,14 +66,14 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; $langs->loadLangs(array("companies", "other", "compta", "banks", "bills", "donations", "loan", "accountancy", "trips", "salaries", "hrm", "members")); // Multi journal -$id_journal = GETPOST('id_journal', 'int'); +$id_journal = GETPOSTINT('id_journal'); -$date_startmonth = GETPOST('date_startmonth', 'int'); -$date_startday = GETPOST('date_startday', 'int'); -$date_startyear = GETPOST('date_startyear', 'int'); -$date_endmonth = GETPOST('date_endmonth', 'int'); -$date_endday = GETPOST('date_endday', 'int'); -$date_endyear = GETPOST('date_endyear', 'int'); +$date_startmonth = GETPOSTINT('date_startmonth'); +$date_startday = GETPOSTINT('date_startday'); +$date_startyear = GETPOSTINT('date_startyear'); +$date_endmonth = GETPOSTINT('date_endmonth'); +$date_endday = GETPOSTINT('date_endday'); +$date_endyear = GETPOSTINT('date_endyear'); $in_bookkeeping = GETPOST('in_bookkeeping', 'aZ09'); if ($in_bookkeeping == '') { $in_bookkeeping = 'notyet'; diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index de47b55ab83..881070ad6fd 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; // Load translation files required by the page $langs->loadLangs(array("commercial", "compta", "bills", "other", "accountancy", "trips", "errors")); -$id_journal = GETPOST('id_journal', 'int'); +$id_journal = GETPOSTINT('id_journal'); $action = GETPOST('action', 'aZ09'); $date_startmonth = GETPOST('date_startmonth'); diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index d92f99e771b..227c2f0f280 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; // Load translation files required by the page $langs->loadLangs(array("commercial", "compta", "bills", "other", "accountancy", "errors")); -$id_journal = GETPOST('id_journal', 'int'); +$id_journal = GETPOSTINT('id_journal'); $action = GETPOST('action', 'aZ09'); $date_startmonth = GETPOST('date_startmonth'); diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 3267f5ae397..6e0640df092 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; // Load translation files required by the page $langs->loadLangs(array("commercial", "compta", "bills", "other", "accountancy", "errors")); -$id_journal = GETPOST('id_journal', 'int'); +$id_journal = GETPOSTINT('id_journal'); $action = GETPOST('action', 'aZ09'); $date_startmonth = GETPOST('date_startmonth'); diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php index 62bd97df17f..4882b722053 100644 --- a/htdocs/accountancy/journal/variousjournal.php +++ b/htdocs/accountancy/journal/variousjournal.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; // Load translation files required by the page $langs->loadLangs(array("banks", "accountancy", "compta", "other", "errors")); -$id_journal = GETPOST('id_journal', 'int'); +$id_journal = GETPOSTINT('id_journal'); $action = GETPOST('action', 'aZ09'); $date_startmonth = GETPOST('date_startmonth'); diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 99bfe67fce5..d384d7c944a 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -38,8 +38,8 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$codeventil = GETPOST('codeventil', 'int'); -$id = GETPOST('id', 'int'); +$codeventil = GETPOSTINT('codeventil'); +$id = GETPOSTINT('id'); // Security check if (!isModEnabled('accounting')) { diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index a74a9a04f54..ace576b4232 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -35,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; // Load translation files required by the page $langs->loadLangs(array("compta", "bills", "other", "accountancy")); -$validatemonth = GETPOST('validatemonth', 'int'); -$validateyear = GETPOST('validateyear', 'int'); +$validatemonth = GETPOSTINT('validatemonth'); +$validateyear = GETPOSTINT('validateyear'); // Security check if (!isModEnabled('accounting')) { @@ -52,8 +52,8 @@ if (!$user->hasRight('accounting', 'bind', 'write')) { $accountingAccount = new AccountingAccount($db); $month_start = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); -if (GETPOST("year", 'int')) { - $year_start = GETPOST("year", 'int'); +if (GETPOSTINT("year")) { + $year_start = GETPOSTINT("year"); } else { $year_start = dol_print_date(dol_now(), '%Y'); if (dol_print_date(dol_now(), '%m') < $month_start) { diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 576e4874a8d..3571a5e2df5 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -46,7 +46,7 @@ $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); // Search Getpost $search_societe = GETPOST('search_societe', 'alpha'); -$search_lineid = GETPOST('search_lineid', 'int'); +$search_lineid = GETPOSTINT('search_lineid'); $search_ref = GETPOST('search_ref', 'alpha'); $search_invoice = GETPOST('search_invoice', 'alpha'); //$search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); @@ -55,22 +55,22 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_country = GETPOST('search_country', 'alpha'); $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } @@ -136,7 +136,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('accounting', 'bind', 'write')) { $error = 0; - if (!(GETPOST('account_parent', 'int') >= 0)) { + if (!(GETPOSTINT('account_parent') >= 0)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors'); } @@ -145,7 +145,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('ac $db->begin(); $sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det"; - $sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0'); + $sql1 .= " SET fk_code_ventilation=".(GETPOSTINT('account_parent') > 0 ? GETPOSTINT('account_parent') : '0'); $sql1 .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')'; dol_syslog('accountancy/supplier/lines.php::changeaccount sql= '.$sql1); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index de9c72a56b5..a97bfb1d531 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -49,14 +49,14 @@ $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancysupplierlist'; // To manage different context of search $optioncss = GETPOST('optioncss', 'alpha'); -$default_account = GETPOST('default_account', 'int'); +$default_account = GETPOSTINT('default_account'); // Select Box $mesCasesCochees = GETPOST('toselect', 'array'); // Search Getpost $search_societe = GETPOST('search_societe', 'alpha'); -$search_lineid = GETPOST('search_lineid', 'int'); +$search_lineid = GETPOSTINT('search_lineid'); $search_ref = GETPOST('search_ref', 'alpha'); $search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); $search_invoice = GETPOST('search_invoice', 'alpha'); @@ -65,22 +65,22 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_country = GETPOST('search_country', 'alpha'); $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/adherents/admin/member_emails.php b/htdocs/adherents/admin/member_emails.php index cc7b60f6233..c2907004341 100644 --- a/htdocs/adherents/admin/member_emails.php +++ b/htdocs/adherents/admin/member_emails.php @@ -105,7 +105,7 @@ if ($action == 'updateall') { // Action to update or add a constant if ($action == 'update' || $action == 'add') { - $constlineid = GETPOST('rowid', 'int'); + $constlineid = GETPOSTINT('rowid'); $constname = GETPOST('constname', 'alpha'); $constvalue = (GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alphanohtml') : GETPOST('constvalue')); diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 8ac296f9449..f922f1abb7f 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -63,7 +63,7 @@ if ($action == 'update') { $showtable = GETPOST('MEMBER_SHOW_TABLE'); $showvoteallowed = GETPOST('MEMBER_SHOW_VOTE_ALLOWED'); $payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE'); - $forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int'); + $forcetype = GETPOSTINT('MEMBER_NEWFORM_FORCETYPE'); $forcemorphy = GETPOST('MEMBER_NEWFORM_FORCEMORPHY', 'aZ09'); $res = dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC", $public, 'chaine', 0, '', $conf->entity); diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index ef217d65871..742905600af 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -38,13 +38,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->loadLangs(array('companies', 'members')); // Get Parameters -$id = GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('rowid', 'int'); +$id = GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('rowid'); // Pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index 66e53b58109..d18ba0c335d 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -251,16 +251,16 @@ abstract class ActionsAdherentCardCommon $this->object->old_name = GETPOST("old_name"); $this->object->old_firstname = GETPOST("old_firstname"); - $this->object->fk_soc = GETPOST("fk_soc", 'int'); - $this->object->socid = GETPOST("fk_soc", 'int'); + $this->object->fk_soc = GETPOSTINT("fk_soc"); + $this->object->socid = GETPOSTINT("fk_soc"); $this->object->lastname = GETPOST("lastname"); $this->object->firstname = GETPOST("firstname"); $this->object->civility_id = GETPOST("civility_id"); $this->object->address = GETPOST("address"); $this->object->zip = GETPOST("zipcode"); $this->object->town = GETPOST("town"); - $this->object->country_id = GETPOST("country_id", 'int') ? GETPOST("country_id", 'int') : $mysoc->country_id; - $this->object->state_id = GETPOST("state_id", 'int'); + $this->object->country_id = GETPOSTINT("country_id") ? GETPOSTINT("country_id") : $mysoc->country_id; + $this->object->state_id = GETPOSTINT("state_id"); $this->object->phone_perso = GETPOST("phone_perso"); $this->object->phone_mobile = GETPOST("phone_mobile"); $this->object->email = GETPOST("email", 'alphawithlgt'); diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 7f41b76e564..8b96f6c3844 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -56,11 +56,11 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); -$rowid = GETPOST('rowid', 'int'); -$id = GETPOST('id') ? GETPOST('id', 'int') : $rowid; -$typeid = GETPOST('typeid', 'int'); -$userid = GETPOST('userid', 'int'); -$socid = GETPOST('socid', 'int'); +$rowid = GETPOSTINT('rowid'); +$id = GETPOST('id') ? GETPOSTINT('id') : $rowid; +$typeid = GETPOSTINT('typeid'); +$userid = GETPOSTINT('userid'); +$socid = GETPOSTINT('socid'); $ref = GETPOST('ref', 'alpha'); if (isModEnabled('mailmanspip')) { @@ -256,8 +256,8 @@ if (empty($reshook)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $birthdate = ''; - if (GETPOST("birthday", 'int') && GETPOST("birthmonth", 'int') && GETPOST("birthyear", 'int')) { - $birthdate = dol_mktime(12, 0, 0, GETPOST("birthmonth", 'int'), GETPOST("birthday", 'int'), GETPOST("birthyear", 'int')); + if (GETPOSTINT("birthday") && GETPOSTINT("birthmonth") && GETPOSTINT("birthyear")) { + $birthdate = dol_mktime(12, 0, 0, GETPOSTINT("birthmonth"), GETPOSTINT("birthday"), GETPOSTINT("birthyear")); } $lastname = GETPOST("lastname", 'alphanohtml'); $firstname = GETPOST("firstname", 'alphanohtml'); @@ -441,14 +441,14 @@ if (empty($reshook)) { } $birthdate = ''; if (GETPOSTISSET("birthday") && GETPOST("birthday") && GETPOSTISSET("birthmonth") && GETPOST("birthmonth") && GETPOSTISSET("birthyear") && GETPOST("birthyear")) { - $birthdate = dol_mktime(12, 0, 0, GETPOST("birthmonth", 'int'), GETPOST("birthday", 'int'), GETPOST("birthyear", 'int')); + $birthdate = dol_mktime(12, 0, 0, GETPOSTINT("birthmonth"), GETPOSTINT("birthday"), GETPOSTINT("birthyear")); } $datesubscription = ''; if (GETPOSTISSET("reday") && GETPOSTISSET("remonth") && GETPOSTISSET("reyear")) { - $datesubscription = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", "int"), GETPOST("reyear", "int")); + $datesubscription = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); } - $typeid = GETPOST("typeid", 'int'); + $typeid = GETPOSTINT("typeid"); $civility_id = GETPOST("civility_id", 'alphanohtml'); $lastname = GETPOST("lastname", 'alphanohtml'); $firstname = GETPOST("firstname", 'alphanohtml'); @@ -457,8 +457,8 @@ if (empty($reshook)) { $address = GETPOST("address", 'alphanohtml'); $zip = GETPOST("zipcode", 'alphanohtml'); $town = GETPOST("town", 'alphanohtml'); - $state_id = GETPOST("state_id", 'int'); - $country_id = GETPOST("country_id", 'int'); + $state_id = GETPOSTINT("state_id"); + $country_id = GETPOSTINT("country_id"); $phone = GETPOST("phone", 'alpha'); $phone_perso = GETPOST("phone_perso", 'alpha'); @@ -471,8 +471,8 @@ if (empty($reshook)) { $morphy = GETPOST("morphy", 'alphanohtml'); $public = GETPOST("public", 'alphanohtml'); - $userid = GETPOST("userid", 'int'); - $socid = GETPOST("socid", 'int'); + $userid = GETPOSTINT("userid"); + $socid = GETPOSTINT("socid"); $default_lang = GETPOST('default_lang', 'alpha'); $object->civility_id = $civility_id; @@ -926,10 +926,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Create mode if ($action == 'create') { $object->canvas = $canvas; - $object->state_id = GETPOST('state_id', 'int'); + $object->state_id = GETPOSTINT('state_id'); // We set country_id, country_code and country for the selected country - $object->country_id = GETPOST('country_id', 'int') ? GETPOST('country_id', 'int') : $mysoc->country_id; + $object->country_id = GETPOSTINT('country_id') ? GETPOSTINT('country_id') : $mysoc->country_id; if ($object->country_id) { $tmparray = getCountry($object->country_id, 'all'); $object->country_code = $tmparray['code']; @@ -1012,7 +1012,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $listetype = $adht->liste_array(1); print img_picto('', $adht->picto, 'class="pictofixedwidth"'); if (count($listetype)) { - print $form->selectarray("typeid", $listetype, (GETPOST('typeid', 'int') ? GETPOST('typeid', 'int') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', '', 1); + print $form->selectarray("typeid", $listetype, (GETPOSTINT('typeid') ? GETPOSTINT('typeid') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', '', 1); } else { print ''.$langs->trans("NoTypeDefinedGoToSetup").''; } @@ -1030,7 +1030,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Civility print ''; + print $formcompany->select_civility(GETPOSTINT('civility_id') ? GETPOSTINT('civility_id') : $object->civility_id, 'civility_id', 'maxwidth150', 1).''; print ''; // Lastname @@ -1087,7 +1087,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''."\n"; // State print ''."\n"; // Telephone diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 0dca3ecbf1c..8ac54b3299e 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -154,7 +154,7 @@ if (preg_match('/set_(.*)/', $action, $reg)) { // Save nb of agenda if (!$error) { - $res = dolibarr_set_const($db, 'AGENDA_EXT_NB', trim(GETPOST('AGENDA_EXT_NB', 'int')), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'AGENDA_EXT_NB', trim(GETPOSTINT('AGENDA_EXT_NB')), 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 3700ecf631f..5ac6e892611 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -48,10 +48,10 @@ if (GETPOSTISSET('MAIN_AGENDA_XCAL_EXPORTKEY')) { $MAIN_AGENDA_XCAL_EXPORTKEY = trim(GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY', 'alpha')); } if (GETPOSTISSET('MAIN_AGENDA_EXPORT_PAST_DELAY')) { - $MAIN_AGENDA_EXPORT_PAST_DELAY = intval(GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY', 'int')); + $MAIN_AGENDA_EXPORT_PAST_DELAY = intval(GETPOSTINT('MAIN_AGENDA_EXPORT_PAST_DELAY')); } if (GETPOSTISSET('MAIN_AGENDA_EXPORT_CACHE')) { - $MAIN_AGENDA_EXPORT_CACHE = intval(GETPOST('MAIN_AGENDA_EXPORT_CACHE', 'int')); + $MAIN_AGENDA_EXPORT_CACHE = intval(GETPOSTINT('MAIN_AGENDA_EXPORT_CACHE')); } if (GETPOSTISSET('AGENDA_EXPORT_FIX_TZ')) { $AGENDA_EXPORT_FIX_TZ = trim(GETPOST('AGENDA_EXPORT_FIX_TZ', 'alpha')); diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index be817438610..49f2dc3380c 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -70,7 +70,7 @@ if ($action == 'setbarcodethirdpartyon') { if ($action == 'setcoder') { $coder = GETPOST('coder', 'alpha'); - $code_id = GETPOST('code_id', 'int'); + $code_id = GETPOSTINT('code_id'); $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type"; $sqlp .= " SET coder = '".$db->escape($coder)."'"; $sqlp .= " WHERE rowid = ".((int) $code_id); diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 189fb532e1f..99d56c35658 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -36,7 +36,7 @@ if (!$user->admin) { accessforbidden(); } -$rowid = GETPOST('rowid', 'int'); +$rowid = GETPOSTINT('rowid'); $action = GETPOST('action', 'aZ09'); @@ -50,7 +50,7 @@ $boxes = array(); */ if ($action == 'addconst') { - dolibarr_set_const($db, "MAIN_BOXES_MAXLINES", GETPOST("MAIN_BOXES_MAXLINES", 'int'), '', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_BOXES_MAXLINES", GETPOSTINT("MAIN_BOXES_MAXLINES"), '', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_ACTIVATE_FILECACHE", GETPOST("MAIN_ACTIVATE_FILECACHE", 'alpha'), 'chaine', 0, '', $conf->entity); } @@ -165,10 +165,10 @@ if ($action == 'switch') { $db->begin(); $objfrom = new ModeleBoxes($db); - $objfrom->fetch(GETPOST("switchfrom", 'int')); + $objfrom->fetch(GETPOSTINT("switchfrom")); $objto = new ModeleBoxes($db); - $objto->fetch(GETPOST('switchto', 'int')); + $objto->fetch(GETPOSTINT('switchto')); $resultupdatefrom = 0; $resultupdateto = 0; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 9eb4626c3bc..f07961486c6 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -92,7 +92,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) activateModulesRequiredByCountry($mysoc->country_code); } - $tmparray = getState(GETPOST('state_id', 'int'), 'all', $db, $langs, 0); + $tmparray = getState(GETPOSTINT('state_id'), 'all', $db, $langs, 0); if (!empty($tmparray['id'])) { $mysoc->state_id = $tmparray['id']; $mysoc->state_code = $tmparray['code']; @@ -218,7 +218,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("socialobject", 'alphanohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("SOCIETE_FISCAL_MONTH_START", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOSTINT("SOCIETE_FISCAL_MONTH_START"), 'chaine', 0, '', $conf->entity); // Sale tax options $usevat = GETPOST("optiontva", 'aZ09'); diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index f290df752bc..792fe0b30cf 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -32,19 +32,19 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; // Load translation files required by the page $langs->load("admin"); -$rowid = GETPOST('rowid', 'int'); -$entity = GETPOST('entity', 'int'); +$rowid = GETPOSTINT('rowid'); +$entity = GETPOSTINT('entity'); $action = GETPOST('action', 'aZ09'); -$debug = GETPOST('debug', 'int'); +$debug = GETPOSTINT('debug'); $consts = GETPOST('const', 'array'); $constname = GETPOST('constname', 'alphanohtml'); $constvalue = GETPOST('constvalue', 'restricthtml'); // We should be able to send everything here $constnote = GETPOST('constnote', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php index 0994918d462..d06fb6502a2 100644 --- a/htdocs/admin/debugbar.php +++ b/htdocs/admin/debugbar.php @@ -49,8 +49,8 @@ $action = GETPOST('action', 'aZ09'); if ($action == 'set') { $db->begin(); - $result1 = dolibarr_set_const($db, "DEBUGBAR_LOGS_LINES_NUMBER", GETPOST('DEBUGBAR_LOGS_LINES_NUMBER', 'int'), 'chaine', 0, '', 0); - $result2 = dolibarr_set_const($db, "DEBUGBAR_USE_LOG_FILE", GETPOST('DEBUGBAR_USE_LOG_FILE', 'int'), 'chaine', 0, '', 0); + $result1 = dolibarr_set_const($db, "DEBUGBAR_LOGS_LINES_NUMBER", GETPOSTINT('DEBUGBAR_LOGS_LINES_NUMBER'), 'chaine', 0, '', 0); + $result2 = dolibarr_set_const($db, "DEBUGBAR_USE_LOG_FILE", GETPOSTINT('DEBUGBAR_USE_LOG_FILE'), 'chaine', 0, '', 0); if ($result1 < 0 || $result2 < 0) { $error++; } diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 5c92e5acd14..0792ad97007 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -46,10 +46,10 @@ $optioncss = GETPOST('optionscss', 'alphanohtml'); $mode = GETPOST('mode', 'aZ09') ? GETPOST('mode', 'aZ09') : 'createform'; // 'createform', 'filters', 'sortorder', 'focus' -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -366,7 +366,7 @@ if (!is_array($result) && $result < 0) { // Page print ''; print ''; - print ''; + print ''; print ''; print '
'.dol_print_date($link->datea, "dayhour", "tzuser").'
'.$langs->trans("UserTitle").''; - print $formcompany->select_civility(GETPOST('civility_id', 'int') ? GETPOST('civility_id', 'int') : $object->civility_id, 'civility_id', 'maxwidth150', 1).'
'.$langs->trans('State').''; if ($soc->country_id) { print img_picto('', 'state', 'class="pictofixedwidth"'); - print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $soc->state_id, $soc->country_code); + print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : $soc->state_id, $soc->country_code); } else { print $countrynotdefined; } @@ -1167,7 +1167,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $adht->fetch($object->typeid); // We set country_id, and country_code, country of the chosen country - $country = GETPOST('country', 'int'); + $country = GETPOSTINT('country'); if (!empty($country) || $object->country_id) { $sql = "SELECT rowid, code, label from ".MAIN_DB_PREFIX."c_country where rowid = ".(!empty($country) ? $country : $object->country_id); $resql = $db->query($sql); @@ -1240,7 +1240,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Type print '
'.$langs->trans("Type").''; if ($user->hasRight('adherent', 'creer')) { - print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $object->typeid), 0, 0, 0, '', 0, 0, 0, '', '', 1); + print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOSTINT("typeid") : $object->typeid), 0, 0, 0, '', 0, 0, 0, '', '', 1); } else { print $adht->getNomUrl(1); print ''; diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 1f02258fae9..ac692433247 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -38,16 +38,16 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; $langs->loadLangs(array("companies", "members", "other")); -$id = GETPOSTISSET('id') ? GETPOST('id', 'int') : GETPOST('rowid', 'int'); +$id = GETPOSTISSET('id') ? GETPOSTINT('id') : GETPOSTINT('rowid'); $ref = GETPOST('ref', 'alphanohtml'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 3b78f0305dc..baa8560b9c6 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -53,11 +53,11 @@ $result = restrictedArea($user, 'adherent'); * Actions */ -$userid = GETPOST('userid', 'int'); +$userid = GETPOSTINT('userid'); if (GETPOST('addbox')) { // Add box (when submit is done from a form when ajax disabled) require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; - $zone = GETPOST('areacode', 'int'); + $zone = GETPOSTINT('areacode'); $boxorder = GETPOST('boxorder', 'aZ09'); $boxorder .= GETPOST('boxcombo', 'aZ09'); $result = InfoBox::saveboxorder($db, $zone, $boxorder, $userid); diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index 47fb5c00a64..edfa8adbb2f 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; // Load translation files required by the page $langs->loadLangs(array("companies", "members", "ldap", "admin")); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alphanohtml'); $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index d2297697632..37aba189a17 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -43,7 +43,7 @@ $langs->loadLangs(array("members", "companies", "categories")); // Get parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); @@ -71,19 +71,19 @@ $search_phone_perso = GETPOST("search_phone_perso", 'alpha'); $search_phone_mobile = GETPOST("search_phone_mobile", 'alpha'); $search_type = GETPOST("search_type", 'alpha'); $search_email = GETPOST("search_email", 'alpha'); -$search_categ = GETPOST("search_categ", 'int'); +$search_categ = GETPOSTINT("search_categ"); $search_morphy = GETPOST("search_morphy", 'alpha'); $search_import_key = trim(GETPOST("search_import_key", 'alpha')); -$catid = GETPOST("catid", 'int'); -$socid = GETPOST('socid', 'int'); +$catid = GETPOSTINT("catid"); +$socid = GETPOSTINT('socid'); $search_filter = GETPOST("search_filter", 'alpha'); $search_status = GETPOST("search_status", 'intcomma'); // status -$search_datec_start = dol_mktime(0, 0, 0, GETPOST('search_datec_start_month', 'int'), GETPOST('search_datec_start_day', 'int'), GETPOST('search_datec_start_year', 'int')); -$search_datec_end = dol_mktime(23, 59, 59, GETPOST('search_datec_end_month', 'int'), GETPOST('search_datec_end_day', 'int'), GETPOST('search_datec_end_year', 'int')); -$search_datem_start = dol_mktime(0, 0, 0, GETPOST('search_datem_start_month', 'int'), GETPOST('search_datem_start_day', 'int'), GETPOST('search_datem_start_year', 'int')); -$search_datem_end = dol_mktime(23, 59, 59, GETPOST('search_datem_end_month', 'int'), GETPOST('search_datem_end_day', 'int'), GETPOST('search_datem_end_year', 'int')); +$search_datec_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datec_start_month'), GETPOSTINT('search_datec_start_day'), GETPOSTINT('search_datec_start_year')); +$search_datec_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datec_end_month'), GETPOSTINT('search_datec_end_day'), GETPOSTINT('search_datec_end_year')); +$search_datem_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datem_start_month'), GETPOSTINT('search_datem_start_day'), GETPOSTINT('search_datem_start_year')); +$search_datem_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datem_end_month'), GETPOSTINT('search_datem_end_day'), GETPOSTINT('search_datem_end_year')); $filter = GETPOST("filter", 'alpha'); if ($filter) { @@ -102,10 +102,10 @@ if ($search_status < -2) { } // Pagination parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -741,7 +741,7 @@ if ($user->hasRight('adherent', 'creer') && $user->hasRight('user', 'user', 'cre if ($user->hasRight('adherent', 'creer')) { $arrayofmassactions['createsubscription'] = img_picto('', 'payment', 'class="pictofixedwidth"').$langs->trans("CreateSubscription"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 1adbdb2db03..180eee496b2 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -37,7 +37,7 @@ $langs->loadLangs(array("companies", "members", "bills")); // Get parameters $action = GETPOST('action', 'aZ09'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alphanohtml'); diff --git a/htdocs/adherents/partnership.php b/htdocs/adherents/partnership.php index 2ec81fdbea9..9edc0603ce2 100644 --- a/htdocs/adherents/partnership.php +++ b/htdocs/adherents/partnership.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; $langs->loadLangs(array("companies","members","partnership", "other")); // Get parameters -$id = GETPOST('rowid', 'int') ? GETPOST('rowid', 'int') : GETPOST('id', 'int'); +$id = GETPOSTINT('rowid') ? GETPOSTINT('rowid') : GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -116,8 +116,8 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } -$date_start = dol_mktime(0, 0, 0, GETPOST('date_partnership_startmonth', 'int'), GETPOST('date_partnership_startday', 'int'), GETPOST('date_partnership_startyear', 'int')); -$date_end = dol_mktime(0, 0, 0, GETPOST('date_partnership_endmonth', 'int'), GETPOST('date_partnership_endday', 'int'), GETPOST('date_partnership_endyear', 'int')); +$date_start = dol_mktime(0, 0, 0, GETPOSTINT('date_partnership_startmonth'), GETPOSTINT('date_partnership_startday'), GETPOSTINT('date_partnership_startyear')); +$date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_partnership_endmonth'), GETPOSTINT('date_partnership_endday'), GETPOSTINT('date_partnership_endyear')); if (empty($reshook)) { $error = 0; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 13dce1b030e..b6c2ea3a676 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -33,10 +33,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); -$userid = GETPOST('userid', 'int'); if ($userid < 0) { +$userid = GETPOSTINT('userid'); if ($userid < 0) { $userid = 0; } -$socid = GETPOST('socid', 'int'); if ($socid < 0) { +$socid = GETPOSTINT('socid'); if ($socid < 0) { $socid = 0; } diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 3d479cd23c6..3efc9a74ef0 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -47,17 +47,17 @@ $confirm = GETPOST('confirm', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ09'); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$id = GETPOST('rowid', 'int') ? GETPOST('rowid', 'int') : GETPOST('id', 'int'); +$id = GETPOSTINT('rowid') ? GETPOSTINT('rowid') : GETPOSTINT('id'); $rowid = $id; $ref = GETPOST('ref', 'alphanohtml'); -$typeid = GETPOST('typeid', 'int'); +$typeid = GETPOSTINT('typeid'); $cancel = GETPOST('cancel'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -86,9 +86,9 @@ $errmsg = ''; $hookmanager->initHooks(array('subscription')); // PDF -$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); -$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); -$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); +$hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); +$hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); +$hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); $datefrom = 0; $dateto = 0; @@ -153,15 +153,15 @@ if (empty($reshook) && $action == 'confirm_create_thirdparty' && $confirm == 'ye if (empty($reshook) && $action == 'setuserid' && ($user->hasRight('user', 'self', 'creer') || $user->hasRight('user', 'user', 'creer'))) { $error = 0; if (!$user->hasRight('user', 'user', 'creer')) { // If can edit only itself user, we can link to itself only - if (GETPOST("userid", 'int') != $user->id && GETPOST("userid", 'int') != $object->user_id) { + if (GETPOSTINT("userid") != $user->id && GETPOSTINT("userid") != $object->user_id) { $error++; setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors'); } } if (!$error) { - if (GETPOST("userid", 'int') != $object->user_id) { // If link differs from currently in database - $result = $object->setUserId(GETPOST("userid", 'int')); + if (GETPOSTINT("userid") != $object->user_id) { // If link differs from currently in database + $result = $object->setUserId(GETPOSTINT("userid")); if ($result < 0) { dol_print_error(null, $object->error); } @@ -173,9 +173,9 @@ if (empty($reshook) && $action == 'setuserid' && ($user->hasRight('user', 'self' if (empty($reshook) && $action == 'setsocid') { $error = 0; if (!$error) { - if (GETPOST('socid', 'int') != $object->fk_soc) { // If link differs from currently in database + if (GETPOSTINT('socid') != $object->fk_soc) { // If link differs from currently in database $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; - $sql .= " WHERE fk_soc = '".GETPOST('socid', 'int')."'"; + $sql .= " WHERE fk_soc = '".GETPOSTINT('socid')."'"; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); @@ -183,14 +183,14 @@ if (empty($reshook) && $action == 'setsocid') { $othermember = new Adherent($db); $othermember->fetch($obj->rowid); $thirdparty = new Societe($db); - $thirdparty->fetch(GETPOST('socid', 'int')); + $thirdparty->fetch(GETPOSTINT('socid')); $error++; setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name), null, 'errors'); } } if (!$error) { - $result = $object->setThirdPartyId(GETPOST('socid', 'int')); + $result = $object->setThirdPartyId(GETPOSTINT('socid')); if ($result < 0) { dol_print_error(null, $object->error); } @@ -214,20 +214,20 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'subscripti $defaultdelay = !empty($adht->duration_value) ? $adht->duration_value : 1; $defaultdelayunit = !empty($adht->duration_unit) ? $adht->duration_unit : 'y'; $paymentdate = ''; // Do not use 0 here, default value is '' that means not filled where 0 means 1970-01-01 - if (GETPOST("reyear", "int") && GETPOST("remonth", "int") && GETPOST("reday", "int")) { - $datesubscription = dol_mktime(0, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int")); + if (GETPOSTINT("reyear") && GETPOSTINT("remonth") && GETPOSTINT("reday")) { + $datesubscription = dol_mktime(0, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); } - if (GETPOST("endyear", 'int') && GETPOST("endmonth", 'int') && GETPOST("endday", 'int')) { - $datesubend = dol_mktime(0, 0, 0, GETPOST("endmonth", 'int'), GETPOST("endday", 'int'), GETPOST("endyear", 'int')); + if (GETPOSTINT("endyear") && GETPOSTINT("endmonth") && GETPOSTINT("endday")) { + $datesubend = dol_mktime(0, 0, 0, GETPOSTINT("endmonth"), GETPOSTINT("endday"), GETPOSTINT("endyear")); } - if (GETPOST("paymentyear", 'int') && GETPOST("paymentmonth", 'int') && GETPOST("paymentday", 'int')) { - $paymentdate = dol_mktime(0, 0, 0, GETPOST("paymentmonth", 'int'), GETPOST("paymentday", 'int'), GETPOST("paymentyear", 'int')); + if (GETPOSTINT("paymentyear") && GETPOSTINT("paymentmonth") && GETPOSTINT("paymentday")) { + $paymentdate = dol_mktime(0, 0, 0, GETPOSTINT("paymentmonth"), GETPOSTINT("paymentday"), GETPOSTINT("paymentyear")); } $amount = price2num(GETPOST("subscription", 'alpha')); // Amount of subscription $label = GETPOST("label"); // Payment information - $accountid = GETPOST("accountid", 'int'); + $accountid = GETPOSTINT("accountid"); $operation = GETPOST("operation", "alphanohtml"); // Payment mode $num_chq = GETPOST("num_chq", "alphanohtml"); $emetteur_nom = GETPOST("chqemetteur"); @@ -287,14 +287,14 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'subscripti $error++; $action = 'addsubscription'; } - if (GETPOST("paymentsave") != 'invoiceonly' && !(GETPOST("accountid", 'int') > 0)) { + if (GETPOST("paymentsave") != 'invoiceonly' && !(GETPOSTINT("accountid") > 0)) { $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount")); setEventMessages($errmsg, null, 'errors'); $error++; $action = 'addsubscription'; } } else { - if (GETPOST("accountid", 'int')) { + if (GETPOSTINT("accountid")) { $errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount"); setEventMessages($errmsg, null, 'errors'); $error++; @@ -980,7 +980,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h $currentmonth = dol_print_date($now, "%m"); print ''.$langs->trans("DateSubscription").''; if (GETPOST('reday')) { - $datefrom = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $datefrom = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); } if (!$datefrom) { $datefrom = $object->datevalid; @@ -1001,7 +1001,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h // Date end subscription if (GETPOST('endday')) { - $dateto = dol_mktime(0, 0, 0, GETPOST('endmonth', 'int'), GETPOST('endday', 'int'), GETPOST('endyear', 'int')); + $dateto = dol_mktime(0, 0, 0, GETPOSTINT('endmonth'), GETPOSTINT('endday'), GETPOSTINT('endyear')); } if (!$dateto) { if (getDolGlobalInt('MEMBER_SUBSCRIPTION_SUGGEST_END_OF_MONTH')) { diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 1cd7376ea75..b78303d6633 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -41,7 +41,7 @@ $object = new Subscription($db); $errmsg = ''; $action = GETPOST("action", 'alpha'); -$rowid = GETPOST("rowid", "int") ? GETPOST("rowid", "int") : GETPOST("id", "int"); +$rowid = GETPOSTINT("rowid") ? GETPOSTINT("rowid") : GETPOSTINT("id"); $typeid = GETPOSTINT("typeid"); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm'); @@ -86,8 +86,8 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'update' && $errmsg = ''; - $newdatestart = dol_mktime(GETPOST('datesubhour', 'int'), GETPOST('datesubmin', 'int'), 0, GETPOST('datesubmonth', 'int'), GETPOST('datesubday', 'int'), GETPOST('datesubyear', 'int')); - $newdateend = dol_mktime(GETPOST('datesubendhour', 'int'), GETPOST('datesubendmin', 'int'), 0, GETPOST('datesubendmonth', 'int'), GETPOST('datesubendday', 'int'), GETPOST('datesubendyear', 'int')); + $newdatestart = dol_mktime(GETPOSTINT('datesubhour'), GETPOSTINT('datesubmin'), 0, GETPOSTINT('datesubmonth'), GETPOSTINT('datesubday'), GETPOSTINT('datesubyear')); + $newdateend = dol_mktime(GETPOSTINT('datesubendhour'), GETPOSTINT('datesubendmin'), 0, GETPOSTINT('datesubendmonth'), GETPOSTINT('datesubendday'), GETPOSTINT('datesubendyear')); if ($object->fk_bank > 0) { $accountline = new AccountLine($db); diff --git a/htdocs/adherents/subscription/info.php b/htdocs/adherents/subscription/info.php index 14afbafca50..6bdf0fd6f5d 100644 --- a/htdocs/adherents/subscription/info.php +++ b/htdocs/adherents/subscription/info.php @@ -36,7 +36,7 @@ if (!$user->hasRight('adherent', 'lire')) { accessforbidden(); } -$rowid = GETPOST("rowid", 'int'); +$rowid = GETPOSTINT("rowid"); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index f411810242d..ddd2728d169 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -34,7 +34,7 @@ $langs->loadLangs(array("members", "companies", "banks")); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -50,17 +50,17 @@ $search_lastname = GETPOST('search_lastname', 'alpha'); $search_firstname = GETPOST('search_firstname', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); $search_note = GETPOST('search_note', 'alpha'); -$search_account = GETPOST('search_account', 'int'); +$search_account = GETPOSTINT('search_account'); $search_amount = GETPOST('search_amount', 'alpha'); $search_all = ''; $date_select = GETPOST("date_select", 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -345,7 +345,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 4a1ee4b36a6..a56598e360a 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; // Load translation files required by the page $langs->load("members"); -$rowid = GETPOST('rowid', 'int'); +$rowid = GETPOSTINT('rowid'); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); @@ -61,10 +61,10 @@ $status = GETPOST('status', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -81,12 +81,12 @@ if (!$sortfield) { $label = GETPOST("label", "alpha"); $morphy = GETPOST("morphy", "alpha"); -$status = GETPOST("status", "int"); -$subscription = GETPOST("subscription", "int"); +$status = GETPOSTINT("status"); +$subscription = GETPOSTINT("subscription"); $amount = GETPOST('amount', 'alpha'); -$duration_value = GETPOST('duration_value', 'int'); +$duration_value = GETPOSTINT('duration_value'); $duration_unit = GETPOST('duration_unit', 'alpha'); -$vote = GETPOST("vote", "int"); +$vote = GETPOSTINT("vote"); $comment = GETPOST("comment", 'restricthtml'); $mail_valid = GETPOST("mail_valid", 'restricthtml'); $caneditamount = GETPOSTINT("caneditamount"); diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php index bd202e5a21a..88301150f13 100644 --- a/htdocs/adherents/type_ldap.php +++ b/htdocs/adherents/type_ldap.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php'; // Load translation files required by the page $langs->loadLangs(array("admin", "members", "ldap")); -$id = GETPOST('rowid', 'int'); +$id = GETPOSTINT('rowid'); $action = GETPOST('action', 'aZ09'); // Security check diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 55ee3bbd697..4dd37b89e24 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; // Load translation files required by the page $langs->loadLangs(array('members', 'languages')); -$id = GETPOST('rowid', 'int') ? GETPOST('rowid', 'int') : GETPOST('id', 'int'); +$id = GETPOSTINT('rowid') ? GETPOSTINT('rowid') : GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $ref = GETPOST('ref', 'alphanohtml'); @@ -279,7 +279,7 @@ if ($action == 'create' && $user->hasRight('adherent', 'configurer')) { print '
'; print ''; print ''; - print ''; + print ''; print dol_get_fiche_head(); diff --git a/htdocs/adherents/vcard.php b/htdocs/adherents/vcard.php index cb8bd1603bb..cd39e578045 100644 --- a/htdocs/adherents/vcard.php +++ b/htdocs/adherents/vcard.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/vcard.class.php'; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alphanohtml'); $object = new Adherent($db); diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 4190c55a8e1..f225f899ee8 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -58,9 +58,9 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode", 'alphanohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOST("state_id", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOSTINT("state_id"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOST('country_id', 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOSTINT('country_id'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("phone", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail", 'alphanohtml'), 'chaine', 0, '', $conf->entity); @@ -138,7 +138,7 @@ print '
'; print img_picto('', 'globe-americas', 'class="pictofixedwidth"'); -print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY') ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'country_id'); +print $form->select_country((GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY') ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -147,7 +147,7 @@ print '
'; print img_picto('', 'state', 'class="pictofixedwidth"'); -print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_STATE') ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY') ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id'); +print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_STATE') ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY') ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id'); print '
'; - if ($action != 'edit' || GETPOST('rowid', 'int') != $defaultvalue->id) { + if ($action != 'edit' || GETPOSTINT('rowid') != $defaultvalue->id) { print $defaultvalue->page; } else { print ''; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index ef1d477a624..0a7a3ea4e7a 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -188,7 +188,7 @@ if ($action == 'update') { // Update values for ($i = 0; $i < 4; $i++) { if (GETPOSTISSET('MAIN_METEO'.$plus.'_LEVEL'.$i)) { - dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOSTINT('MAIN_METEO'.$plus.'_LEVEL'.$i), 'chaine', 0, '', $conf->entity); } } diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 28fdb10609b..2afd06435b8 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -49,9 +49,9 @@ $langs->loadLangs(array("errors", "admin", "main", "companies", "resource", "hol $action = GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view'; $confirm = GETPOST('confirm', 'alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $rowid = GETPOST('rowid', 'alpha'); -$entity = GETPOST('entity', 'int'); +$entity = GETPOSTINT('entity'); $code = GETPOST('code', 'alpha'); $acts = array(); $actl = array(); @@ -65,7 +65,7 @@ $listoffset = GETPOST('listoffset'); $listlimit = GETPOST('listlimit') > 0 ? GETPOST('listlimit') : 1000; // To avoid too long dictionaries $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -74,7 +74,7 @@ $offset = $listlimit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -$search_country_id = GETPOST('search_country_id', 'int'); +$search_country_id = GETPOSTINT('search_country_id'); $search_code = GETPOST('search_code', 'alpha'); $search_active = GETPOST('search_active', 'alpha'); @@ -931,13 +931,13 @@ if (empty($reshook)) { } if ($keycode == 'sortorder') { // For column name 'sortorder', we use the field name 'position' - $sql .= (int) GETPOST('position', 'int'); + $sql .= GETPOSTINT('position'); } elseif (GETPOST($keycode) == '' && !($keycode == 'code' && $id == 10)) { $sql .= "null"; // For vat, we want/accept code = '' } elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; } elseif (in_array($keycode, array('joinfile', 'private', 'pos', 'position', 'scale', 'use_default'))) { - $sql .= (int) GETPOST($keycode, 'int'); + $sql .= GETPOSTINT($keycode); } else { $sql .= "'".$db->escape(GETPOST($keycode, 'alphanohtml'))."'"; } @@ -952,8 +952,8 @@ if (empty($reshook)) { setEventMessages($langs->transnoentities("RecordCreatedSuccessfully"), null, 'mesgs'); // Clean $_POST array, we keep only id of dictionary - if ($id == 10 && GETPOST('country', 'int') > 0) { - $search_country_id = GETPOST('country', 'int'); + if ($id == 10 && GETPOSTINT('country') > 0) { + $search_country_id = GETPOSTINT('country'); } $_POST = array('id'=>$id); } else { @@ -1000,13 +1000,13 @@ if (empty($reshook)) { } $sql .= $field."="; if ($listfieldvalue[$i] == 'sortorder') { // For column name 'sortorder', we use the field name 'position' - $sql .= (int) GETPOST('position', 'int'); + $sql .= GETPOSTINT('position'); } elseif (GETPOST($keycode) == '' && !($keycode == 'code' && $id == 10)) { $sql .= "null"; // For vat, we want/accept code = '' } elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; } elseif (in_array($keycode, array('joinfile', 'private', 'pos', 'position', 'scale', 'use_default'))) { - $sql .= (int) GETPOST($keycode, 'int'); + $sql .= GETPOSTINT($keycode); } else { $sql .= "'".$db->escape(GETPOST($keycode, 'alphanohtml'))."'"; } @@ -2305,10 +2305,10 @@ if ($id > 0) { $showfield = 0; } elseif ($value == 'unicode') { $valuetoshow = $langs->getCurrencySymbol($obj->code, 1); - } elseif ($value == 'label' && $tabname[GETPOST("id", 'int')] == 'c_units') { + } elseif ($value == 'label' && $tabname[GETPOSTINT("id")] == 'c_units') { $langs->load("products"); $valuetoshow = $langs->trans($obj->$value); - } elseif ($value == 'short_label' && $tabname[GETPOST("id", 'int')] == 'c_units') { + } elseif ($value == 'short_label' && $tabname[GETPOSTINT("id")] == 'c_units') { $langs->load("products"); $valuetoshow = $langs->trans($obj->$value); } elseif (($value == 'unit') && ($tabname[$id] == 'c_paper_format')) { diff --git a/htdocs/admin/dolistore/ajax/image.php b/htdocs/admin/dolistore/ajax/image.php index 9ff92554e09..e5896a4eec1 100644 --- a/htdocs/admin/dolistore/ajax/image.php +++ b/htdocs/admin/dolistore/ajax/image.php @@ -40,8 +40,8 @@ top_httphead('image'); $dolistore = new Dolistore(); -$id_product = GETPOST('id_product', 'int'); -$id_image = GETPOST('id_image', 'int'); +$id_product = GETPOSTINT('id_product'); +$id_image = GETPOSTINT('id_image'); // quality : image resize with this in the URL : "cart_default", "home_default", "large_default", "medium_default", "small_default", "thickbox_default" $quality = GETPOST('quality', 'alpha'); diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index b061eabdfe2..844f897547f 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -53,7 +53,7 @@ if (!isModEnabled('emailcollector')) { $langs->loadLangs(array("admin", "mails", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -61,7 +61,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'emailcollectorcard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); -$operationid = GETPOST('operationid', 'int'); +$operationid = GETPOSTINT('operationid'); // Initialize technical objects $object = new EmailCollector($db); @@ -154,7 +154,7 @@ if (GETPOST('addfilter', 'alpha')) { if ($action == 'deletefilter') { $emailcollectorfilter = new EmailCollectorFilter($db); - $emailcollectorfilter->fetch(GETPOST('filterid', 'int')); + $emailcollectorfilter->fetch(GETPOSTINT('filterid')); if ($emailcollectorfilter->id > 0) { $result = $emailcollectorfilter->delete($user); if ($result > 0) { @@ -198,7 +198,7 @@ if (GETPOST('addoperation', 'alpha')) { if ($action == 'updateoperation') { $emailcollectoroperation = new EmailCollectorAction($db); - $emailcollectoroperation->fetch(GETPOST('rowidoperation2', 'int')); + $emailcollectoroperation->fetch(GETPOSTINT('rowidoperation2')); $emailcollectoroperation->actionparam = GETPOST('operationparam2', 'alphawithlgt'); @@ -221,7 +221,7 @@ if ($action == 'updateoperation') { } if ($action == 'deleteoperation') { $emailcollectoroperation = new EmailCollectorAction($db); - $emailcollectoroperation->fetch(GETPOST('operationid', 'int')); + $emailcollectoroperation->fetch(GETPOSTINT('operationid')); if ($emailcollectoroperation->id > 0) { $result = $emailcollectoroperation->delete($user); if ($result > 0) { diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 833e822c288..e431b1f19dc 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -38,7 +38,7 @@ $langs->loadLangs(array("admin", "other")); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -47,13 +47,13 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action $page = 0; @@ -99,8 +99,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -365,7 +365,7 @@ $arrayofmassactions = array( if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index afdeca4b7b2..6b321316f47 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -41,10 +41,10 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'au $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index a1360b92966..16f4e1acc36 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -152,13 +152,13 @@ if ($action == 'updateMask') { $res3 = 0; if (isModEnabled('project') && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided - $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity); + $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOSTINT('EXPENSEREPORT_PROJECT_IS_REQUIRED'), 'chaine', 0, '', $conf->entity); } - $dates = GETPOST('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', 'int'); + $dates = GETPOSTINT('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH'); $res4 = dolibarr_set_const($db, 'EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', intval($dates), 'chaine', 0, '', $conf->entity); - $amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int'); + $amounts = GETPOSTINT('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY'); $res5 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity); if (!($res1 > 0) || !($res2 > 0) || !($res3 >= 0) || !($res4 >0) || !($res5 >0)) { diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index 639fcf50077..b3f22626264 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -60,11 +60,11 @@ if (empty($reshook)) { $error = false; $action = GETPOST('action', 'aZ09'); - $id = GETPOST('id', 'int'); + $id = GETPOSTINT('id'); $apply_to = GETPOST('apply_to'); - $fk_user = GETPOST('fk_user', 'int'); - $fk_usergroup = GETPOST('fk_usergroup', 'int'); + $fk_user = GETPOSTINT('fk_user'); + $fk_usergroup = GETPOSTINT('fk_usergroup'); $restrictive = GETPOSTINT('restrictive'); $fk_c_type_fees = GETPOSTINT('fk_c_type_fees'); $code_expense_rules_type = GETPOST('code_expense_rules_type'); diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index b9c200b3b50..4d1b5cc3bed 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -68,8 +68,8 @@ if ($result) { } if ($action == 'add' || GETPOST("modify")) { - $external_rss_title = "external_rss_title_".GETPOST("norss", 'int'); - $external_rss_urlrss = "external_rss_urlrss_".GETPOST("norss", 'int'); + $external_rss_title = "external_rss_title_".GETPOSTINT("norss"); + $external_rss_urlrss = "external_rss_urlrss_".GETPOSTINT("norss"); if (GETPOST($external_rss_urlrss, 'alpha')) { $boxlabel = '(ExternalRSSInformations)'; @@ -93,7 +93,7 @@ if ($action == 'add' || GETPOST("modify")) { } else { // Ajoute boite box_external_rss dans definition des boites $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes_def (file, note)"; - $sql .= " VALUES ('box_external_rss.php','".$db->escape(GETPOST("norss", 'int').' ('.GETPOST($external_rss_title, 'alpha')).")')"; + $sql .= " VALUES ('box_external_rss.php','".$db->escape(GETPOSTINT("norss").' ('.GETPOSTINT($external_rss_title)).")')"; if (!$db->query($sql)) { dol_print_error($db); $error++; @@ -101,9 +101,9 @@ if ($action == 'add' || GETPOST("modify")) { //print $sql;exit; } - $result1 = dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_".GETPOST("norss", 'int'), GETPOST($external_rss_title, 'alpha'), 'chaine', 0, '', $conf->entity); + $result1 = dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_".GETPOSTINT("norss"), GETPOSTINT($external_rss_title), 'chaine', 0, '', $conf->entity); if ($result1) { - $consttosave = "EXTERNAL_RSS_URLRSS_".GETPOST("norss", 'int'); + $consttosave = "EXTERNAL_RSS_URLRSS_".GETPOSTINT("norss"); $urltosave = GETPOST($external_rss_urlrss, 'alpha'); $result2 = dolibarr_set_const($db, $consttosave, $urltosave, 'chaine', 0, '', $conf->entity); //var_dump($result2);exit; @@ -121,12 +121,12 @@ if ($action == 'add' || GETPOST("modify")) { } if (GETPOST("delete")) { - if (GETPOST("norss", 'int')) { + if (GETPOSTINT("norss")) { $db->begin(); // Supprime boite box_external_rss de definition des boites $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."boxes_def"; - $sql .= " WHERE file = 'box_external_rss.php' AND note LIKE '".$db->escape(GETPOST("norss", 'int'))." %'"; + $sql .= " WHERE file = 'box_external_rss.php' AND note LIKE '".$db->escape(GETPOSTINT("norss"))." %'"; $resql = $db->query($sql); if ($resql) { @@ -161,9 +161,9 @@ if (GETPOST("delete")) { } - $result1 = dolibarr_del_const($db, "EXTERNAL_RSS_TITLE_".GETPOST("norss", 'int'), $conf->entity); + $result1 = dolibarr_del_const($db, "EXTERNAL_RSS_TITLE_".GETPOSTINT("norss"), $conf->entity); if ($result1) { - $result2 = dolibarr_del_const($db, "EXTERNAL_RSS_URLRSS_".GETPOST("norss", 'int'), $conf->entity); + $result2 = dolibarr_del_const($db, "EXTERNAL_RSS_URLRSS_".GETPOSTINT("norss"), $conf->entity); } if ($result1 && $result2) { diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 30525d92a68..a28e5d57482 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -230,7 +230,7 @@ if ($action == 'updateMask') { } } } elseif ($action == 'set_INVOICE_CHECK_POSTERIOR_DATE') { - $check_posterior_date = GETPOST('INVOICE_CHECK_POSTERIOR_DATE', 'int'); + $check_posterior_date = GETPOSTINT('INVOICE_CHECK_POSTERIOR_DATE'); $res = dolibarr_set_const($db, 'INVOICE_CHECK_POSTERIOR_DATE', $check_posterior_date, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index ae0c57284df..e0c92c8f663 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -73,7 +73,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'update') { - $max_rank = GETPOST('HRM_MAXRANK', 'int'); + $max_rank = GETPOSTINT('HRM_MAXRANK'); // We complete skill possible level notation if necessary if (!empty($max_rank)) { diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 2e13c2d5c7a..1d27c5b2dbd 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -248,17 +248,17 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOST("MAIN_SIZE_LISTE_LIMIT", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOSTINT("MAIN_SIZE_LISTE_LIMIT"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOSTINT("main_size_shortliste_limit"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET("MAIN_CHECKBOX_LEFT_COLUMN")) { - dolibarr_set_const($db, "MAIN_CHECKBOX_LEFT_COLUMN", GETPOST("MAIN_CHECKBOX_LEFT_COLUMN", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_CHECKBOX_LEFT_COLUMN", GETPOSTINT("MAIN_CHECKBOX_LEFT_COLUMN"), 'chaine', 0, '', $conf->entity); } //dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity); //dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity); //dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", GETPOST("MAIN_MENU_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_START_WEEK", GETPOSTINT("MAIN_START_WEEK"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'alphanohtml'), 'chaine', 0, '', $conf->entity); @@ -318,7 +318,7 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); } - header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup&mode=".$mode.(GETPOSTISSET('page_y') ? '&page_y='.GETPOST('page_y', 'int') : '')); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup&mode=".$mode.(GETPOSTISSET('page_y') ? '&page_y='.GETPOSTINT('page_y') : '')); exit; } diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index cc1fd97fe62..dcf59d40d8b 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -65,7 +65,7 @@ if (empty($reshook)) { if (!dolibarr_set_const($db, 'LDAP_SERVER_TYPE', GETPOST("type", 'aZ09'), 'chaine', 0, '', $conf->entity)) { $error++; } - if (!dolibarr_set_const($db, 'LDAP_USERACCOUNTCONTROL', GETPOST("userAccountControl", 'int'), 'chaine', 0, '', $conf->entity)) { + if (!dolibarr_set_const($db, 'LDAP_USERACCOUNTCONTROL', GETPOSTINT("userAccountControl"), 'chaine', 0, '', $conf->entity)) { $error++; } if (!dolibarr_set_const($db, 'LDAP_SERVER_PROTOCOLVERSION', GETPOST("LDAP_SERVER_PROTOCOLVERSION", 'aZ09'), 'chaine', 0, '', $conf->entity)) { @@ -77,7 +77,7 @@ if (empty($reshook)) { if (!dolibarr_set_const($db, 'LDAP_SERVER_HOST_SLAVE', GETPOST("slave", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) { $error++; } - if (!dolibarr_set_const($db, 'LDAP_SERVER_PORT', GETPOST("port", 'int'), 'chaine', 0, '', $conf->entity)) { + if (!dolibarr_set_const($db, 'LDAP_SERVER_PORT', GETPOSTINT("port"), 'chaine', 0, '', $conf->entity)) { $error++; } if (!dolibarr_set_const($db, 'LDAP_SERVER_DN', GETPOST("dn", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) { diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 41699a84709..a4911e94e52 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -45,8 +45,8 @@ $mainmaxdecimalstot = 'MAIN_MAX_DECIMALS_TOT'.(!empty($currencycode) ? '_'.$curr $mainmaxdecimalsshown = 'MAIN_MAX_DECIMALS_SHOWN'.(!empty($currencycode) ? '_'.$currencycode : ''); $mainroundingruletot = 'MAIN_ROUNDING_RULE_TOT'.(!empty($currencycode) ? '_'.$currencycode : ''); -$valmainmaxdecimalsunit = GETPOST($mainmaxdecimalsunit, 'int'); -$valmainmaxdecimalstot = GETPOST($mainmaxdecimalstot, 'int'); +$valmainmaxdecimalsunit = GETPOSTINT($mainmaxdecimalsunit); +$valmainmaxdecimalstot = GETPOSTINT($mainmaxdecimalstot); $valmainmaxdecimalsshown = GETPOST($mainmaxdecimalsshown, 'alpha'); // Can be 'x.y' but also 'x...' $valmainroundingruletot = price2num(GETPOST($mainroundingruletot, 'alphanohtml'), '', 2); diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 417e90f9ef4..93a47a30e5e 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -51,7 +51,7 @@ if ($action == 'setvalue') { $mailerror = GETPOST('MAILING_EMAIL_ERRORSTO', 'alpha'); $checkread = GETPOST('value', 'alpha'); $checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY', 'alpha'); - $contactbulkdefault = GETPOST('MAILING_CONTACT_DEFAULT_BULK_STATUS', 'int'); + $contactbulkdefault = GETPOSTINT('MAILING_CONTACT_DEFAULT_BULK_STATUS'); if (GETPOST('MAILING_DELAY', 'alpha') != '') { $mailingdelay = price2num(GETPOST('MAILING_DELAY', 'alpha'), 3); // Not less than 1 millisecond. } else { @@ -98,7 +98,7 @@ if ($action == 'setvalue') { } } if ($action == 'setonsearchandlistgooncustomerorsuppliercard') { - $setonsearchandlistgooncustomerorsuppliercard = GETPOST('value', 'int'); + $setonsearchandlistgooncustomerorsuppliercard = GETPOSTINT('value'); $res = dolibarr_set_const($db, "SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD", $setonsearchandlistgooncustomerorsuppliercard, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index cdda45c2a90..e224b75a986 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -86,13 +86,13 @@ if ($action == 'update' && !$cancel) { } if (!$error) { - dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOSTINT("MAIN_DISABLE_ALL_MAILS"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_FORCE_SENDTO", GETPOST("MAIN_MAIL_FORCE_SENDTO", 'alphanohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_ENABLED_USER_DEST_SELECT", GETPOST("MAIN_MAIL_ENABLED_USER_DEST_SELECT", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, 'MAIN_MAIL_NO_WITH_TO_SELECTED', GETPOST('MAIN_MAIL_NO_WITH_TO_SELECTED', 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_ENABLED_USER_DEST_SELECT", GETPOSTINT("MAIN_MAIL_ENABLED_USER_DEST_SELECT"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_MAIL_NO_WITH_TO_SELECTED', GETPOSTINT('MAIN_MAIL_NO_WITH_TO_SELECTED'), 'chaine', 0, '', $conf->entity); // Send mode parameters dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE", 'aZ09'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOST("MAIN_MAIL_SMTP_PORT", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOSTINT("MAIN_MAIL_SMTP_PORT"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", GETPOST("MAIN_MAIL_SMTP_SERVER", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", GETPOST("MAIN_MAIL_SMTPS_ID", 'alphanohtml'), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET("MAIN_MAIL_SMTPS_PW")) { @@ -104,11 +104,11 @@ if ($action == 'update' && !$cancel) { if (GETPOSTISSET("MAIN_MAIL_SMTPS_OAUTH_SERVICE")) { dolibarr_set_const($db, "MAIN_MAIL_SMTPS_OAUTH_SERVICE", GETPOST("MAIN_MAIL_SMTPS_OAUTH_SERVICE", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOST("MAIN_MAIL_EMAIL_TLS", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS", GETPOST("MAIN_MAIL_EMAIL_STARTTLS", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED", GETPOST("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOSTINT("MAIN_MAIL_EMAIL_TLS"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS", GETPOSTINT("MAIN_MAIL_EMAIL_STARTTLS"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED", GETPOSTINT("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_ENABLED", GETPOST("MAIN_MAIL_EMAIL_DKIM_ENABLED", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_ENABLED", GETPOSTINT("MAIN_MAIL_EMAIL_DKIM_ENABLED"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_DOMAIN", GETPOST("MAIN_MAIL_EMAIL_DKIM_DOMAIN", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_SELECTOR", GETPOST("MAIN_MAIL_EMAIL_DKIM_SELECTOR", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY", GETPOST("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY", 'alphanohtml'), 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index d0a452061de..1d718819e79 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -35,7 +35,7 @@ $langs->loadLangs(array("errors", "admin", "mails", "languages")); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -44,14 +44,14 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $rowid = GETPOST('rowid', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -88,8 +88,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -203,7 +203,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; if ($action == 'delete') { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."c_email_senderprofile WHERE rowid = ".GETPOST('id', 'int'); + $sql = "DELETE FROM ".MAIN_DB_PREFIX."c_email_senderprofile WHERE rowid = ".GETPOSTINT('id'); $resql = $db->query($sql); if ($resql) { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); @@ -268,7 +268,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { - $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)).")"; + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; } else { $sql .= " WHERE 1 = 1"; } @@ -397,9 +397,9 @@ foreach ($search as $key => $val) { } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } @@ -453,11 +453,11 @@ if ($action != 'create') { print '
'.$langs->trans("User").''; print img_picto('', 'user', 'class="pictofixedwidth"'); - print $form->select_dolusers((GETPOSTISSET('private') ? GETPOST('private', 'int') : $object->private), 'private', 1, null, 0, ($user->admin ? '' : $user->id)); + print $form->select_dolusers((GETPOSTISSET('private') ? GETPOSTINT('private') : $object->private), 'private', 1, null, 0, ($user->admin ? '' : $user->id)); print '
'.$langs->trans("Position").'
'.$langs->trans("Position").'
'.$langs->trans("Status").''; - print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], (GETPOSTISSET('active') ? GETPOST('active', 'int') : $object->active), 0, 0, 0, '', 1); + print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], (GETPOSTISSET('active') ? GETPOSTINT('active') : $object->active), 0, 0, 0, '', 1); print '
'; @@ -485,11 +485,11 @@ if ($action != 'create') { print '
'.$langs->trans("User").''; print img_picto('', 'user', 'class="pictofixedwidth"'); - print $form->select_dolusers((GETPOSTISSET('private') ? GETPOST('private', 'int') : -1), 'private', 1, null, 0, ($user->admin ? '' : $user->id)); + print $form->select_dolusers((GETPOSTISSET('private') ? GETPOSTINT('private') : -1), 'private', 1, null, 0, ($user->admin ? '' : $user->id)); print '
'.$langs->trans("Position").'
'.$langs->trans("Position").'
'.$langs->trans("Status").''; - print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], GETPOST('active', 'int'), 0); + print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], GETPOSTINT('active'), 0); print '
'; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 13545002911..cc9b100d393 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -62,7 +62,7 @@ $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $mode = GETPOST('mode', 'aZ09'); $optioncss = GETPOST('optioncss', 'alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $rowid = GETPOST('rowid', 'alpha'); $search_label = GETPOST('search_label', 'alphanohtml'); // Must allow value like 'Abc Def' or '(MyTemplateName)' $search_type_template = GETPOST('search_type_template', 'alpha'); @@ -81,10 +81,10 @@ $actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"') $listoffset = GETPOST('listoffset', 'alpha'); $listlimit = GETPOST('listlimit', 'alpha') > 0 ? GETPOST('listlimit', 'alpha') : 1000; -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -401,12 +401,12 @@ if (empty($reshook)) { if (!$user->admin) { // A non admin user can only edit its own template $sql .= " ".((int) $user->id); } else { - $sql .= " ".((int) GETPOST($keycode, 'int')); + $sql .= " ".(GETPOSTINT($keycode)); } } elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; } elseif (in_array($keycode, array('joinfiles', 'defaultfortype', 'private', 'position', 'entity'))) { - $sql .= (int) GETPOST($keycode, 'int'); + $sql .= GETPOSTINT($keycode); } else { $sql .= "'".$db->escape(GETPOST($keycode, 'alphanohtml'))."'"; } @@ -454,7 +454,7 @@ if (empty($reshook)) { } // Rename some POST variables into a generic name - if ($field == 'fk_user' && !(GETPOST('fk_user', 'int') > 0)) { + if ($field == 'fk_user' && !(GETPOSTINT('fk_user') > 0)) { $_POST['fk_user'] = ''; } if ($field == 'topic') { @@ -483,12 +483,12 @@ if (empty($reshook)) { if (!$user->admin) { // A non admin user can only edit its own template $sql .= " ".((int) $user->id); } else { - $sql .= " ".((int) GETPOST($keycode, 'int')); + $sql .= " ".(GETPOSTINT($keycode)); } } elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; } elseif (in_array($keycode, array('joinfiles', 'defaultfortype', 'private', 'position'))) { - $sql .= (int) GETPOST($keycode, 'int'); + $sql .= GETPOSTINT($keycode); } else { $sql .= "'".$db->escape(GETPOST($keycode, 'alphanohtml'))."'"; } @@ -693,8 +693,8 @@ if ($action == 'create') { $obj->label = GETPOST('label'); $obj->lang = GETPOST('lang'); $obj->type_template = GETPOST('type_template'); - $obj->fk_user = GETPOST('fk_user', 'int'); - $obj->private = GETPOST('private', 'int'); + $obj->fk_user = GETPOSTINT('fk_user'); + $obj->private = GETPOSTINT('private'); $obj->position = GETPOST('position'); $obj->topic = GETPOST('topic'); $obj->joinfiles = GETPOST('joinfiles'); diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 3b680f93a7b..f2969e5ed69 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -133,7 +133,7 @@ if ($action == 'add') { $menu->prefix = (string) GETPOST('picto', 'restricthtmlallowclass'); $menu->url = (string) GETPOST('url', 'alphanohtml'); $menu->langs = (string) GETPOST('langs', 'alphanohtml'); - $menu->position = (int) GETPOST('position', 'int'); + $menu->position = GETPOSTINT('position'); $menu->enabled = (string) GETPOST('enabled', 'alphanohtml'); $menu->perms = (string) GETPOST('perms', 'alphanohtml'); $menu->target = (string) GETPOST('target', 'alphanohtml'); @@ -187,14 +187,14 @@ if ($action == 'update') { if (!$error) { $menu = new Menubase($db); - $result = $menu->fetch(GETPOST('menuId', 'int')); + $result = $menu->fetch(GETPOSTINT('menuId')); if ($result > 0) { $menu->title = (string) GETPOST('titre', 'alphanohtml'); $menu->prefix = (string) GETPOST('picto', 'restricthtmlallowclass'); $menu->leftmenu = (string) GETPOST('leftmenu', 'aZ09'); $menu->url = (string) GETPOST('url', 'alphanohtml'); $menu->langs = (string) GETPOST('langs', 'alphanohtml'); - $menu->position = (int) GETPOST('position', 'int'); + $menu->position = GETPOSTINT('position'); $menu->enabled = (string) GETPOST('enabled', 'alphanohtml'); $menu->perms = (string) GETPOST('perms', 'alphanohtml'); $menu->target = (string) GETPOST('target', 'alphanohtml'); @@ -274,7 +274,7 @@ if ($action == 'create') { print load_fiche_titre($langs->trans("NewMenu"), '', 'title_setup'); - print ''; + print ''; print ''; print dol_get_fiche_head(); @@ -283,16 +283,16 @@ if ($action == 'create') { print ''; // Id - $parent_rowid = GETPOST('menuId', 'int'); + $parent_rowid = GETPOSTINT('menuId'); $parent_mainmenu = ''; $parent_leftmenu = ''; $parent_langs = ''; $parent_level = ''; - if (GETPOST('menuId', 'int')) { + if (GETPOSTINT('menuId')) { $sql = "SELECT m.rowid, m.mainmenu, m.leftmenu, m.level, m.langs"; $sql .= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql .= " WHERE m.rowid = ".((int) GETPOST('menuId', 'int')); + $sql .= " WHERE m.rowid = ".(GETPOSTINT('menuId')); $res = $db->query($sql); if ($res) { while ($menu = $db->fetch_array($res)) { @@ -408,7 +408,7 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; + print ''; print dol_get_fiche_head(); @@ -416,7 +416,7 @@ if ($action == 'create') { print '
'; $menu = new Menubase($db); - $result = $menu->fetch(GETPOST('menuId', 'int')); + $result = $menu->fetch(GETPOSTINT('menuId')); //var_dump($menu); // Id diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index d18f205f4de..c6099a88c6c 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -75,7 +75,7 @@ if ($action == 'up') { // Get current position $sql = "SELECT m.rowid, m.position, m.type, m.fk_menu"; $sql .= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql .= " WHERE m.rowid = ".GETPOST("menuId", "int"); + $sql .= " WHERE m.rowid = ".GETPOSTINT("menuId"); dol_syslog("admin/menus/index.php ".$sql); $result = $db->query($sql); $num = $db->num_rows($result); @@ -92,7 +92,7 @@ if ($action == 'up') { // Menu before $sql = "SELECT m.rowid, m.position"; $sql .= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql .= " WHERE (m.position < ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid < ".GETPOST("menuId", "int")."))"; + $sql .= " WHERE (m.position < ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid < ".GETPOSTINT("menuId")."))"; $sql .= " AND m.menu_handler='".$db->escape($menu_handler_to_search)."'"; $sql .= " AND m.entity = ".$conf->entity; $sql .= " AND m.type = '".$db->escape($current['type'])."'"; @@ -126,7 +126,7 @@ if ($action == 'up') { // Get current position $sql = "SELECT m.rowid, m.position, m.type, m.fk_menu"; $sql .= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql .= " WHERE m.rowid = ".GETPOST("menuId", "int"); + $sql .= " WHERE m.rowid = ".GETPOSTINT("menuId"); dol_syslog("admin/menus/index.php ".$sql); $result = $db->query($sql); $num = $db->num_rows($result); @@ -143,7 +143,7 @@ if ($action == 'up') { // Menu after $sql = "SELECT m.rowid, m.position"; $sql .= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql .= " WHERE (m.position > ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid > ".GETPOST("menuId", "int")."))"; + $sql .= " WHERE (m.position > ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid > ".GETPOSTINT("menuId")."))"; $sql .= " AND m.menu_handler='".$db->escape($menu_handler_to_search)."'"; $sql .= " AND m.entity = ".$conf->entity; $sql .= " AND m.type = '".$db->escape($current['type'])."'"; @@ -174,7 +174,7 @@ if ($action == 'up') { $db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; - $sql .= " WHERE rowid = ".GETPOST('menuId', 'int'); + $sql .= " WHERE rowid = ".GETPOSTINT('menuId'); $resql = $db->query($sql); if ($resql) { $db->commit(); @@ -231,11 +231,11 @@ print "
\n"; if ($action == 'delete') { $sql = "SELECT m.titre as title"; $sql .= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql .= " WHERE m.rowid = ".GETPOST('menuId', 'int'); + $sql .= " WHERE m.rowid = ".GETPOSTINT('menuId'); $result = $db->query($sql); $obj = $db->fetch_object($result); - print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOST('menuId', 'int'), $langs->trans("DeleteMenu"), $langs->trans("ConfirmDeleteMenu", $obj->title), "confirm_delete"); + print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOSTINT('menuId'), $langs->trans("DeleteMenu"), $langs->trans("ConfirmDeleteMenu", $obj->title), "confirm_delete"); } $newcardbutton = ''; diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 8ef166d933c..dd91a52a04d 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -41,7 +41,7 @@ $langs->loadLangs(array('errors', 'admin', 'modulebuilder', 'exports')); $mode = GETPOST('mode', 'alpha'); $action = GETPOST('action', 'aZ09'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); if (empty($mode)) { $mode = 'desc'; } diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 62c612ab24a..d24c833cb85 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -56,7 +56,7 @@ if (GETPOSTISSET('mode')) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); -$page_y = GETPOST('page_y', 'int'); +$page_y = GETPOSTINT('page_y'); $search_keyword = GETPOST('search_keyword', 'alpha'); $search_status = GETPOST('search_status', 'alpha'); $search_nature = GETPOST('search_nature', 'alpha'); @@ -66,9 +66,9 @@ $search_version = GETPOST('search_version', 'alpha'); // For dolistore search $options = array(); $options['per_page'] = 20; -$options['categorie'] = ((int) (GETPOST('categorie', 'int') ? GETPOST('categorie', 'int') : 0)); -$options['start'] = ((int) (GETPOST('start', 'int') ? GETPOST('start', 'int') : 0)); -$options['end'] = ((int) (GETPOST('end', 'int') ? GETPOST('end', 'int') : 0)); +$options['categorie'] = ((int) (GETPOSTINT('categorie') ? GETPOSTINT('categorie') : 0)); +$options['start'] = ((int) (GETPOSTINT('start') ? GETPOSTINT('start') : 0)); +$options['end'] = ((int) (GETPOSTINT('end') ? GETPOSTINT('end') : 0)); $options['search'] = GETPOST('search_keyword', 'alpha'); $dolistore = new Dolistore(false); diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 08822da9a59..6121350b972 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -100,7 +100,7 @@ if ($action == 'add_currency') { $error = 0; if (GETPOST('updatecurrency', 'alpha')) { - $fk_multicurrency = GETPOST('fk_multicurrency', 'int'); + $fk_multicurrency = GETPOSTINT('fk_multicurrency'); $rate = price2num(GETPOST('rate', 'alpha')); $currency = new MultiCurrency($db); @@ -117,7 +117,7 @@ if ($action == 'add_currency') { } } } elseif (GETPOST('deletecurrency', 'alpha')) { - $fk_multicurrency = GETPOST('fk_multicurrency', 'int'); + $fk_multicurrency = GETPOSTINT('fk_multicurrency'); $currency = new MultiCurrency($db); if ($currency->fetch($fk_multicurrency) > 0) { diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 5fd744ca88b..55dc6212a60 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -79,7 +79,7 @@ if ($action == 'setparams') { $error++; } - $res = dolibarr_set_const($db, "PAYMENTS_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "PAYMENTS_REPORT_GROUP_BY_MOD", GETPOSTINT('PAYMENTS_REPORT_GROUP_BY_MOD'), 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index e5fe6cc018c..43e2f1473d2 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -50,7 +50,7 @@ $type = 'paymentorder'; if ($action == "set") { $db->begin(); - $id = GETPOST('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT', 'int'); + $id = GETPOSTINT('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT'); $account = new Account($db); if ($account->fetch($id) > 0) { $res = dolibarr_set_const($db, "PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity); @@ -115,7 +115,7 @@ if ($action == "set") { if ($action == "addnotif") { $bon = new BonPrelevement($db); - $bon->addNotification($db, GETPOST('user', 'int'), $action); + $bon->addNotification($db, GETPOSTINT('user'), $action); header("Location: ".$_SERVER["PHP_SELF"]); exit; @@ -123,7 +123,7 @@ if ($action == "addnotif") { if ($action == "deletenotif") { $bon = new BonPrelevement($db); - $bon->deleteNotificationById(GETPOST('notif', 'int')); + $bon->deleteNotificationById(GETPOSTINT('notif')); header("Location: ".$_SERVER["PHP_SELF"]); exit; diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index e9af7bdc816..a792c664a6c 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -137,7 +137,7 @@ if ($action == 'update') { } if (GETPOSTISSET('MAIN_DOCUMENTS_LOGO_HEIGHT')) { - dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOSTINT("MAIN_DOCUMENTS_LOGO_HEIGHT"), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET('MAIN_INVERT_SENDER_RECIPIENT')) { dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 2c76236310c..31becefc379 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -75,10 +75,10 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", GETPOST("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH')) { - dolibarr_set_const($db, "MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", GETPOST("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", GETPOSTINT("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH"), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET('INVOICE_ADD_ZATCA_QR_CODE')) { - dolibarr_set_const($db, "INVOICE_ADD_ZATCA_QR_CODE", GETPOST("INVOICE_ADD_ZATCA_QR_CODE", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "INVOICE_ADD_ZATCA_QR_CODE", GETPOSTINT("INVOICE_ADD_ZATCA_QR_CODE"), 'chaine', 0, '', $conf->entity); if (GETPOSTINT('INVOICE_ADD_ZATCA_QR_CODE') == 1) { dolibarr_del_const($db, "INVOICE_ADD_SWISS_QR_CODE", $conf->entity); } @@ -90,10 +90,10 @@ if ($action == 'update') { } } if (GETPOSTISSET('INVOICE_CATEGORY_OF_OPERATION')) { - dolibarr_set_const($db, "INVOICE_CATEGORY_OF_OPERATION", GETPOST("INVOICE_CATEGORY_OF_OPERATION", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "INVOICE_CATEGORY_OF_OPERATION", GETPOSTINT("INVOICE_CATEGORY_OF_OPERATION"), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET('INVOICE_SHOW_SHIPPING_ADDRESS')) { - dolibarr_set_const($db, "INVOICE_SHOW_SHIPPING_ADDRESS", GETPOST("INVOICE_SHOW_SHIPPING_ADDRESS", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "INVOICE_SHOW_SHIPPING_ADDRESS", GETPOSTINT("INVOICE_SHOW_SHIPPING_ADDRESS"), 'chaine', 0, '', $conf->entity); dolibarr_del_const($db, "INVOICE_SHOW_SHIPPING_ADDRESS", $conf->entity); } diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index e7c4bd3fbb4..b74904f0a9f 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -47,14 +47,14 @@ $entity = $conf->entity; if ($action == 'add') { $sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=1"; - $sql .= " WHERE id = ".GETPOST("pid", 'int'); + $sql .= " WHERE id = ".GETPOSTINT("pid"); $sql .= " AND entity = ".$conf->entity; $db->query($sql); } if ($action == 'remove') { $sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=0"; - $sql .= " WHERE id = ".GETPOST('pid', 'int'); + $sql .= " WHERE id = ".GETPOSTINT('pid'); $sql .= " AND entity = ".$conf->entity; $db->query($sql); } diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 8e25b9295b9..f1add49e837 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -52,7 +52,7 @@ $error = 0; if ($action == "set") { $db->begin(); - $id = GETPOST('PRELEVEMENT_ID_BANKACCOUNT', 'int'); + $id = GETPOSTINT('PRELEVEMENT_ID_BANKACCOUNT'); $account = new Account($db); if ($account->fetch($id) > 0) { $res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity); @@ -118,7 +118,7 @@ if ($action == "set") { if ($action == "addnotif") { $bon = new BonPrelevement($db); - $bon->addNotification($db, GETPOST('user', 'int'), $action); + $bon->addNotification($db, GETPOSTINT('user'), $action); header("Location: ".$_SERVER["PHP_SELF"]); exit; @@ -126,7 +126,7 @@ if ($action == "addnotif") { if ($action == "deletenotif") { $bon = new BonPrelevement($db); - $bon->deleteNotificationById(GETPOST('notif', 'int')); + $bon->deleteNotificationById(GETPOSTINT('notif')); header("Location: ".$_SERVER["PHP_SELF"]); exit; diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 2c7f58be336..6b7c5f686ed 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -44,12 +44,12 @@ $action = GETPOST('action', 'aZ09'); $mode = GETPOST('mode', 'alpha'); $printername = GETPOST('printername', 'alpha'); -$printerid = GETPOST('printerid', 'int'); +$printerid = GETPOSTINT('printerid'); $parameter = GETPOST('parameter', 'alpha'); $template = GETPOST('template', 'alphanohtml'); $templatename = GETPOST('templatename', 'alpha'); -$templateid = GETPOST('templateid', 'int'); +$templateid = GETPOSTINT('templateid'); $printer = new dolReceiptPrinter($db); @@ -89,7 +89,7 @@ if ($action == 'addprinter' && $user->admin) { if (!$error) { $db->begin(); - $result = $printer->addPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter); + $result = $printer->addPrinter($printername, GETPOSTINT('printertypeid'), GETPOSTINT('printerprofileid'), $parameter); if ($result > 0) { $error++; } @@ -139,7 +139,7 @@ if ($action == 'updateprinter' && $user->admin) { if (!$error) { $db->begin(); - $result = $printer->updatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid); + $result = $printer->updatePrinter($printername, GETPOSTINT('printertypeid'), GETPOSTINT('printerprofileid'), $parameter, $printerid); if ($result > 0) { $error++; } diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index c1e01049a65..c8ac3fa4423 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -131,7 +131,7 @@ if ($action == 'updateMask') { dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } elseif ($action == 'setparams') { - $res = dolibarr_set_const($db, "PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", GETPOSTINT('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD'), 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index f917784870e..fc745fb998c 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -71,7 +71,7 @@ if ($action == 'update') { $error = 0; // Tax mode - $tax_mode = GETPOST('tax_mode', 'int'); + $tax_mode = GETPOSTINT('tax_mode'); $db->begin(); @@ -122,7 +122,7 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_INFO_VAT_RETURN", GETPOST("MAIN_INFO_VAT_RETURN", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_TVA_DAY_DEADLINE_SUBMISSION", GETPOST("deadline_day_vat", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_TVA_DAY_DEADLINE_SUBMISSION", GETPOSTINT("deadline_day_vat"), 'chaine', 0, '', $conf->entity); if (!$error) { $db->commit(); diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 6ca24301575..19405ddbf4b 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -86,7 +86,7 @@ if ($action == 'updateMask') { } } elseif (preg_match('/set_(.*)/', $action, $reg)) { $code = $reg[1]; - $value = GETPOSTISSET($code) ? GETPOST($code, 'int') : 1; + $value = GETPOSTISSET($code) ? GETPOSTINT($code) : 1; if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha'); $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity); @@ -152,20 +152,20 @@ if ($action == 'updateMask') { } if (GETPOSTISSET('product_category_id')) { - $param_ticket_product_category = GETPOST('product_category_id', 'int'); + $param_ticket_product_category = GETPOSTINT('product_category_id'); $res = dolibarr_set_const($db, 'TICKET_PRODUCT_CATEGORY', $param_ticket_product_category, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } } - $param_delay_first_response = GETPOST('delay_first_response', 'int'); + $param_delay_first_response = GETPOSTINT('delay_first_response'); $res = dolibarr_set_const($db, 'TICKET_DELAY_BEFORE_FIRST_RESPONSE', $param_delay_first_response, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } - $param_delay_between_responses = GETPOST('delay_between_responses', 'int'); + $param_delay_between_responses = GETPOSTINT('delay_between_responses'); $res = dolibarr_set_const($db, 'TICKET_DELAY_SINCE_LAST_RESPONSE', $param_delay_between_responses, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index e58b0599b76..942ff6662c0 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -163,7 +163,7 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') { } } elseif (preg_match('/set_(.*)/', $action, $reg)) { $code = $reg[1]; - $value = GETPOSTISSET($code) ? GETPOST($code, 'int') : 1; + $value = GETPOSTISSET($code) ? GETPOSTINT($code) : 1; if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha'); $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 48781cd43e2..a3ffe8a8c53 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -34,7 +34,7 @@ $action = GETPOST('action', 'aZ09'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "DESC"; } @@ -44,7 +44,7 @@ if (!$sortfield) { if (empty($page) || $page == -1) { $page = 0; } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; if (!$user->admin) { diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index e01aa09e96b..a708e51adfa 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -38,10 +38,10 @@ $export_type = GETPOST('export_type', 'alpha'); $file = dol_sanitizeFileName(GETPOST('filename_template', 'alpha')); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action @@ -68,7 +68,7 @@ $utils = new Utils($db); if ($file && !$what) { //print DOL_URL_ROOT.'/dolibarr_export.php'; - header("Location: ".DOL_URL_ROOT.'/admin/tools/dolibarr_export.php?msg='.urlencode($langs->trans("ErrorFieldRequired", $langs->transnoentities("ExportMethod"))).(GETPOST('page_y', 'int') ? '&page_y='.GETPOST('page_y', 'int') : '')); + header("Location: ".DOL_URL_ROOT.'/admin/tools/dolibarr_export.php?msg='.urlencode($langs->trans("ErrorFieldRequired", $langs->transnoentities("ExportMethod"))).(GETPOSTINT('page_y') ? '&page_y='.GETPOSTINT('page_y') : '')); exit; } @@ -222,5 +222,5 @@ top_httphead(); $db->close(); // Redirect to backup page -header("Location: dolibarr_export.php".(GETPOST('page_y', 'int') ? '?page_y='.GETPOST('page_y', 'int') : '')); +header("Location: dolibarr_export.php".(GETPOSTINT('page_y') ? '?page_y='.GETPOSTINT('page_y') : '')); exit(); diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 1907e451b53..551a90c7b67 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -47,7 +47,7 @@ $file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2|\.zst)$/i', '', $ $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "DESC"; } @@ -59,7 +59,7 @@ if ($page < 0) { } elseif (empty($page)) { $page = 0; } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; if (!$user->admin) { diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 669d1fefac6..54fa535d5fc 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -47,10 +47,10 @@ if ($user->socid > 0) { $langs->loadLangs(array("companies", "admin", "users", "other","withdrawals")); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -64,7 +64,7 @@ if (!$sortorder) { $sortorder = "DESC"; } -$search_rowid = GETPOST("search_rowid", "int"); +$search_rowid = GETPOSTINT("search_rowid"); $search_code = GETPOST("search_code", "alpha"); $search_ip = GETPOST("search_ip", "alpha"); $search_user = GETPOST("search_user", "alpha"); @@ -76,13 +76,13 @@ $optioncss = GETPOST("optioncss", "aZ"); // Option for the css output (always '' $now = dol_now(); $nowarray = dol_getdate($now); -if (GETPOST("date_startmonth", 'int') > 0) { - $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth", 'int'), GETPOST("date_startday", 'int'), GETPOST("date_startyear", 'int'), 'tzuserrel'); +if (GETPOSTINT("date_startmonth") > 0) { + $date_start = dol_mktime(0, 0, 0, GETPOSTINT("date_startmonth"), GETPOSTINT("date_startday"), GETPOSTINT("date_startyear"), 'tzuserrel'); } else { $date_start = ''; } -if (GETPOST("date_endmonth", 'int') > 0) { - $date_end = dol_get_last_hour(dol_mktime(23, 59, 59, GETPOST("date_endmonth", 'int'), GETPOST("date_endday", 'int'), GETPOST("date_endyear", 'int'), 'tzuserrel'), 'tzuserrel'); +if (GETPOSTINT("date_endmonth") > 0) { + $date_end = dol_get_last_hour(dol_mktime(23, 59, 59, GETPOSTINT("date_endmonth"), GETPOSTINT("date_endday"), GETPOSTINT("date_endyear"), 'tzuserrel'), 'tzuserrel'); } else { $date_end = ''; } diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 1254bdeedc7..4a1861be87b 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -47,10 +47,10 @@ if ($user->socid > 0) { $socid = $user->socid; } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index e23297cc251..04b8cee7488 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -35,7 +35,7 @@ if (!$user->admin) { accessforbidden(); } -$id = GETPOST('rowid', 'int'); +$id = GETPOSTINT('rowid'); $action = GETPOST('action', 'aZ09'); $optioncss = GETPOST('optionscss', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ09'); @@ -51,10 +51,10 @@ if ($mode == 'searchkey') { } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -120,7 +120,7 @@ if ($action == 'update') { if (!$error) { $db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transkey = '".$db->escape($transkey)."', transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".((int) GETPOST('rowid', 'int')); + $sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transkey = '".$db->escape($transkey)."', transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".(GETPOSTINT('rowid')); $result = $db->query($sql); if ($result) { $db->commit(); @@ -397,7 +397,7 @@ if ($mode == 'overwrite') { print ''."\n"; print ''; print ''; $coldisplay++; - print ''; $coldisplay++; diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index 484360aae04..20fdeceede1 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; $langs->loadLangs(array("agenda", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -54,10 +54,10 @@ if (GETPOST('actioncode', 'array')) { $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bookcal/availabilities_card.php b/htdocs/bookcal/availabilities_card.php index ae32bbe7b33..8845a16723b 100644 --- a/htdocs/bookcal/availabilities_card.php +++ b/htdocs/bookcal/availabilities_card.php @@ -34,9 +34,9 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; $langs->loadLangs(array("agenda", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOSTINT('lineid'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -148,10 +148,10 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; if ($action == 'set_thirdparty' && $permissiontoadd) { - $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); + $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', '', 'date', '', $user, $triggermodname); } if ($action == 'classin' && $permissiontoadd) { - $object->setProject(GETPOST('projectid', 'int')); + $object->setProject(GETPOSTINT('projectid')); } // Actions to send emails @@ -411,7 +411,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Show object lines $result = $object->getLinesArray(); - print ' + print ' @@ -429,7 +429,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1); + $object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1); } // Form to add new line diff --git a/htdocs/bookcal/availabilities_contact.php b/htdocs/bookcal/availabilities_contact.php index 07278fd60c7..cfd91d3b2f6 100644 --- a/htdocs/bookcal/availabilities_contact.php +++ b/htdocs/bookcal/availabilities_contact.php @@ -32,10 +32,10 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page $langs->loadLangs(array("agenda", "companies", "other", "mails")); -$id = (GETPOST('id') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOST('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$lineid = GETPOST('lineid', 'int'); -$socid = GETPOST('socid', 'int'); +$lineid = GETPOSTINT('lineid'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); // Initialize technical objects @@ -78,7 +78,7 @@ if (!$permissiontoread) { */ if ($action == 'addcontact' && $permission) { - $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $contactid = (GETPOST('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); @@ -95,7 +95,7 @@ if ($action == 'addcontact' && $permission) { } } elseif ($action == 'swapstatut' && $permission) { // Toggle the status of a contact - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } elseif ($action == 'deletecontact' && $permission) { // Deletes a contact $result = $object->delete_contact($lineid); diff --git a/htdocs/bookcal/availabilities_document.php b/htdocs/bookcal/availabilities_document.php index 723df675ef5..cbd0d169216 100644 --- a/htdocs/bookcal/availabilities_document.php +++ b/htdocs/bookcal/availabilities_document.php @@ -37,14 +37,14 @@ $langs->loadLangs(array("agenda", "companies", "other", "mails")); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); -$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$id = (GETPOSTINT('socid') ? GETPOSTINT('socid') : GETPOSTINT('id')); $ref = GETPOST('ref', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index ca40cc6bc95..a98a6beb8bb 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -37,12 +37,12 @@ require_once __DIR__.'/class/availabilities.class.php'; // Load translation files required by the page $langs->loadLangs(array("agenda", "other")); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -52,10 +52,10 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ' $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -93,8 +93,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -259,7 +259,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { - $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)).")"; + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; } else { $sql .= " WHERE 1 = 1"; } @@ -416,9 +416,9 @@ foreach ($search as $key => $val) { } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } @@ -440,7 +440,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/bookcal/availabilities_note.php b/htdocs/bookcal/availabilities_note.php index 5b8b4dee169..3f7bf24edee 100644 --- a/htdocs/bookcal/availabilities_note.php +++ b/htdocs/bookcal/availabilities_note.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; $langs->loadLangs(array("agenda", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/bookcal/bookcalindex.php b/htdocs/bookcal/bookcalindex.php index cbffda374fd..018a6914676 100644 --- a/htdocs/bookcal/bookcalindex.php +++ b/htdocs/bookcal/bookcalindex.php @@ -38,7 +38,7 @@ $action = GETPOST('action', 'aZ09'); // if (! $user->hasRight('bookcal', 'myobject', 'read')) { // accessforbidden(); // } -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if (isset($user->socid) && $user->socid > 0) { $action = ''; $socid = $user->socid; diff --git a/htdocs/bookcal/booking_list.php b/htdocs/bookcal/booking_list.php index 32d048a2b44..2503e170947 100644 --- a/htdocs/bookcal/booking_list.php +++ b/htdocs/bookcal/booking_list.php @@ -42,9 +42,9 @@ require_once __DIR__.'/class/calendar.class.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "other")); -$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $type = GETPOST('type', 'aZ09'); diff --git a/htdocs/bookcal/calendar_agenda.php b/htdocs/bookcal/calendar_agenda.php index deb1f993471..b7b2d319649 100644 --- a/htdocs/bookcal/calendar_agenda.php +++ b/htdocs/bookcal/calendar_agenda.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_calendar.lib.php'; $langs->loadLangs(array("bookcal@bookcal", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -53,10 +53,10 @@ if (GETPOST('actioncode', 'array')) { $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bookcal/calendar_card.php b/htdocs/bookcal/calendar_card.php index 45efc029195..6d8038b8d4a 100644 --- a/htdocs/bookcal/calendar_card.php +++ b/htdocs/bookcal/calendar_card.php @@ -84,9 +84,9 @@ dol_include_once('/bookcal/lib/bookcal_calendar.lib.php'); $langs->loadLangs(array("bookcal@bookcal", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOSTINT('lineid'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -204,10 +204,10 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; if ($action == 'set_thirdparty' && $permissiontoadd) { - $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); + $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', '', 'date', '', $user, $triggermodname); } if ($action == 'classin' && $permissiontoadd) { - $object->setProject(GETPOST('projectid', 'int')); + $object->setProject(GETPOSTINT('projectid')); } // Actions to send emails @@ -445,7 +445,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Show object lines $result = $object->getLinesArray(); - print ' + print ' @@ -463,7 +463,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1); + $object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1); } // Form to add new line diff --git a/htdocs/bookcal/calendar_contact.php b/htdocs/bookcal/calendar_contact.php index 8247fa2ca74..71821a0a8c3 100644 --- a/htdocs/bookcal/calendar_contact.php +++ b/htdocs/bookcal/calendar_contact.php @@ -62,10 +62,10 @@ dol_include_once('/bookcal/lib/bookcal_calendar.lib.php'); // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); -$id = (GETPOST('id') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOST('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$lineid = GETPOST('lineid', 'int'); -$socid = GETPOST('socid', 'int'); +$lineid = GETPOSTINT('lineid'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); // Initialize technical objects @@ -108,7 +108,7 @@ if (!$permissiontoread) { */ if ($action == 'addcontact' && $permission) { - $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $contactid = (GETPOST('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); @@ -125,7 +125,7 @@ if ($action == 'addcontact' && $permission) { } } elseif ($action == 'swapstatut' && $permission) { // Toggle the status of a contact - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } elseif ($action == 'deletecontact' && $permission) { // Deletes a contact $result = $object->delete_contact($lineid); diff --git a/htdocs/bookcal/calendar_document.php b/htdocs/bookcal/calendar_document.php index 96b8b5b4d83..4a71e5d6457 100644 --- a/htdocs/bookcal/calendar_document.php +++ b/htdocs/bookcal/calendar_document.php @@ -86,14 +86,14 @@ $langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); -$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$id = (GETPOSTINT('socid') ? GETPOSTINT('socid') : GETPOSTINT('id')); $ref = GETPOST('ref', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php index 9230edb9285..e8fc92b546d 100644 --- a/htdocs/bookcal/calendar_list.php +++ b/htdocs/bookcal/calendar_list.php @@ -36,7 +36,7 @@ $langs->loadLangs(array("bookcal@bookcal", "other")); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -45,14 +45,14 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -90,8 +90,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -256,7 +256,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { - $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)).")"; + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; } else { $sql .= " WHERE 1 = 1"; } @@ -398,9 +398,9 @@ foreach ($search as $key => $val) { } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } @@ -422,7 +422,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/bookcal/calendar_note.php b/htdocs/bookcal/calendar_note.php index 31f47504264..5f13b1129e6 100644 --- a/htdocs/bookcal/calendar_note.php +++ b/htdocs/bookcal/calendar_note.php @@ -80,7 +80,7 @@ dol_include_once('/bookcal/lib/bookcal_calendar.lib.php'); $langs->loadLangs(array("bookcal@bookcal", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index d9d887ab4d4..3e474c85762 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -34,12 +34,12 @@ $langs->loadLangs(array('bookmarks', 'other')); // Get Parameters -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); $action = GETPOST("action", "alpha"); $title = (string) GETPOST("title", "alpha"); $url = (string) GETPOST("url", "alpha"); $urlsource = GETPOST("urlsource", "alpha"); -$target = GETPOST("target", "int"); +$target = GETPOSTINT("target"); $userid = GETPOSTINT("userid"); $position = GETPOSTINT("position"); $backtopage = GETPOST('backtopage', 'alpha'); @@ -82,7 +82,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update') { } if ($action == 'update') { - $object->fetch(GETPOST("id", 'int')); + $object->fetch(GETPOSTINT("id")); } // Check if null because user not admin can't set an user and send empty value here. if (!empty($userid)) { @@ -183,18 +183,18 @@ if ($action == 'create') { if ($url && !preg_match('/^http/i', $url)) { $defaulttarget = 0; } - print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : $defaulttarget, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300'); + print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOSTINT('target') : $defaulttarget, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300'); print ''; // Visibility / Owner print ''; // Position print ''; print '
'.$obj->lang.''; - if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) { + if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) { print ''; } else { print $obj->transkey; @@ -411,7 +411,7 @@ if ($mode == 'overwrite') { print ''; print ''; */ - if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) { + if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) { print ''; } else { //print $obj->transkey.' '.$langsenfileonly->tab_translate[$obj->transkey]; @@ -426,7 +426,7 @@ if ($mode == 'overwrite') { print ''; - if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) { + if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) { print ''; print ''; print '   '; diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index ade787ae727..3bceb532a83 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -49,10 +49,10 @@ $actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"') $actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -238,7 +238,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { $db->begin(); $website = new Website($db); - $rowid = GETPOST('rowid', 'int'); + $rowid = GETPOSTINT('rowid'); $website->fetch($rowid); // Modify entry diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index 215ac230493..680cd961729 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -40,10 +40,10 @@ $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/asset/accountancy_codes.php b/htdocs/asset/accountancy_codes.php index 4641f61a021..f68e835a1ff 100644 --- a/htdocs/asset/accountancy_codes.php +++ b/htdocs/asset/accountancy_codes.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.ph $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index 181c9c209ef..7520dda55fc 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->loadLangs(array("assets", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -51,10 +51,10 @@ if (GETPOST('actioncode', 'array')) { $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 95459707381..434ee1f3318 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $langs->loadLangs(array("assets", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -123,10 +123,10 @@ if (empty($reshook)) { // Action dispose object if ($action == 'confirm_disposal' && $confirm == 'yes' && $permissiontoadd) { - $object->disposal_date = dol_mktime(12, 0, 0, GETPOST('disposal_datemonth', 'int'), GETPOST('disposal_dateday', 'int'), GETPOST('disposal_dateyear', 'int')); // for date without hour, we use gmt - $object->disposal_amount_ht = GETPOST('disposal_amount', 'int'); - $object->fk_disposal_type = GETPOST('fk_disposal_type', 'int'); - $disposal_invoice_id = GETPOST('disposal_invoice_id', 'int'); + $object->disposal_date = dol_mktime(12, 0, 0, GETPOSTINT('disposal_datemonth'), GETPOSTINT('disposal_dateday'), GETPOSTINT('disposal_dateyear')); // for date without hour, we use gmt + $object->disposal_amount_ht = GETPOSTINT('disposal_amount'); + $object->fk_disposal_type = GETPOSTINT('fk_disposal_type'); + $disposal_invoice_id = GETPOSTINT('disposal_invoice_id'); $object->disposal_depreciated = ((GETPOST('disposal_depreciated') == '1' || GETPOST('disposal_depreciated') == 'on') ? 1 : 0); $object->disposal_subject_to_vat = ((GETPOST('disposal_subject_to_vat') == '1' || GETPOST('disposal_subject_to_vat') == 'on') ? 1 : 0); @@ -136,7 +136,7 @@ if (empty($reshook)) { } $action = ''; } elseif ($action == "add") { - $object->supplier_invoice_id = GETPOST('supplier_invoice_id', 'int'); + $object->supplier_invoice_id = GETPOSTINT('supplier_invoice_id'); } // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen @@ -189,7 +189,7 @@ if ($action == 'create') { } if (GETPOSTISSET('supplier_invoice_id')) { $object->fields['supplier_invoice_id'] = array('type' => 'integer:FactureFournisseur:fourn/class/fournisseur.facture.class.php:1:entity IN (__SHARED_ENTITIES__)', 'label' => 'SupplierInvoice', 'enabled' => '1', 'noteditable' => '1', 'position' => 280, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => '1',); - print ''; + print ''; } print dol_get_fiche_head(array(), ''); @@ -266,10 +266,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Disposal $langs->load('bills'); - $disposal_date = dol_mktime(12, 0, 0, GETPOST('disposal_datemonth', 'int'), GETPOST('disposal_dateday', 'int'), GETPOST('disposal_dateyear', 'int')); // for date without hour, we use gmt - $disposal_amount = GETPOST('disposal_amount', 'int'); - $fk_disposal_type = GETPOST('fk_disposal_type', 'int'); - $disposal_invoice_id = GETPOST('disposal_invoice_id', 'int'); + $disposal_date = dol_mktime(12, 0, 0, GETPOSTINT('disposal_datemonth'), GETPOSTINT('disposal_dateday'), GETPOSTINT('disposal_dateyear')); // for date without hour, we use gmt + $disposal_amount = GETPOSTINT('disposal_amount'); + $fk_disposal_type = GETPOSTINT('fk_disposal_type'); + $disposal_invoice_id = GETPOSTINT('disposal_invoice_id'); $disposal_depreciated = GETPOSTISSET('disposal_depreciated') ? GETPOST('disposal_depreciated') : 1; $disposal_depreciated = !empty($disposal_depreciated) ? 1 : 0; $disposal_subject_to_vat = GETPOSTISSET('disposal_subject_to_vat') ? GETPOST('disposal_subject_to_vat') : 1; diff --git a/htdocs/asset/class/assetdepreciationoptions.class.php b/htdocs/asset/class/assetdepreciationoptions.class.php index 15b7f24c216..99497d1b23a 100644 --- a/htdocs/asset/class/assetdepreciationoptions.class.php +++ b/htdocs/asset/class/assetdepreciationoptions.class.php @@ -236,11 +236,11 @@ class AssetDepreciationOptions extends CommonObject if (in_array($field_info['type'], array('text', 'html'))) { $value = GETPOST($html_name, 'restricthtml'); } elseif ($field_info['type'] == 'date') { - $value = dol_mktime(12, 0, 0, GETPOST($html_name . 'month', 'int'), GETPOST($html_name . 'day', 'int'), GETPOST($html_name . 'year', 'int')); // for date without hour, we use gmt + $value = dol_mktime(12, 0, 0, GETPOSTINT($html_name . 'month'), GETPOSTINT($html_name . 'day'), GETPOSTINT($html_name . 'year')); // for date without hour, we use gmt } elseif ($field_info['type'] == 'datetime') { - $value = dol_mktime(GETPOST($html_name . 'hour', 'int'), GETPOST($html_name . 'min', 'int'), GETPOST($html_name . 'sec', 'int'), GETPOST($html_name . 'month', 'int'), GETPOST($html_name . 'day', 'int'), GETPOST($html_name . 'year', 'int'), 'tzuserrel'); + $value = dol_mktime(GETPOSTINT($html_name . 'hour'), GETPOSTINT($html_name . 'min'), GETPOSTINT($html_name . 'sec'), GETPOSTINT($html_name . 'month'), GETPOSTINT($html_name . 'day'), GETPOSTINT($html_name . 'year'), 'tzuserrel'); } elseif ($field_info['type'] == 'duration') { - $value = 60 * 60 * GETPOST($html_name . 'hour', 'int') + 60 * GETPOST($html_name . 'min', 'int'); + $value = 60 * 60 * GETPOSTINT($html_name . 'hour') + 60 * GETPOSTINT($html_name . 'min'); } elseif (preg_match('/^(integer|price|real|double)/', $field_info['type'])) { $value = price2num(GETPOST($html_name, 'alphanohtml')); // To fix decimal separator according to lang setup } elseif ($field_info['type'] == 'boolean') { diff --git a/htdocs/asset/depreciation.php b/htdocs/asset/depreciation.php index 6c8659aad9c..f20ccdbe7e7 100644 --- a/htdocs/asset/depreciation.php +++ b/htdocs/asset/depreciation.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.ph $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/depreciation_options.php b/htdocs/asset/depreciation_options.php index 0b771b216d5..6202e4f2b6f 100644 --- a/htdocs/asset/depreciation_options.php +++ b/htdocs/asset/depreciation_options.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.ph $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/disposal.php b/htdocs/asset/disposal.php index 98f07003db1..6ef7433061d 100644 --- a/htdocs/asset/disposal.php +++ b/htdocs/asset/disposal.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index 460b30d1a90..69112f6e619 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -37,14 +37,14 @@ $langs->loadLangs(array('assets', 'companies', 'other', 'mails')); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index a2f421410ea..427307532e2 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -36,7 +36,7 @@ $langs->loadLangs(array("assets", "other")); // Get parameters $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -44,13 +44,13 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'as $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'alpha'); // mode view (kanban or common) -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action @@ -87,8 +87,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -396,7 +396,7 @@ $arrayofmassactions = array( if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/asset/model/accountancy_codes.php b/htdocs/asset/model/accountancy_codes.php index 292c69defa7..61db2261bb1 100644 --- a/htdocs/asset/model/accountancy_codes.php +++ b/htdocs/asset/model/accountancy_codes.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/asset/class/assetaccountancycodes.class.php'; $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index e0b62ecec79..04739e21408 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; $langs->loadLangs(array("assets", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -51,10 +51,10 @@ if (GETPOST('actioncode', 'array')) { //$search_rowid = GETPOST('search_rowid'); //$search_agenda_label = GETPOST('search_agenda_label'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/asset/model/card.php b/htdocs/asset/model/card.php index 3ab71c675c4..31544663a62 100644 --- a/htdocs/asset/model/card.php +++ b/htdocs/asset/model/card.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/asset/class/assetaccountancycodes.class.php'; $langs->loadLangs(array("assets", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); diff --git a/htdocs/asset/model/depreciation_options.php b/htdocs/asset/model/depreciation_options.php index 0000f2bf723..5beeb1a7a33 100644 --- a/htdocs/asset/model/depreciation_options.php +++ b/htdocs/asset/model/depreciation_options.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.ph $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index 00db6f0417c..51033b5c2b1 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -34,7 +34,7 @@ $langs->loadLangs(array("assets", "other")); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -42,13 +42,13 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'as $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action @@ -87,8 +87,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -399,7 +399,7 @@ $arrayofmassactions = array( if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/asset/model/note.php b/htdocs/asset/model/note.php index 0476b6f4a57..e704b6ae390 100644 --- a/htdocs/asset/model/note.php +++ b/htdocs/asset/model/note.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/asset/class/assetmodel.class.php'; $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php index d2a89f96f0f..a87f252acc9 100644 --- a/htdocs/asset/note.php +++ b/htdocs/asset/note.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/tpl/depreciation_options_edit.tpl.php b/htdocs/asset/tpl/depreciation_options_edit.tpl.php index 649a00e0797..8031d3576f1 100644 --- a/htdocs/asset/tpl/depreciation_options_edit.tpl.php +++ b/htdocs/asset/tpl/depreciation_options_edit.tpl.php @@ -124,7 +124,7 @@ if (empty($reshook)) { print img_picto('', $field_info['picto'], '', false, 0, 0, '', 'pictofixedwidth'); } if (in_array($field_info['type'], array('int', 'integer'))) { - $value = GETPOSTISSET($html_name) ? GETPOST($html_name, 'int') : $assetdepreciationoptions->$field_key; + $value = GETPOSTISSET($html_name) ? GETPOSTINT($html_name) : $assetdepreciationoptions->$field_key; } elseif ($field_info['type'] == 'double') { $value = GETPOSTISSET($html_name) ? price2num(GETPOST($html_name, 'alphanohtml')) : $assetdepreciationoptions->$field_key; } elseif (preg_match('/^(text|html)/', $field_info['type'])) { diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 132c368114c..9f39d925bb6 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -45,10 +45,10 @@ $year = dol_print_date($now, '%Y'); $month = dol_print_date($now, '%m'); $day = dol_print_date($now, '%d'); $forbarcode = GETPOST('forbarcode', 'alphanohtml'); -$fk_barcode_type = GETPOST('fk_barcode_type', 'int'); +$fk_barcode_type = GETPOSTINT('fk_barcode_type'); $mode = GETPOST('mode', 'aZ09'); $modellabel = GETPOST("modellabel", 'aZ09'); // Doc template to use -$numberofsticker = GETPOST('numberofsticker', 'int'); +$numberofsticker = GETPOSTINT('numberofsticker'); $mesg = ''; @@ -86,8 +86,8 @@ if ($reshook < 0) { if (empty($reshook)) { if (GETPOST('submitproduct') && GETPOST('submitproduct')) { $action = ''; // We reset because we don't want to build doc - if (GETPOST('productid', 'int') > 0) { - $result = $producttmp->fetch(GETPOST('productid', 'int')); + if (GETPOSTINT('productid') > 0) { + $result = $producttmp->fetch(GETPOSTINT('productid')); if ($result < 0) { setEventMessage($producttmp->error, 'errors'); } @@ -105,8 +105,8 @@ if (empty($reshook)) { } if (GETPOST('submitthirdparty') && GETPOST('submitthirdparty')) { $action = ''; // We reset because we don't want to build doc - if (GETPOST('socid', 'int') > 0) { - $thirdpartytmp->fetch(GETPOST('socid', 'int')); + if (GETPOSTINT('socid') > 0) { + $thirdpartytmp->fetch(GETPOSTINT('socid')); $forbarcode = $thirdpartytmp->barcode; $fk_barcode_type = $thirdpartytmp->barcode_type_code; @@ -334,7 +334,7 @@ print '
'; print '
'; print $langs->trans("NumberOfStickers").'   '; print '
'; -print ''; +print ''; print '
'; print ''; @@ -410,7 +410,7 @@ if ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')) { print ''; print '
'; print '
'; - $form->select_produits(GETPOST('productid', 'int'), 'productid', '', '', 0, -1, 2, '', 0, array(), 0, '1', 0, 'minwidth400imp', 1); + $form->select_produits(GETPOSTINT('productid'), 'productid', '', '', 0, -1, 2, '', 0, array(), 0, '1', 0, 'minwidth400imp', 1); print '   '; print '
'; } @@ -419,7 +419,7 @@ if ($user->hasRight('societe', 'lire')) { print ''; print '
'; print '
'; - print $form->select_company(GETPOST('socid', 'int'), 'socid', '', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300'); + print $form->select_company(GETPOSTINT('socid'), 'socid', '', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300'); print '   '; print '
'; } diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index bb8cd151bbd..8978814dcb5 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -40,7 +40,7 @@ if (!$user->admin || empty($conf->blockedlog->enabled)) { // Get Parameters $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -$withtab = GETPOST('withtab', 'int'); +$withtab = GETPOSTINT('withtab'); /* diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 8a39531b7e0..6b4fbec24e3 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -46,17 +46,17 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bl $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$search_showonlyerrors = GETPOST('search_showonlyerrors', 'int'); +$search_showonlyerrors = GETPOSTINT('search_showonlyerrors'); if ($search_showonlyerrors < 0) { $search_showonlyerrors = 0; } -$search_startyear = GETPOST('search_startyear', 'int'); -$search_startmonth = GETPOST('search_startmonth', 'int'); -$search_startday = GETPOST('search_startday', 'int'); -$search_endyear = GETPOST('search_endyear', 'int'); -$search_endmonth = GETPOST('search_endmonth', 'int'); -$search_endday = GETPOST('search_endday', 'int'); +$search_startyear = GETPOSTINT('search_startyear'); +$search_startmonth = GETPOSTINT('search_startmonth'); +$search_startday = GETPOSTINT('search_startday'); +$search_endyear = GETPOSTINT('search_endyear'); +$search_endmonth = GETPOSTINT('search_endmonth'); +$search_endday = GETPOSTINT('search_endday'); $search_id = GETPOST('search_id', 'alpha'); $search_fk_user = GETPOST('search_fk_user', 'intcomma'); $search_start = -1; @@ -80,10 +80,10 @@ if (($search_start == -1 || empty($search_start)) && !GETPOSTISSET('search_start } // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -159,9 +159,9 @@ if ($action === 'downloadblockchain') { $sql = "SELECT rowid,date_creation,tms,user_fullname,action,amounts,element,fk_object,date_object,ref_object,signature,fk_user,object_data"; $sql .= " FROM ".MAIN_DB_PREFIX."blockedlog"; $sql .= " WHERE entity = ".$conf->entity; - if (GETPOST('monthtoexport', 'int') > 0 || GETPOST('yeartoexport', 'int') > 0) { - $dates = dol_get_first_day(GETPOST('yeartoexport', 'int'), GETPOST('monthtoexport', 'int') ? GETPOST('monthtoexport', 'int') : 1); - $datee = dol_get_last_day(GETPOST('yeartoexport', 'int'), GETPOST('monthtoexport', 'int') ? GETPOST('monthtoexport', 'int') : 12); + if (GETPOSTINT('monthtoexport') > 0 || GETPOSTINT('yeartoexport') > 0) { + $dates = dol_get_first_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 1); + $datee = dol_get_last_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 12); $sql .= " AND date_creation BETWEEN '".$db->idate($dates)."' AND '".$db->idate($datee)."'"; } $sql .= " ORDER BY rowid ASC"; // Required so we get the first one @@ -189,9 +189,9 @@ if ($action === 'downloadblockchain') { $sql = "SELECT rowid, date_creation, tms, user_fullname, action, amounts, element, fk_object, date_object, ref_object, signature, fk_user, object_data, object_version"; $sql .= " FROM ".MAIN_DB_PREFIX."blockedlog"; $sql .= " WHERE entity = ".((int) $conf->entity); - if (GETPOST('monthtoexport', 'int') > 0 || GETPOST('yeartoexport', 'int') > 0) { - $dates = dol_get_first_day(GETPOST('yeartoexport', 'int'), GETPOST('monthtoexport', 'int') ? GETPOST('monthtoexport', 'int') : 1); - $datee = dol_get_last_day(GETPOST('yeartoexport', 'int'), GETPOST('monthtoexport', 'int') ? GETPOST('monthtoexport', 'int') : 12); + if (GETPOSTINT('monthtoexport') > 0 || GETPOSTINT('yeartoexport') > 0) { + $dates = dol_get_first_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 1); + $datee = dol_get_last_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 12); $sql .= " AND date_creation BETWEEN '".$db->idate($dates)."' AND '".$db->idate($datee)."'"; } $sql .= " ORDER BY rowid ASC"; // Required so later we can use the parameter $previoushash of checkSignature() @@ -200,7 +200,7 @@ if ($action === 'downloadblockchain') { if ($res) { header('Content-Type: application/octet-stream'); header("Content-Transfer-Encoding: Binary"); - header("Content-disposition: attachment; filename=\"unalterable-log-archive-".$dolibarr_main_db_name."-".(GETPOST('yeartoexport', 'int') > 0 ? GETPOST('yeartoexport', 'int').(GETPOST('monthtoexport', 'int') > 0 ? sprintf("%02d", GETPOST('monthtoexport', 'int')) : '').'-' : '').$previoushash.".csv\""); + header("Content-disposition: attachment; filename=\"unalterable-log-archive-".$dolibarr_main_db_name."-".(GETPOSTINT('yeartoexport') > 0 ? GETPOSTINT('yeartoexport').(GETPOSTINT('monthtoexport') > 0 ? sprintf("%02d", GETPOSTINT('monthtoexport')) : '').'-' : '').$previoushash.".csv\""); print $langs->transnoentities('Id') .';'.$langs->transnoentities('Date') @@ -379,7 +379,7 @@ print ''; print '
'; print $langs->trans("RestrictYearToExport").': '; -$smonth = GETPOST('monthtoexport', 'int'); +$smonth = GETPOSTINT('monthtoexport'); // Month $retstring = ''; $retstring .= '"; print $retstring; -print ''; +print ''; print ''; print ''; if (getDolGlobalString('BLOCKEDLOG_USE_REMOTE_AUTHORITY')) { diff --git a/htdocs/blockedlog/ajax/block-add.php b/htdocs/blockedlog/ajax/block-add.php index e2009a01da1..cebd9151b5b 100644 --- a/htdocs/blockedlog/ajax/block-add.php +++ b/htdocs/blockedlog/ajax/block-add.php @@ -38,7 +38,7 @@ if (!defined('NOREQUIREHTML')) { $res = require '../../main.inc.php'; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $element = GETPOST('element', 'alpha'); $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/blockedlog/ajax/block-info.php b/htdocs/blockedlog/ajax/block-info.php index 8660ebbbc82..66d146cc533 100644 --- a/htdocs/blockedlog/ajax/block-info.php +++ b/htdocs/blockedlog/ajax/block-info.php @@ -41,7 +41,7 @@ if (!defined('NOREQUIREHTML')) { require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $block = new BlockedLog($db); if ((!$user->admin && !$user->hasRight('blockedlog', 'read')) || empty($conf->blockedlog->enabled)) { diff --git a/htdocs/bom/ajax/ajax.php b/htdocs/bom/ajax/ajax.php index eddb8a40dc5..943230cbed7 100644 --- a/htdocs/bom/ajax/ajax.php +++ b/htdocs/bom/ajax/ajax.php @@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; $action = GETPOST('action', 'aZ09'); -$idproduct = GETPOST('idproduct', 'int'); +$idproduct = GETPOSTINT('idproduct'); /* diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index d4fb24d6daa..82d832319c1 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -35,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; $langs->loadLangs(array('mrp', 'other')); // Get parameters -$id = GETPOST('id', 'int'); -$socid = GETPOST('socid', 'int'); +$id = GETPOSTINT('id'); +$socid = GETPOSTINT('socid'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); @@ -56,10 +56,10 @@ $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); // Load variables for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 9abba40be0c..c4db4c61421 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -36,8 +36,8 @@ require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp.lib.php'; $langs->loadLangs(array('mrp', 'other')); // Get parameters -$id = GETPOST('id', 'int'); -$lineid = GETPOST('lineid', 'int'); +$id = GETPOSTINT('id'); +$lineid = GETPOSTINT('lineid'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -47,9 +47,9 @@ $backtopage = GETPOST('backtopage', 'alpha'); // PDF -$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); -$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); -$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); +$hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); +$hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); +$hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); // Initialize technical objects $object = new BOM($db); @@ -155,7 +155,7 @@ if (empty($reshook)) { $predef = ''; // Set if we used free entry or predefined product - $bom_child_id = (int) GETPOST('bom_id', 'int'); + $bom_child_id = GETPOSTINT('bom_id'); if ($bom_child_id > 0) { $bom_child = new BOM($db); $res = $bom_child->fetch($bom_child_id); @@ -163,12 +163,12 @@ if (empty($reshook)) { $idprod = $bom_child->fk_product; } } else { - $idprod = (!empty(GETPOST('idprodservice', 'int')) ? GETPOST('idprodservice', 'int') : (int) GETPOST('idprod', 'int')); + $idprod = (!empty(GETPOSTINT('idprodservice')) ? GETPOSTINT('idprodservice') : GETPOSTINT('idprod')); } $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); - $disable_stock_change = GETPOST('disable_stock_change', 'int'); + $disable_stock_change = GETPOSTINT('disable_stock_change'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); $fk_unit = GETPOST('fk_unit', 'alphanohtml'); @@ -247,7 +247,7 @@ if (empty($reshook)) { // Set if we used free entry or predefined product $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); - $disable_stock_change = GETPOST('disable_stock_change', 'int'); + $disable_stock_change = GETPOSTINT('disable_stock_change'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); $fk_unit = GETPOST('fk_unit', 'alphanohtml'); @@ -608,7 +608,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); + $object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1, '/bom/tpl'); } // Form to add new line @@ -660,7 +660,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); + $object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1, '/bom/tpl'); } // Form to add new line diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index df5a9044bf5..67ef5c7e1c7 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -37,7 +37,7 @@ $langs->loadLangs(array("mrp", "companies", "other", "mails")); // Get parameters $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$id = (GETPOSTINT('socid') ? GETPOSTINT('socid') : GETPOSTINT('id')); $ref = GETPOST('ref', 'alpha'); // Security check - Protection if external user @@ -46,10 +46,10 @@ $ref = GETPOST('ref', 'alpha'); // $result = restrictedArea($user, 'bom', $id); // Load variables for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index a4d3be63e5f..cd6aaf1eaee 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -33,10 +33,10 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $langs->loadLangs(array('mrp', 'other')); // Get Parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -47,7 +47,7 @@ $mode = GETPOST('mode', 'aZ'); // mode view (kanban or common) // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page'); @@ -89,8 +89,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -322,7 +322,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { - $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)).")"; + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; } else { $sql .= " WHERE 1 = 1"; } @@ -457,9 +457,9 @@ foreach ($search as $key => $val) { } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } @@ -480,7 +480,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index 52b472428b6..00383849710 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; $langs->loadLangs(array("mrp", "other", "stocks")); // Get parameters -$id = GETPOST('id', 'int'); -$lineid = GETPOST('lineid', 'int'); +$id = GETPOSTINT('id'); +$lineid = GETPOSTINT('lineid'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); diff --git a/htdocs/bom/bom_note.php b/htdocs/bom/bom_note.php index aba22ade7ca..5237fc30066 100644 --- a/htdocs/bom/bom_note.php +++ b/htdocs/bom/bom_note.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; $langs->loadLangs(array("mrp", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 3791531ed5a..cf927bc763c 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -120,9 +120,9 @@ if (isModEnabled("product") || isModEnabled("service")) { $statustoshow = -1; if (getDolGlobalString('ENTREPOT_EXTRA_STATUS')) { // hide products in closed warehouse, but show products for internal transfer - print $form->select_produits(GETPOST('idprod', 'int'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'), 1); + print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOSTINT('combinations'), 1); } else { - print $form->select_produits(GETPOST('idprod', 'int'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'), 1); + print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOSTINT('combinations'), 1); } $urltocreateproduct = DOL_URL_ROOT.'/product/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id); print ''; diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index 6f4ad4e5a85..5535f3dbf5a 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -138,11 +138,11 @@ if ($filtertype != 1) { } $coldisplay++; - print '
qty_frozen ? ' checked="checked"' : '')) . '>'; + print 'qty_frozen ? ' checked="checked"' : '')) . '>'; print 'disable_stock_change ? ' checked="checked"' : '')) . '">'; + print 'disable_stock_change ? ' checked="checked"' : '')) . '">'; print ' '.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'
'.$langs->trans("Visibility").''; print img_picto('', 'user', 'class="pictofixedwidth"'); - print $form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx'); + print $form->select_dolusers(GETPOSTISSET('userid') ? GETPOSTINT('userid') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx'); print '
'.$langs->trans("Position").''; - print 'position).'">'; + print 'position).'">'; print '
'; @@ -284,7 +284,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { print ''.$langs->trans("Visibility").''; if ($action == 'edit' && $user->admin) { print img_picto('', 'user', 'class="pictofixedwidth"'); - print $form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx'); + print $form->select_dolusers(GETPOSTISSET('userid') ? GETPOSTINT('userid') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx'); } else { if ($object->fk_user > 0) { $fuser = new User($db); @@ -299,7 +299,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { // Position print ''.$langs->trans("Position").''; if ($action == 'edit') { - print 'position).'">'; + print 'position).'">'; } else { print $object->position; } diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index b22c1d294b4..50212e04137 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -31,7 +31,7 @@ $langs->loadLangs(array('bookmarks', 'admin')); // Get Parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); @@ -40,14 +40,14 @@ $backtopage = GETPOST('backtopage', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); $mode = GETPOST('mode', 'aZ'); -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); $search_title = GETPOST('search_title', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -247,7 +247,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 9d66e35f9f1..06510e44aa7 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->load("categories"); // Security check -$socid = (int) GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if (!$user->hasRight('categorie', 'lire')) { accessforbidden(); } @@ -45,7 +45,7 @@ if (!$user->hasRight('categorie', 'lire')) { $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $origin = GETPOST('origin', 'alpha'); -$catorigin = (int) GETPOST('catorigin', 'int'); +$catorigin = GETPOSTINT('catorigin'); $type = GETPOST('type', 'aZ09'); $urlfrom = GETPOST('urlfrom', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -53,9 +53,9 @@ $backtopage = GETPOST('backtopage', 'alpha'); $label = (string) GETPOST('label', 'alphanohtml'); $description = (string) GETPOST('description', 'restricthtml'); $color = preg_replace('/[^0-9a-f#]/i', '', (string) GETPOST('color', 'alphanohtml')); -$position = (int) GETPOST('position', 'int'); -$visible = (int) GETPOST('visible', 'int'); -$parent = (int) GETPOST('parent', 'int'); +$position = GETPOSTINT('position'); +$visible = GETPOSTINT('visible'); +$parent = GETPOSTINT('parent'); if ($origin) { if ($type == Categorie::TYPE_PRODUCT) { diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 16965accb55..a3fe18a25c1 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -34,20 +34,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Load translation files required by the page $langs->load("categories"); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alphanohtml'); $action = (GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'edit'); $confirm = GETPOST('confirm'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$socid = (int) GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $label = (string) GETPOST('label', 'alphanohtml'); $description = (string) GETPOST('description', 'restricthtml'); $color = preg_replace('/[^0-9a-f#]/i', '', (string) GETPOST('color', 'alphanohtml')); -$position = (int) GETPOST('position', 'int'); -$visible = (int) GETPOST('visible', 'int'); -$parent = (int) GETPOST('parent', 'int'); +$position = GETPOSTINT('position'); +$visible = GETPOSTINT('visible'); +$parent = GETPOSTINT('parent'); if ($id == "") { dol_print_error(null, 'Missing parameter id'); diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index eb322bbeb3f..d3eeb6b8e16 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -36,10 +36,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // Load translation files required by the page $langs->load("categories"); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $type = (GETPOST('type', 'aZ09') ? GETPOST('type', 'aZ09') : Categorie::TYPE_PRODUCT); $catname = GETPOST('catname', 'alpha'); -$nosearch = GETPOST('nosearch', 'int'); +$nosearch = GETPOSTINT('nosearch'); $categstatic = new Categorie($db); if (is_numeric($type)) { diff --git a/htdocs/categories/info.php b/htdocs/categories/info.php index aceabfdaffb..59dedc1312e 100644 --- a/htdocs/categories/info.php +++ b/htdocs/categories/info.php @@ -37,7 +37,7 @@ if (!$user->hasRight('categorie', 'lire')) { $langs->loadLangs(array('categories', 'sendings')); $socid = 0; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $label = GETPOST('label', 'alpha'); // Security check diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 4757aab5fdd..bd40d078fa1 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php'; $langs->loadlangs(array('categories', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $label = GETPOST('label', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 9293c62219b..1665c80150d 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Load translation files required by the page $langs->loadLangs(array('categories', 'languages')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $label = GETPOST('label', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index a7a13ff64d1..ddfe5fc9946 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -37,14 +37,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Load translation files required by the page $langs->loadLangs(array("categories", "compta")); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $label = GETPOST('label', 'alpha'); -$removeelem = GETPOST('removeelem', 'int'); -$elemid = GETPOST('elemid', 'int'); +$removeelem = GETPOSTINT('removeelem'); +$elemid = GETPOSTINT('elemid'); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -54,10 +54,10 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/collab/index.php b/htdocs/collab/index.php index 746cc019a8b..bee5d778dc7 100644 --- a/htdocs/collab/index.php +++ b/htdocs/collab/index.php @@ -41,7 +41,7 @@ $conf->dol_hide_leftmenu = 1; // Force hide of left menu. $error = 0; $website = GETPOST('website', 'alpha'); $page = GETPOST('page', 'alpha'); -$pageid = GETPOST('pageid', 'int'); +$pageid = GETPOSTINT('pageid'); $action = GETPOST('action', 'aZ09'); if (GETPOST('delete')) { diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index cc5c5c1c8dd..bcad30ffa91 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -58,15 +58,15 @@ $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $socpeopleassigned = GETPOST('socpeopleassigned', 'array'); $origin = GETPOST('origin', 'alpha'); -$originid = GETPOST('originid', 'int'); +$originid = GETPOSTINT('originid'); $confirm = GETPOST('confirm', 'alpha'); $fulldayevent = GETPOST('fullday', 'alpha'); -$aphour = GETPOST('aphour', 'int'); -$apmin = GETPOST('apmin', 'int'); -$p2hour = GETPOST('p2hour', 'int'); -$p2min = GETPOST('p2min', 'int'); +$aphour = GETPOSTINT('aphour'); +$apmin = GETPOSTINT('apmin'); +$p2hour = GETPOSTINT('p2hour'); +$p2min = GETPOSTINT('p2min'); $addreminder = GETPOST('addreminder', 'alpha'); $offsetvalue = GETPOSTINT('offsetvalue'); @@ -82,12 +82,12 @@ if ($complete == 'na' || $complete == -2) { if ($fulldayevent) { $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); // For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere) - $datep = dol_mktime('00', '00', 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); - $datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datep = dol_mktime('00', '00', 0, GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datef = dol_mktime('23', '59', '59', GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), $tzforfullday ? $tzforfullday : 'tzuserrel'); //print $db->idate($datep); exit; } else { - $datep = dol_mktime($aphour, $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel'); - $datef = dol_mktime($p2hour, $p2min, '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel'); + $datep = dol_mktime($aphour, $apmin, 0, GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel'); + $datef = dol_mktime($p2hour, $p2min, '59', GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel'); } $reg = array(); if (GETPOST('datep')) { @@ -99,8 +99,8 @@ if (GETPOST('datep')) { } // Security check -$socid = GETPOST('socid', 'int'); -$id = GETPOST('id', 'int'); +$socid = GETPOSTINT('socid'); +$id = GETPOSTINT('id'); if ($user->socid && ($socid != $user->socid)) { accessforbidden(); } @@ -269,7 +269,7 @@ if (empty($reshook) && (GETPOST('addassignedtoresource') || GETPOST('updateassig if (empty($reshook) && $action == 'classin' && ($user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->hasRight('agenda', 'myactions', 'create')))) { //$object->fetch($id); - $object->setProject(GETPOST('projectid', 'int')); + $object->setProject(GETPOSTINT('projectid')); } // Action clone object @@ -283,7 +283,7 @@ if (empty($reshook) && $action == 'confirm_clone' && $confirm == 'yes') { reset($object->socpeopleassigned); $object->contact_id = key($object->socpeopleassigned); } - $result = $object->createFromClone($user, GETPOST('socid', 'int')); + $result = $object->createFromClone($user, GETPOSTINT('socid')); if ($result > 0) { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); exit(); @@ -316,17 +316,17 @@ if (empty($reshook) && $action == 'add') { exit; } - $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status + $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOSTINT("percentage")); // If status is -1 or 100, percentage is not defined and we must use status // Clean parameters if ($fulldayevent) { $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); // For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere) - $datep = dol_mktime('00', '00', '00', GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); - $datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datep = dol_mktime('00', '00', '00', GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datef = dol_mktime('23', '59', '59', GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), $tzforfullday ? $tzforfullday : 'tzuserrel'); } else { - $datep = dol_mktime(GETPOST("aphour", 'int'), GETPOST("apmin", 'int'), GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel'); - $datef = dol_mktime(GETPOST("p2hour", 'int'), GETPOST("p2min", 'int'), GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel'); + $datep = dol_mktime(GETPOSTINT("aphour"), GETPOSTINT("apmin"), GETPOSTINT("apsec"), GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel'); + $datef = dol_mktime(GETPOSTINT("p2hour"), GETPOSTINT("p2min"), GETPOSTINT("apsec"), GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel'); } // Check parameters @@ -356,7 +356,7 @@ if (empty($reshook) && $action == 'add') { if (!$error) { // Initialisation object actioncomm - $object->priority = GETPOSTISSET("priority") ? GETPOST("priority", "int") : 0; + $object->priority = GETPOSTISSET("priority") ? GETPOSTINT("priority") : 0; $object->fulldayevent = ($fulldayevent ? 1 : 0); $object->location = GETPOST("location", 'alphanohtml'); $object->label = GETPOST('label', 'alphanohtml'); @@ -386,7 +386,7 @@ if (empty($reshook) && $action == 'add') { } } } - $object->fk_project = GETPOSTISSET("projectid") ? GETPOST("projectid", 'int') : 0; + $object->fk_project = GETPOSTISSET("projectid") ? GETPOSTINT("projectid") : 0; $taskid = GETPOSTINT('taskid'); if (!empty($taskid)) { @@ -437,7 +437,7 @@ if (empty($reshook) && $action == 'add') { $object->contact = $contact; } - if (GETPOST('socid', 'int') > 0) { + if (GETPOSTINT('socid') > 0) { $object->socid = GETPOSTINT('socid'); $object->fetch_thirdparty(); @@ -511,7 +511,7 @@ if (empty($reshook) && $action == 'add') { if ($userepeatevent && !empty($selectedrecurrulefreq) && $selectedrecurrulefreq != 'no') { $eventisrecurring = 1; $object->recurid = dol_print_date(dol_now('gmt'), 'dayhourlog', 'gmt'); - $object->recurdateend = dol_mktime(0, 0, 0, GETPOST('limitmonth', 'int'), GETPOST('limitday', 'int'), GETPOST('limityear', 'int')); + $object->recurdateend = dol_mktime(0, 0, 0, GETPOSTINT('limitmonth'), GETPOSTINT('limitday'), GETPOSTINT('limityear')); } else { unset($object->recurid); unset($object->recurrule); @@ -609,22 +609,22 @@ if (empty($reshook) && $action == 'add') { if ($eventisrecurring) { // We set first date of recurrence and offsets if ($selectedrecurrulefreq == 'WEEKLY' && !empty($selectedrecurrulebyday)) { - $firstdatearray = dol_get_first_day_week(GETPOST("apday", 'int'), GETPOST("apmonth", 'int'), GETPOST("apyear", 'int')); - $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), $firstdatearray['month'], $firstdatearray['first_day'], $firstdatearray['year'], $tzforfullday ? $tzforfullday : 'tzuserrel'); + $firstdatearray = dol_get_first_day_week(GETPOSTINT("apday"), GETPOSTINT("apmonth"), GETPOSTINT("apyear")); + $datep = dol_mktime($fulldayevent ? '00' : GETPOSTINT("aphour"), $fulldayevent ? '00' : GETPOSTINT("apmin"), $fulldayevent ? '00' : GETPOSTINT("apsec"), $firstdatearray['month'], $firstdatearray['first_day'], $firstdatearray['year'], $tzforfullday ? $tzforfullday : 'tzuserrel'); $datep = dol_time_plus_duree($datep, $selectedrecurrulebyday + 6, 'd');//We begin the week after $dayoffset = 7; $monthoffset = 0; } elseif ($selectedrecurrulefreq == 'MONTHLY' && !empty($selectedrecurrulebymonthday)) { $firstday = $selectedrecurrulebymonthday; - $firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOST("apmonth", 'int') + 1 : GETPOST("apmonth", 'int');//We begin the week after - $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), $firstmonth, $firstday, GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOSTINT("apmonth") + 1 : GETPOSTINT("apmonth");//We begin the week after + $datep = dol_mktime($fulldayevent ? '00' : GETPOSTINT("aphour"), $fulldayevent ? '00' : GETPOSTINT("apmin"), $fulldayevent ? '00' : GETPOSTINT("apsec"), $firstmonth, $firstday, GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel'); $dayoffset = 0; $monthoffset = 1; } else { $error++; } // End date - $repeateventlimitdate = dol_mktime(23, 59, 59, GETPOSTISSET("limitmonth") ? GETPOST("limitmonth", 'int') : 1, GETPOSTISSET("limitday") ? GETPOST("limitday", 'int') : 1, GETPOSTISSET("limityear") && GETPOST("limityear", 'int') < 2100 ? GETPOST("limityear", 'int') : 2100, $tzforfullday ? $tzforfullday : 'tzuserrel'); + $repeateventlimitdate = dol_mktime(23, 59, 59, GETPOSTISSET("limitmonth") ? GETPOSTINT("limitmonth") : 1, GETPOSTISSET("limitday") ? GETPOSTINT("limitday") : 1, GETPOSTISSET("limityear") && GETPOSTINT("limityear") < 2100 ? GETPOSTINT("limityear") : 2100, $tzforfullday ? $tzforfullday : 'tzuserrel'); // Set date of end of event $deltatime = num_between_day($object->datep, $datep); $datef = dol_time_plus_duree($datef, $deltatime, 'd'); @@ -743,11 +743,11 @@ if (empty($reshook) && $action == 'add') { if (empty($reshook) && $action == 'update') { if (empty($cancel)) { $fulldayevent = GETPOST('fullday'); - $aphour = GETPOST('aphour', 'int'); - $apmin = GETPOST('apmin', 'int'); - $p2hour = GETPOST('p2hour', 'int'); - $p2min = GETPOST('p2min', 'int'); - $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status + $aphour = GETPOSTINT('aphour'); + $apmin = GETPOSTINT('apmin'); + $p2hour = GETPOSTINT('p2hour'); + $p2min = GETPOSTINT('p2min'); + $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOSTINT("percentage")); // If status is -1 or 100, percentage is not defined and we must use status // Clean parameters if ($aphour == -1) { @@ -772,11 +772,11 @@ if (empty($reshook) && $action == 'update') { if ($fulldayevent) { $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); // For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere) - $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); - $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datep = dol_mktime($fulldayevent ? '00' : GETPOSTINT("aphour"), $fulldayevent ? '00' : GETPOSTINT("apmin"), $fulldayevent ? '00' : GETPOSTINT("apsec"), GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datef = dol_mktime($fulldayevent ? '23' : GETPOSTINT("p2hour"), $fulldayevent ? '59' : GETPOSTINT("p2min"), $fulldayevent ? '59' : GETPOSTINT("apsec"), GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), $tzforfullday ? $tzforfullday : 'tzuserrel'); } else { - $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel'); - $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel'); + $datep = dol_mktime($fulldayevent ? '00' : GETPOSTINT("aphour"), $fulldayevent ? '00' : GETPOSTINT("apmin"), $fulldayevent ? '00' : GETPOSTINT("apsec"), GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel'); + $datef = dol_mktime($fulldayevent ? '23' : GETPOSTINT("p2hour"), $fulldayevent ? '59' : GETPOSTINT("p2min"), $fulldayevent ? '59' : GETPOSTINT("apsec"), GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel'); } if ($object->elementtype == 'ticket') { // code should be TICKET_MSG, TICKET_MSG_PRIVATE, TICKET_MSG_SENTBYMAIL, TICKET_MSG_PRIVATE_SENTBYMAIL @@ -805,21 +805,21 @@ if (empty($reshook) && $action == 'update') { $object->datep = $datep; $object->datef = $datef; $object->percentage = $percentage; - $object->priority = GETPOST("priority", "int"); + $object->priority = GETPOSTINT("priority"); $object->fulldayevent = GETPOST("fullday") ? 1 : 0; $object->location = GETPOST('location', "alphanohtml"); - $object->socid = GETPOST("socid", "int"); + $object->socid = GETPOSTINT("socid"); $socpeopleassigned = GETPOST("socpeopleassigned", 'array'); $object->socpeopleassigned = array(); foreach ($socpeopleassigned as $cid) { $object->socpeopleassigned[$cid] = array('id' => $cid); } - $object->contact_id = GETPOST("contactid", 'int'); + $object->contact_id = GETPOSTINT("contactid"); if (empty($object->contact_id) && !empty($object->socpeopleassigned)) { reset($object->socpeopleassigned); $object->contact_id = key($object->socpeopleassigned); } - $object->fk_project = GETPOST("projectid", 'int'); + $object->fk_project = GETPOSTINT("projectid"); $object->note_private = trim(GETPOST("note", "restricthtml")); if (GETPOST("elementtype", 'alpha')) { @@ -830,7 +830,7 @@ if (empty($reshook) && $action == 'update') { $hasPermissionOnLinkedObject = 1; } if ($hasPermissionOnLinkedObject) { - $object->fk_element = GETPOST("fk_element", 'int'); + $object->fk_element = GETPOSTINT("fk_element"); $object->elementtype = GETPOST("elementtype", 'alpha'); } } @@ -876,7 +876,7 @@ if (empty($reshook) && $action == 'update') { if (getDolGlobalString('AGENDA_ENABLE_DONEBY')) { if (GETPOST("doneby")) { - $object->userdoneid = GETPOST("doneby", "int"); + $object->userdoneid = GETPOSTINT("doneby"); } } @@ -1448,7 +1448,7 @@ if ($action == 'create') { // Done by if (getDolGlobalString('AGENDA_ENABLE_DONEBY')) { print ''.$langs->trans("ActionDoneBy").''; - print $form->select_dolusers(GETPOSTISSET("doneby") ? GETPOST("doneby", 'int') : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1); + print $form->select_dolusers(GETPOSTISSET("doneby") ? GETPOSTINT("doneby") : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1); print ''; } @@ -1498,7 +1498,7 @@ if ($action == 'create') { if (GETPOSTISSET('status')) { $percent = GETPOST('status'); } elseif (GETPOSTISSET('percentage')) { - $percent = GETPOST('percentage', 'int'); + $percent = GETPOSTINT('percentage'); } else { if ($complete == '0' || GETPOST("afaire") == 1) { $percent = '0'; @@ -1520,11 +1520,11 @@ if ($action == 'create') { if (isModEnabled("societe")) { // Related company print ''.$langs->trans("ActionOnCompany").''; - if (GETPOST('socid', 'int') > 0) { + if (GETPOSTINT('socid') > 0) { $societe = new Societe($db); - $societe->fetch(GETPOST('socid', 'int')); + $societe->fetch(GETPOSTINT('socid')); print $societe->getNomUrl(1); - print ''; + print ''; } else { $events = array(); $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); @@ -1540,11 +1540,11 @@ if ($action == 'create') { // Related contact print ''.$langs->trans("ActionOnContact").''; $preselectedids = GETPOST('socpeopleassigned', 'array'); - if (GETPOST('contactid', 'int')) { - $preselectedids[GETPOST('contactid', 'int')] = GETPOST('contactid', 'int'); + if (GETPOSTINT('contactid')) { + $preselectedids[GETPOSTINT('contactid')] = GETPOSTINT('contactid'); } if ($origin=='contact') { - $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int'); + $preselectedids[GETPOSTINT('originid')] = GETPOSTINT('originid'); } // select "all" or "none" contact by default if (getDolGlobalInt('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT')) { @@ -1561,7 +1561,7 @@ if ($action == 'create') { if (isModEnabled('project')) { $langs->load("projects"); - $projectid = GETPOST('projectid', 'int'); + $projectid = GETPOSTINT('projectid'); print ''.$langs->trans("Project").''; print img_picto('', 'project', 'class="pictofixedwidth"'); @@ -1596,7 +1596,7 @@ if ($action == 'create') { $projectsListId = $projectid; } - $tid = GETPOSTISSET("projecttaskid") ? GETPOST("projecttaskid", 'int') : (GETPOSTISSET("taskid") ? GETPOST("taskid", 'int') : ''); + $tid = GETPOSTISSET("projecttaskid") ? GETPOSTINT("projecttaskid") : (GETPOSTISSET("taskid") ? GETPOSTINT("taskid") : ''); $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', $projectsListId); print ''; @@ -1632,7 +1632,7 @@ if ($action == 'create') { // Priority if (getDolGlobalString('AGENDA_SUPPORT_PRIORITY_IN_EVENTS')) { print ''.$langs->trans("Priority").''; - print ''; + print ''; print ''; } @@ -1744,10 +1744,10 @@ if ($id > 0) { $result5 = $object->fetch_optionals(); if ($listUserAssignedUpdated || $donotclearsession) { - $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status + $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOSTINT("percentage")); // If status is -1 or 100, percentage is not defined and we must use status - $datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel'); - $datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel'); + $datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel'); + $datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel'); $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm'); $object->label = GETPOST("label", "alphanohtml"); @@ -1757,13 +1757,13 @@ if ($id > 0) { $object->priority = GETPOST("priority", "alphanohtml"); $object->fulldayevent = GETPOST("fullday") ? 1 : 0; $object->location = GETPOST('location', "alphanohtml"); - $object->socid = GETPOST("socid", "int"); + $object->socid = GETPOSTINT("socid"); $socpeopleassigned = GETPOST("socpeopleassigned", 'array'); foreach ($socpeopleassigned as $tmpid) { $object->socpeopleassigned[$id] = array('id' => $tmpid); } - $object->contact_id = GETPOST("contactid", 'int'); - $object->fk_project = GETPOST("projectid", 'int'); + $object->contact_id = GETPOSTINT("contactid"); + $object->fk_project = GETPOSTINT("projectid"); $object->note_private = GETPOST("note", 'restricthtml'); } @@ -2022,7 +2022,7 @@ if ($id > 0) { // Status print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - $percent = GETPOSTISSET("percentage") ? GETPOST("percentage", "int") : $object->percentage; + $percent = GETPOSTISSET("percentage") ? GETPOSTINT("percentage") : $object->percentage; $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); print ''; diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index a27f7bfef20..44107ddaaf1 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -42,12 +42,12 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('companies', 'commercial', 'other', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } @@ -67,10 +67,10 @@ if ($id > 0) { $hookmanager->initHooks(array('actioncard', 'globalcard')); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 62b5600af50..338887acab2 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -51,13 +51,13 @@ if (!getDolGlobalString('AGENDA_EXT_NB')) { $MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB'); $DELAYFORCACHE = 300; // 300 seconds -$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int'); +$disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); -$check_holiday = GETPOST('check_holiday', 'int'); +$check_holiday = GETPOSTINT('check_holiday'); $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); $filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3); $usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3); -$showbirthday = empty($conf->use_javascript_ajax) ? GETPOST("showbirthday", "int") : 1; +$showbirthday = empty($conf->use_javascript_ajax) ? GETPOSTINT("showbirthday") : 1; $search_categ_cus = GETPOST("search_categ_cus", "int", 3) ? GETPOST("search_categ_cus", "int", 3) : 0; // If not choice done on calendar owner (like on left menu link "Agenda"), we filter on user. @@ -69,11 +69,11 @@ $newparam = ''; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; if (!$sortorder) { $sortorder = "ASC"; @@ -83,7 +83,7 @@ if (!$sortfield) { } // Security check -$socid = GETPOST("search_socid", "int") ? GETPOST("search_socid", "int") : GETPOST("socid", "int"); +$socid = GETPOSTINT("search_socid") ? GETPOSTINT("search_socid") : GETPOSTINT("socid"); if ($user->socid) { $socid = $user->socid; } @@ -108,22 +108,22 @@ $mode = GETPOST('mode', 'aZ09'); if (empty($mode) && preg_match('/show_/', $action)) { $mode = $action; // For backward compatibility } -$resourceid = GETPOST("search_resourceid", "int"); -$year = GETPOST("year", "int") ? GETPOST("year", "int") : date("Y"); -$month = GETPOST("month", "int") ? GETPOST("month", "int") : date("m"); -$week = GETPOST("week", "int") ? GETPOST("week", "int") : date("W"); -$day = GETPOST("day", "int") ? GETPOST("day", "int") : date("d"); +$resourceid = GETPOSTINT("search_resourceid"); +$year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y"); +$month = GETPOSTINT("month") ? GETPOSTINT("month") : date("m"); +$week = GETPOSTINT("week") ? GETPOSTINT("week") : date("W"); +$day = GETPOSTINT("day") ? GETPOSTINT("day") : date("d"); $pid = GETPOST("search_projectid", "int", 3) ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); $status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo', 'na' or -1 $type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09'); -$maxprint = GETPOSTISSET("maxprint") ? GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW; +$maxprint = GETPOSTISSET("maxprint") ? GETPOSTINT("maxprint") : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW; $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); +$dateselect = dol_mktime(0, 0, 0, GETPOSTINT('dateselectmonth'), GETPOSTINT('dateselectday'), GETPOSTINT('dateselectyear')); if ($dateselect > 0) { - $day = GETPOST('dateselectday', 'int'); - $month = GETPOST('dateselectmonth', 'int'); - $year = GETPOST('dateselectyear', 'int'); + $day = GETPOSTINT('dateselectday'); + $month = GETPOSTINT('dateselectmonth'); + $year = GETPOSTINT('dateselectyear'); } // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) @@ -148,16 +148,16 @@ if (empty($mode) && !GETPOSTISSET('mode')) { if ($mode == 'default') { // When action is default, we want a calendar view and not the list $mode = (($defaultview != 'show_list') ? $defaultview : 'show_month'); } -if (GETPOST('viewcal', 'int') && GETPOST('mode', 'alpha') != 'show_day' && GETPOST('mode', 'alpha') != 'show_week') { +if (GETPOSTINT('viewcal') && GETPOSTINT('mode') != 'show_day' && GETPOSTINT('mode') != 'show_week') { $mode = 'show_month'; $day = ''; } // View by month -if (GETPOST('viewweek', 'int') || GETPOST('mode', 'alpha') == 'show_week') { +if (GETPOSTINT('viewweek') || GETPOSTINT('mode') == 'show_week') { $mode = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d")); } // View by week -if (GETPOST('viewday', 'int') || GETPOST('mode', 'alpha') == 'show_day') { +if (GETPOSTINT('viewday') || GETPOSTINT('mode') == 'show_day') { $mode = 'show_day'; $day = ($day ? $day : date("d")); } // View by day @@ -647,7 +647,7 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on foreach ($showextcals as $val) { $htmlname = md5($val['name']); // not used for security purpose, only to get a string with no special char - if (!empty($val['default']) || GETPOST('check_ext'.$htmlname, 'int')) { + if (!empty($val['default']) || GETPOSTINT('check_ext'.$htmlname)) { $default = "checked"; } else { $default = ''; diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 591fb5082d3..0b16f28193e 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -37,7 +37,7 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->load("commercial"); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('actioncard', 'globalcard')); diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 55cb92d71f3..30a690b38cc 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -50,19 +50,19 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'ac $optioncss = GETPOST('optioncss', 'alpha'); -$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int'); +$disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); $mode = GETPOST('mode', 'aZ09'); if (empty($mode) && preg_match('/show_/', $action)) { $mode = $action; // For backward compatibility } -$resourceid = GETPOST("search_resourceid", "int") ? GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int"); +$resourceid = GETPOSTINT("search_resourceid") ? GETPOSTINT("search_resourceid") : GETPOSTINT("resourceid"); $pid = GETPOST("search_projectid", 'int', 3) ? GETPOST("search_projectid", 'int', 3) : GETPOST("projectid", 'int', 3); $search_status = (GETPOST("search_status", 'aZ09') != '') ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); $type = GETPOST('search_type', 'alphanohtml') ? GETPOST('search_type', 'alphanohtml') : GETPOST('type', 'alphanohtml'); -$year = GETPOST("year", 'int'); -$month = GETPOST("month", 'int'); -$day = GETPOST("day", 'int'); +$year = GETPOSTINT("year"); +$month = GETPOSTINT("month"); +$day = GETPOSTINT("day"); // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) if (GETPOST('search_actioncode', 'array')) { @@ -80,11 +80,11 @@ $search_title = GETPOST('search_title', 'alpha'); $search_note = GETPOST('search_note', 'alpha'); // $dateselect is a day included inside the event range -$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int'), 'tzuserrel'); -$datestart_dtstart = dol_mktime(0, 0, 0, GETPOST('datestart_dtstartmonth', 'int'), GETPOST('datestart_dtstartday', 'int'), GETPOST('datestart_dtstartyear', 'int'), 'tzuserrel'); -$datestart_dtend = dol_mktime(23, 59, 59, GETPOST('datestart_dtendmonth', 'int'), GETPOST('datestart_dtendday', 'int'), GETPOST('datestart_dtendyear', 'int'), 'tzuserrel'); -$dateend_dtstart = dol_mktime(0, 0, 0, GETPOST('dateend_dtstartmonth', 'int'), GETPOST('dateend_dtstartday', 'int'), GETPOST('dateend_dtstartyear', 'int'), 'tzuserrel'); -$dateend_dtend = dol_mktime(23, 59, 59, GETPOST('dateend_dtendmonth', 'int'), GETPOST('dateend_dtendday', 'int'), GETPOST('dateend_dtendyear', 'int'), 'tzuserrel'); +$dateselect = dol_mktime(0, 0, 0, GETPOSTINT('dateselectmonth'), GETPOSTINT('dateselectday'), GETPOSTINT('dateselectyear'), 'tzuserrel'); +$datestart_dtstart = dol_mktime(0, 0, 0, GETPOSTINT('datestart_dtstartmonth'), GETPOSTINT('datestart_dtstartday'), GETPOSTINT('datestart_dtstartyear'), 'tzuserrel'); +$datestart_dtend = dol_mktime(23, 59, 59, GETPOSTINT('datestart_dtendmonth'), GETPOSTINT('datestart_dtendday'), GETPOSTINT('datestart_dtendyear'), 'tzuserrel'); +$dateend_dtstart = dol_mktime(0, 0, 0, GETPOSTINT('dateend_dtstartmonth'), GETPOSTINT('dateend_dtstartday'), GETPOSTINT('dateend_dtstartyear'), 'tzuserrel'); +$dateend_dtend = dol_mktime(23, 59, 59, GETPOSTINT('dateend_dtendmonth'), GETPOSTINT('dateend_dtendday'), GETPOSTINT('dateend_dtendyear'), 'tzuserrel'); if ($search_status == '' && !GETPOSTISSET('search_status')) { $search_status = ((!getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); } @@ -95,7 +95,7 @@ if (empty($mode) && !GETPOSTISSET('mode')) { $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); $filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3); $usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3); -$showbirthday = empty($conf->use_javascript_ajax) ? (GETPOST("search_showbirthday", "int") ? GETPOST("search_showbirthday", "int") : GETPOST("showbirthday", "int")) : 1; +$showbirthday = empty($conf->use_javascript_ajax) ? (GETPOSTINT("search_showbirthday") ? GETPOSTINT("search_showbirthday") : GETPOSTINT("showbirthday")) : 1; $search_categ_cus = GETPOST("search_categ_cus", "int", 3) ? GETPOST("search_categ_cus", "int", 3) : 0; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context @@ -114,10 +114,10 @@ if (empty($filtert) && !getDolGlobalString('AGENDA_ALL_CALENDARS')) { } // Pagination parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -137,7 +137,7 @@ if (!$sortfield) { } // Security check -$socid = GETPOST("search_socid", 'int') ? GETPOST("search_socid", 'int') : GETPOST("socid", 'int'); +$socid = GETPOSTINT("search_socid") ? GETPOSTINT("search_socid") : GETPOSTINT("socid"); if ($user->socid) { $socid = $user->socid; } @@ -350,41 +350,41 @@ if ($search_title != '') { if ($search_note != '') { $param .= '&search_note='.urlencode($search_note); } -if (GETPOST('datestart_dtstartday', 'int')) { - $param .= '&datestart_dtstartday='.GETPOST('datestart_dtstartday', 'int'); +if (GETPOSTINT('datestart_dtstartday')) { + $param .= '&datestart_dtstartday='.GETPOSTINT('datestart_dtstartday'); } -if (GETPOST('datestart_dtstartmonth', 'int')) { - $param .= '&datestart_dtstartmonth='.GETPOST('datestart_dtstartmonth', 'int'); +if (GETPOSTINT('datestart_dtstartmonth')) { + $param .= '&datestart_dtstartmonth='.GETPOSTINT('datestart_dtstartmonth'); } -if (GETPOST('datestart_dtstartyear', 'int')) { - $param .= '&datestart_dtstartyear='.GETPOST('datestart_dtstartyear', 'int'); +if (GETPOSTINT('datestart_dtstartyear')) { + $param .= '&datestart_dtstartyear='.GETPOSTINT('datestart_dtstartyear'); } -if (GETPOST('datestart_dtendday', 'int')) { - $param .= '&datestart_dtendday='.GETPOST('datestart_dtendday', 'int'); +if (GETPOSTINT('datestart_dtendday')) { + $param .= '&datestart_dtendday='.GETPOSTINT('datestart_dtendday'); } -if (GETPOST('datestart_dtendmonth', 'int')) { - $param .= '&datestart_dtendmonth='.GETPOST('datestart_dtendmonth', 'int'); +if (GETPOSTINT('datestart_dtendmonth')) { + $param .= '&datestart_dtendmonth='.GETPOSTINT('datestart_dtendmonth'); } -if (GETPOST('datestart_dtendyear', 'int')) { - $param .= '&datestart_dtendyear='.GETPOST('datestart_dtendyear', 'int'); +if (GETPOSTINT('datestart_dtendyear')) { + $param .= '&datestart_dtendyear='.GETPOSTINT('datestart_dtendyear'); } -if (GETPOST('dateend_dtstartday', 'int')) { - $param .= '&dateend_dtstartday='.GETPOST('dateend_dtstartday', 'int'); +if (GETPOSTINT('dateend_dtstartday')) { + $param .= '&dateend_dtstartday='.GETPOSTINT('dateend_dtstartday'); } -if (GETPOST('dateend_dtstartmonth', 'int')) { - $param .= '&dateend_dtstartmonth='.GETPOST('dateend_dtstartmonth', 'int'); +if (GETPOSTINT('dateend_dtstartmonth')) { + $param .= '&dateend_dtstartmonth='.GETPOSTINT('dateend_dtstartmonth'); } -if (GETPOST('dateend_dtstartyear', 'int')) { - $param .= '&dateend_dtstartyear='.GETPOST('dateend_dtstartyear', 'int'); +if (GETPOSTINT('dateend_dtstartyear')) { + $param .= '&dateend_dtstartyear='.GETPOSTINT('dateend_dtstartyear'); } -if (GETPOST('dateend_dtendday', 'int')) { - $param .= '&dateend_dtendday='.GETPOST('dateend_dtendday', 'int'); +if (GETPOSTINT('dateend_dtendday')) { + $param .= '&dateend_dtendday='.GETPOSTINT('dateend_dtendday'); } -if (GETPOST('dateend_dtendmonth', 'int')) { - $param .= '&dateend_dtendmonth='.GETPOST('dateend_dtendmonth', 'int'); +if (GETPOSTINT('dateend_dtendmonth')) { + $param .= '&dateend_dtendmonth='.GETPOSTINT('dateend_dtendmonth'); } -if (GETPOST('dateend_dtendyear', 'int')) { - $param .= '&dateend_dtendyear='.GETPOST('dateend_dtendyear', 'int'); +if (GETPOSTINT('dateend_dtendyear')) { + $param .= '&dateend_dtendyear='.GETPOSTINT('dateend_dtendyear'); } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); @@ -410,7 +410,7 @@ if ($user->hasRight('agenda', 'allactions', 'delete')) { if (isModEnabled('category') && $user->hasRight('agenda', 'myactions', 'create')) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index f226da960c4..83ac43bc4e2 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -46,7 +46,7 @@ if (!isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) { $action = GETPOST('action', 'aZ09'); -$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int'); +$disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); $filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3); @@ -64,11 +64,11 @@ if (empty($filtert) && !getDolGlobalString('AGENDA_ALL_CALENDARS')) { // Sorting $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; if (!$sortorder) { $sortorder = "ASC"; @@ -79,7 +79,7 @@ if (!$sortfield) { // Security check -$socid = GETPOST("search_socid", "int") ? GETPOST("search_socid", "int") : GETPOST("socid", "int"); +$socid = GETPOSTINT("search_socid") ? GETPOSTINT("search_socid") : GETPOSTINT("socid"); if ($user->socid) { $socid = $user->socid; } @@ -100,15 +100,15 @@ if (!$user->hasRight('agenda', 'allactions', 'read') || $filter == 'mine') { // } $mode = 'show_pertype'; -$resourceid = GETPOST("search_resourceid", "int") ? GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int"); -$year = GETPOST("year", "int") ? GETPOST("year", "int") : date("Y"); -$month = GETPOST("month", "int") ? GETPOST("month", "int") : date("m"); -$week = GETPOST("week", "int") ? GETPOST("week", "int") : date("W"); -$day = GETPOST("day", "int") ? GETPOST("day", "int") : date("d"); +$resourceid = GETPOSTINT("search_resourceid") ? GETPOSTINT("search_resourceid") : GETPOSTINT("resourceid"); +$year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y"); +$month = GETPOSTINT("month") ? GETPOSTINT("month") : date("m"); +$week = GETPOSTINT("week") ? GETPOSTINT("week") : date("W"); +$day = GETPOSTINT("day") ? GETPOSTINT("day") : date("d"); $pid = GETPOSTISSET("search_projectid") ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); $status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); $type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'alpha') : GETPOST("type", 'alpha'); -$maxprint = ((GETPOST("maxprint", 'int') != '') ? GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); +$maxprint = ((GETPOSTINT("maxprint") != '') ? GETPOSTINT("maxprint") : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) @@ -121,19 +121,19 @@ if (GETPOST('search_actioncode', 'array:aZ09')) { $actioncode = GETPOST("search_actioncode", "alpha", 3) ? GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode", "alpha") == '0' ? '0' : ((!getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE') || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE)); } -$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); +$dateselect = dol_mktime(0, 0, 0, GETPOSTINT('dateselectmonth'), GETPOSTINT('dateselectday'), GETPOSTINT('dateselectyear')); if ($dateselect > 0) { - $day = GETPOST('dateselectday', 'int'); - $month = GETPOST('dateselectmonth', 'int'); - $year = GETPOST('dateselectyear', 'int'); + $day = GETPOSTINT('dateselectday'); + $month = GETPOSTINT('dateselectmonth'); + $year = GETPOSTINT('dateselectyear'); } // working hours $tmp = !getDolGlobalString('MAIN_DEFAULT_WORKING_HOURS') ? '9-18' : $conf->global->MAIN_DEFAULT_WORKING_HOURS; $tmp = str_replace(' ', '', $tmp); // FIX 7533 $tmparray = explode('-', $tmp); -$begin_h = GETPOST('begin_h', 'int') != '' ? GETPOST('begin_h', 'int') : ($tmparray[0] != '' ? $tmparray[0] : 9); -$end_h = GETPOST('end_h', 'int') ? GETPOST('end_h', 'int') : ($tmparray[1] != '' ? $tmparray[1] : 18); +$begin_h = GETPOSTINT('begin_h') != '' ? GETPOSTINT('begin_h') : ($tmparray[0] != '' ? $tmparray[0] : 9); +$end_h = GETPOSTINT('end_h') ? GETPOSTINT('end_h') : ($tmparray[1] != '' ? $tmparray[1] : 18); if ($begin_h < 0 || $begin_h > 23) { $begin_h = 9; } diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index a3ae68e6bd3..2201fe9d360 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -47,7 +47,7 @@ if (!isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) { $action = GETPOST('action', 'aZ09'); -$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int'); +$disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); $filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3); @@ -64,11 +64,11 @@ $showbirthday = 0; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; if (!$sortorder) { $sortorder = "ASC"; @@ -77,7 +77,7 @@ if (!$sortfield) { $sortfield = "a.datec"; } -$socid = GETPOST("search_socid", "int") ? GETPOST("search_socid", "int") : GETPOST("socid", "int"); +$socid = GETPOSTINT("search_socid") ? GETPOSTINT("search_socid") : GETPOSTINT("socid"); if ($user->socid) { $socid = $user->socid; } @@ -97,15 +97,15 @@ if (!$user->hasRight('agenda', 'allactions', 'read') || $filter == 'mine') { // } $mode = 'show_peruser'; -$resourceid = GETPOST("search_resourceid", "int") ? GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int"); -$year = GETPOST("year", "int") ? GETPOST("year", "int") : date("Y"); -$month = GETPOST("month", "int") ? GETPOST("month", "int") : date("m"); -$week = GETPOST("week", "int") ? GETPOST("week", "int") : date("W"); -$day = GETPOST("day", "int") ? GETPOST("day", "int") : date("d"); +$resourceid = GETPOSTINT("search_resourceid") ? GETPOSTINT("search_resourceid") : GETPOSTINT("resourceid"); +$year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y"); +$month = GETPOSTINT("month") ? GETPOSTINT("month") : date("m"); +$week = GETPOSTINT("week") ? GETPOSTINT("week") : date("W"); +$day = GETPOSTINT("day") ? GETPOSTINT("day") : date("d"); $pid = GETPOSTISSET("search_projectid") ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); $status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo', 'na' or -1 $type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'alpha') : GETPOST("type", 'alpha'); -$maxprint = ((GETPOST("maxprint", 'int') != '') ? GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); +$maxprint = ((GETPOSTINT("maxprint") != '') ? GETPOSTINT("maxprint") : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $search_categ_cus = GETPOST("search_categ_cus", "int", 3) ? GETPOST("search_categ_cus", "int", 3) : 0; // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) @@ -118,18 +118,18 @@ if (GETPOST('search_actioncode', 'array:aZ09')) { $actioncode = GETPOST("search_actioncode", "alpha", 3) ? GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode", "alpha") == '0' ? '0' : ((!getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE') || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE)); } -$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); +$dateselect = dol_mktime(0, 0, 0, GETPOSTINT('dateselectmonth'), GETPOSTINT('dateselectday'), GETPOSTINT('dateselectyear')); if ($dateselect > 0) { - $day = GETPOST('dateselectday', 'int'); - $month = GETPOST('dateselectmonth', 'int'); - $year = GETPOST('dateselectyear', 'int'); + $day = GETPOSTINT('dateselectday'); + $month = GETPOSTINT('dateselectmonth'); + $year = GETPOSTINT('dateselectyear'); } $tmp = !getDolGlobalString('MAIN_DEFAULT_WORKING_HOURS') ? '9-18' : $conf->global->MAIN_DEFAULT_WORKING_HOURS; $tmp = str_replace(' ', '', $tmp); // FIX 7533 $tmparray = explode('-', $tmp); -$begin_h = GETPOST('begin_h', 'int') != '' ? GETPOST('begin_h', 'int') : ($tmparray[0] != '' ? $tmparray[0] : 9); -$end_h = GETPOST('end_h', 'int') ? GETPOST('end_h', 'int') : ($tmparray[1] != '' ? $tmparray[1] : 18); +$begin_h = GETPOSTINT('begin_h') != '' ? GETPOSTINT('begin_h') : ($tmparray[0] != '' ? $tmparray[0] : 9); +$end_h = GETPOSTINT('end_h') ? GETPOSTINT('end_h') : ($tmparray[1] != '' ? $tmparray[1] : 18); if ($begin_h < 0 || $begin_h > 23) { $begin_h = 9; } @@ -143,8 +143,8 @@ if ($end_h <= $begin_h) { $tmp = !getDolGlobalString('MAIN_DEFAULT_WORKING_DAYS') ? '1-5' : $conf->global->MAIN_DEFAULT_WORKING_DAYS; $tmp = str_replace(' ', '', $tmp); // FIX 7533 $tmparray = explode('-', $tmp); -$begin_d = GETPOST('begin_d', 'int') ? GETPOST('begin_d', 'int') : ($tmparray[0] != '' ? $tmparray[0] : 1); -$end_d = GETPOST('end_d', 'int') ? GETPOST('end_d', 'int') : ($tmparray[1] != '' ? $tmparray[1] : 5); +$begin_d = GETPOSTINT('begin_d') ? GETPOSTINT('begin_d') : ($tmparray[0] != '' ? $tmparray[0] : 1); +$end_d = GETPOSTINT('end_d') ? GETPOSTINT('end_d') : ($tmparray[1] != '' ? $tmparray[1] : 5); if ($begin_d < 1 || $begin_d > 7) { $begin_d = 1; } diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 5ef15ca226a..712c3ee0ccc 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -35,14 +35,14 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $langs->loadLangs(array("agenda", "commercial")); $action = GETPOST('action', 'aZ09'); -$month = GETPOST('month', 'int'); -$year = GETPOST('year', 'int'); +$month = GETPOSTINT('month'); +$year = GETPOSTINT('year'); $optioncss = GETPOST('optioncss', 'alpha'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index ac3c2b57bbb..72357539c84 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -91,12 +91,12 @@ if (isModEnabled('notification')) { $action = GETPOST('action', 'aZ09'); -$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$id = (GETPOSTINT('socid') ? GETPOSTINT('socid') : GETPOSTINT('id')); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -173,7 +173,7 @@ if (empty($reshook)) { // Payment terms of the settlement if ($action == 'setconditions' && $user->hasRight('societe', 'creer')) { $object->fetch($id); - $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), GETPOST('cond_reglement_id_deposit_percent', 'alpha')); + $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id'), GETPOSTINT('cond_reglement_id_deposit_percent')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -182,7 +182,7 @@ if (empty($reshook)) { // Payment mode if ($action == 'setmode' && $user->hasRight('societe', 'creer')) { $object->fetch($id); - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + $result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -200,7 +200,7 @@ if (empty($reshook)) { // Bank account if ($action == 'setbankaccount' && $user->hasRight('societe', 'creer')) { $object->fetch($id); - $result = $object->setBankAccount(GETPOST('fk_account', 'int')); + $result = $object->setBankAccount(GETPOSTINT('fk_account')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -209,7 +209,7 @@ if (empty($reshook)) { // customer preferred shipping method if ($action == 'setshippingmethod' && $user->hasRight('societe', 'creer')) { $object->fetch($id); - $result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int')); + $result = $object->setShippingMethod(GETPOSTINT('shipping_method_id')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -297,7 +297,7 @@ if (empty($reshook)) { // warehouse if ($action == 'setwarehouse' && $user->hasRight('societe', 'creer')) { - $result = $object->setWarehouse(GETPOST('fk_warehouse', 'int')); + $result = $object->setWarehouse(GETPOSTINT('fk_warehouse')); } } diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 255ab70afa7..ca78aa8f9c9 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -32,7 +32,7 @@ $langs->load("companies"); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "ASC"; } @@ -42,7 +42,7 @@ if (!$sortfield) { if ($page < 0) { $page = 0; } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; $type = GETPOST('type', 'alpha'); @@ -53,7 +53,7 @@ $contactname = GETPOST('contactname'); $begin = GETPOST('begin', 'alpha'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $action = ''; $socid = $user->socid; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 843c0ceaf35..67823d4b12f 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -54,10 +54,10 @@ $hookmanager->initHooks(array('commercialindex')); $langs->loadLangs(array("boxes", "commercial", "contracts", "orders", "propal", "supplier_proposal")); $action = GETPOST('action', 'aZ09'); -$bid = GETPOST('bid', 'int'); +$bid = GETPOSTINT('bid'); // Securite access client -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if (isset($user->socid) && $user->socid > 0) { $action = ''; $socid = $user->socid; diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index 73fc1826706..4742d6b66e7 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -44,10 +44,10 @@ if (isModEnabled('categorie')) { } // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -62,12 +62,12 @@ if (!$sortfield) { } $id = GETPOSTINT('id'); -$rowid = GETPOST('rowid', 'int'); +$rowid = GETPOSTINT('rowid'); $action = GETPOST('action', 'aZ09'); $search_nom = GETPOST("search_nom"); $search_prenom = GETPOST("search_prenom"); $search_email = GETPOST("search_email"); -$template_id = GETPOST('template_id', 'int'); +$template_id = GETPOSTINT('template_id'); // Do we click on purge search criteria ? if (GETPOST('button_removefilter_x', 'alpha')) { @@ -134,14 +134,14 @@ if ($action == 'add') { $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_st_dt', $array_query)) { - $array_query['options_'.$dtarr[1].'_st_dt'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear', 'int')); + $array_query['options_'.$dtarr[1].'_st_dt'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_st_dtmonth'), GETPOSTINT('options_'.$dtarr[1].'_st_dtday'), GETPOSTINT('options_'.$dtarr[1].'_st_dtyear')); } } elseif (preg_match("/end_dt/", $key)) { // Special case for end date come with 3 inputs day, month, year $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_end_dt', $array_query)) { - $array_query['options_'.$dtarr[1].'_end_dt'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear', 'int')); + $array_query['options_'.$dtarr[1].'_end_dt'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_end_dtmonth'), GETPOSTINT('options_'.$dtarr[1].'_end_dtday'), GETPOSTINT('options_'.$dtarr[1].'_end_dtyear')); } } else { $array_query[$key] = GETPOST($key); @@ -154,14 +154,14 @@ if ($action == 'add') { $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_st_dt_cnct', $array_query)) { - $array_query['options_'.$dtarr[1].'_st_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear_cnct', 'int')); + $array_query['options_'.$dtarr[1].'_st_dt_cnct'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_st_dtmonth_cnct'), GETPOSTINT('options_'.$dtarr[1].'_st_dtday_cnct'), GETPOSTINT('options_'.$dtarr[1].'_st_dtyear_cnct')); } } elseif (preg_match("/end_dt/", $key)) { // Special case for end date come with 3 inputs day, month, year $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_end_dt_cnct', $array_query)) { - $array_query['options_'.$dtarr[1].'_end_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear_cnct', 'int')); + $array_query['options_'.$dtarr[1].'_end_dt_cnct'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_end_dtmonth_cnct'), GETPOSTINT('options_'.$dtarr[1].'_end_dtday_cnct'), GETPOSTINT('options_'.$dtarr[1].'_end_dtyear_cnct')); } } else { $array_query[$key] = GETPOST($key); @@ -185,7 +185,7 @@ if ($action == 'add') { if ($key == $date_key) { $dt = GETPOST($date_key); if (!empty($dt)) { - $array_query[$key] = dol_mktime(0, 0, 0, GETPOST($date_key.'month', 'int'), GETPOST($date_key.'day', 'int'), GETPOST($date_key.'year', 'int')); + $array_query[$key] = dol_mktime(0, 0, 0, GETPOSTINT($date_key.'month'), GETPOSTINT($date_key.'day'), GETPOSTINT($date_key.'year')); } else { $array_query[$key] = ''; } @@ -285,14 +285,14 @@ if ($action == 'savefilter' || $action == 'createfilter') { $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_st_dt', $array_query)) { - $array_query['options_'.$dtarr[1].'_st_dt'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear', 'int')); + $array_query['options_'.$dtarr[1].'_st_dt'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_st_dtmonth'), GETPOSTINT('options_'.$dtarr[1].'_st_dtday'), GETPOSTINT('options_'.$dtarr[1].'_st_dtyear')); } } elseif (preg_match("/end_dt/", $key)) { // Special case for end date come with 3 inputs day, month, year $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_end_dt', $array_query)) { - $array_query['options_'.$dtarr[1].'_end_dt'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear', 'int')); + $array_query['options_'.$dtarr[1].'_end_dt'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_end_dtmonth'), GETPOSTINT('options_'.$dtarr[1].'_end_dtday'), GETPOSTINT('options_'.$dtarr[1].'_end_dtyear')); // print $array_query['options_'.$dtarr[1].'_end_dt']; // 01/02/1013=1361228400 } @@ -306,14 +306,14 @@ if ($action == 'savefilter' || $action == 'createfilter') { $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_st_dt_cnct', $array_query)) { - $array_query['options_'.$dtarr[1].'_st_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear_cnct', 'int')); + $array_query['options_'.$dtarr[1].'_st_dt_cnct'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_st_dtmonth_cnct'), GETPOSTINT('options_'.$dtarr[1].'_st_dtday_cnct'), GETPOSTINT('options_'.$dtarr[1].'_st_dtyear_cnct')); } } elseif (preg_match("/end_dt/", $key)) { // Special case for end date come with 3 inputs day, month, year $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_end_dt_cnct', $array_query)) { - $array_query['options_'.$dtarr[1].'_end_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear_cnct', 'int')); + $array_query['options_'.$dtarr[1].'_end_dt_cnct'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_end_dtmonth_cnct'), GETPOSTINT('options_'.$dtarr[1].'_end_dtday_cnct'), GETPOSTINT('options_'.$dtarr[1].'_end_dtyear_cnct')); // print $array_query['cnct_options_'.$dtarr[1].'_end_dt']; // 01/02/1013=1361228400 } @@ -339,7 +339,7 @@ if ($action == 'savefilter' || $action == 'createfilter') { if ($key == $date_key) { $dt = GETPOST($date_key); if (!empty($dt)) { - $array_query[$key] = dol_mktime(0, 0, 0, GETPOST($date_key.'month', 'int'), GETPOST($date_key.'day', 'int'), GETPOST($date_key.'year', 'int')); + $array_query[$key] = dol_mktime(0, 0, 0, GETPOSTINT($date_key.'month'), GETPOSTINT($date_key.'day'), GETPOSTINT($date_key.'year')); } else { $array_query[$key] = ''; } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 80eb874e179..639a655efb7 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Load translation files required by the page $langs->loadLangs(array("mails", "admin")); -$id = (GETPOST('mailid', 'int') ? GETPOST('mailid', 'int') : GETPOST('id', 'int')); +$id = (GETPOSTINT('mailid') ? GETPOSTINT('mailid') : GETPOSTINT('id')); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 4dac837e45b..d0b95b32522 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -38,10 +38,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; $langs->loadLangs(array("mails", "admin")); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -55,14 +55,14 @@ if (!$sortorder) { $sortorder = "DESC,ASC"; } -$id = GETPOST('id', 'int'); -$rowid = GETPOST('rowid', 'int'); +$id = GETPOSTINT('id'); +$rowid = GETPOSTINT('rowid'); $action = GETPOST('action', 'aZ09'); $search_lastname = GETPOST("search_lastname", 'alphanohtml'); $search_firstname = GETPOST("search_firstname", 'alphanohtml'); $search_email = GETPOST("search_email", 'alphanohtml'); $search_other = GETPOST("search_other", 'alphanohtml'); -$search_dest_status = GETPOST('search_dest_status', 'int'); +$search_dest_status = GETPOSTINT('search_dest_status'); // Search modules dirs $modulesdir = dolGetModulesDirs('/mailings'); @@ -145,7 +145,7 @@ if ($action == 'add' && $user->hasRight('mailing', 'creer')) { // Add recipient } } -if (GETPOST('clearlist', 'int') && $user->hasRight('mailing', 'creer')) { +if (GETPOSTINT('clearlist') && $user->hasRight('mailing', 'creer')) { // Loading Class $obj = new MailingTargets($db); $obj->clear_target($id); @@ -155,7 +155,7 @@ if (GETPOST('clearlist', 'int') && $user->hasRight('mailing', 'creer')) { */ } -if (GETPOST('exportcsv', 'int') && $user->hasRight('mailing', 'lire')) { +if (GETPOSTINT('exportcsv') && $user->hasRight('mailing', 'lire')) { $completefilename = 'targets_emailing'.$object->id.'_'.dol_print_date(dol_now(), 'dayhourlog').'.csv'; header('Content-Type: text/csv'); header('Content-Disposition: attachment;filename='.$completefilename); diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index 12ca330896b..0bf7e9cb4ad 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/emailing.lib.php'; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Load translation files required by the page $langs->load("mails"); diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 0383ee5a5a1..082c75b6fe3 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -32,7 +32,7 @@ $langs->load('mails'); // Get Parameters $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -42,10 +42,10 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ' $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -314,7 +314,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/comm/mailing/note.php b/htdocs/comm/mailing/note.php index 19e623d519b..6b7a5153bd7 100644 --- a/htdocs/comm/mailing/note.php +++ b/htdocs/comm/mailing/note.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/emailing.lib.php'; $langs->loadLangs(array("mails", "mailing", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php index d2729885b96..c9a4dd839ed 100644 --- a/htdocs/comm/multiprix.php +++ b/htdocs/comm/multiprix.php @@ -34,15 +34,15 @@ $langs->loadLangs(array('orders', 'companies')); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); -$id = GETPOST('id', 'int'); -$_socid = GETPOST("id", 'int'); +$id = GETPOSTINT('id'); +$_socid = GETPOSTINT("id"); // Security check if ($user->socid > 0) { $_socid = $user->socid; } // Security check -$socid = GETPOST("socid", 'int'); +$socid = GETPOSTINT("socid"); if ($user->socid > 0) { $action = ''; $id = $user->socid; diff --git a/htdocs/comm/propal/agenda.php b/htdocs/comm/propal/agenda.php index bcf710dac81..7a6f4d4d6e1 100644 --- a/htdocs/comm/propal/agenda.php +++ b/htdocs/comm/propal/agenda.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->loadLangs(array("propal", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -50,10 +50,10 @@ if (GETPOST('actioncode', 'array')) { $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index f827bc3e6ae..d22278ad585 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -72,24 +72,24 @@ if (isModEnabled('margin')) { $error = 0; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $origin = GETPOST('origin', 'alpha'); -$originid = GETPOST('originid', 'int'); +$originid = GETPOSTINT('originid'); $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$lineid = GETPOST('lineid', 'int'); -$contactid = GETPOST('contactid', 'int'); -$projectid = GETPOST('projectid', 'int'); -$rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1; +$lineid = GETPOSTINT('lineid'); +$contactid = GETPOSTINT('contactid'); +$projectid = GETPOSTINT('projectid'); +$rank = (GETPOSTINT('rank') > 0) ? GETPOSTINT('rank') : -1; // PDF -$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); -$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); -$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); +$hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); +$hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); +$hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); $object = new Propal($db); $extrafields = new ExtraFields($db); @@ -193,9 +193,9 @@ if (empty($reshook)) { 12, 0, 0, - GETPOST('date_deliverymonth', 'int'), - GETPOST('date_deliveryday', 'int'), - GETPOST('date_deliveryyear', 'int') + GETPOSTINT('date_deliverymonth'), + GETPOSTINT('date_deliveryday'), + GETPOSTINT('date_deliveryyear') ); $date_delivery_old = $object->delivery_date; if (!empty($date_delivery_old) && !empty($date_delivery)) { @@ -224,7 +224,7 @@ if (empty($reshook)) { } } - $result = $object->createFromClone($user, $socid, (GETPOSTISSET('entity') ? GETPOST('entity', 'int') : null), (GETPOST('update_prices', 'aZ') ? true : false), (GETPOST('update_desc', 'aZ') ? true : false)); + $result = $object->createFromClone($user, $socid, (GETPOSTISSET('entity') ? GETPOSTINT('entity') : null), (GETPOSTINT('update_prices') ? true : false), (GETPOSTINT('update_desc') ? true : false)); if ($result > 0) { $warningMsgLineList = array(); // check all product lines are to sell otherwise add a warning message for each product line is not to sell @@ -302,7 +302,7 @@ if (empty($reshook)) { exit(); } elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) { // Validation - $idwarehouse = GETPOST('idwarehouse', 'int'); + $idwarehouse = GETPOSTINT('idwarehouse'); $result = $object->valid($user); if ($result > 0 && getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) { $result = $object->closeProposal($user, $object::STATUS_SIGNED); @@ -338,7 +338,7 @@ if (empty($reshook)) { } } } elseif ($action == 'setdate' && $usercancreate) { - $datep = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $datep = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); if (empty($datep)) { $error++; @@ -376,7 +376,7 @@ if (empty($reshook)) { } } } elseif ($action == 'setecheance' && $usercancreate) { - $result = $object->set_echeance($user, dol_mktime(12, 0, 0, GETPOST('echmonth', 'int'), GETPOST('echday', 'int'), GETPOST('echyear', 'int'))); + $result = $object->set_echeance($user, dol_mktime(12, 0, 0, GETPOSTINT('echmonth'), GETPOSTINT('echday'), GETPOSTINT('echyear'))); if ($result >= 0) { if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) { $outputlangs = $langs; @@ -403,7 +403,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'setdate_livraison' && $usercancreate) { - $result = $object->setDeliveryDate($user, dol_mktime(12, 0, 0, GETPOST('date_livraisonmonth', 'int'), GETPOST('date_livraisonday', 'int'), GETPOST('date_livraisonyear', 'int'))); + $result = $object->setDeliveryDate($user, dol_mktime(12, 0, 0, GETPOSTINT('date_livraisonmonth'), GETPOSTINT('date_livraisonday'), GETPOSTINT('date_livraisonyear'))); if ($result < 0) { dol_print_error($db, $object->error); } @@ -415,7 +415,7 @@ if (empty($reshook)) { } } elseif ($action == 'set_incoterms' && isModEnabled('incoterm') && $usercancreate) { // Set incoterm - $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); + $result = $object->setIncoterms(GETPOSTINT('incoterm_id'), GETPOSTINT('location_incoterms')); } elseif ($action == 'add' && $usercancreate) { // Create proposal $object->socid = $socid; @@ -423,7 +423,7 @@ if (empty($reshook)) { $datep = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $date_delivery = dol_mktime(12, 0, 0, GETPOST('date_livraisonmonth'), GETPOST('date_livraisonday'), GETPOST('date_livraisonyear')); - $duration = GETPOST('duree_validite', 'int'); + $duration = GETPOSTINT('duree_validite'); if (empty($datep)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePropal")), null, 'errors'); @@ -448,7 +448,7 @@ if (empty($reshook)) { // If we select proposal to clone during creation (when option PROPAL_CLONE_ON_CREATE_PAGE is on) if (GETPOST('createmode') == 'copy' && GETPOST('copie_propal')) { - if ($object->fetch(GETPOST('copie_propal', 'int')) > 0) { + if ($object->fetch(GETPOSTINT('copie_propal')) > 0) { $object->ref = GETPOST('ref'); $object->datep = $datep; $object->date = $datep; @@ -733,16 +733,16 @@ if (empty($reshook)) { } } elseif ($action == 'confirm_closeas' && $usercanclose && !GETPOST('cancel', 'alpha')) { // Close proposal - if (!(GETPOST('statut', 'int') > 0)) { + if (!(GETPOSTINT('statut') > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors'); $action = 'closeas'; - } elseif (GETPOST('statut', 'int') == $object::STATUS_SIGNED || GETPOST('statut', 'int') == $object::STATUS_NOTSIGNED) { + } elseif (GETPOSTINT('statut') == $object::STATUS_SIGNED || GETPOSTINT('statut') == $object::STATUS_NOTSIGNED) { $locationTarget = ''; // prevent browser refresh from closing proposal several times if ($object->statut == $object::STATUS_VALIDATED || (getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') && $object->statut == $object::STATUS_DRAFT)) { $db->begin(); - $result = $object->closeProposal($user, GETPOST('statut', 'int'), GETPOST('note_private', 'restricthtml')); + $result = $object->closeProposal($user, GETPOSTINT('statut'), GETPOSTINT('note_private')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -756,19 +756,19 @@ if (empty($reshook)) { $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); if ( - !$error && GETPOST('statut', 'int') == $object::STATUS_SIGNED && GETPOST('generate_deposit', 'alpha') == 'on' + !$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOSTINT('generate_deposit') == 'on' && !empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && $user->hasRight('facture', 'creer') ) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; - $date = dol_mktime(0, 0, 0, GETPOST('datefmonth', 'int'), GETPOST('datefday', 'int'), GETPOST('datefyear', 'int')); + $date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear')); $forceFields = array(); if (GETPOSTISSET('date_pointoftax')) { - $forceFields['date_pointoftax'] = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); + $forceFields['date_pointoftax'] = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear')); } - $deposit = Facture::createDepositFromOrigin($object, $date, GETPOST('cond_reglement_id', 'int'), $user, 0, GETPOST('validate_generated_deposit', 'alpha') == 'on', $forceFields); + $deposit = Facture::createDepositFromOrigin($object, $date, GETPOSTINT('cond_reglement_id'), $user, 0, GETPOSTINT('validate_generated_deposit') == 'on', $forceFields); if ($deposit) { setEventMessage('DepositGenerated'); @@ -936,9 +936,9 @@ if (empty($reshook)) { $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } } elseif ($action == "setabsolutediscount" && $usercancreate) { - if (GETPOST("remise_id", "int")) { + if (GETPOSTINT("remise_id")) { if ($object->id > 0) { - $result = $object->insert_discount(GETPOST("remise_id", "int")); + $result = $object->insert_discount(GETPOSTINT("remise_id")); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -1020,7 +1020,7 @@ if (empty($reshook)) { if ($prod_entry_mode == 'free') { $idprod = 0; } else { - $idprod = GETPOST('idprod', 'int'); + $idprod = GETPOSTINT('idprod'); if (getDolGlobalString('MAIN_DISABLE_FREE_LINES') && $idprod <= 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")), null, 'errors'); @@ -1159,7 +1159,7 @@ if (empty($reshook)) { // If price per quantity if ($prod->prices_by_qty[0]) { // yes, this product has some prices per quantity // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. - $pqp = GETPOST('pbq', 'int'); + $pqp = GETPOSTINT('pbq'); // Search price into product_price_by_qty from $prod->id foreach ($prod->prices_by_qty_list[0] as $priceforthequantityarray) { @@ -1180,7 +1180,7 @@ if (empty($reshook)) { // If price per quantity and customer if ($prod->prices_by_qty[$object->thirdparty->price_level]) { // yes, this product has some prices per quantity // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. - $pqp = GETPOST('pbq', 'int'); + $pqp = GETPOSTINT('pbq'); // Search price into product_price_by_qty from $prod->id foreach ($prod->prices_by_qty_list[$object->thirdparty->price_level] as $priceforthequantityarray) { @@ -1510,13 +1510,13 @@ if (empty($reshook)) { } // Define special_code for special lines - $special_code = GETPOST('special_code', 'int'); + $special_code = GETPOSTINT('special_code'); if (!GETPOST('qty')) { $special_code = 3; } // Check minimum price - $productid = GETPOST('productid', 'int'); + $productid = GETPOSTINT('productid'); if (!empty($productid)) { $product = new Product($db); $res = $product->fetch($productid); @@ -1566,7 +1566,7 @@ if (empty($reshook)) { if (!$user->hasRight('margins', 'creer')) { foreach ($object->lines as &$line) { - if ($line->id == GETPOST('lineid', 'int')) { + if ($line->id == GETPOSTINT('lineid')) { $fournprice = $line->fk_fournprice; $buyingprice = $line->pa_ht; break; @@ -1583,7 +1583,7 @@ if (empty($reshook)) { $price_base_type = 'TTC'; } - $result = $object->updateline(GETPOST('lineid', 'int'), $pu, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $description, $price_base_type, $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise); + $result = $object->updateline(GETPOSTINT('lineid'), $pu, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $description, $price_base_type, $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise); if ($result >= 0) { $db->commit(); @@ -1640,38 +1640,38 @@ if (empty($reshook)) { exit(); } elseif ($action == 'classin' && $usercancreate) { // Set project - $object->setProject(GETPOST('projectid', 'int')); + $object->setProject(GETPOSTINT('projectid')); } elseif ($action == 'setavailability' && $usercancreate) { // Delivery time - $result = $object->set_availability($user, GETPOST('availability_id', 'int')); + $result = $object->set_availability($user, GETPOSTINT('availability_id')); } elseif ($action == 'setdemandreason' && $usercancreate) { // Origin of the commercial proposal - $result = $object->set_demand_reason($user, GETPOST('demand_reason_id', 'int')); + $result = $object->set_demand_reason($user, GETPOSTINT('demand_reason_id')); } elseif ($action == 'setconditions' && $usercancreate) { // Terms of payment - $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), GETPOST('cond_reglement_id_deposit_percent', 'alpha')); + $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id'), GETPOSTINT('cond_reglement_id_deposit_percent')); //} elseif ($action == 'setremisepercent' && $usercancreate) { // $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2)); //} elseif ($action == 'setremiseabsolue' && $usercancreate) { // $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2)); } elseif ($action == 'setmode' && $usercancreate) { // Payment choice - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + $result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id')); } elseif ($action == 'setmulticurrencycode' && $usercancreate) { // Multicurrency Code $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); } elseif ($action == 'setmulticurrencyrate' && $usercancreate) { // Multicurrency rate - $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOST('calculation_mode', 'int')); + $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOSTINT('calculation_mode')); } elseif ($action == 'setbankaccount' && $usercancreate) { // bank account - $result = $object->setBankAccount(GETPOST('fk_account', 'int')); + $result = $object->setBankAccount(GETPOSTINT('fk_account')); } elseif ($action == 'setshippingmethod' && $usercancreate) { // shipping method - $result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int')); + $result = $object->setShippingMethod(GETPOSTINT('shipping_method_id')); } elseif ($action == 'setwarehouse' && $usercancreate) { // warehouse - $result = $object->setWarehouse(GETPOST('warehouse_id', 'int')); + $result = $object->setWarehouse(GETPOSTINT('warehouse_id')); } elseif ($action == 'update_extras') { $object->oldcopy = dol_clone($object, 2); $attribute_name = GETPOST('attribute', 'restricthtml'); @@ -1715,7 +1715,7 @@ if (empty($reshook)) { } elseif ($action == 'swapstatut') { // Toggle the status of a contact if ($object->fetch($id) > 0) { - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } else { dol_print_error($db); } @@ -1775,10 +1775,10 @@ if ($action == 'create') { $currency_code = $conf->currency; - $cond_reglement_id = GETPOST('cond_reglement_id', 'int'); + $cond_reglement_id = GETPOSTINT('cond_reglement_id'); $deposit_percent = GETPOST('cond_reglement_id_deposit_percent', 'alpha'); - $mode_reglement_id = GETPOST('mode_reglement_id', 'int'); - $fk_account = GETPOST('fk_account', 'int'); + $mode_reglement_id = GETPOSTINT('mode_reglement_id'); + $fk_account = GETPOSTINT('fk_account'); // Load objectsrc if (!empty($origin) && !empty($originid)) { @@ -1857,16 +1857,16 @@ if ($action == 'create') { // If form was posted (but error returned), we must reuse the value posted in priority (standard Dolibarr behaviour) if (!GETPOST('changecompany')) { if (GETPOSTISSET('cond_reglement_id')) { - $cond_reglement_id = GETPOST('cond_reglement_id', 'int'); + $cond_reglement_id = GETPOSTINT('cond_reglement_id'); } if (GETPOSTISSET('deposit_percent')) { $deposit_percent = price2num(GETPOST('deposit_percent', 'alpha')); } if (GETPOSTISSET('mode_reglement_id')) { - $mode_reglement_id = GETPOST('mode_reglement_id', 'int'); + $mode_reglement_id = GETPOSTINT('mode_reglement_id'); } if (GETPOSTISSET('cond_reglement_id')) { - $fk_account = GETPOST('fk_account', 'int'); + $fk_account = GETPOSTINT('fk_account'); } } @@ -2000,7 +2000,7 @@ if ($action == 'create') { // Source / Channel - What trigger creation print ''.$langs->trans('Source').''; print img_picto('', 'question', 'class="pictofixedwidth"'); - $form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOST('demand_reason_id', 'int') : ''), 'demand_reason_id', "SRC_PROP", 1, 'maxwidth200 widthcentpercentminusx'); + $form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOSTINT('demand_reason_id') : ''), 'demand_reason_id', "SRC_PROP", 1, 'maxwidth200 widthcentpercentminusx'); print ''; // Shipping Method @@ -2010,7 +2010,7 @@ if ($action == 'create') { } print ''.$langs->trans('SendingMethod').''; print img_picto('', 'dolly', 'class="pictofixedwidth"'); - $form->selectShippingMethod((GETPOSTISSET('shipping_method_id') ? GETPOST('shipping_method_id', 'int') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); + $form->selectShippingMethod((GETPOSTISSET('shipping_method_id') ? GETPOSTINT('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); print ''; } @@ -2030,7 +2030,7 @@ if ($action == 'create') { } print ''; print img_picto('', 'clock', 'class="pictofixedwidth"'); - $form->selectAvailabilityDelay((GETPOSTISSET('availability_id') ? GETPOST('availability_id', 'int') : ''), 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx'); + $form->selectAvailabilityDelay((GETPOSTISSET('availability_id') ? GETPOSTINT('availability_id') : ''), 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx'); print ''; // Delivery date (or manufacturing) @@ -2258,7 +2258,7 @@ if ($action == 'create') { $formquestion = array( // 'text' => $langs->trans("ConfirmClone"), // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', $filter, '', 0, 0, null, 0, 'maxwidth300')), + array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', $filter, '', 0, 0, null, 0, 'maxwidth300')), array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans('PuttingPricesUpToDate'), 'value' => 0), array('type' => 'checkbox', 'name' => 'update_desc', 'label' => $langs->trans('PuttingDescUpToDate'), 'value' => 0), ); diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 1da537b7d89..3e47a6921e3 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -37,9 +37,9 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Load translation files required by the page $langs->loadLangs(array('facture', 'propal', 'orders', 'sendings', 'companies')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOSTINT('lineid'); $action = GETPOST('action', 'aZ09'); $object = new Propal($db); @@ -87,7 +87,7 @@ if (empty($reshook)) { // Add new contact if ($action == 'addcontact' && $user->hasRight('propal', 'creer')) { if ($object->id > 0) { - $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $contactid = (GETPOSTINT('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); } @@ -106,7 +106,7 @@ if (empty($reshook)) { } elseif ($action == 'swapstatut' && $user->hasRight('propal', 'creer')) { // Toggle the status of a contact if ($object->id > 0) { - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } } elseif ($action == 'deletecontact' && $user->hasRight('propal', 'creer')) { // Delete contact diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 00ec2367c8a..07ea2de457b 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -42,14 +42,14 @@ $langs->loadLangs(array('propal', 'compta', 'other', 'companies')); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index ce58344c3d9..ebc5905dc2a 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -42,7 +42,7 @@ $now = dol_now(); $max = 5; // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if (isset($user->socid) && $user->socid > 0) { $action = ''; $socid = $user->socid; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index b785152916b..7a1626674e5 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -63,11 +63,11 @@ if (isModEnabled("expedition")) { } // Get Parameters -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); @@ -76,8 +76,8 @@ $mode = GETPOST('mode', 'alpha'); // Search Fields $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); -$search_user = GETPOST('search_user', 'int'); -$search_sale = GETPOST('search_sale', 'int'); +$search_user = GETPOSTINT('search_user'); +$search_sale = GETPOSTINT('search_sale'); $search_ref = GETPOST('sf_ref') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_refcustomer = GETPOST('search_refcustomer', 'alpha'); $search_refproject = GETPOST('search_refproject', 'alpha'); @@ -94,48 +94,48 @@ $search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'a $search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha'); $search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); -$search_product_category = GETPOST('search_product_category', 'int'); +$search_product_category = GETPOSTINT('search_product_category'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST("search_state"); -$search_country = GETPOST("search_country", 'int'); -$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_country = GETPOSTINT("search_country"); +$search_type_thirdparty = GETPOSTINT("search_type_thirdparty"); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); -$search_date_end_startday = GETPOST('search_date_end_startday', 'int'); -$search_date_end_startmonth = GETPOST('search_date_end_startmonth', 'int'); -$search_date_end_startyear = GETPOST('search_date_end_startyear', 'int'); -$search_date_end_endday = GETPOST('search_date_end_endday', 'int'); -$search_date_end_endmonth = GETPOST('search_date_end_endmonth', 'int'); -$search_date_end_endyear = GETPOST('search_date_end_endyear', 'int'); +$search_date_end_startday = GETPOSTINT('search_date_end_startday'); +$search_date_end_startmonth = GETPOSTINT('search_date_end_startmonth'); +$search_date_end_startyear = GETPOSTINT('search_date_end_startyear'); +$search_date_end_endday = GETPOSTINT('search_date_end_endday'); +$search_date_end_endmonth = GETPOSTINT('search_date_end_endmonth'); +$search_date_end_endyear = GETPOSTINT('search_date_end_endyear'); $search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver $search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); -$search_date_delivery_startday = GETPOST('search_date_delivery_startday', 'int'); -$search_date_delivery_startmonth = GETPOST('search_date_delivery_startmonth', 'int'); -$search_date_delivery_startyear = GETPOST('search_date_delivery_startyear', 'int'); -$search_date_delivery_endday = GETPOST('search_date_delivery_endday', 'int'); -$search_date_delivery_endmonth = GETPOST('search_date_delivery_endmonth', 'int'); -$search_date_delivery_endyear = GETPOST('search_date_delivery_endyear', 'int'); +$search_date_delivery_startday = GETPOSTINT('search_date_delivery_startday'); +$search_date_delivery_startmonth = GETPOSTINT('search_date_delivery_startmonth'); +$search_date_delivery_startyear = GETPOSTINT('search_date_delivery_startyear'); +$search_date_delivery_endday = GETPOSTINT('search_date_delivery_endday'); +$search_date_delivery_endmonth = GETPOSTINT('search_date_delivery_endmonth'); +$search_date_delivery_endyear = GETPOSTINT('search_date_delivery_endyear'); $search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear); $search_date_delivery_end = dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear); -$search_availability = GETPOST('search_availability', 'int'); -$search_categ_cus = GETPOST("search_categ_cus", 'int'); -$search_fk_cond_reglement = GETPOST("search_fk_cond_reglement", 'int'); -$search_fk_shipping_method = GETPOST("search_fk_shipping_method", 'int'); -$search_fk_input_reason = GETPOST("search_fk_input_reason", 'int'); -$search_fk_mode_reglement = GETPOST("search_fk_mode_reglement", 'int'); -$search_date_signature_startday = GETPOST('search_date_signature_startday', 'int'); -$search_date_signature_startmonth = GETPOST('search_date_signature_startmonth', 'int'); -$search_date_signature_startyear = GETPOST('search_date_signature_startyear', 'int'); -$search_date_signature_endday = GETPOST('search_date_signature_endday', 'int'); -$search_date_signature_endmonth = GETPOST('search_date_signature_endmonth', 'int'); -$search_date_signature_endyear = GETPOST('search_date_signature_endyear', 'int'); +$search_availability = GETPOSTINT('search_availability'); +$search_categ_cus = GETPOSTINT("search_categ_cus"); +$search_fk_cond_reglement = GETPOSTINT("search_fk_cond_reglement"); +$search_fk_shipping_method = GETPOSTINT("search_fk_shipping_method"); +$search_fk_input_reason = GETPOSTINT("search_fk_input_reason"); +$search_fk_mode_reglement = GETPOSTINT("search_fk_mode_reglement"); +$search_date_signature_startday = GETPOSTINT('search_date_signature_startday'); +$search_date_signature_startmonth = GETPOSTINT('search_date_signature_startmonth'); +$search_date_signature_startyear = GETPOSTINT('search_date_signature_startyear'); +$search_date_signature_endday = GETPOSTINT('search_date_signature_endday'); +$search_date_signature_endmonth = GETPOSTINT('search_date_signature_endmonth'); +$search_date_signature_endyear = GETPOSTINT('search_date_signature_endyear'); $search_date_signature_start = dol_mktime(0, 0, 0, $search_date_signature_startmonth, $search_date_signature_startday, $search_date_signature_startyear); $search_date_signature_end = dol_mktime(23, 59, 59, $search_date_signature_endmonth, $search_date_signature_endday, $search_date_signature_endyear); $search_status = GETPOST('search_status', 'alpha'); @@ -144,10 +144,10 @@ $optioncss = GETPOST('optioncss', 'alpha'); $object_statut = GETPOST('search_statut', 'alpha'); // Pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index bc408a1c6de..e412b5d1077 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -37,7 +37,7 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('propal', 'compta', 'bills', 'companies')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 3603f89af2a..76809fc222f 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -44,8 +44,8 @@ $object_status = GETPOST('object_status', 'intcomma'); $typent_id = GETPOSTINT('typent_id'); $categ_id = GETPOSTINT('categ_id'); -$userid = GETPOST('userid', 'int'); -$socid = GETPOST('socid', 'int'); +$userid = GETPOSTINT('userid'); +$socid = GETPOSTINT('socid'); // Security check if ($user->socid > 0) { $action = ''; @@ -53,7 +53,7 @@ if ($user->socid > 0) { } $nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); -$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; +$year = GETPOST('year') > 0 ? GETPOSTINT('year') : $nowyear; $startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS')))); $endyear = $year; diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 551172f2674..122d0f88811 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -36,7 +36,7 @@ if ($user->socid > 0) { } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $action = ''; $socid = $user->socid; diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index b1f003f9e11..4881fce1920 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -34,7 +34,7 @@ if (isModEnabled('facture')) { } // Security check -$socid = GETPOST("socid", 'int'); +$socid = GETPOSTINT("socid"); if ($user->socid > 0) { $action = ''; $id = $user->socid; diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index f1c5f748e62..2a3ee4a4991 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -30,9 +30,9 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'orders', 'bills')); -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); -$socid = GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('socid', 'int'); +$socid = GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('socid'); // Security check if ($user->socid > 0) { $socid = $user->socid; @@ -66,7 +66,7 @@ if ($action == 'setremise') { $object = new Societe($db); $object->fetch($id); - $discount_type = GETPOST('discount_type', 'int'); + $discount_type = GETPOSTINT('discount_type'); if (!empty($discount_type)) { $result = $object->set_remise_supplier(price2num(GETPOST("remise")), GETPOST("note", "alphanohtml"), $user); @@ -79,7 +79,7 @@ if ($action == 'setremise') { header("Location: ".$backtopage); exit; } else { - header("Location: remise.php?id=".GETPOST("id", 'int')); + header("Location: remise.php?id=".GETPOSTINT("id")); exit; } } else { @@ -175,10 +175,10 @@ if ($socid > 0) { // Discount type print ''.$langs->trans('DiscountType').''; if ($isCustomer) { - print ' '; + print ' '; } if ($isSupplier) { - print ' '; + print ' '; } print ''; } diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 068fdff9052..994e30fb9f1 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -38,13 +38,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; // Load translation files required by the page $langs->loadLangs(array('orders', 'bills', 'companies')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Security check -$socid = GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('socid', 'int'); +$socid = GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('socid'); if ($user->socid > 0) { $socid = $user->socid; } @@ -75,7 +75,7 @@ if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes' && $permi $amount_ttc_2 = price2num($amount_ttc_2); $error = 0; - $remid = (GETPOST("remid", 'int') ? GETPOST("remid", 'int') : 0); + $remid = (GETPOSTINT("remid") ? GETPOSTINT("remid") : 0); $discount = new DiscountAbsolute($db); $res = $discount->fetch($remid); if (!($res > 0)) { diff --git a/htdocs/commande/agenda.php b/htdocs/commande/agenda.php index 49fe399610b..3c0eea17f23 100644 --- a/htdocs/commande/agenda.php +++ b/htdocs/commande/agenda.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->loadLangs(array("order", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -50,10 +50,10 @@ if (GETPOST('actioncode', 'array')) { $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 988879d2f7f..c2c6cfe44cf 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -78,25 +78,25 @@ if (isModEnabled('productbatch')) { } -$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('orderid', 'int')); +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('orderid')); $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$lineid = GETPOST('lineid', 'int'); -$contactid = GETPOST('contactid', 'int'); -$projectid = GETPOST('projectid', 'int'); +$lineid = GETPOSTINT('lineid'); +$contactid = GETPOSTINT('contactid'); +$projectid = GETPOSTINT('projectid'); $origin = GETPOST('origin', 'alpha'); -$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility -$rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1; +$originid = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility +$rank = (GETPOSTINT('rank') > 0) ? GETPOSTINT('rank') : -1; // PDF -$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); -$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); -$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); +$hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); +$hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); +$hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); // Security check if (!empty($user->socid)) { @@ -139,7 +139,7 @@ $permissiontoadd = $usercancreate; // Used by the include of actions_addu $error = 0; -$date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); +$date_delivery = dol_mktime(GETPOSTINT('liv_hour'), GETPOSTINT('liv_min'), 0, GETPOSTINT('liv_month'), GETPOSTINT('liv_day'), GETPOSTINT('liv_year')); /* @@ -278,11 +278,11 @@ if (empty($reshook)) { } } elseif ($action == 'classin' && $usercancreate) { // Link to a project - $object->setProject(GETPOST('projectid', 'int')); + $object->setProject(GETPOSTINT('projectid')); } elseif ($action == 'add' && $usercancreate) { // Add order $datecommande = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - $date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); + $date_delivery = dol_mktime(GETPOSTINT('liv_hour'), GETPOSTINT('liv_min'), 0, GETPOSTINT('liv_month'), GETPOSTINT('liv_day'), GETPOSTINT('liv_year')); if ($datecommande == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), null, 'errors'); @@ -305,7 +305,7 @@ if (empty($reshook)) { $object->date_commande = $datecommande; $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); - $object->source = GETPOST('source_id', 'int'); + $object->source = GETPOSTINT('source_id'); $object->fk_project = GETPOSTINT('projectid'); $object->ref_client = GETPOST('ref_client', 'alpha'); $object->model_pdf = GETPOST('model'); @@ -520,8 +520,8 @@ if (empty($reshook)) { // Insert default contacts if defined if ($object_id > 0) { - if (GETPOST('contactid', 'int')) { - $result = $object->add_contact(GETPOST('contactid', 'int'), 'CUSTOMER', 'external'); + if (GETPOSTINT('contactid')) { + $result = $object->add_contact(GETPOSTINT('contactid'), 'CUSTOMER', 'external'); if ($result < 0) { setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors'); $error++; @@ -574,14 +574,14 @@ if (empty($reshook)) { } } } elseif ($action == 'setdate' && $usercancreate) { - $date = dol_mktime(0, 0, 0, GETPOST('order_month', 'int'), GETPOST('order_day', 'int'), GETPOST('order_year', 'int')); + $date = dol_mktime(0, 0, 0, GETPOSTINT('order_month'), GETPOSTINT('order_day'), GETPOSTINT('order_year')); $result = $object->set_date($user, $date); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'setdate_livraison' && $usercancreate) { - $date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); + $date_delivery = dol_mktime(GETPOSTINT('liv_hour'), GETPOSTINT('liv_min'), 0, GETPOSTINT('liv_month'), GETPOSTINT('liv_day'), GETPOSTINT('liv_year')); $object->fetch($id); $result = $object->setDeliveryDate($user, $date_delivery); @@ -589,7 +589,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'setmode' && $usercancreate) { - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + $result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -598,7 +598,7 @@ if (empty($reshook)) { $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); } elseif ($action == 'setmulticurrencyrate' && $usercancreate) { // Multicurrency rate - $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOST('calculation_mode', 'int')); + $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOSTINT('calculation_mode')); } elseif ($action == 'setavailability' && $usercancreate) { $result = $object->availability(GETPOST('availability_id')); if ($result < 0) { @@ -638,19 +638,19 @@ if (empty($reshook)) { } } elseif ($action == 'setbankaccount' && $usercancreate) { // bank account - $result = $object->setBankAccount(GETPOST('fk_account', 'int')); + $result = $object->setBankAccount(GETPOSTINT('fk_account')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'setshippingmethod' && $usercancreate) { // shipping method - $result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int')); + $result = $object->setShippingMethod(GETPOSTINT('shipping_method_id')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'setwarehouse' && $usercancreate) { // warehouse - $result = $object->setWarehouse(GETPOST('warehouse_id', 'int')); + $result = $object->setWarehouse(GETPOSTINT('warehouse_id')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -708,7 +708,7 @@ if (empty($reshook)) { if ($prod_entry_mode == 'free') { $idprod = 0; } else { - $idprod = GETPOST('idprod', 'int'); + $idprod = GETPOSTINT('idprod'); if (getDolGlobalString('MAIN_DISABLE_FREE_LINES') && $idprod <= 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")), null, 'errors'); @@ -852,7 +852,7 @@ if (empty($reshook)) { // If price per quantity if ($prod->prices_by_qty[0]) { // yes, this product has some prices per quantity // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. - $pqp = GETPOST('pbq', 'int'); + $pqp = GETPOSTINT('pbq'); // Search price into product_price_by_qty from $prod->id foreach ($prod->prices_by_qty_list[0] as $priceforthequantityarray) { @@ -873,7 +873,7 @@ if (empty($reshook)) { // If price per quantity and customer if ($prod->prices_by_qty[$object->thirdparty->price_level]) { // yes, this product has some prices per quantity // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. - $pqp = GETPOST('pbq', 'int'); + $pqp = GETPOSTINT('pbq'); // Search price into product_price_by_qty from $prod->id foreach ($prod->prices_by_qty_list[$object->thirdparty->price_level] as $priceforthequantityarray) { if ($priceforthequantityarray['rowid'] != $pqp) { @@ -1199,7 +1199,7 @@ if (empty($reshook)) { $remise_percent = GETPOST('remise_percent') != '' ? price2num(GETPOST('remise_percent'), '', 2) : 0; // Check minimum price - $productid = GETPOST('productid', 'int'); + $productid = GETPOSTINT('productid'); if (!empty($productid)) { $product = new Product($db); $product->fetch($productid); @@ -1252,7 +1252,7 @@ if (empty($reshook)) { if (!$error) { if (!$user->hasRight('margins', 'creer')) { foreach ($object->lines as &$line) { - if ($line->id == GETPOST('lineid', 'int')) { + if ($line->id == GETPOSTINT('lineid')) { $fournprice = $line->fk_fournprice; $buyingprice = $line->pa_ht; break; @@ -1267,7 +1267,7 @@ if (empty($reshook)) { $price_base_type = 'TTC'; } - $result = $object->updateline(GETPOST('lineid', 'int'), $description, $pu, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $price_base_type, $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise); + $result = $object->updateline(GETPOSTINT('lineid'), $description, $pu, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $price_base_type, $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise); if ($result >= 0) { if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) { @@ -1323,7 +1323,7 @@ if (empty($reshook)) { header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // To re-display card in edit mode exit(); } elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) { - $idwarehouse = GETPOST('idwarehouse', 'int'); + $idwarehouse = GETPOSTINT('idwarehouse'); $qualified_for_stock_change = 0; if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { @@ -1359,14 +1359,14 @@ if (empty($reshook)) { ) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; - $date = dol_mktime(0, 0, 0, GETPOST('datefmonth', 'int'), GETPOST('datefday', 'int'), GETPOST('datefyear', 'int')); + $date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear')); $forceFields = array(); if (GETPOSTISSET('date_pointoftax')) { - $forceFields['date_pointoftax'] = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); + $forceFields['date_pointoftax'] = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear')); } - $deposit = Facture::createDepositFromOrigin($object, $date, GETPOST('cond_reglement_id', 'int'), $user, 0, GETPOST('validate_generated_deposit', 'alpha') == 'on', $forceFields); + $deposit = Facture::createDepositFromOrigin($object, $date, GETPOSTINT('cond_reglement_id'), $user, 0, GETPOSTINT('validate_generated_deposit') == 'on', $forceFields); if ($deposit) { setEventMessage('DepositGenerated'); @@ -1469,7 +1469,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'confirm_cancel' && $confirm == 'yes' && $usercanvalidate) { - $idwarehouse = GETPOST('idwarehouse', 'int'); + $idwarehouse = GETPOSTINT('idwarehouse'); $qualified_for_stock_change = 0; if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { @@ -1633,7 +1633,7 @@ if (empty($reshook)) { } elseif ($action == 'swapstatut') { // bascule du statut d'un contact if ($object->id > 0) { - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } else { dol_print_error($db); } @@ -1956,7 +1956,7 @@ if ($action == 'create' && $usercancreate) { if (isModEnabled('expedition')) { print ''.$langs->trans('SendingMethod').''; print img_picto('', 'object_dolly', 'class="pictofixedwidth"'); - $form->selectShippingMethod(((GETPOSTISSET('shipping_method_id') && GETPOST('shipping_method_id', 'int') != 0) ? GETPOST('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); + $form->selectShippingMethod(((GETPOSTISSET('shipping_method_id') && GETPOSTINT('shipping_method_id') != 0) ? GETPOST('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); print ''; } @@ -2216,7 +2216,7 @@ if ($action == 'create' && $usercancreate) { // 'text' => $langs->trans("ConfirmClone"), // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse', 'int') ? GETPOST('idwarehouse', 'int') : 'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) + array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOSTINT('idwarehouse') ? GETPOSTINT('idwarehouse') : 'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) ); } @@ -2428,7 +2428,7 @@ if ($action == 'create' && $usercancreate) { $filter = '(s.client:IN:1,2,3)'; // Create an array for form $formquestion = array( - array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', $filter, '', 0, 0, null, 0, 'maxwidth300')) + array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', $filter, '', 0, 0, null, 0, 'maxwidth300')) ); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index f031865993b..0df141b3c41 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Load translation files required by the page $langs->loadLangs(array('orders', 'sendings', 'companies', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); @@ -71,7 +71,7 @@ if (empty($reshook)) { $result = $object->fetch($id); if ($result > 0 && $id > 0) { - $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $contactid = (GETPOSTINT('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); } @@ -90,14 +90,14 @@ if (empty($reshook)) { } elseif ($action == 'swapstatut' && $user->hasRight('commande', 'creer')) { // Toggle the status of a contact if ($object->fetch($id)) { - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } else { dol_print_error($db); } } elseif ($action == 'deletecontact' && $user->hasRight('commande', 'creer')) { // Delete contact $object->fetch($id); - $result = $object->delete_contact(GETPOST("lineid", 'int')); + $result = $object->delete_contact(GETPOSTINT("lineid")); if ($result >= 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 828722687d4..07086496213 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -46,10 +46,10 @@ if (!$user->hasRight('facture', 'creer')) { // Load translation files required by the page $langs->loadLangs(array("companies", "orders")); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 864375fbf5d..550ed05cc01 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -42,14 +42,14 @@ $langs->loadLangs(array('companies', 'other', 'bills', 'orders')); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 3d3bdc94425..0186d660953 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -50,7 +50,7 @@ $hookmanager->initHooks(array('ordersindex')); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid > 0) { $action = ''; $socid = $user->socid; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index de9e0bd9892..c9fa02304f5 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -56,29 +56,29 @@ $langs->loadLangs(array('orders', 'sendings', 'deliveries', 'companies', 'compta // Get Parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'orderlist'; $mode = GETPOST('mode', 'alpha'); // Search Parameters -$search_datecloture_start = GETPOST('search_datecloture_start', 'int'); +$search_datecloture_start = GETPOSTINT('search_datecloture_start'); if (empty($search_datecloture_start)) { - $search_datecloture_start = dol_mktime(0, 0, 0, GETPOST('search_datecloture_startmonth', 'int'), GETPOST('search_datecloture_startday', 'int'), GETPOST('search_datecloture_startyear', 'int')); + $search_datecloture_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datecloture_startmonth'), GETPOSTINT('search_datecloture_startday'), GETPOSTINT('search_datecloture_startyear')); } -$search_datecloture_end = GETPOST('search_datecloture_end', 'int'); +$search_datecloture_end = GETPOSTINT('search_datecloture_end'); if (empty($search_datecloture_end)) { - $search_datecloture_end = dol_mktime(23, 59, 59, GETPOST('search_datecloture_endmonth', 'int'), GETPOST('search_datecloture_endday', 'int'), GETPOST('search_datecloture_endyear', 'int')); + $search_datecloture_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datecloture_endmonth'), GETPOSTINT('search_datecloture_endday'), GETPOSTINT('search_datecloture_endyear')); } -$search_dateorder_start = dol_mktime(0, 0, 0, GETPOST('search_dateorder_start_month', 'int'), GETPOST('search_dateorder_start_day', 'int'), GETPOST('search_dateorder_start_year', 'int')); -$search_dateorder_end = dol_mktime(23, 59, 59, GETPOST('search_dateorder_end_month', 'int'), GETPOST('search_dateorder_end_day', 'int'), GETPOST('search_dateorder_end_year', 'int')); -$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_start_month', 'int'), GETPOST('search_datedelivery_start_day', 'int'), GETPOST('search_datedelivery_start_year', 'int')); -$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_end_month', 'int'), GETPOST('search_datedelivery_end_day', 'int'), GETPOST('search_datedelivery_end_year', 'int')); +$search_dateorder_start = dol_mktime(0, 0, 0, GETPOSTINT('search_dateorder_start_month'), GETPOSTINT('search_dateorder_start_day'), GETPOSTINT('search_dateorder_start_year')); +$search_dateorder_end = dol_mktime(23, 59, 59, GETPOSTINT('search_dateorder_end_month'), GETPOSTINT('search_dateorder_end_day'), GETPOSTINT('search_dateorder_end_year')); +$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datedelivery_start_month'), GETPOSTINT('search_datedelivery_start_day'), GETPOSTINT('search_datedelivery_start_year')); +$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datedelivery_end_month'), GETPOSTINT('search_datedelivery_end_day'), GETPOSTINT('search_datedelivery_end_year')); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); -$search_product_category = GETPOST('search_product_category', 'int'); +$search_product_category = GETPOSTINT('search_product_category'); $search_ref = GETPOST('search_ref', 'alpha') != '' ? GETPOST('search_ref', 'alpha') : GETPOST('sref', 'alpha'); $search_ref_customer = GETPOST('search_ref_customer', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); @@ -87,14 +87,14 @@ $search_parent_name = trim(GETPOST('search_parent_name', 'alphanohtml')); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST('search_state', 'alpha'); -$search_country = GETPOST('search_country', 'int'); -$search_type_thirdparty = GETPOST('search_type_thirdparty', 'int'); -$search_user = GETPOST('search_user', 'int'); -$search_sale = GETPOST('search_sale', 'int'); +$search_country = GETPOSTINT('search_country'); +$search_type_thirdparty = GETPOSTINT('search_type_thirdparty'); +$search_user = GETPOSTINT('search_user'); +$search_sale = GETPOSTINT('search_sale'); $search_total_ht = GETPOST('search_total_ht', 'alpha'); $search_total_vat = GETPOST('search_total_vat', 'alpha'); $search_total_ttc = GETPOST('search_total_ttc', 'alpha'); -$search_warehouse = GETPOST('search_warehouse', 'int'); +$search_warehouse = GETPOSTINT('search_warehouse'); $search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha'); $search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha'); @@ -103,26 +103,26 @@ $search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', $search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); -$search_categ_cus = GETPOST("search_categ_cus", 'int'); +$search_categ_cus = GETPOSTINT("search_categ_cus"); $optioncss = GETPOST('optioncss', 'alpha'); -$search_billed = GETPOST('search_billed', 'int'); -$search_status = GETPOST('search_status', 'int'); +$search_billed = GETPOSTINT('search_billed'); +$search_status = GETPOSTINT('search_status'); $search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_project = GETPOST('search_project', 'alpha'); $search_shippable = GETPOST('search_shippable', 'aZ09'); -$search_fk_cond_reglement = GETPOST('search_fk_cond_reglement', 'int'); -$search_fk_shipping_method = GETPOST('search_fk_shipping_method', 'int'); -$search_fk_mode_reglement = GETPOST('search_fk_mode_reglement', 'int'); -$search_fk_input_reason = GETPOST('search_fk_input_reason', 'int'); +$search_fk_cond_reglement = GETPOSTINT('search_fk_cond_reglement'); +$search_fk_shipping_method = GETPOSTINT('search_fk_shipping_method'); +$search_fk_mode_reglement = GETPOSTINT('search_fk_mode_reglement'); +$search_fk_input_reason = GETPOSTINT('search_fk_input_reason'); $diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id; // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -228,7 +228,7 @@ if (!$user->hasRight('societe', 'client', 'voir')) { } // Security check -$id = (GETPOST('orderid') ? GETPOST('orderid', 'int') : GETPOST('id', 'int')); +$id = (GETPOST('orderid') ? GETPOSTINT('orderid') : GETPOSTINT('id')); if ($user->socid) { $socid = $user->socid; } @@ -333,8 +333,8 @@ if (empty($reshook)) { if ($massaction == 'confirm_createbills') { // Create bills from orders. $orders = GETPOST('toselect', 'array'); - $createbills_onebythird = GETPOST('createbills_onebythird', 'int'); - $validate_invoices = GETPOST('validate_invoices', 'int'); + $createbills_onebythird = GETPOSTINT('createbills_onebythird'); + $validate_invoices = GETPOSTINT('validate_invoices'); $errors = array(); @@ -376,7 +376,7 @@ if (empty($reshook)) { $objecttmp->ref_client = $cmd->ref_client; } - $datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $datefacture = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); if (empty($datefacture)) { $datefacture = dol_now(); } @@ -1512,7 +1512,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); -if (GETPOST('autoselectall', 'int')) { +if (GETPOSTINT('autoselectall')) { $selectedfields .= ''; } - if (!GETPOST('fac_rec', 'int')) { + if (!GETPOSTINT('fac_rec')) { print ' '; } print ''; @@ -3394,8 +3394,8 @@ if ($action == 'create') { } // Overwrite some values if creation of invoice is from a predefined invoice - if (empty($origin) && empty($originid) && GETPOST('fac_rec', 'int') > 0) { - $invoice_predefined->fetch(GETPOST('fac_rec', 'int')); + if (empty($origin) && empty($originid) && GETPOSTINT('fac_rec') > 0) { + $invoice_predefined->fetch(GETPOSTINT('fac_rec')); $dateinvoice = $invoice_predefined->date_when; // To use next gen date by default later if (empty($projectid)) { @@ -3431,9 +3431,9 @@ if ($action == 'create') { while ($i < $num) { $objp = $db->fetch_object($resql); print ''; $i++; @@ -3469,7 +3469,7 @@ if ($action == 'create') { // Standard invoice print '
'; - $tmp = ' '; + $tmp = ' '; $tmp = $tmp.''; $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3, 'standardonsmartphone'); print ''; @@ -3540,7 +3540,7 @@ if ($action == 'create') { 'variablealllines' => $langs->transnoentitiesnoconv('VarAmountAllLines') ); $typedeposit = GETPOST('typedeposit', 'aZ09'); - $valuedeposit = GETPOST('valuedeposit', 'int'); + $valuedeposit = GETPOSTINT('valuedeposit'); if (empty($typedeposit) && !empty($objectsrc->deposit_percent)) { $origin_payment_conditions_deposit_percent = getDictionaryValue('c_payment_term', 'deposit_percent', $objectsrc->cond_reglement_id); if (!empty($origin_payment_conditions_deposit_percent)) { @@ -3573,10 +3573,10 @@ if ($action == 'create') { print ''; // Next situation invoice - $opt = $form->selectSituationInvoices(GETPOST('originid', 'int'), $socid); + $opt = $form->selectSituationInvoices(GETPOSTINT('originid'), $socid); print '
'; - $tmp = ''.$langs->trans('NoSituations').'') || (GETPOST('origin') && GETPOST('origin') != 'facture' && GETPOST('origin') != 'commande')) { $tmp .= ' disabled'; } @@ -3606,7 +3606,7 @@ if ($action == 'create') { if (is_array($facids)) { foreach ($facids as $facparam) { $options .= '
'; print '
'; @@ -3828,8 +3828,8 @@ if ($action == 'create') { print ''; } - $newdateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver'); - $date_pointoftax = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int'), 'tzserver'); + $newdateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); + $date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver'); // Date invoice print ''; // Number diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index fc1dbded732..16d1af4f562 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -34,10 +34,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; // Load translation files required by the page $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin")); -$local = GETPOST('localTaxType', 'int'); +$local = GETPOSTINT('localTaxType'); // Date range -$year = GETPOST("year", "int"); +$year = GETPOSTINT("year"); if (empty($year)) { $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year_start = $year_current; @@ -93,14 +93,14 @@ if (empty($min)) { // 0=normal, 1=option vat for services is on debit, 2=option on payments for products $modetax = getDolGlobalString('TAX_MODE'); if (GETPOSTISSET("modetax")) { - $modetax = GETPOST("modetax", 'int'); + $modetax = GETPOSTINT("modetax"); } if (empty($modetax)) { $modetax = 0; } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index caa5173a13c..0e6ffde780c 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -35,10 +35,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; // Load translation files required by the page $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin")); -$localTaxType = GETPOST('localTaxType', 'int'); +$localTaxType = GETPOSTINT('localTaxType'); // Date range -$year = GETPOST("year", "int"); +$year = GETPOSTINT("year"); if (empty($year)) { $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year_start = $year_current; @@ -49,11 +49,11 @@ if (empty($year)) { $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear")); $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear")); if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int"); + $q = GETPOSTINT("q"); if (empty($q)) { - if (GETPOST("month", "int")) { - $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); - $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); + if (GETPOSTINT("month")) { + $date_start = dol_get_first_day($year_start, GETPOSTINT("month"), false); + $date_end = dol_get_last_day($year_start, GETPOSTINT("month"), false); } else { $date_start = dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START, false); $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; @@ -82,14 +82,14 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e // 0=normal, 1=option vat for services is on debit, 2=option on payments for products $modetax = getDolGlobalString('TAX_MODE'); if (GETPOSTISSET("modetax")) { - $modetax = GETPOST("modetax", 'int'); + $modetax = GETPOSTINT("modetax"); } if (empty($modetax)) { $modetax = 0; } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/localtax/list.php b/htdocs/compta/localtax/list.php index f7e1a6a5431..6b11de62daa 100644 --- a/htdocs/compta/localtax/list.php +++ b/htdocs/compta/localtax/list.php @@ -28,16 +28,16 @@ require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; // Load translation files required by the page $langs->load("compta"); -$limit = GETPOST('limit', 'int'); +$limit = GETPOSTINT('limit'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } $result = restrictedArea($user, 'tax', '', '', 'charges'); -$ltt = GETPOST("localTaxType", 'int'); +$ltt = GETPOSTINT("localTaxType"); $mode = GETPOST('mode', 'alpha'); diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 6a508abb5f8..63df3750d22 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -45,9 +45,9 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class. // Load translation files required by the page $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin")); -$local = GETPOST('localTaxType', 'int'); +$local = GETPOSTINT('localTaxType'); // Date range -$year = GETPOST("year", "int"); +$year = GETPOSTINT("year"); if (empty($year)) { $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year_start = $year_current; @@ -59,11 +59,11 @@ $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_star $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear")); // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int"); + $q = GETPOSTINT("q"); if (empty($q)) { - if (GETPOST("month", "int")) { - $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); - $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); + if (GETPOSTINT("month")) { + $date_start = dol_get_first_day($year_start, GETPOSTINT("month"), false); + $date_end = dol_get_last_day($year_start, GETPOSTINT("month"), false); } else { $date_start = dol_get_first_day($year_start, !getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START, false); if (!getDolGlobalString('MAIN_INFO_VAT_RETURN') || getDolGlobalInt('MAIN_INFO_VAT_RETURN') == 2) { @@ -105,14 +105,14 @@ if (empty($min)) { $calc = getDolGlobalString('MAIN_INFO_LOCALTAX_CALC').$local; $modetax = getDolGlobalInt('TAX_MODE'); if (GETPOSTISSET("modetax")) { - $modetax = GETPOST("modetax", 'int'); + $modetax = GETPOSTINT("modetax"); } if (empty($modetax)) { $modetax = 0; } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 8a066a3ba42..2a593eb6543 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -53,7 +53,7 @@ $socid = GETPOSTINT('socid'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); $amounts = array(); $amountsresttopay = array(); @@ -164,7 +164,7 @@ if (empty($reshook)) { } } - $formquestion[$i++] = array('type' => 'hidden', 'name' => $key, 'value' => GETPOST($key, 'int')); + $formquestion[$i++] = array('type' => 'hidden', 'name' => $key, 'value' => GETPOSTINT($key)); } } @@ -253,7 +253,7 @@ if (empty($reshook)) { if (isModEnabled("banque")) { // If the bank module is active, an account is required to input a payment - if (GETPOST('accountid', 'int') <= 0) { + if (GETPOSTINT('accountid') <= 0) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors'); $error++; } @@ -933,7 +933,7 @@ if (!GETPOST('action', 'aZ09')) { if (empty($page) || $page == -1) { $page = 0; } - $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; + $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; if (!$sortorder) { diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 7252650d2e0..bfdd60e522f 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -43,13 +43,13 @@ if (isModEnabled('margin')) { // Load translation files required by the page $langs->loadLangs(array('bills', 'banks', 'companies')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($socid < 0) { $socid = 0; } @@ -218,7 +218,7 @@ if (empty($reshook)) { } if ($action == 'setdatep' && GETPOST('datepday') && $user->hasRight('facture', 'paiement')) { - $datepaye = dol_mktime(GETPOST('datephour', 'int'), GETPOST('datepmin', 'int'), GETPOST('datepsec', 'int'), GETPOST('datepmonth', 'int'), GETPOST('datepday', 'int'), GETPOST('datepyear', 'int')); + $datepaye = dol_mktime(GETPOSTINT('datephour'), GETPOSTINT('datepmin'), GETPOSTINT('datepsec'), GETPOSTINT('datepmonth'), GETPOSTINT('datepday'), GETPOSTINT('datepyear')); $res = $object->update_date($datepaye); if ($res === 0) { setEventMessages($langs->trans('PaymentDateUpdateSucceeded'), null, 'mesgs'); @@ -237,7 +237,7 @@ if (empty($reshook)) { $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note } - $bankaccountid = GETPOST('accountid', 'int'); + $bankaccountid = GETPOSTINT('accountid'); if ($bankaccountid > 0) { $object->paiementcode = $object->type_code; $object->amounts = $object->getAmountsArray(); diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 898320fdb1c..b2dcd4f0bc5 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -51,7 +51,7 @@ $object = new RemiseCheque($db); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "ASC"; } @@ -61,21 +61,21 @@ if (!$sortfield) { if (empty($page) || $page == -1) { $page = 0; } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; $upload_dir = $conf->bank->multidir_output[$object->entity ? $object->entity : $conf->entity]."/checkdeposits"; // filter by dates from / to -$search_date_start_day = GETPOST('search_date_start_day', 'int'); -$search_date_start_month = GETPOST('search_date_start_month', 'int'); -$search_date_start_year = GETPOST('search_date_start_year', 'int'); -$search_date_end_day = GETPOST('search_date_end_day', 'int'); -$search_date_end_month = GETPOST('search_date_end_month', 'int'); -$search_date_end_year = GETPOST('search_date_end_year', 'int'); +$search_date_start_day = GETPOSTINT('search_date_start_day'); +$search_date_start_month = GETPOSTINT('search_date_start_month'); +$search_date_start_year = GETPOSTINT('search_date_start_year'); +$search_date_end_day = GETPOSTINT('search_date_end_day'); +$search_date_end_month = GETPOSTINT('search_date_end_month'); +$search_date_end_year = GETPOSTINT('search_date_end_year'); $search_date_start = dol_mktime(0, 0, 0, $search_date_start_month, $search_date_start_day, $search_date_start_year); $search_date_end = dol_mktime(23, 59, 59, $search_date_end_month, $search_date_end_day, $search_date_end_year); -$filteraccountid = GETPOST('accountid', 'int'); +$filteraccountid = GETPOSTINT('accountid'); // Security check $fieldname = (!empty($ref) ? 'ref' : 'rowid'); @@ -100,9 +100,9 @@ $arrayofpaymentmodetomanage = explode(',', getDolGlobalString('BANK_PAYMENT_MODE */ if ($action == 'setdate' && $user->hasRight('banque', 'cheque')) { - $result = $object->fetch(GETPOST('id', 'int')); + $result = $object->fetch(GETPOSTINT('id')); if ($result > 0) { - $date = dol_mktime(0, 0, 0, GETPOST('datecreate_month', 'int'), GETPOST('datecreate_day', 'int'), GETPOST('datecreate_year', 'int')); + $date = dol_mktime(0, 0, 0, GETPOSTINT('datecreate_month'), GETPOSTINT('datecreate_day'), GETPOSTINT('datecreate_year')); $result = $object->set_date($user, $date); if ($result < 0) { @@ -114,7 +114,7 @@ if ($action == 'setdate' && $user->hasRight('banque', 'cheque')) { } if ($action == 'setrefext' && $user->hasRight('banque', 'cheque')) { - $result = $object->fetch(GETPOST('id', 'int')); + $result = $object->fetch(GETPOSTINT('id')); if ($result > 0) { $ref_ext = GETPOST('ref_ext'); @@ -128,7 +128,7 @@ if ($action == 'setrefext' && $user->hasRight('banque', 'cheque')) { } if ($action == 'setref' && $user->hasRight('banque', 'cheque')) { - $result = $object->fetch(GETPOST('id', 'int')); + $result = $object->fetch(GETPOSTINT('id')); if ($result > 0) { $ref = GETPOST('ref'); @@ -141,12 +141,12 @@ if ($action == 'setref' && $user->hasRight('banque', 'cheque')) { } } -if ($action == 'create' && GETPOST("accountid", "int") > 0 && $user->hasRight('banque', 'cheque')) { +if ($action == 'create' && GETPOSTINT("accountid") > 0 && $user->hasRight('banque', 'cheque')) { if (GETPOSTISARRAY('toRemise')) { $object->type = $type; $arrayofid = GETPOST('toRemise', 'array:int'); - $result = $object->create($user, GETPOST("accountid", "int"), 0, $arrayofid); + $result = $object->create($user, GETPOSTINT("accountid"), 0, $arrayofid); if ($result > 0) { if ($object->statut == 1) { // If statut is validated, we build doc $object->fetch($object->id); // To force to reload all properties in correct property name @@ -175,9 +175,9 @@ if ($action == 'create' && GETPOST("accountid", "int") > 0 && $user->hasRight('b } } -if ($action == 'remove' && $id > 0 && GETPOST("lineid", 'int') > 0 && $user->hasRight('banque', 'cheque')) { +if ($action == 'remove' && $id > 0 && GETPOSTINT("lineid") > 0 && $user->hasRight('banque', 'cheque')) { $object->id = $id; - $result = $object->removeCheck(GETPOST("lineid", "int")); + $result = $object->removeCheck(GETPOSTINT("lineid")); if ($result === 0) { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; @@ -223,7 +223,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->hasRight('banqu if ($action == 'confirm_reject_check' && $confirm == 'yes' && $user->hasRight('banque', 'cheque')) { $reject_date = dol_mktime(0, 0, 0, GETPOST('rejectdate_month'), GETPOST('rejectdate_day'), GETPOST('rejectdate_year')); - $rejected_check = GETPOST('bankid', 'int'); + $rejected_check = GETPOSTINT('bankid'); $object->fetch($id); $paiement_id = $object->rejectCheck($rejected_check, $reject_date); @@ -362,7 +362,7 @@ if ($action == 'new') { */ if ($action == 'reject_check') { $formquestion = array( - array('type' => 'hidden', 'name' => 'bankid', 'value' => GETPOST('lineid', 'int')), + array('type' => 'hidden', 'name' => 'bankid', 'value' => GETPOSTINT('lineid')), array('type' => 'date', 'name' => 'rejectdate_', 'label' => $langs->trans("RejectCheckDate"), 'value' => dol_now()) ); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("RejectCheck"), $langs->trans("ConfirmRejectCheck"), 'confirm_reject_check', $formquestion, '', 1); diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 8aa74f5fe2a..3d7129afbcd 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -42,22 +42,22 @@ if ($user->socid) { $result = restrictedArea($user, 'banque', '', ''); $search_ref = GETPOST('search_ref', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); -$search_account = GETPOST('search_account', 'int'); +$search_account = GETPOSTINT('search_account'); $search_amount = GETPOST('search_amount', 'alpha'); $mode = GETPOST('mode', 'alpha'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/paiement/info.php b/htdocs/compta/paiement/info.php index 1cbee7a50cb..424a960061e 100644 --- a/htdocs/compta/paiement/info.php +++ b/htdocs/compta/paiement/info.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Load translation files required by the page $langs->loadLangs(array('bills', 'companies')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 693f6c8de39..bbded249fb9 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -47,32 +47,32 @@ $confirm = GETPOST('confirm', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'paymentlist'; -$facid = GETPOST('facid', 'int'); -$socid = GETPOST('socid', 'int'); -$userid = GETPOST('userid', 'int'); +$facid = GETPOSTINT('facid'); +$socid = GETPOSTINT('socid'); +$userid = GETPOSTINT('userid'); $search_ref = GETPOST("search_ref", "alpha"); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_company = GETPOST("search_company", 'alpha'); $search_paymenttype = GETPOST("search_paymenttype"); -$search_account = GETPOST("search_account", "int"); +$search_account = GETPOSTINT("search_account"); $search_payment_num = GETPOST('search_payment_num', 'alpha'); $search_amount = GETPOST("search_amount", 'alpha'); // alpha because we must be able to search on "< x" $search_status = GETPOST('search_status', 'intcomma'); -$search_sale = GETPOST('search_sale', 'int'); +$search_sale = GETPOSTINT('search_sale'); $mode = GETPOST('mode', 'alpha'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index 9685b6821c2..52c5bfb27fe 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -44,7 +44,7 @@ if (!$user->hasRight('societe', 'client', 'voir')) { $dir .= '/private/'.$user->id; // If user has no permission to see all, output dir is specific to user } -$year = GETPOST('year', 'int'); +$year = GETPOSTINT('year'); if (!$year) { $year = date("Y"); } @@ -71,14 +71,14 @@ if ($action == 'builddoc') { // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. $sav_charset_output = $outputlangs->charset_output; - if ($rap->write_file($dir, GETPOST("remonth", "int"), GETPOST("reyear", "int"), $outputlangs) > 0) { + if ($rap->write_file($dir, GETPOSTINT("remonth"), GETPOSTINT("reyear"), $outputlangs) > 0) { $outputlangs->charset_output = $sav_charset_output; } else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, $obj->error); } - $year = GETPOST("reyear", "int"); + $year = GETPOSTINT("reyear"); } diff --git a/htdocs/compta/paiement/tovalidate.php b/htdocs/compta/paiement/tovalidate.php index 5caada7cd7e..8735b7c0ebd 100644 --- a/htdocs/compta/paiement/tovalidate.php +++ b/htdocs/compta/paiement/tovalidate.php @@ -35,10 +35,10 @@ if ($user->socid > 0) { } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index c61dbcf3084..dce1a7f5d83 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -60,7 +60,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y exit; } - $datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int")); + $datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); if (!(GETPOST("paiementtype") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")), null, 'errors'); @@ -118,7 +118,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y } if (!$error) { - $result = $paiement->addPaymentToBank($user, 'payment_sc', '(SocialContributionPayment)', GETPOST('accountid', 'int'), '', ''); + $result = $paiement->addPaymentToBank($user, 'payment_sc', '(SocialContributionPayment)', GETPOSTINT('accountid'), '', ''); if (!($result > 0)) { $error++; setEventMessages($paiement->error, null, 'errors'); @@ -202,7 +202,7 @@ if ($action == 'create') { print '';*/ print '"; @@ -218,7 +218,7 @@ if ($action == 'create') { print ''; print ''; // Number diff --git a/htdocs/compta/paiement_vat.php b/htdocs/compta/paiement_vat.php index 3cac781c50e..30fb1768dc7 100644 --- a/htdocs/compta/paiement_vat.php +++ b/htdocs/compta/paiement_vat.php @@ -58,9 +58,9 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y exit; } - $datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int')); + $datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); - if (!(GETPOST("paiementtype", 'int') > 0)) { + if (!(GETPOSTINT("paiementtype") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")), null, 'errors'); $error++; $action = 'create'; @@ -70,7 +70,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y $error++; $action = 'create'; } - if (isModEnabled("banque") && !(GETPOST("accountid", 'int') > 0)) { + if (isModEnabled("banque") && !(GETPOSTINT("accountid") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToDebit")), null, 'errors'); $error++; $action = 'create'; @@ -116,7 +116,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y } if (!$error) { - $result = $paiement->addPaymentToBank($user, 'payment_vat', '(VATPayment)', GETPOST('accountid', 'int'), '', ''); + $result = $paiement->addPaymentToBank($user, 'payment_vat', '(VATPayment)', GETPOSTINT('accountid'), '', ''); if (!($result > 0)) { $error++; setEventMessages($paiement->error, null, 'errors'); @@ -201,14 +201,14 @@ if ($action == 'create') { print '';*/ print '"; print ''; print '\n"; print ''; @@ -216,7 +216,7 @@ if ($action == 'create') { print ''; print ''; // Number diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index fe6eb04fcde..7e6303486d0 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -40,7 +40,7 @@ if (isModEnabled("banque")) { $langs->loadLangs(array('bills', 'banks', 'companies')); // Security check -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'aZ09'); if ($user->socid) { diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index 12650cb0122..f27bec0c8b6 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -40,7 +40,7 @@ if (isModEnabled("banque")) { $langs->loadLangs(array('bills', 'banks', 'companies')); // Security check -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); if ($user->socid) { diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index 5f808e03e2e..8848d70c325 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; $langs->loadLangs(array('banks', 'categories', 'withdrawals')); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index e9cf5f7dfa8..508c05c777f 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -38,17 +38,17 @@ $langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawal // Get supervariables $action = GETPOST('action', 'aZ09'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $type = GETPOST('type', 'aZ09'); -$date_trans = dol_mktime(GETPOST('date_transhour', 'int'), GETPOST('date_transmin', 'int'), GETPOST('date_transsec', 'int'), GETPOST('date_transmonth', 'int'), GETPOST('date_transday', 'int'), GETPOST('date_transyear', 'int')); +$date_trans = dol_mktime(GETPOSTINT('date_transhour'), GETPOSTINT('date_transmin'), GETPOSTINT('date_transsec'), GETPOSTINT('date_transmonth'), GETPOSTINT('date_transday'), GETPOSTINT('date_transyear')); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -104,7 +104,7 @@ if ($reshook < 0) { if (empty($reshook)) { if ($action == 'setbankaccount' && $permissiontoadd) { $object->oldcopy = dol_clone($object, 2); - $object->fk_bank_account = GETPOST('fk_bank_account', 'int'); + $object->fk_bank_account = GETPOSTINT('fk_bank_account'); $object->update($user); } @@ -119,7 +119,7 @@ if (empty($reshook)) { if ($action == 'infotrans' && $permissiontosend) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $dt = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); /* if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $object->ref) @@ -150,7 +150,7 @@ if (empty($reshook)) { // Set direct debit order to credited, create payment and close invoices if ($action == 'setinfocredit' && $permissiontocreditdebit) { - $dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $dt = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); if (($object->type != 'bank-transfer' && $object->statut == BonPrelevement::STATUS_CREDITED) || ($object->type == 'bank-transfer' && $object->statut == BonPrelevement::STATUS_DEBITED)) { $error = 1; diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index f9cbe577064..1e44e0d7088 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -51,11 +51,11 @@ $mode = GETPOST('mode', 'alpha') ? GETPOST('mode', 'alpha') : 'real'; $type = GETPOST('type', 'aZ09'); $sourcetype = GETPOST('sourcetype', 'aZ09'); $format = GETPOST('format', 'aZ09'); -$id_bankaccount = GETPOST('id_bankaccount', 'int'); -$executiondate = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); +$id_bankaccount = GETPOSTINT('id_bankaccount'); +$executiondate = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -64,7 +64,7 @@ $offset = $limit * $page; $hookmanager->initHooks(array('directdebitcreatecard', 'globalcard')); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } @@ -218,7 +218,7 @@ $arrayofselected = is_array($toselect) ? $toselect : array(); // List of mass actions available $arrayofmassactions = array( ); -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index a072d5774da..50177879826 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -37,8 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies')); // Security check -$socid = GETPOST('socid', 'int'); -$status = GETPOST('status', 'int'); +$socid = GETPOSTINT('socid'); +$status = GETPOSTINT('status'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page @@ -51,10 +51,10 @@ $search_facture = GETPOST('search_facture', 'alpha'); $search_societe = GETPOST('search_societe', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 157188d326f..358d5c9fff6 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -38,17 +38,17 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; $langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals', 'salaries', 'suppliers')); // Get supervariables -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); -$userid = GETPOST('userid', 'int'); +$socid = GETPOSTINT('socid'); +$userid = GETPOSTINT('userid'); $type = GETPOST('type', 'aZ09'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 28992168195..fe3334fcfb9 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -45,16 +45,16 @@ if ($user->socid > 0) { } // Get supervariables -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $type = GETPOST('type', 'aZ09'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index dee3198493b..370a9a21ddc 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -35,16 +35,16 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->loadLangs(array("banks", "categories", 'withdrawals', 'bills')); // Get supervariables -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $type = GETPOST('type', 'aZ09'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 341b378cc05..b8c75847372 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->loadLangs(array('banks', 'categories', 'withdrawals')); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 340e0cde34e..ff5bdf390b3 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -38,15 +38,15 @@ $langs->loadlangs(array('banks', 'categories', 'bills', 'companies', 'withdrawal // Get supervariables $action = GETPOST('action', 'aZ09'); -$id = GETPOST('id', 'int'); -$socid = GETPOST('socid', 'int'); +$id = GETPOSTINT('id'); +$socid = GETPOSTINT('socid'); $type = GETPOST('type', 'aZ09'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortorder = GETPOST('sortorder', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -84,8 +84,8 @@ $error = 0; if ($action == 'confirm_rejet' && $permissiontoadd) { if (GETPOST("confirm") == 'yes') { - if (GETPOST('remonth', 'int')) { - $daterej = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + if (GETPOSTINT('remonth')) { + $daterej = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); } if (empty($daterej)) { @@ -108,7 +108,7 @@ if ($action == 'confirm_rejet' && $permissiontoadd) { if ($lipre->fetch($id) == 0) { $rej = new RejetPrelevement($db, $user, $type); - $result = $rej->create($user, $id, GETPOST('motif', 'alpha'), $daterej, $lipre->bon_rowid, GETPOST('facturer', 'int')); + $result = $rej->create($user, $id, GETPOSTINT('motif'), $daterej, $lipre->bon_rowid, GETPOSTINT('facturer')); if ($result > 0) { header("Location: line.php?id=".urlencode($id).'&type='.urlencode($type)); @@ -239,7 +239,7 @@ if ($id) { //Reason print ''; print ''; //Facturer @@ -247,7 +247,7 @@ if ($id) { print $form->textwithpicto($langs->trans("RefusedInvoicing"), $langs->trans("DirectDebitRefusedInvoicingDesc")); print ''; print ''; print '
'.$langs->trans('DateInvoice').''; @@ -3854,11 +3854,11 @@ if ($action == 'create') { if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY')) { $rwStyle = 'display:none;'; - if (in_array(GETPOST('type', 'int'), $retainedWarrantyInvoiceAvailableType)) { + if (in_array(GETPOSTINT('type'), $retainedWarrantyInvoiceAvailableType)) { $rwStyle = ''; } - $retained_warranty = GETPOST('retained_warranty', 'int'); + $retained_warranty = GETPOSTINT('retained_warranty'); if (empty($retained_warranty)) { if (!empty($objectsrc->retained_warranty)) { // use previous situation value $retained_warranty = $objectsrc->retained_warranty; @@ -3871,7 +3871,7 @@ if ($action == 'create') { // Retained warranty payment term print '
'.$langs->trans('PaymentConditionsShortRetainedWarranty').''; - $retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); + $retained_warranty_fk_cond_reglement = GETPOSTINT('retained_warranty_fk_cond_reglement'); if (empty($retained_warranty_fk_cond_reglement)) { $retained_warranty_fk_cond_reglement = getDolGlobalString('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID'); if (!empty($objectsrc->retained_warranty_fk_cond_reglement)) { // use previous situation value @@ -3986,7 +3986,7 @@ if ($action == 'create') { // Help of substitution key $htmltext = ''; - if (GETPOST('fac_rec', 'int') > 0) { + if (GETPOSTINT('fac_rec') > 0) { $dateexample = ($newdateinvoice ? $newdateinvoice : $dateinvoice); if (empty($dateexample)) { $dateexample = dol_now(); @@ -4910,7 +4910,7 @@ if ($action == 'create') { print ''; print ''; print ''; - $retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); + $retained_warranty_fk_cond_reglement = GETPOSTINT('retained_warranty_fk_cond_reglement'); $retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $retained_warranty_fk_cond_reglement : $object->retained_warranty_fk_cond_reglement; $retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $retained_warranty_fk_cond_reglement : getDolGlobalString('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID'); print $form->getSelectConditionsPaiements($retained_warranty_fk_cond_reglement, 'retained_warranty_fk_cond_reglement', -1, 1); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 76941f3ee16..12bbd6fa5f0 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -538,12 +538,12 @@ class Facture extends CommonInvoice // Fields coming from GUI. // @TODO Value of template should be used as default value on the form on the GUI, and we should here always use the value from GUI // set by posted page with $object->xxx = ... and this section should be removed. - $this->fk_project = GETPOST('projectid', 'int') > 0 ? GETPOSTINT('projectid') : $_facrec->fk_project; + $this->fk_project = GETPOSTINT('projectid') > 0 ? GETPOSTINT('projectid') : $_facrec->fk_project; $this->note_public = GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : $_facrec->note_public; $this->note_private = GETPOSTISSET('note_private') ? GETPOST('note_private', 'restricthtml') : $_facrec->note_private; $this->model_pdf = GETPOSTISSET('model') ? GETPOST('model', 'alpha') : $_facrec->model_pdf; - $this->cond_reglement_id = GETPOST('cond_reglement_id', 'int') > 0 ? GETPOSTINT('cond_reglement_id') : $_facrec->cond_reglement_id; - $this->mode_reglement_id = GETPOST('mode_reglement_id', 'int') > 0 ? GETPOSTINT('mode_reglement_id') : $_facrec->mode_reglement_id; + $this->cond_reglement_id = GETPOSTINT('cond_reglement_id') > 0 ? GETPOSTINT('cond_reglement_id') : $_facrec->cond_reglement_id; + $this->mode_reglement_id = GETPOSTINT('mode_reglement_id') > 0 ? GETPOSTINT('mode_reglement_id') : $_facrec->mode_reglement_id; $this->fk_account = GETPOST('fk_account') > 0 ? GETPOSTINT('fk_account') : $_facrec->fk_account; // Set here to have this defined for substitution into notes, should be recalculated after adding lines to get same result diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 616a365e879..a6bb2603558 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -40,10 +40,10 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('bills', 'companies')); -$id = (GETPOST('id') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOST('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$lineid = GETPOST('lineid', 'int'); -$socid = GETPOST('socid', 'int'); +$lineid = GETPOSTINT('lineid'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); // Security check @@ -77,7 +77,7 @@ if (empty($reshook)) { // Add new contact if ($action == 'addcontact' && $user->hasRight('facture', 'creer')) { if ($result > 0 && $id > 0) { - $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $contactid = (GETPOST('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); } @@ -95,7 +95,7 @@ if (empty($reshook)) { } } elseif ($action == 'swapstatut' && $user->hasRight('facture', 'creer')) { // Toggle the status of a contact - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } elseif ($action == 'deletecontact' && $user->hasRight('facture', 'creer')) { // Delete contact $result = $object->delete_contact($lineid); diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index a687998b04a..44519923cbe 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -43,17 +43,17 @@ if (isModEnabled('project')) { $langs->loadLangs(array('propal', 'compta', 'other', 'bills', 'companies')); -$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/facture/index.php b/htdocs/compta/facture/index.php index fe614a7d2dc..ea2543aeb90 100644 --- a/htdocs/compta/facture/index.php +++ b/htdocs/compta/facture/index.php @@ -35,7 +35,7 @@ restrictedArea($user, 'facture'); $langs->load('bills'); // Filter to show only result of one customer -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if (isset($user->socid) && $user->socid > 0) { $action = ''; $socid = $user->socid; diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 95b739eb5a7..13052314892 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -47,7 +47,7 @@ $langs->loadLangs(array('companies', 'bills', 'compta', 'admin', 'other')); $action = GETPOST('action', 'alpha'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); @@ -55,10 +55,10 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'in $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); -$id = (GETPOST('facid', 'int') ? GETPOST('facid', 'int') : GETPOST('id', 'int')); -$lineid = GETPOST('lineid', 'int'); +$id = (GETPOSTINT('facid') ? GETPOSTINT('facid') : GETPOSTINT('id')); +$lineid = GETPOSTINT('lineid'); $ref = GETPOST('ref', 'alpha'); if ($user->socid) { $socid = $user->socid; @@ -75,32 +75,32 @@ $search_montant_vat = GETPOST('search_montant_vat'); $search_montant_ttc = GETPOST('search_montant_ttc'); $search_payment_mode = GETPOST('search_payment_mode'); $search_payment_term = GETPOST('search_payment_term'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); -$search_date_when_startday = GETPOST('search_date_when_startday', 'int'); -$search_date_when_startmonth = GETPOST('search_date_when_startmonth', 'int'); -$search_date_when_startyear = GETPOST('search_date_when_startyear', 'int'); -$search_date_when_endday = GETPOST('search_date_when_endday', 'int'); -$search_date_when_endmonth = GETPOST('search_date_when_endmonth', 'int'); -$search_date_when_endyear = GETPOST('search_date_when_endyear', 'int'); +$search_date_when_startday = GETPOSTINT('search_date_when_startday'); +$search_date_when_startmonth = GETPOSTINT('search_date_when_startmonth'); +$search_date_when_startyear = GETPOSTINT('search_date_when_startyear'); +$search_date_when_endday = GETPOSTINT('search_date_when_endday'); +$search_date_when_endmonth = GETPOSTINT('search_date_when_endmonth'); +$search_date_when_endyear = GETPOSTINT('search_date_when_endyear'); $search_date_when_start = dol_mktime(0, 0, 0, $search_date_when_startmonth, $search_date_when_startday, $search_date_when_startyear); // Use tzserver $search_date_when_end = dol_mktime(23, 59, 59, $search_date_when_endmonth, $search_date_when_endday, $search_date_when_endyear); -$search_recurring = GETPOST('search_recurring', 'int'); +$search_recurring = GETPOSTINT('search_recurring'); $search_frequency = GETPOST('search_frequency', 'alpha'); $search_unit_frequency = GETPOST('search_unit_frequency', 'alpha'); $search_nb_gen_done = GETPOST('search_nb_gen_done', 'alpha'); -$search_status = GETPOST('search_status', 'int'); +$search_status = GETPOSTINT('search_status'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 391b9bb084d..d728541b8d9 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -64,15 +64,15 @@ if (isModEnabled('commande')) { $langs->loadLangs(array('bills', 'companies', 'products', 'categories')); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); -$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0); +$projectid = (GETPOST('projectid') ? GETPOSTINT('projectid') : 0); -$id = (GETPOST('id', 'int') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); $socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $optioncss = GETPOST('optioncss', 'alpha'); @@ -87,8 +87,8 @@ $lineid = GETPOSTINT('lineid'); $userid = GETPOSTINT('userid'); $search_ref = GETPOST('sf_ref') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_refcustomer = GETPOST('search_refcustomer', 'alpha'); -$search_type = GETPOST('search_type', 'int'); -$search_subtype = GETPOST('search_subtype', 'int'); +$search_type = GETPOSTINT('search_type'); +$search_subtype = GETPOSTINT('search_subtype'); $search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_project = GETPOST('search_project', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); @@ -106,8 +106,8 @@ $search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'a $search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha'); $search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha'); $search_status = GETPOST('search_status', 'intcomma'); -$search_paymentmode = GETPOST('search_paymentmode', 'int'); -$search_paymentterms = GETPOST('search_paymentterms', 'int'); +$search_paymentmode = GETPOSTINT('search_paymentmode'); +$search_paymentterms = GETPOSTINT('search_paymentterms'); $search_module_source = GETPOST('search_module_source', 'alpha'); $search_pos_source = GETPOST('search_pos_source', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); @@ -115,9 +115,9 @@ $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST("search_state"); $search_country = GETPOST("search_country", 'alpha'); $search_customer_code = GETPOST("search_customer_code", 'alphanohtml'); -$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); -$search_user = GETPOST('search_user', 'int'); -$search_sale = GETPOST('search_sale', 'int'); +$search_type_thirdparty = GETPOSTINT("search_type_thirdparty"); +$search_user = GETPOSTINT('search_user'); +$search_sale = GETPOSTINT('search_sale'); $search_date_startday = GETPOSTINT('search_date_startday'); $search_date_startmonth = GETPOSTINT('search_date_startmonth'); $search_date_startyear = GETPOSTINT('search_date_startyear'); @@ -142,8 +142,8 @@ $search_datelimit_endmonth = GETPOSTINT('search_datelimit_endmonth'); $search_datelimit_endyear = GETPOSTINT('search_datelimit_endyear'); $search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear); $search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear); -$search_categ_cus = GETPOST("search_categ_cus", 'int'); -$search_product_category = GETPOST('search_product_category', 'int'); +$search_categ_cus = GETPOSTINT("search_categ_cus"); +$search_product_category = GETPOSTINT('search_product_category'); $search_fac_rec_source_title = GETPOST("search_fac_rec_source_title", 'alpha'); $search_btn = GETPOST('button_search', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha'); @@ -157,7 +157,7 @@ $filtre = GETPOST('filtre', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 226984ec5f4..7c93f507ff9 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -37,9 +37,9 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('companies', 'bills')); -$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $object = new Facture($db); diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 9942b002a73..e79cc953f3a 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -42,9 +42,9 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // Load translation files required by the page $langs->loadLangs(array('bills', 'banks', 'withdrawals', 'companies')); -$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $type = GETPOST('type', 'aZ09'); @@ -130,7 +130,7 @@ if (empty($reshook)) { if ($action == "delete" && $usercancreate) { if ($object->id > 0) { - $result = $object->demande_prelevement_delete($user, GETPOST('did', 'int')); + $result = $object->demande_prelevement_delete($user, GETPOSTINT('did')); if ($result == 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id.'&type='.$type); exit; @@ -140,7 +140,7 @@ if (empty($reshook)) { // Make payment with Direct Debit Stripe if ($action == 'sepastripedirectdebit' && $usercancreate) { - $result = $object->makeStripeSepaRequest($user, GETPOST('did', 'int'), 'direct-debit', 'facture'); + $result = $object->makeStripeSepaRequest($user, GETPOSTINT('did'), 'direct-debit', 'facture'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -155,7 +155,7 @@ if (empty($reshook)) { // Make payment with Direct Debit Stripe if ($action == 'sepastripecredittransfer' && $usercancreate) { - $result = $object->makeStripeSepaRequest($user, GETPOST('did', 'int'), 'bank-transfer', 'supplier_invoice'); + $result = $object->makeStripeSepaRequest($user, GETPOSTINT('did'), 'bank-transfer', 'supplier_invoice'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -179,7 +179,7 @@ if (empty($reshook)) { $db->begin(); if (!$error) { - $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); + $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id')); if ($result < 0) { $error++; setEventMessages($object->error, $object->errors, 'errors'); @@ -209,9 +209,9 @@ if (empty($reshook)) { } } elseif ($action == 'setmode' && $usercancreate) { // payment mode - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + $result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id')); } elseif ($action == 'setdatef' && $usercancreate) { - $newdate = dol_mktime(0, 0, 0, GETPOST('datefmonth', 'int'), GETPOST('datefday', 'int'), GETPOST('datefyear', 'int'), 'tzserver'); + $newdate = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'), 'tzserver'); if ($newdate > (dol_now('tzuserrel') + (!getDolGlobalString('INVOICE_MAX_FUTURE_DELAY') ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { if (!getDolGlobalString('INVOICE_MAX_FUTURE_DELAY')) { setEventMessages($langs->trans("WarningInvoiceDateInFuture"), null, 'warnings'); @@ -234,7 +234,7 @@ if (empty($reshook)) { dol_print_error($db, $object->error); } } elseif ($action == 'setdate_lim_reglement' && $usercancreate) { - $object->date_echeance = dol_mktime(12, 0, 0, GETPOST('date_lim_reglementmonth', 'int'), GETPOST('date_lim_reglementday', 'int'), GETPOST('date_lim_reglementyear', 'int')); + $object->date_echeance = dol_mktime(12, 0, 0, GETPOSTINT('date_lim_reglementmonth'), GETPOSTINT('date_lim_reglementday'), GETPOSTINT('date_lim_reglementyear')); if (!empty($object->date_echeance) && $object->date_echeance < $object->date) { $object->date_echeance = $object->date; setEventMessages($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), null, 'warnings'); diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index f98216140f9..8e5ca60137a 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -55,8 +55,8 @@ $object_status = GETPOST('object_status', 'intcomma'); $typent_id = GETPOSTINT('typent_id'); $categ_id = GETPOSTINT('categ_id'); -$userid = GETPOST('userid', 'int'); -$socid = GETPOST('socid', 'int'); +$userid = GETPOSTINT('userid'); +$socid = GETPOSTINT('socid'); $custcats = GETPOST('custcats', 'array'); // Security check if ($user->socid > 0) { @@ -65,7 +65,7 @@ if ($user->socid > 0) { } $nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); -$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; +$year = GETPOST('year') > 0 ? GETPOSTINT('year') : $nowyear; $startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS')))); $endyear = $year; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index e5e49696f0f..c280a92183e 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -56,7 +56,7 @@ if (isModEnabled('commande')) { // Get parameters $action = GETPOST('action', 'aZ09'); -$bid = GETPOST('bid', 'int'); +$bid = GETPOSTINT('bid'); // Security check $socid = ''; diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 894aa3986d1..f52b3c2f72e 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -32,19 +32,19 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'banks', 'bills')); -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); $action = GETPOST("action", "aZ09"); $cancel = GETPOST('cancel', 'aZ09'); -$refund = GETPOST("refund", "int"); +$refund = GETPOSTINT("refund"); if (empty($refund)) { $refund = 0; } -$lttype = GETPOST('localTaxType', 'int'); +$lttype = GETPOSTINT('localTaxType'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } @@ -188,7 +188,7 @@ if ($action == 'create') { // Bank account print '
'.$langs->trans("BankAccount").''; print img_picto('', 'bank_account', 'pictofixedwidth'); - $form->select_comptes(GETPOST("accountid", "int"), "accountid", 0, "courant=1", 2, '', 0, 'maxwidth500 widthcentpercentminusx'); // Affiche liste des comptes courant + $form->select_comptes(GETPOSTINT("accountid"), "accountid", 0, "courant=1", 2, '', 0, 'maxwidth500 widthcentpercentminusx'); // Affiche liste des comptes courant print '
'.$langs->trans("RemainderToPay").''.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'
'.$langs->trans("Date").''; - $datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int')); + $datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); $datepayment = !getDolGlobalString('MAIN_AUTOFILL_DATE') ? (GETPOSTISSET("remonth") ? $datepaye : -1) : ''; print $form->selectDate($datepayment, '', '', '', 0, "add_payment", 1, 1, 0, '', '', $charge->date_ech, '', 1, $langs->trans("DateOfSocialContribution")); print "'.$langs->trans('AccountToDebit').''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); - print $form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid", 'int') : $charge->accountid, "accountid", 0, '', 2, '', 0, 'maxwidth500 widthcentpercentminusx', 1); // Show opend bank account list + print $form->select_comptes(GETPOSTISSET("accountid") ? GETPOSTINT("accountid") : $charge->accountid, "accountid", 0, '', 2, '', 0, 'maxwidth500 widthcentpercentminusx', 1); // Show opend bank account list print '
'.$langs->trans("RemainderToPay").''.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'
'.$langs->trans("Date").''; - $datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int')); - $datepayment = !getDolGlobalString('MAIN_AUTOFILL_DATE') ? (GETPOST("remonth", 'int') ? $datepaye : -1) : 0; + $datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); + $datepayment = !getDolGlobalString('MAIN_AUTOFILL_DATE') ? (GETPOSTINT("remonth") ? $datepaye : -1) : 0; print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1); print "
'.$langs->trans("PaymentMode").''; - print $form->select_types_paiements(GETPOSTISSET("paiementtype") ? GETPOST("paiementtype", "int") : $tva->paiementtype, "paiementtype", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1); + print $form->select_types_paiements(GETPOSTISSET("paiementtype") ? GETPOSTINT("paiementtype") : $tva->paiementtype, "paiementtype", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1); print "
'.$langs->trans('AccountToDebit').''; print img_picto('', 'bank_account', 'pictofixedwidth'); - $form->select_comptes(GETPOST("accountid", "int") ? GETPOST("accountid", "int") : $tva->accountid, "accountid", 0, '', 1, '', 0, 'maxwidth500 widthcentpercentminusx'); // Show opend bank account list + $form->select_comptes(GETPOSTINT("accountid") ? GETPOSTINT("accountid") : $tva->accountid, "accountid", 0, '', 1, '', 0, 'maxwidth500 widthcentpercentminusx'); // Show opend bank account list print '
'.$langs->trans("RefusedReason").''; - print $form->selectarray("motif", $rej->motifs, GETPOSTISSET('motif') ? GETPOST('motif', 'int') : ''); + print $form->selectarray("motif", $rej->motifs, GETPOSTISSET('motif') ? GETPOSTINT('motif') : ''); print '
'; - print $form->selectarray("facturer", $rej->labelsofinvoicing, GETPOSTISSET('facturer') ? GETPOST('facturer', 'int') : '', 0); + print $form->selectarray("facturer", $rej->labelsofinvoicing, GETPOSTISSET('facturer') ? GETPOSTINT('facturer') : '', 0); print '
'; diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index a03fa0e1148..e77bd4a2343 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -36,7 +36,7 @@ $langs->loadLangs(array('banks', 'withdrawals', 'companies', 'categories')); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -48,10 +48,10 @@ $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hier $type = GETPOST('type', 'aZ09'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -70,7 +70,7 @@ $search_line = GETPOST('search_line', 'alpha'); $search_bon = GETPOST('search_bon', 'alpha'); $search_code = GETPOST('search_code', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); -$statut = GETPOST('statut', 'int'); +$statut = GETPOSTINT('statut'); $bon = new BonPrelevement($db); $line = new LignePrelevement($db); @@ -80,7 +80,7 @@ $userstatic = new User($db); $hookmanager->initHooks(array('withdrawalsreceiptslineslist')); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index 912e725e91d..5efc08d75ea 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -45,10 +45,10 @@ $mode = GETPOST('mode', 'alpha'); $type = GETPOST('type', 'aZ09'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -64,7 +64,7 @@ if (!$sortfield) { } // Get supervariables -$statut = GETPOST('statut', 'int'); +$statut = GETPOSTINT('statut'); $search_ref = GETPOST('search_ref', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); @@ -79,7 +79,7 @@ if ($type == 'bank-transfer') { } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index 30db9e40c50..68e5c098bcd 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -40,10 +40,10 @@ $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies')); $type = GETPOST('type', 'aZ09'); // Get supervariables -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortorder = GETPOST('sortorder', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -52,7 +52,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 1ebee939615..ad8792944dd 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -35,7 +35,7 @@ $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies')); $type = GETPOST('type', 'aZ09'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 2dda35eb209..17281ae721c 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -35,7 +35,7 @@ if (isModEnabled('facture')) { $langs->load("bills"); } -$id = GETPOST('id') ? GETPOST('id', 'int') : GETPOST('socid', 'int'); +$id = GETPOST('id') ? GETPOSTINT('id') : GETPOSTINT('socid'); // Security check if ($user->socid) { @@ -52,10 +52,10 @@ if ($id > 0) { $hookmanager->initHooks(array('recapcomptacard', 'globalcard')); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 62b86621a6a..efa2ed773d4 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -46,18 +46,18 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'donation', 'salaries', 'accountancy', 'loan')); -$date_startmonth = GETPOST('date_startmonth', 'int'); -$date_startday = GETPOST('date_startday', 'int'); -$date_startyear = GETPOST('date_startyear', 'int'); -$date_endmonth = GETPOST('date_endmonth', 'int'); -$date_endday = GETPOST('date_endday', 'int'); -$date_endyear = GETPOST('date_endyear', 'int'); +$date_startmonth = GETPOSTINT('date_startmonth'); +$date_startday = GETPOSTINT('date_startday'); +$date_startyear = GETPOSTINT('date_startyear'); +$date_endmonth = GETPOSTINT('date_endmonth'); +$date_endday = GETPOSTINT('date_endday'); +$date_endyear = GETPOSTINT('date_endyear'); $showaccountdetail = GETPOST('showaccountdetail', 'aZ09') ? GETPOST('showaccountdetail', 'aZ09') : 'yes'; -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -70,7 +70,7 @@ if (!$sortorder) { } // Date range -$year = GETPOST('year', 'int'); // this is used for navigation previous/next. It is the last year to show in filter +$year = GETPOSTINT('year'); // this is used for navigation previous/next. It is the last year to show in filter if (empty($year)) { $year_current = dol_print_date(dol_now(), "%Y"); $month_current = dol_print_date(dol_now(), "%m"); @@ -85,11 +85,11 @@ $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); // We define date_start and date_end if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q") ? GETPOST("q", 'int') : 0; + $q = GETPOST("q") ? GETPOSTINT("q") : 0; if ($q == 0) { // We define date_start and date_end $year_end = $year_start; - $month_start = GETPOST("month") ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); + $month_start = GETPOST("month") ? GETPOSTINT("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); $month_end = ""; if (!GETPOST('month')) { if (!$year && $month_start > $month_current) { @@ -147,7 +147,7 @@ if (GETPOST("modecompta", 'alpha')) { $AccCat = new AccountancyCategory($db); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid > 0) { $socid = $user->socid; } diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index c769adfade6..167ca1793f6 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -36,12 +36,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'donation', 'salaries')); -$date_startday = GETPOST('date_startday', 'int'); -$date_startmonth = GETPOST('date_startmonth', 'int'); -$date_startyear = GETPOST('date_startyear', 'int'); -$date_endday = GETPOST('date_endday', 'int'); -$date_endmonth = GETPOST('date_endmonth', 'int'); -$date_endyear = GETPOST('date_endyear', 'int'); +$date_startday = GETPOSTINT('date_startday'); +$date_startmonth = GETPOSTINT('date_startmonth'); +$date_startyear = GETPOSTINT('date_startyear'); +$date_endday = GETPOSTINT('date_endday'); +$date_endmonth = GETPOSTINT('date_endmonth'); +$date_endyear = GETPOSTINT('date_endyear'); $nbofyear = 4; @@ -50,7 +50,7 @@ $nbofyear = 4; // Date range -$year = GETPOST('year', 'int'); // this is used for navigation previous/next. It is the last year to show in filter +$year = GETPOSTINT('year'); // this is used for navigation previous/next. It is the last year to show in filter if (empty($year)) { $year_current = dol_print_date(dol_now(), "%Y"); $month_current = dol_print_date(dol_now(), "%m"); @@ -65,11 +65,11 @@ $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, // We define date_start and date_end if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q") ? GETPOST("q", 'int') : 0; + $q = GETPOST("q") ? GETPOSTINT("q") : 0; if ($q == 0) { // We define date_start and date_end $year_end = $year_start + $nbofyear - (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1); - $month_start = GETPOST("month") ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); + $month_start = GETPOST("month") ? GETPOSTINT("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); if (!GETPOST('month')) { if (!$year && $month_start > $month_current) { $year_start--; @@ -121,7 +121,7 @@ if (GETPOST("modecompta", 'alpha')) { } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid > 0) { $socid = $user->socid; } diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index b03d6299aea..0a38507ccb6 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -41,18 +41,18 @@ $mesg = ''; $action = GETPOST('action', 'aZ09'); $cat_id = GETPOST('account_category'); $selectcpt = GETPOST('cpt_bk'); -$id = GETPOST('id', 'int'); -$rowid = GETPOST('rowid', 'int'); +$id = GETPOSTINT('id'); +$rowid = GETPOSTINT('rowid'); $cancel = GETPOST('cancel', 'alpha'); $showaccountdetail = GETPOST('showaccountdetail', 'aZ09') ? GETPOST('showaccountdetail', 'aZ09') : 'no'; -$date_startmonth = GETPOST('date_startmonth', 'int'); -$date_startday = GETPOST('date_startday', 'int'); -$date_startyear = GETPOST('date_startyear', 'int'); -$date_endmonth = GETPOST('date_endmonth', 'int'); -$date_endday = GETPOST('date_endday', 'int'); -$date_endyear = GETPOST('date_endyear', 'int'); +$date_startmonth = GETPOSTINT('date_startmonth'); +$date_startday = GETPOSTINT('date_startday'); +$date_startyear = GETPOSTINT('date_startyear'); +$date_endmonth = GETPOSTINT('date_endmonth'); +$date_endday = GETPOSTINT('date_endday'); +$date_endyear = GETPOSTINT('date_endyear'); $nbofyear = 1; @@ -60,7 +60,7 @@ $nbofyear = 1; //$conf->global->SOCIETE_FISCAL_MONTH_START = 7; // Date range -$year = GETPOST('year', 'int'); // year with current month, is the month of the period we must show +$year = GETPOSTINT('year'); // year with current month, is the month of the period we must show if (empty($year)) { $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $month_current = dol_print_date(dol_now(), "%m"); @@ -75,11 +75,11 @@ $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); // We define date_start and date_end if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q") ? GETPOST("q", 'int') : 0; + $q = GETPOST("q") ? GETPOSTINT("q") : 0; if ($q == 0) { // We define date_start and date_end $year_end = $year_start + ($nbofyear - 1); - $month_start = GETPOST("month", 'int') ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); + $month_start = GETPOSTINT("month") ? GETPOSTINT("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); $date_startmonth = $month_start; if (!GETPOST('month')) { if (!$year && $month_start > $month_current) { @@ -151,7 +151,7 @@ if (GETPOST("modecompta", 'alpha')) { $AccCat = new AccountancyCategory($db); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid > 0) { $socid = $user->socid; } diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 9911bb2f6e8..6bb11589a2d 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -47,7 +47,7 @@ if (isModEnabled('accounting')) { // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'banks', 'hrm')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -55,15 +55,15 @@ $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOSTINT('lineid'); -$fk_project = (GETPOST('fk_project') ? GETPOST('fk_project', 'int') : 0); +$fk_project = (GETPOST('fk_project') ? GETPOSTINT('fk_project') : 0); $dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear')); $dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear')); $label = GETPOST('label', 'alpha'); $actioncode = GETPOST('actioncode'); -$fk_user = GETPOST('userid', 'int') > 0 ? GETPOST('userid', 'int') : 0; +$fk_user = GETPOSTINT('userid') > 0 ? GETPOSTINT('userid') : 0; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('taxcard', 'globalcard')); @@ -91,7 +91,7 @@ $permissiondellink = $user->hasRight('tax', 'charges', 'creer'); // Used by the $upload_dir = $conf->tax->multidir_output[isset($object->entity) ? $object->entity : 1]; // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } @@ -146,7 +146,7 @@ if (empty($reshook)) { // payment mode if ($action == 'setmode' && $permissiontoadd) { - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + $result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -154,7 +154,7 @@ if (empty($reshook)) { // Bank account if ($action == 'setbankaccount' && $permissiontoadd) { - $result = $object->setBankAccount(GETPOST('fk_account', 'int')); + $result = $object->setBankAccount(GETPOSTINT('fk_account')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -204,9 +204,9 @@ if (empty($reshook)) { $object->period = $dateperiod; $object->amount = $amount; $object->fk_user = $fk_user; - $object->mode_reglement_id = (int) GETPOST('mode_reglement_id', 'int'); - $object->fk_account = (int) GETPOST('fk_account', 'int'); - $object->fk_project = (int) GETPOST('fk_project', 'int'); + $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); + $object->fk_account = GETPOSTINT('fk_account'); + $object->fk_project = GETPOSTINT('fk_project'); $id = $object->create($user); if ($id <= 0) { @@ -271,14 +271,14 @@ if (empty($reshook)) { $object->label = $langs->trans("CopyOf").' '.$object->label; } - if (GETPOST('clone_for_next_month', 'int')) { // This can be true only if TAX_ADD_CLONE_FOR_NEXT_MONTH_CHECKBOX has been set + if (GETPOSTINT('clone_for_next_month')) { // This can be true only if TAX_ADD_CLONE_FOR_NEXT_MONTH_CHECKBOX has been set $object->periode = dol_time_plus_duree($object->periode, 1, 'm'); $object->period = dol_time_plus_duree($object->periode, 1, 'm'); $object->date_ech = dol_time_plus_duree($object->date_ech, 1, 'm'); } else { // Note date_ech is often a little bit higher than dateperiod - $newdateperiod = dol_mktime(0, 0, 0, GETPOST('clone_periodmonth', 'int'), GETPOST('clone_periodday', 'int'), GETPOST('clone_periodyear', 'int')); - $newdateech = dol_mktime(0, 0, 0, GETPOST('clone_date_echmonth', 'int'), GETPOST('clone_date_echday', 'int'), GETPOST('clone_date_echyear', 'int')); + $newdateperiod = dol_mktime(0, 0, 0, GETPOSTINT('clone_periodmonth'), GETPOSTINT('clone_periodday'), GETPOSTINT('clone_periodyear')); + $newdateech = dol_mktime(0, 0, 0, GETPOSTINT('clone_date_echmonth'), GETPOSTINT('clone_date_echday'), GETPOSTINT('clone_date_echyear')); if ($newdateperiod) { $object->periode = $newdateperiod; $object->period = $newdateperiod; @@ -423,13 +423,13 @@ if ($action == 'create') { // Payment Mode print ''.$langs->trans('DefaultPaymentMode').''; - $form->select_types_paiements(GETPOST('mode_reglement_id', 'int'), 'mode_reglement_id'); + $form->select_types_paiements(GETPOSTINT('mode_reglement_id'), 'mode_reglement_id'); print ''; // Bank Account if (isModEnabled("banque")) { print ''.$langs->trans('DefaultBankAccount').''; - print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(GETPOST('fk_account', 'int'), 'fk_account', 0, '', 2, '', 0, '', 1); + print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(GETPOSTINT('fk_account'), 'fk_account', 0, '', 2, '', 0, '', 1); print ''; } diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index ef68f325cc4..8c22eeed12d 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -42,15 +42,15 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('other', 'companies', 'compta', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index 2d78bc86c66..24181ae4b7b 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -34,7 +34,7 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('compta', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $object = new ChargeSociales($db); @@ -43,7 +43,7 @@ if ($id > 0) { } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index a0145c6a260..e2f887eb034 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -49,36 +49,36 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sc $mode = GETPOST('mode', 'alpha'); -$search_ref = GETPOST('search_ref', 'int'); +$search_ref = GETPOSTINT('search_ref'); $search_label = GETPOST('search_label', 'alpha'); -$search_typeid = GETPOST('search_typeid', 'int'); +$search_typeid = GETPOSTINT('search_typeid'); $search_amount = GETPOST('search_amount', 'alpha'); -$search_status = GETPOST('search_status', 'int'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_status = GETPOSTINT('search_status'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); -$search_date_limit_startday = GETPOST('search_date_limit_startday', 'int'); -$search_date_limit_startmonth = GETPOST('search_date_limit_startmonth', 'int'); -$search_date_limit_startyear = GETPOST('search_date_limit_startyear', 'int'); -$search_date_limit_endday = GETPOST('search_date_limit_endday', 'int'); -$search_date_limit_endmonth = GETPOST('search_date_limit_endmonth', 'int'); -$search_date_limit_endyear = GETPOST('search_date_limit_endyear', 'int'); +$search_date_limit_startday = GETPOSTINT('search_date_limit_startday'); +$search_date_limit_startmonth = GETPOSTINT('search_date_limit_startmonth'); +$search_date_limit_startyear = GETPOSTINT('search_date_limit_startyear'); +$search_date_limit_endday = GETPOSTINT('search_date_limit_endday'); +$search_date_limit_endmonth = GETPOSTINT('search_date_limit_endmonth'); +$search_date_limit_endyear = GETPOSTINT('search_date_limit_endyear'); $search_date_limit_start = dol_mktime(0, 0, 0, $search_date_limit_startmonth, $search_date_limit_startday, $search_date_limit_startyear); $search_date_limit_end = dol_mktime(23, 59, 59, $search_date_limit_endmonth, $search_date_limit_endday, $search_date_limit_endyear); $search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_users = GETPOST('search_users'); -$search_type = GETPOST('search_type', 'int'); -$search_account = GETPOST('search_account', 'int'); +$search_type = GETPOSTINT('search_type'); +$search_account = GETPOSTINT('search_account'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST("sortorder", 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; // If $page is not defined, or '' or -1 @@ -94,7 +94,7 @@ if (!$sortorder) { $sortorder = "DESC"; } -$filtre = GETPOST("filtre", 'int'); +$filtre = GETPOSTINT("filtre"); $arrayfields = array( 'cs.rowid' =>array('label'=>"Ref", 'checked'=>1, 'position'=>10), @@ -123,7 +123,7 @@ $permissiontoadd = $user->hasRight('tax', 'charges', 'creer'); $permissiontodelete = $user->hasRight('tax', 'charges', 'supprimer'); // Security check -$socid = GETPOST("socid", 'int'); +$socid = GETPOSTINT("socid"); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/sociales/note.php b/htdocs/compta/sociales/note.php index cdabc0cede5..2f5487497f6 100644 --- a/htdocs/compta/sociales/note.php +++ b/htdocs/compta/sociales/note.php @@ -35,7 +35,7 @@ if (isModEnabled('project')) { $langs->loadLangs(array('compta', 'bills')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -47,7 +47,7 @@ if ($id > 0) { } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 749e9497c25..fb3ecf981cb 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -50,14 +50,14 @@ $hookmanager->initHooks(array('specialexpensesindex')); // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'hrm')); -$year = GETPOST("year", 'int'); -$search_sc_type = GETPOST('search_sc_type', 'int'); +$year = GETPOSTINT("year"); +$search_sc_type = GETPOSTINT('search_sc_type'); $optioncss = GETPOST('optioncss', 'alpha'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index 60de44d0545..85906cd2c12 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -43,8 +43,8 @@ $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "produ $modecompta = (GETPOST('modecompta', 'alpha') ? GETPOST('modecompta', 'alpha') : $conf->global->ACCOUNTING_MODE); // Date range -$year = GETPOST("year", 'int'); -$month = GETPOST("month", 'int'); +$year = GETPOSTINT("year"); +$month = GETPOSTINT("month"); if (empty($year)) { $year_current = dol_print_date(dol_now(), '%Y'); $month_current = dol_print_date(dol_now(), '%m'); @@ -60,7 +60,7 @@ $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endda // Quarter $q = ''; if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int"); + $q = GETPOSTINT("q"); if (empty($q)) { // We define date_start and date_end $month_start = GETPOST("month") ? GETPOST("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); @@ -120,14 +120,14 @@ if (empty($min)) { // 0=normal, 1=option vat for services is on debit, 2=option on payments for products $modetax = !getDolGlobalString('TAX_MODE') ? 0 : $conf->global->TAX_MODE; if (GETPOSTISSET("modetax")) { - $modetax = GETPOST("modetax", 'int'); + $modetax = GETPOSTINT("modetax"); } if (empty($modetax)) { $modetax = 0; } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 34b0b614b7a..6a52f9ee62a 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $langs->loadLangs(array("products", "categories", "errors", 'accountancy')); // Security pack (data & check) -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid > 0) { $socid = $user->socid; @@ -64,8 +64,8 @@ if (!$sortfield) { } // Category -$selected_cat = (int) GETPOST('search_categ', 'int'); -$selected_soc = (int) GETPOST('search_soc', 'int'); +$selected_cat = GETPOSTINT('search_categ'); +$selected_soc = GETPOSTINT('search_soc'); $subcat = false; if (GETPOST('subcat', 'alpha') === 'yes') { $subcat = true; @@ -73,7 +73,7 @@ if (GETPOST('subcat', 'alpha') === 'yes') { $categorie = new Categorie($db); // product/service -$selected_type = GETPOST('search_type', 'int'); +$selected_type = GETPOSTINT('search_type'); if ($selected_type == '') { $selected_type = -1; } @@ -103,7 +103,7 @@ $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_star $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int"); + $q = GETPOSTINT("q"); if (empty($q)) { // We define date_start and date_end $month_start = GETPOST("month") ? GETPOST("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 7529db23725..768867e0ddc 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page $langs->load("accountancy"); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); // Security check if ($user->socid > 0) { @@ -63,14 +63,14 @@ if (!$sortfield) { } // Date range -$year = GETPOST("year", 'int'); -$month = GETPOST("month", 'int'); -$date_startyear = GETPOST("date_startyear", 'int'); -$date_startmonth = GETPOST("date_startmonth", 'int'); -$date_startday = GETPOST("date_startday", 'int'); -$date_endyear = GETPOST("date_endyear", 'int'); -$date_endmonth = GETPOST("date_endmonth", 'int'); -$date_endday = GETPOST("date_endday", 'int'); +$year = GETPOSTINT("year"); +$month = GETPOSTINT("month"); +$date_startyear = GETPOSTINT("date_startyear"); +$date_startmonth = GETPOSTINT("date_startmonth"); +$date_startday = GETPOSTINT("date_startday"); +$date_endyear = GETPOSTINT("date_endyear"); +$date_endmonth = GETPOSTINT("date_endmonth"); +$date_endday = GETPOSTINT("date_endday"); if (empty($year)) { $year_current = dol_print_date(dol_now(), '%Y'); $month_current = dol_print_date(dol_now(), '%m'); diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index aada2d53b30..afd631a8cdc 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -55,10 +55,10 @@ if (!$sortfield) { $sortfield = "nom"; } -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); // Category -$selected_cat = (int) GETPOST('search_categ', 'int'); +$selected_cat = GETPOSTINT('search_categ'); if ($selected_cat == -1) { $selected_cat = ''; } @@ -82,18 +82,18 @@ if (isModEnabled('accounting')) { $hookmanager->initHooks(array('casoclist')); // Date range -$year = GETPOST("year", 'int'); -$month = GETPOST("month", 'int'); +$year = GETPOSTINT("year"); +$month = GETPOSTINT("month"); $search_societe = GETPOST("search_societe", 'alpha'); $search_zip = GETPOST("search_zip", 'alpha'); $search_town = GETPOST("search_town", 'alpha'); $search_country = GETPOST("search_country", 'alpha'); -$date_startyear = GETPOST("date_startyear", 'int'); -$date_startmonth = GETPOST("date_startmonth", 'int'); -$date_startday = GETPOST("date_startday", 'int'); -$date_endyear = GETPOST("date_endyear", 'int'); -$date_endmonth = GETPOST("date_endmonth", 'int'); -$date_endday = GETPOST("date_endday", 'int'); +$date_startyear = GETPOSTINT("date_startyear"); +$date_startmonth = GETPOSTINT("date_startmonth"); +$date_startday = GETPOSTINT("date_startday"); +$date_endyear = GETPOSTINT("date_endyear"); +$date_endmonth = GETPOSTINT("date_endmonth"); +$date_endday = GETPOSTINT("date_endday"); if (empty($year)) { $year_current = dol_print_date(dol_now(), '%Y'); $month_current = dol_print_date(dol_now(), '%m'); @@ -107,7 +107,7 @@ $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_star $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int") ? GETPOST("q", "int") : 0; + $q = GETPOSTINT("q") ? GETPOSTINT("q") : 0; if (empty($q)) { // We define date_start and date_end $month_start = GETPOST("month") ? GETPOST("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 7bdf3a279ce..927b5760979 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -32,17 +32,17 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'donation', 'salaries')); -$date_startday = GETPOST('date_startday', 'int'); -$date_startmonth = GETPOST('date_startmonth', 'int'); -$date_startyear = GETPOST('date_startyear', 'int'); -$date_endday = GETPOST('date_endday', 'int'); -$date_endmonth = GETPOST('date_endmonth', 'int'); -$date_endyear = GETPOST('date_endyear', 'int'); +$date_startday = GETPOSTINT('date_startday'); +$date_startmonth = GETPOSTINT('date_startmonth'); +$date_startyear = GETPOSTINT('date_startyear'); +$date_endday = GETPOSTINT('date_endday'); +$date_endmonth = GETPOSTINT('date_endmonth'); +$date_endyear = GETPOSTINT('date_endyear'); $nbofyear = 4; // Date range -$year = GETPOST('year', 'int'); +$year = GETPOSTINT('year'); if (empty($year)) { $year_current = dol_print_date(dol_now(), "%Y"); $month_current = dol_print_date(dol_now(), "%m"); @@ -61,7 +61,7 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e if ($q == 0) { // We define date_start and date_end $year_end = $year_start + $nbofyear - (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1); - $month_start = GETPOSTISSET("month") ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); + $month_start = GETPOSTISSET("month") ? GETPOSTINT("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); if (!GETPOST('month')) { if (!$year && $month_start > $month_current) { $year_start--; @@ -112,10 +112,10 @@ if (GETPOST("modecompta", 'alpha')) { $modecompta = GETPOST("modecompta", 'alpha'); } -$userid = GETPOST('userid', 'int'); +$userid = GETPOSTINT('userid'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid > 0) { $socid = $user->socid; } @@ -384,7 +384,7 @@ $now = dol_now(); $casenow = dol_print_date($now, "%Y-%m"); // Loop on each month -$nb_mois_decalage = GETPOSTISSET('date_startmonth') ? (GETPOST('date_startmonth', 'int') - 1) : (!getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') ? 0 : ($conf->global->SOCIETE_FISCAL_MONTH_START - 1)); +$nb_mois_decalage = GETPOSTISSET('date_startmonth') ? (GETPOSTINT('date_startmonth') - 1) : (!getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') ? 0 : ($conf->global->SOCIETE_FISCAL_MONTH_START - 1)); for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) { $mois_modulo = $mois; // ajout if ($mois > 12) { diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index ca856e67747..2b819e74fa6 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -28,17 +28,17 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills')); -$date_startday = GETPOST('date_startday', 'int'); -$date_startmonth = GETPOST('date_startmonth', 'int'); -$date_startyear = GETPOST('date_startyear', 'int'); -$date_endday = GETPOST('date_endday', 'int'); -$date_endmonth = GETPOST('date_endmonth', 'int'); -$date_endyear = GETPOST('date_endyear', 'int'); +$date_startday = GETPOSTINT('date_startday'); +$date_startmonth = GETPOSTINT('date_startmonth'); +$date_startyear = GETPOSTINT('date_startyear'); +$date_endday = GETPOSTINT('date_endday'); +$date_endmonth = GETPOSTINT('date_endmonth'); +$date_endyear = GETPOSTINT('date_endyear'); $nbofyear = 4; // Date range -$year = GETPOST('year', 'int'); +$year = GETPOSTINT('year'); if (empty($year)) { $year_current = dol_print_date(dol_now(), "%Y"); $month_current = dol_print_date(dol_now(), "%m"); @@ -57,7 +57,7 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e if ($q == 0) { // We define date_start and date_end $year_end = $year_start + $nbofyear - (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1); - $month_start = GETPOSTISSET("month") ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); + $month_start = GETPOSTISSET("month") ? GETPOSTINT("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); if (!GETPOST('month')) { if (!$year && $month_start > $month_current) { $year_start--; @@ -91,8 +91,8 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e } } -$userid = GETPOST('userid', 'int'); -$socid = GETPOST('socid', 'int'); +$userid = GETPOSTINT('userid'); +$socid = GETPOSTINT('socid'); $tmps = dol_getdate($date_start); $year_start = $tmps['year']; diff --git a/htdocs/compta/stats/supplier_turnover_by_prodserv.php b/htdocs/compta/stats/supplier_turnover_by_prodserv.php index f49e79a18a0..e9568c4aa73 100644 --- a/htdocs/compta/stats/supplier_turnover_by_prodserv.php +++ b/htdocs/compta/stats/supplier_turnover_by_prodserv.php @@ -47,14 +47,14 @@ if (!$sortfield) { } // Category -$selected_cat = (int) GETPOST('search_categ', 'int'); -$selected_soc = (int) GETPOST('search_soc', 'int'); +$selected_cat = GETPOSTINT('search_categ'); +$selected_soc = GETPOSTINT('search_soc'); $subcat = false; if (GETPOST('subcat', 'alpha') === 'yes') { $subcat = true; } // product/service -$selected_type = GETPOST('search_type', 'int'); +$selected_type = GETPOSTINT('search_type'); if ($selected_type == '') { $selected_type = -1; } @@ -84,7 +84,7 @@ $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_star $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int"); + $q = GETPOSTINT("q"); if (empty($q)) { // We define date_start and date_end $month_start = GETPOST("month") ? GETPOST("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); @@ -194,7 +194,7 @@ foreach ($allparams as $key => $value) { } // Security pack (data & check) -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid > 0) { $socid = $user->socid; diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index fe20a1e6bee..205f9000031 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -52,10 +52,10 @@ if (!$sortfield) { } -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); // Category -$selected_cat = (int) GETPOST('search_categ', 'int'); +$selected_cat = GETPOSTINT('search_categ'); $subcat = false; if (GETPOST('subcat', 'alpha') === 'yes') { $subcat = true; @@ -73,8 +73,8 @@ $search_country = GETPOST("search_country", 'alpha'); // Date range -$year = GETPOST("year", 'int'); -$month = GETPOST("month", 'int'); +$year = GETPOSTINT("year"); +$month = GETPOSTINT("month"); $date_startyear = GETPOST("date_startyear", 'alpha'); $date_startmonth = GETPOST("date_startmonth", 'alpha'); $date_startday = GETPOST("date_startday", 'alpha'); @@ -94,7 +94,7 @@ $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_star $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int") ? GETPOST("q", "int") : 0; + $q = GETPOSTINT("q") ? GETPOSTINT("q") : 0; if (empty($q)) { // We define date_start and date_end $month_start = GETPOST("month") ? GETPOST("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 127aca426d3..df825768fee 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -43,7 +43,7 @@ if (isModEnabled('accounting')) { // Load translation files required by the page $langs->loadLangs(array('compta', 'banks', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -52,9 +52,9 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'my $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -$refund = GETPOST("refund", "int"); +$refund = GETPOSTINT("refund"); if (GETPOSTISSET('auto_create_paiement') || $action === 'add') { - $auto_create_payment = GETPOST("auto_create_paiement", "int"); + $auto_create_payment = GETPOSTINT("auto_create_paiement"); } else { $auto_create_payment = !getDolGlobalString('CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT'); } @@ -63,8 +63,8 @@ if (empty($refund)) { $refund = 0; } -$datev = dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int')); -$datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int')); +$datev = dol_mktime(12, 0, 0, GETPOSTINT("datevmonth"), GETPOSTINT("datevday"), GETPOSTINT("datevyear")); +$datep = dol_mktime(12, 0, 0, GETPOSTINT("datepmonth"), GETPOSTINT("datepday"), GETPOSTINT("datepyear")); // Initialize technical objects $object = new Tva($db); @@ -90,7 +90,7 @@ $permissiondellink = $user->hasRight('tax', 'charges', 'creer'); // Used by the $upload_dir = $conf->tax->multidir_output[isset($object->entity) ? $object->entity : 1].'/vat'; // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if (!empty($user->socid)) { $socid = $user->socid; } @@ -135,7 +135,7 @@ if (empty($reshook)) { // payment mode if ($action == 'setmode' && $user->hasRight('tax', 'charges', 'creer')) { $object->fetch($id); - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + $result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -144,7 +144,7 @@ if (empty($reshook)) { // Bank account if ($action == 'setbankaccount' && $user->hasRight('tax', 'charges', 'creer')) { $object->fetch($id); - $result = $object->setBankAccount(GETPOST('fk_account', 'int')); + $result = $object->setBankAccount(GETPOSTINT('fk_account')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -238,7 +238,7 @@ if (empty($reshook)) { } if (!$error) { - $result = $paiement->addPaymentToBank($user, 'payment_vat', '(VATPayment)', GETPOST('accountid', 'int'), '', ''); + $result = $paiement->addPaymentToBank($user, 'payment_vat', '(VATPayment)', GETPOSTINT('accountid'), '', ''); if (!($result > 0)) { $error++; setEventMessages($paiement->error, null, 'errors'); @@ -343,7 +343,7 @@ if (empty($reshook)) { $object->label = $langs->trans("CopyOf").' '.$object->label; } - $newdateperiod = dol_mktime(0, 0, 0, GETPOST('clone_periodmonth', 'int'), GETPOST('clone_periodday', 'int'), GETPOST('clone_periodyear', 'int')); + $newdateperiod = dol_mktime(0, 0, 0, GETPOSTINT('clone_periodmonth'), GETPOSTINT('clone_periodday'), GETPOSTINT('clone_periodyear')); if ($newdateperiod) { $object->datev = $newdateperiod; } @@ -460,7 +460,7 @@ if ($action == 'create') { print ''.$langs->trans("Label").''; print ''.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).''; - print $form->selectDate((GETPOST("datevmonth", 'int') ? $datev : -1), "datev", '', '', '', 'add', 1, 1); + print $form->selectDate((GETPOSTINT("datevmonth") ? $datev : -1), "datev", '', '', '', 'add', 1, 1); print ''; // Amount @@ -479,7 +479,7 @@ if ($action == 'create') { // Type payment print ''.$langs->trans("PaymentMode").''; - print $form->select_types_paiements(GETPOST("type_payment", 'int'), "type_payment", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1); + print $form->select_types_paiements(GETPOSTINT("type_payment"), "type_payment", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1); print "\n"; print ""; @@ -487,7 +487,7 @@ if ($action == 'create') { // Bank account print ''.$langs->trans("BankAccount").''; print img_picto('', 'bank_account', 'pictofixedwidth'); - $form->select_comptes(GETPOST("accountid", 'int'), "accountid", 0, "courant=1", 1, '', 0, 'maxwidth500 widthcentpercentminusx'); // List of bank account available + $form->select_comptes(GETPOSTINT("accountid"), "accountid", 0, "courant=1", 1, '', 0, 'maxwidth500 widthcentpercentminusx'); // List of bank account available print ''; } diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index c7b9f2dcc61..ba9af57f4c5 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -43,15 +43,15 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('other', 'companies', 'compta', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 5b30b2a9214..db73cc25e56 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -40,9 +40,9 @@ $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "produ $now = dol_now(); $refresh = GETPOSTISSET('submit') ? true : false; -$year_current = GETPOSTISSET('year') ? GETPOST('year', 'int') : dol_print_date($now, '%Y', 'tzserver'); +$year_current = GETPOSTISSET('year') ? GETPOSTINT('year') : dol_print_date($now, '%Y', 'tzserver'); $year_start = $year_current; -$month_current = GETPOSTISSET('month') ? GETPOST('month', 'int') : dol_print_date($now, '%m', 'tzserver'); +$month_current = GETPOSTISSET('month') ? GETPOSTINT('month') : dol_print_date($now, '%m', 'tzserver'); $month_start = $month_current; $refresh = true; @@ -53,14 +53,14 @@ include DOL_DOCUMENT_ROOT.'/compta/tva/initdatesforvat.inc.php'; // 0=normal, 1=option vat for services is on debit, 2=option on payments for products $modetax = getDolGlobalString('TAX_MODE'); if (GETPOSTISSET("modetax")) { - $modetax = GETPOST("modetax", 'int'); + $modetax = GETPOSTINT("modetax"); } if (empty($modetax)) { $modetax = 0; } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/tva/info.php b/htdocs/compta/tva/info.php index a54be0cdf28..3e02aaa8c0c 100644 --- a/htdocs/compta/tva/info.php +++ b/htdocs/compta/tva/info.php @@ -30,13 +30,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $object = new Tva($db); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/tva/initdatesforvat.inc.php b/htdocs/compta/tva/initdatesforvat.inc.php index 59106f8750c..53cbd63b8cc 100644 --- a/htdocs/compta/tva/initdatesforvat.inc.php +++ b/htdocs/compta/tva/initdatesforvat.inc.php @@ -28,7 +28,7 @@ if (!getDolGlobalInt('SOCIETE_FISCAL_MONTH_START')) { } // Date range -$year = GETPOST("year", "int"); +$year = GETPOSTINT("year"); if (empty($year)) { $year_current = $current_date['year']; $year_start = $year_current; @@ -40,11 +40,11 @@ $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_star $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // Set default period if not defined if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int"); + $q = GETPOSTINT("q"); if (empty($q)) { - if (GETPOST("month", 'int')) { - $date_start = dol_get_first_day($year_start, GETPOST("month", 'int'), 'tzserver'); - $date_end = dol_get_last_day($year_start, GETPOST("month", 'int'), 'tzserver'); + if (GETPOSTINT("month")) { + $date_start = dol_get_first_day($year_start, GETPOSTINT("month"), 'tzserver'); + $date_end = dol_get_last_day($year_start, GETPOSTINT("month"), 'tzserver'); } else { if (!getDolGlobalString('MAIN_INFO_VAT_RETURN') || getDolGlobalInt('MAIN_INFO_VAT_RETURN') == 2) { // quaterly vat, we take last past complete quarter $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 4912417bdf9..32c982c080c 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -41,7 +41,7 @@ $langs->loadLangs(array('compta', 'bills')); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -53,20 +53,20 @@ $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hier $search_ref = GETPOST('search_ref', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); -$search_dateend_start = dol_mktime(0, 0, 0, GETPOST('search_dateend_startmonth', 'int'), GETPOST('search_dateend_startday', 'int'), GETPOST('search_dateend_startyear', 'int')); -$search_dateend_end = dol_mktime(23, 59, 59, GETPOST('search_dateend_endmonth', 'int'), GETPOST('search_dateend_endday', 'int'), GETPOST('search_dateend_endyear', 'int')); -$search_datepayment_start = dol_mktime(0, 0, 0, GETPOST('search_datepayment_startmonth', 'int'), GETPOST('search_datepayment_startday', 'int'), GETPOST('search_datepayment_startyear', 'int')); -$search_datepayment_end = dol_mktime(23, 59, 59, GETPOST('search_datepayment_endmonth', 'int'), GETPOST('search_datepayment_endday', 'int'), GETPOST('search_datepayment_endyear', 'int')); -$search_type = GETPOST('search_type', 'int'); -$search_account = GETPOST('search_account', 'int'); +$search_dateend_start = dol_mktime(0, 0, 0, GETPOSTINT('search_dateend_startmonth'), GETPOSTINT('search_dateend_startday'), GETPOSTINT('search_dateend_startyear')); +$search_dateend_end = dol_mktime(23, 59, 59, GETPOSTINT('search_dateend_endmonth'), GETPOSTINT('search_dateend_endday'), GETPOSTINT('search_dateend_endyear')); +$search_datepayment_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datepayment_startmonth'), GETPOSTINT('search_datepayment_startday'), GETPOSTINT('search_datepayment_startyear')); +$search_datepayment_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datepayment_endmonth'), GETPOSTINT('search_datepayment_endday'), GETPOSTINT('search_datepayment_endyear')); +$search_type = GETPOSTINT('search_type'); +$search_account = GETPOSTINT('search_account'); $search_amount = GETPOST('search_amount', 'alpha'); -$search_status = GETPOST('search_status', 'int'); -$ltt = GETPOST("ltt", "int"); +$search_status = GETPOSTINT('search_status'); +$ltt = GETPOSTINT("ltt"); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST('page', 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT('page'); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -105,7 +105,7 @@ $permissiontoadd = $user->hasRight('tax', 'charges', 'creer'); $permissiontodelete = $user->hasRight('tax', 'charges', 'supprimer'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } @@ -281,40 +281,40 @@ if (!empty($search_label)) { $param .= '&search_label="'.$search_label.'"'; } if (!empty($search_dateend_start)) { - $param .= '&search_dateend_startyear='.GETPOST('search_dateend_startyear', 'int'); + $param .= '&search_dateend_startyear='.GETPOSTINT('search_dateend_startyear'); } if (!empty($search_dateend_start)) { - $param .= '&search_dateend_startmonth='.GETPOST('search_dateend_startmonth', 'int'); + $param .= '&search_dateend_startmonth='.GETPOSTINT('search_dateend_startmonth'); } if (!empty($search_dateend_start)) { - $param .= '&search_dateend_startday='.GETPOST('search_dateend_startday', 'int'); + $param .= '&search_dateend_startday='.GETPOSTINT('search_dateend_startday'); } if (!empty($search_dateend_end)) { - $param .= '&search_dateend_endyear='.GETPOST('search_dateend_endyear', 'int'); + $param .= '&search_dateend_endyear='.GETPOSTINT('search_dateend_endyear'); } if (!empty($search_dateend_end)) { - $param .= '&search_dateend_endmonth='.GETPOST('search_dateend_endmonth', 'int'); + $param .= '&search_dateend_endmonth='.GETPOSTINT('search_dateend_endmonth'); } if (!empty($search_dateend_end)) { - $param .= '&search_dateend_endday='.GETPOST('search_dateend_endday', 'int'); + $param .= '&search_dateend_endday='.GETPOSTINT('search_dateend_endday'); } if (!empty($search_datepayment_start)) { - $param .= '&search_datepayment_startyear='.GETPOST('search_datepayment_startyear', 'int'); + $param .= '&search_datepayment_startyear='.GETPOSTINT('search_datepayment_startyear'); } if (!empty($search_datepayment_start)) { - $param .= '&search_datepayment_startmonth='.GETPOST('search_datepayment_startmonth', 'int'); + $param .= '&search_datepayment_startmonth='.GETPOSTINT('search_datepayment_startmonth'); } if (!empty($search_datepayment_start)) { - $param .= '&search_datepayment_startday='.GETPOST('search_datepayment_startday', 'int'); + $param .= '&search_datepayment_startday='.GETPOSTINT('search_datepayment_startday'); } if (!empty($search_datepayment_end)) { - $param .= '&search_datepayment_endyear='.GETPOST('search_datepayment_endyear', 'int'); + $param .= '&search_datepayment_endyear='.GETPOSTINT('search_datepayment_endyear'); } if (!empty($search_datepayment_end)) { - $param .= '&search_datepayment_endmonth='.GETPOST('search_datepayment_endmonth', 'int'); + $param .= '&search_datepayment_endmonth='.GETPOSTINT('search_datepayment_endmonth'); } if (!empty($search_datepayment_end)) { - $param .= '&search_datepayment_endday='.GETPOST('search_datepayment_endday', 'int'); + $param .= '&search_datepayment_endday='.GETPOSTINT('search_datepayment_endday'); } if (!empty($search_type) && $search_type > 0) { $param .= '&search_type='.$search_type; diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index e5cb19877e6..b877b472551 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -40,17 +40,17 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; $langs->loadLangs(array('compta', 'bills')); $mode = GETPOST("mode", 'alpha'); -$year = GETPOST("year", 'int'); +$year = GETPOSTINT("year"); $filtre = GETPOST("filtre", 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); if (!$year && $mode != 'tvaonly') { $year = date("Y", time()); } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index a0134194b48..40d49e2404f 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -55,8 +55,8 @@ $mesg = ''; $error = 0; $errors = array(); $action = (GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view'); $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$id = GETPOST('id', 'int'); -$socid = GETPOST('socid', 'int'); +$id = GETPOSTINT('id'); +$socid = GETPOSTINT('socid'); // Initialize objects $object = new Contact($db); @@ -92,10 +92,10 @@ if ($user->socid) { } $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index d0db16191d0..ab35f938890 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -285,7 +285,7 @@ abstract class ActionsContactCardCommon // phpcs:enable global $langs, $mysoc; - $this->object->socid = GETPOST("socid", 'int'); + $this->object->socid = GETPOSTINT("socid"); $this->object->lastname = GETPOST("name"); $this->object->firstname = GETPOST("firstname"); $this->object->civility_id = GETPOST("civility_id"); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 9d8ee6762ce..3ca3250d3c3 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -205,7 +205,7 @@ if (empty($reshook)) { $object->canvas = $canvas; } - $object->entity = (GETPOSTISSET('entity') ? GETPOST('entity', 'int') : $conf->entity); + $object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $conf->entity); $object->socid = $socid; $object->lastname = (string) GETPOST("lastname", 'alpha'); $object->firstname = (string) GETPOST("firstname", 'alpha'); @@ -214,8 +214,8 @@ if (empty($reshook)) { $object->address = (string) GETPOST("address", 'alpha'); $object->zip = (string) GETPOST("zipcode", 'alpha'); $object->town = (string) GETPOST("town", 'alpha'); - $object->country_id = (int) GETPOST("country_id", 'int'); - $object->state_id = (int) GETPOST("state_id", 'int'); + $object->country_id = GETPOSTINT("country_id"); + $object->state_id = GETPOSTINT("state_id"); $object->socialnetworks = array(); if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { @@ -238,7 +238,7 @@ if (empty($reshook)) { $object->statut = 1; //Default status to Actif // Note: Correct date should be completed with location to have exact GM time of birth. - $object->birthday = dol_mktime(0, 0, 0, GETPOST("birthdaymonth", 'int'), GETPOST("birthdayday", 'int'), GETPOST("birthdayyear", 'int')); + $object->birthday = dol_mktime(0, 0, 0, GETPOSTINT("birthdaymonth"), GETPOSTINT("birthdayday"), GETPOSTINT("birthdayyear")); $object->birthday_alert = GETPOSTINT("birthday_alert"); //Default language @@ -342,7 +342,7 @@ if (empty($reshook)) { $action = 'edit'; } - if (isModEnabled('mailing') && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && GETPOST("no_email", "int") == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (isModEnabled('mailing') && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && GETPOSTINT("no_email") == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $error++; $errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")); $action = 'edit'; @@ -356,7 +356,7 @@ if (empty($reshook)) { } if (!$error) { - $contactid = GETPOST("contactid", 'int'); + $contactid = GETPOSTINT("contactid"); $object->fetch($contactid); $object->fetchRoles(); @@ -413,11 +413,11 @@ if (empty($reshook)) { $object->address = (string) GETPOST("address", 'alpha'); $object->zip = (string) GETPOST("zipcode", 'alpha'); $object->town = (string) GETPOST("town", 'alpha'); - $object->state_id = GETPOST("state_id", 'int'); - $object->country_id = GETPOST("country_id", 'int'); + $object->state_id = GETPOSTINT("state_id"); + $object->country_id = GETPOSTINT("country_id"); $object->email = (string) GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); - $object->no_email = GETPOST("no_email", "int"); + $object->no_email = GETPOSTINT("no_email"); $object->socialnetworks = array(); if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { @@ -430,7 +430,7 @@ if (empty($reshook)) { $object->phone_perso = (string) GETPOST("phone_perso", 'alpha'); $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); $object->fax = (string) GETPOST("fax", 'alpha'); - $object->priv = (string) GETPOST("priv", 'int'); + $object->priv = (string) GETPOSTINT("priv"); $object->note_public = (string) GETPOST("note_public", 'restricthtml'); $object->note_private = (string) GETPOST("note_private", 'restricthtml'); @@ -455,7 +455,7 @@ if (empty($reshook)) { // Update mass emailing flag into table mailing_unsubscribe if (GETPOSTISSET('no_email') && $object->email) { - $no_email = GETPOST('no_email', 'int'); + $no_email = GETPOSTINT('no_email'); $result = $object->setNoEmail($no_email); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -500,14 +500,14 @@ if (empty($reshook)) { // Update extrafields if ($action == "update_extras" && !empty($permissiontoadd)) { - $object->fetch(GETPOST('id', 'int')); + $object->fetch(GETPOSTINT('id')); $attributekey = GETPOST('attribute', 'alpha'); $attributekeylong = 'options_'.$attributekey; if (GETPOSTISSET($attributekeylong.'day') && GETPOSTISSET($attributekeylong.'month') && GETPOSTISSET($attributekeylong.'year')) { // This is properties of a date - $object->array_options['options_'.$attributekey] = dol_mktime(GETPOST($attributekeylong.'hour', 'int'), GETPOST($attributekeylong.'min', 'int'), GETPOST($attributekeylong.'sec', 'int'), GETPOST($attributekeylong.'month', 'int'), GETPOST($attributekeylong.'day', 'int'), GETPOST($attributekeylong.'year', 'int')); + $object->array_options['options_'.$attributekey] = dol_mktime(GETPOSTINT($attributekeylong.'hour'), GETPOSTINT($attributekeylong.'min'), GETPOSTINT($attributekeylong.'sec'), GETPOSTINT($attributekeylong.'month'), GETPOSTINT($attributekeylong.'day'), GETPOSTINT($attributekeylong.'year')); //var_dump(dol_print_date($object->array_options['options_'.$attributekey]));exit; } else { $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, 'alpha'); @@ -628,10 +628,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { */ $object->canvas = $canvas; - $object->state_id = GETPOST("state_id", "int"); + $object->state_id = GETPOSTINT("state_id"); // We set country_id, country_code and label for the selected country - $object->country_id = GETPOST("country_id") ? GETPOST("country_id", "int") : (empty($objsoc->country_id) ? $mysoc->country_id : $objsoc->country_id); + $object->country_id = GETPOST("country_id") ? GETPOSTINT("country_id") : (empty($objsoc->country_id) ? $mysoc->country_id : $objsoc->country_id); if ($object->country_id) { $tmparray = getCountry($object->country_id, 'all'); $object->country_code = $tmparray['code']; @@ -848,7 +848,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; // Default value is in MAILING_CONTACT_DEFAULT_BULK_STATUS that you can modify in setup of module emailing - print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS')), 1, false, (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2)); + print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOSTINT("no_email") : getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS')), 1, false, (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2)); print ''; print ''; } @@ -1002,7 +1002,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!getDolGlobalString('SOCIETE_DISABLE_CONTACTS')) { print ''; print ''; - print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company(GETPOST('socid', 'int') ? GETPOST('socid', 'int') : ($object->socid ? $object->socid : -1), 'socid', '', $langs->trans("SelectThirdParty")); + print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company(GETPOSTINT('socid') ? GETPOSTINT('socid') : ($object->socid ? $object->socid : -1), 'socid', '', $langs->trans("SelectThirdParty")); print ''; print ''; } @@ -1126,7 +1126,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; $useempty = (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2); - print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $object->no_email), 1, false, $useempty); + print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOSTINT("no_email") : $object->no_email), 1, false, $useempty); print ''; print ''; } diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 1e82f807105..21ba9ed848f 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $object = new Contact($db); if ($id > 0) { @@ -49,10 +49,10 @@ if (empty($object->thirdparty)) { $socid = !empty($object->thirdparty->id) ? $object->thirdparty->id : null; // Sort & Order fields -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -69,8 +69,8 @@ if (!$sortfield) { // Search fields $sref = GETPOST("sref"); $sprod_fulldescr = GETPOST("sprod_fulldescr"); -$month = GETPOST('month', 'int'); -$year = GETPOST('year', 'int'); +$month = GETPOSTINT('month'); +$year = GETPOSTINT('year'); // Clean up on purge search criteria ? if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index 0ab502e6fa9..ede18370781 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $langs->loadLangs(array('other', 'companies', 'contact')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -53,10 +53,10 @@ if (!empty($canvas)) { } // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contact/info.php b/htdocs/contact/info.php index f92734644de..d1248286792 100644 --- a/htdocs/contact/info.php +++ b/htdocs/contact/info.php @@ -35,7 +35,7 @@ $langs->load("companies"); // Security check -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 4d74382ad4e..337966133c5 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -36,7 +36,7 @@ $langs->load("admin"); $action = GETPOST('action', 'aZ09'); // Security check -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index a9878be3a28..45a39bfee2f 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -49,7 +49,7 @@ $socialnetworks = getArrayOfSocialNetworks(); // Get parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'contactlist'; @@ -60,8 +60,8 @@ if ($contextpage == 'poslist') { } // Security check -$id = GETPOST('id', 'int'); -$contactid = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); +$contactid = GETPOSTINT('id'); $ref = ''; // There is no ref for contacts if ($user->socid) { $socid = $user->socid; @@ -72,7 +72,7 @@ $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('searc $search_cti = preg_replace('/^0+/', '', preg_replace('/[^0-9]/', '', GETPOST('search_cti', 'alphanohtml'))); // Phone number without any special chars $search_phone = GETPOST("search_phone", 'alpha'); -$search_id = GETPOST("search_id", "int"); +$search_id = GETPOSTINT("search_id"); $search_firstlast_only = GETPOST("search_firstlast_only", 'alpha'); $search_lastname = GETPOST("search_lastname", 'alpha'); $search_firstname = GETPOST("search_firstname", 'alpha'); @@ -85,7 +85,7 @@ $search_phone_mobile = GETPOST("search_phone_mobile", 'alpha'); $search_fax = GETPOST("search_fax", 'alpha'); $search_email = GETPOST("search_email", 'alpha'); if (isModEnabled('mailing')) { - $search_no_email = GETPOSTISSET("search_no_email") ? GETPOST("search_no_email", 'int') : -1; + $search_no_email = GETPOSTISSET("search_no_email") ? GETPOSTINT("search_no_email") : -1; } else { $search_no_email = -1; } @@ -98,10 +98,10 @@ if (isModEnabled('socialnetworks')) { } $search_priv = GETPOST("search_priv", 'alpha'); $search_sale = GETPOSTINT('search_sale'); -$search_categ = GETPOST("search_categ", 'int'); -$search_categ_thirdparty = GETPOST("search_categ_thirdparty", 'int'); -$search_categ_supplier = GETPOST("search_categ_supplier", 'int'); -$search_status = GETPOST("search_status", 'int'); +$search_categ = GETPOSTINT("search_categ"); +$search_categ_thirdparty = GETPOSTINT("search_categ_thirdparty"); +$search_categ_supplier = GETPOSTINT("search_categ_supplier"); +$search_status = GETPOSTINT("search_status"); $search_type = GETPOST('search_type', 'alpha'); $search_address = GETPOST('search_address', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); @@ -110,9 +110,9 @@ $search_import_key = GETPOST("search_import_key", 'alpha'); $search_country = GETPOST("search_country", 'intcomma'); $search_roles = GETPOST("search_roles", 'array'); $search_level = GETPOST("search_level", 'array'); -$search_stcomm = GETPOST('search_stcomm', 'int'); -$search_birthday_start = dol_mktime(0, 0, 0, GETPOST('search_birthday_startmonth', 'int'), GETPOST('search_birthday_startday', 'int'), GETPOST('search_birthday_startyear', 'int')); -$search_birthday_end = dol_mktime(23, 59, 59, GETPOST('search_birthday_endmonth', 'int'), GETPOST('search_birthday_endday', 'int'), GETPOST('search_birthday_endyear', 'int')); +$search_stcomm = GETPOSTINT('search_stcomm'); +$search_birthday_start = dol_mktime(0, 0, 0, GETPOSTINT('search_birthday_startmonth'), GETPOSTINT('search_birthday_startday'), GETPOSTINT('search_birthday_startyear')); +$search_birthday_end = dol_mktime(23, 59, 59, GETPOSTINT('search_birthday_endmonth'), GETPOSTINT('search_birthday_endday'), GETPOSTINT('search_birthday_endyear')); if ($search_status === '') { $search_status = 1; // always display active customer first @@ -128,14 +128,14 @@ $place = GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'; // $place is $type = GETPOST("type", 'aZ'); $view = GETPOST("view", 'alpha'); -$userid = GETPOST('userid', 'int'); +$userid = GETPOSTINT('userid'); $begin = GETPOST('begin'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "ASC"; } @@ -288,8 +288,8 @@ if (!$permissiontoread) { */ if ($action == "change" && $user->hasRight('takepos', 'run')) { // Change customer for TakePOS - $idcustomer = GETPOST('idcustomer', 'int'); - $idcontact = GETPOST('idcontact', 'int'); + $idcustomer = GETPOSTINT('idcustomer'); + $idcontact = GETPOSTINT('idcontact'); // Check if draft invoice already exists, if not create it $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' AND entity IN (".getEntity('invoice').")"; @@ -935,7 +935,7 @@ if (!empty($permissiontodelete)) { if (isModEnabled('category') && $user->hasRight('societe', 'creer')) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { $arrayofmassactions = array(); } if ($contextpage != 'poslist') { diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index 7dd2b319e67..1f7a328e614 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -35,7 +35,7 @@ $action = GETPOST('action', 'aZ09'); // Load translation files required by the page $langs->load("companies"); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $object = new Contact($db); if ($id > 0) { diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index c9e96439ef9..357b6401023 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'other')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); // Security check diff --git a/htdocs/contact/project.php b/htdocs/contact/project.php index 9cc60d2cbe4..389bb693d1d 100644 --- a/htdocs/contact/project.php +++ b/htdocs/contact/project.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->loadLangs(array("contacts", "companies", "projects")); // Security check -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index 5760cc9e670..a8434eff2d9 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/vcard.class.php'; $contact = new Contact($db); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Security check $result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 45f81b633c9..5c0506a94c7 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -50,7 +50,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Security check @@ -63,10 +63,10 @@ $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($id) ? 'rowid' : 'ref'); $result = restrictedArea($user, 'contrat', $fieldvalue, '', '', '', $fieldtype); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index fb3290f6124..231f433f3b4 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -61,16 +61,16 @@ $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$socid = GETPOST('socid', 'int'); -$id = GETPOST('id', 'int'); +$socid = GETPOSTINT('socid'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $origin = GETPOST('origin', 'alpha'); -$originid = GETPOST('originid', 'int'); +$originid = GETPOSTINT('originid'); // PDF -$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); -$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); -$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); +$hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); +$hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); +$hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); $datecontrat = ''; @@ -164,7 +164,7 @@ if (empty($reshook)) { $date_end = dol_mktime(GETPOST('endhour'), GETPOST('endmin'), 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); } - $result = $object->active_line($user, GETPOST('ligne', 'int'), $date_start, $date_end, GETPOST('comment')); + $result = $object->active_line($user, GETPOSTINT('ligne'), $date_start, $date_end, GETPOST('comment')); if ($result > 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); @@ -182,7 +182,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), null, 'errors'); } if (!$error) { - $result = $object->close_line($user, GETPOST('ligne', 'int'), $date_end, urldecode(GETPOST('comment'))); + $result = $object->close_line($user, GETPOSTINT('ligne'), $date_end, urldecode(GETPOST('comment'))); if ($result > 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; @@ -250,12 +250,12 @@ if (empty($reshook)) { $object->socid = $socid; $object->date_contrat = $datecontrat; - $object->commercial_suivi_id = GETPOST('commercial_suivi_id', 'int'); - $object->commercial_signature_id = GETPOST('commercial_signature_id', 'int'); + $object->commercial_suivi_id = GETPOSTINT('commercial_suivi_id'); + $object->commercial_signature_id = GETPOSTINT('commercial_signature_id'); $object->note_private = GETPOST('note_private', 'alpha'); $object->note_public = GETPOST('note_public', 'alpha'); - $object->fk_project = GETPOST('projectid', 'int'); + $object->fk_project = GETPOSTINT('projectid'); $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2); $object->ref = GETPOST('ref', 'alpha'); $object->ref_customer = GETPOST('ref_customer', 'alpha'); @@ -451,7 +451,7 @@ if (empty($reshook)) { if (GETPOST('prod_entry_mode', 'alpha') == 'free') { $idprod = 0; } else { - $idprod = GETPOST('idprod', 'int'); + $idprod = GETPOSTINT('idprod'); if (getDolGlobalString('MAIN_DISABLE_FREE_LINES') && $idprod <= 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")), null, 'errors'); @@ -712,7 +712,7 @@ if (empty($reshook)) { if (!$error) { $objectline = new ContratLigne($db); - if ($objectline->fetch(GETPOST('elrowid', 'int')) < 0) { + if ($objectline->fetch(GETPOSTINT('elrowid')) < 0) { setEventMessages($objectline->error, $objectline->errors, 'errors'); $error++; } @@ -771,7 +771,7 @@ if (empty($reshook)) { $remise = round(($price_ht * $remise_percent / 100), 2); } - $objectline->fk_product = GETPOST('idprod', 'int'); + $objectline->fk_product = GETPOSTINT('idprod'); $objectline->description = GETPOST('product_desc', 'restricthtml'); $objectline->price_ht = $price_ht; $objectline->subprice = price2num(GETPOST('elprice'), 'MU'); @@ -822,7 +822,7 @@ if (empty($reshook)) { $db->rollback(); } } elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->hasRight('contrat', 'creer')) { - $result = $object->deleteLine(GETPOST('lineid', 'int'), $user); + $result = $object->deleteLine(GETPOSTINT('lineid'), $user); if ($result >= 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); @@ -1036,10 +1036,10 @@ if (empty($reshook)) { } } elseif ($action == 'swapstatut') { // bascule du statut d'un contact - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } elseif ($action == 'deletecontact') { // Efface un contact - $result = $object->delete_contact(GETPOST('lineid', 'int')); + $result = $object->delete_contact(GETPOSTINT('lineid')); if ($result >= 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); @@ -1111,7 +1111,7 @@ if ($action == 'create') { $soc->fetch($socid); } - if (GETPOST('origin') && GETPOST('originid', 'int')) { + if (GETPOST('origin') && GETPOSTINT('originid')) { // Parse element/subelement (ex: project_task) $regs = array(); $element = $subelement = GETPOST('origin'); @@ -1121,7 +1121,7 @@ if ($action == 'create') { } if ($element == 'project') { - $projectid = GETPOST('originid', 'int'); + $projectid = GETPOSTINT('originid'); } else { // For compatibility if ($element == 'order' || $element == 'commande') { @@ -1161,7 +1161,7 @@ if ($action == 'create') { $srccontactslist = $objectsrc->liste_contact(-1, 'external', 1); } } else { - $projectid = GETPOST('projectid', 'int'); + $projectid = GETPOSTINT('projectid'); $note_private = GETPOST("note_private"); $note_public = GETPOST("note_public"); } @@ -1358,7 +1358,7 @@ if ($action == 'create') { } elseif ($action == 'clone') { $filter = '(s.client:IN:1,2,3)'; // Clone confirmation - $formquestion = array(array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', $filter))); + $formquestion = array(array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', $filter))); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneContract', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } @@ -1892,7 +1892,7 @@ if ($action == 'create') { 'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"), array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid)); - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid', 'int'), $langs->trans("MoveToAnotherContract"), $langs->trans("ConfirmMoveToAnotherContract"), "confirm_move", $formquestion); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOSTINT('rowid'), $langs->trans("MoveToAnotherContract"), $langs->trans("ConfirmMoveToAnotherContract"), "confirm_move", $formquestion); print '
'; } @@ -1960,13 +1960,13 @@ if ($action == 'create') { } // Form to activate line - if ($user->hasRight('contrat', 'activer') && $action == 'activateline' && $object->lines[$cursorline - 1]->id == GETPOST('ligne', 'int')) { + if ($user->hasRight('contrat', 'activer') && $action == 'activateline' && $object->lines[$cursorline - 1]->id == GETPOSTINT('ligne')) { print ''; print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -2015,7 +2015,7 @@ if ($action == 'create') { print ''; } - if ($user->hasRight('contrat', 'activer') && $action == 'unactivateline' && $object->lines[$cursorline - 1]->id == GETPOST('ligne', 'int')) { + if ($user->hasRight('contrat', 'activer') && $action == 'unactivateline' && $object->lines[$cursorline - 1]->id == GETPOSTINT('ligne')) { /** * Disable a contract line */ @@ -2084,7 +2084,7 @@ if ($action == 'create') { $dateSelector = 1; print "\n"; - print ' + print ' diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index df7331cb65a..2af94f7654c 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -40,8 +40,8 @@ $langs->loadLangs(array('contracts', 'companies')); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -$socid = GETPOST('socid', 'int'); -$id = GETPOST('id', 'int'); +$socid = GETPOSTINT('socid'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Security check @@ -98,7 +98,7 @@ if (empty($reshook)) { // Toggle the status of a contact if ($action == 'swapstatut' && $user->hasRight('contrat', 'creer')) { if ($object->fetch($id)) { - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } else { dol_print_error($db, $object->error); } @@ -107,7 +107,7 @@ if (empty($reshook)) { // Delete contact if ($action == 'deletecontact' && $user->hasRight('contrat', 'creer')) { $object->fetch($id); - $result = $object->delete_contact(GETPOST("lineid", 'int')); + $result = $object->delete_contact(GETPOSTINT("lineid")); if ($result >= 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 9cea403d00c..df1fe678317 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -42,7 +42,7 @@ $langs->loadLangs(array('other', 'products', 'contracts')); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Security check @@ -53,10 +53,10 @@ if ($user->socid > 0) { } // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index be492d4cea0..584ea7d0697 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -39,13 +39,13 @@ $langs->loadLangs(array('products', 'companies', 'contracts')); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); $statut = GETPOST('statut') ? GETPOST('statut') : 1; // Security check $socid = 0; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); if (!empty($user->socid)) { $socid = $user->socid; } diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 72fd00021c8..8c5d25cbb97 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -47,7 +47,7 @@ $langs->loadLangs(array('contracts', 'products', 'companies', 'compta')); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'contractlist'; // To manage different context of search @@ -59,59 +59,59 @@ $search_email = GETPOST('search_email', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST("search_state", 'alpha'); -$search_country = GETPOST("search_country", 'int'); -$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); +$search_country = GETPOSTINT("search_country"); +$search_type_thirdparty = GETPOSTINT("search_type_thirdparty"); $search_contract = GETPOST('search_contract', 'alpha'); $search_ref_customer = GETPOST('search_ref_customer', 'alpha'); $search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); $search_all = (GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search_status = GETPOST('search_status', 'alpha'); -$socid = GETPOST('socid', 'int'); -$search_user = GETPOST('search_user', 'int'); -$search_sale = GETPOST('search_sale', 'int'); -$search_product_category = GETPOST('search_product_category', 'int'); -$search_dfmonth = GETPOST('search_dfmonth', 'int'); -$search_dfyear = GETPOST('search_dfyear', 'int'); +$socid = GETPOSTINT('socid'); +$search_user = GETPOSTINT('search_user'); +$search_sale = GETPOSTINT('search_sale'); +$search_product_category = GETPOSTINT('search_product_category'); +$search_dfmonth = GETPOSTINT('search_dfmonth'); +$search_dfyear = GETPOSTINT('search_dfyear'); $search_op2df = GETPOST('search_op2df', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $searchCategoryCustomerOperator = 0; if (GETPOSTISSET('formfilteraction')) { - $searchCategoryCustomerOperator = GETPOST('search_category_customer_operator', 'int'); + $searchCategoryCustomerOperator = GETPOSTINT('search_category_customer_operator'); } elseif (getDolGlobalString('MAIN_SEARCH_CAT_OR_BY_DEFAULT')) { $searchCategoryCustomerOperator = getDolGlobalString('MAIN_SEARCH_CAT_OR_BY_DEFAULT'); } $searchCategoryCustomerList = GETPOST('search_category_customer_list', 'array'); -$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int'); -$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int'); -$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int'); +$search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); +$search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); +$search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); $search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver -$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int'); -$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int'); -$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int'); +$search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); +$search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); +$search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); $search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver -$search_date_modif_startmonth = GETPOST('search_date_modif_startmonth', 'int'); -$search_date_modif_startyear = GETPOST('search_date_modif_startyear', 'int'); -$search_date_modif_startday = GETPOST('search_date_modif_startday', 'int'); +$search_date_modif_startmonth = GETPOSTINT('search_date_modif_startmonth'); +$search_date_modif_startyear = GETPOSTINT('search_date_modif_startyear'); +$search_date_modif_startday = GETPOSTINT('search_date_modif_startday'); $search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver -$search_date_modif_endmonth = GETPOST('search_date_modif_endmonth', 'int'); -$search_date_modif_endyear = GETPOST('search_date_modif_endyear', 'int'); -$search_date_modif_endday = GETPOST('search_date_modif_endday', 'int'); +$search_date_modif_endmonth = GETPOSTINT('search_date_modif_endmonth'); +$search_date_modif_endyear = GETPOSTINT('search_date_modif_endyear'); +$search_date_modif_endday = GETPOSTINT('search_date_modif_endday'); $search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -127,7 +127,7 @@ if (!$sortorder) { } // Security check -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); if ($user->socid) { $socid = $user->socid; } @@ -733,7 +733,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/contrat/messaging.php b/htdocs/contrat/messaging.php index 5eaaac8d51f..edaeb02525b 100644 --- a/htdocs/contrat/messaging.php +++ b/htdocs/contrat/messaging.php @@ -53,13 +53,13 @@ $search_agenda_label = GETPOST('search_agenda_label'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ?GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -80,7 +80,7 @@ $object = new Contrat($db); $hookmanager->initHooks(array('agendacontract', 'globalcard')); // Security check -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); $socid = 0; if ($user->socid) { $socid = $user->socid; diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index ec9f9da7dc2..996eace982f 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -37,8 +37,8 @@ $langs->loadLangs(array('companies', 'contracts')); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -$socid = GETPOST('socid', 'int'); -$id = GETPOST('id', 'int'); +$socid = GETPOSTINT('socid'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Security check diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 69025a66d0f..eae46a028e6 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -44,10 +44,10 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ' $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -71,8 +71,8 @@ $search_total_ttc = GETPOST("search_total_ttc", 'alpha'); $search_contract = GETPOST("search_contract", 'alpha'); $search_service = GETPOST("search_service", 'alpha'); $search_status = GETPOST("search_status", 'alpha'); -$search_product_category = GETPOST('search_product_category', 'int'); -$socid = GETPOST('socid', 'int'); +$search_product_category = GETPOSTINT('search_product_category'); +$socid = GETPOSTINT('socid'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'contractservicelist'.$mode; $opouvertureprevuemonth = GETPOST('opouvertureprevuemonth'); @@ -80,19 +80,19 @@ $opouvertureprevueday = GETPOST('opouvertureprevueday'); $opouvertureprevueyear = GETPOST('opouvertureprevueyear'); $filter_opouvertureprevue = GETPOST('filter_opouvertureprevue'); -$op1month = GETPOST('op1month', 'int'); -$op1day = GETPOST('op1day', 'int'); -$op1year = GETPOST('op1year', 'int'); +$op1month = GETPOSTINT('op1month'); +$op1day = GETPOSTINT('op1day'); +$op1year = GETPOSTINT('op1year'); $filter_op1 = GETPOST('filter_op1', 'alpha'); -$op2month = GETPOST('op2month', 'int'); -$op2day = GETPOST('op2day', 'int'); -$op2year = GETPOST('op2year', 'int'); +$op2month = GETPOSTINT('op2month'); +$op2day = GETPOSTINT('op2day'); +$op2year = GETPOSTINT('op2year'); $filter_op2 = GETPOST('filter_op2', 'alpha'); -$opcloturemonth = GETPOST('opcloturemonth', 'int'); -$opclotureday = GETPOST('opclotureday', 'int'); -$opclotureyear = GETPOST('opclotureyear', 'int'); +$opcloturemonth = GETPOSTINT('opcloturemonth'); +$opclotureday = GETPOSTINT('opclotureday'); +$opclotureyear = GETPOSTINT('opclotureyear'); $filter_opcloture = GETPOST('filter_opcloture', 'alpha'); @@ -107,7 +107,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Security check -$contratid = GETPOST('id', 'int'); +$contratid = GETPOSTINT('id'); if (!empty($user->socid)) { $socid = $user->socid; } diff --git a/htdocs/contrat/ticket.php b/htdocs/contrat/ticket.php index e4e1296ccdb..7c7cce00982 100644 --- a/htdocs/contrat/ticket.php +++ b/htdocs/contrat/ticket.php @@ -37,8 +37,8 @@ require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php"; $langs->loadLangs(array('companies', 'contracts', 'tickets')); -$socid=GETPOST('socid', 'int'); -$id=GETPOST('id', 'int'); +$socid=GETPOSTINT('socid'); +$id=GETPOSTINT('id'); $ref=GETPOST('ref', 'alpha'); $action=GETPOST('action', 'alpha'); diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 9f5228561d0..1fac2f45c9e 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -110,9 +110,9 @@ if ($action == 'add' && !empty($permissiontoadd)) { $value = GETPOST($key, 'restricthtml'); } } elseif ($object->fields[$key]['type'] == 'date') { - $value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); // for date without hour, we use gmt + $value = dol_mktime(12, 0, 0, GETPOSTINT($key.'month'), GETPOSTINT($key.'day'), GETPOSTINT($key.'year')); // for date without hour, we use gmt } elseif ($object->fields[$key]['type'] == 'datetime') { - $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'), 'tzuserrel'); + $value = dol_mktime(GETPOSTINT($key.'hour'), GETPOSTINT($key.'min'), GETPOSTINT($key.'sec'), GETPOSTINT($key.'month'), GETPOSTINT($key.'day'), GETPOSTINT($key.'year'), 'tzuserrel'); } elseif ($object->fields[$key]['type'] == 'duration') { $value = 60 * 60 * GETPOSTINT($key.'hour') + 60 * GETPOSTINT($key.'min'); } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { @@ -263,12 +263,12 @@ if ($action == 'update' && !empty($permissiontoadd)) { $value = GETPOST($key, 'restricthtml'); } } elseif ($object->fields[$key]['type'] == 'date') { - $value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); // for date without hour, we use gmt + $value = dol_mktime(12, 0, 0, GETPOSTINT($key.'month'), GETPOSTINT($key.'day'), GETPOSTINT($key.'year')); // for date without hour, we use gmt } elseif ($object->fields[$key]['type'] == 'datetime') { - $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'), 'tzuserrel'); + $value = dol_mktime(GETPOSTINT($key.'hour'), GETPOSTINT($key.'min'), GETPOSTINT($key.'sec'), GETPOSTINT($key.'month'), GETPOSTINT($key.'day'), GETPOSTINT($key.'year'), 'tzuserrel'); } elseif ($object->fields[$key]['type'] == 'duration') { - if (GETPOST($key.'hour', 'int') != '' || GETPOST($key.'min', 'int') != '') { - $value = 60 * 60 * GETPOST($key.'hour', 'int') + 60 * GETPOST($key.'min', 'int'); + if (GETPOSTINT($key.'hour') != '' || GETPOSTINT($key.'min') != '') { + $value = 60 * 60 * GETPOSTINT($key.'hour') + 60 * GETPOSTINT($key.'min'); } else { $value = ''; } @@ -353,8 +353,8 @@ if ($action == 'update' && !empty($permissiontoadd)) { // Action to update one modulebuilder field $reg = array(); -if (preg_match('/^set(\w+)$/', $action, $reg) && GETPOST('id', 'int') > 0 && !empty($permissiontoadd)) { - $object->fetch(GETPOST('id', 'int')); +if (preg_match('/^set(\w+)$/', $action, $reg) && GETPOSTINT('id') > 0 && !empty($permissiontoadd)) { + $object->fetch(GETPOSTINT('id')); $keyforfield = $reg[1]; if (property_exists($object, $keyforfield)) { @@ -378,8 +378,8 @@ if (preg_match('/^set(\w+)$/', $action, $reg) && GETPOST('id', 'int') > 0 && !em } // Action to update one extrafield -if ($action == "update_extras" && GETPOST('id', 'int') > 0 && !empty($permissiontoadd)) { - $object->fetch(GETPOST('id', 'int')); +if ($action == "update_extras" && GETPOSTINT('id') > 0 && !empty($permissiontoadd)) { + $object->fetch(GETPOSTINT('id')); $object->oldcopy = dol_clone($object, 2); diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index 5efa4df394d..8e34bcdbc52 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -55,9 +55,9 @@ if ($action == 'builddoc' && ($permissiontoadd || !empty($usercangeneretedoc))) // Special case to force bank account //if (property_exists($object, 'fk_bank')) //{ - if (GETPOST('fk_bank', 'int')) { + if (GETPOSTINT('fk_bank')) { // this field may come from an external module - $object->fk_bank = GETPOST('fk_bank', 'int'); + $object->fk_bank = GETPOSTINT('fk_bank'); } elseif (!empty($object->fk_account)) { $object->fk_bank = $object->fk_account; } diff --git a/htdocs/core/actions_dellink.inc.php b/htdocs/core/actions_dellink.inc.php index 3ba1df0b0e8..9d5bb687c64 100644 --- a/htdocs/core/actions_dellink.inc.php +++ b/htdocs/core/actions_dellink.inc.php @@ -26,9 +26,9 @@ // $object must be defined // $permissiondellink must be defined -$dellinkid = GETPOST('dellinkid', 'int'); +$dellinkid = GETPOSTINT('dellinkid'); $addlink = GETPOST('addlink', 'alpha'); -$addlinkid = GETPOST('idtolinkto', 'int'); +$addlinkid = GETPOSTINT('idtolinkto'); $addlinkref = GETPOST('reftolinkto', 'alpha'); $cancellink = GETPOST('cancel', 'alpha'); diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index a563b791f51..affca98a90d 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -200,7 +200,7 @@ if ($action == 'add') { GETPOST('attrname', 'aZ09'), GETPOST('label', 'alpha'), $type, - GETPOST('pos', 'int'), + GETPOSTINT('pos'), $extrasize, $elementtype, (GETPOST('unique', 'alpha') ? 1 : 0), @@ -337,7 +337,7 @@ if ($action == 'update') { if (!$error) { if (GETPOSTISSET("attrname") && preg_match("/^\w[a-zA-Z0-9-_]*$/", GETPOST('attrname', 'aZ09')) && !is_numeric(GETPOST('attrname', 'aZ09'))) { - $pos = GETPOST('pos', 'int'); + $pos = GETPOSTINT('pos'); // Construct array for parameter (value of select list) $parameters = $param; $parameters_array = explode("\r\n", $parameters); diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 28d5d33800c..ed0d8b4e8ec 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -28,7 +28,7 @@ // Protection to understand what happen when submitting files larger than post_max_size -if (GETPOST('uploadform', 'int') && empty($_POST) && empty($_FILES)) { +if (GETPOSTINT('uploadform') && empty($_POST) && empty($_FILES)) { dol_syslog("The PHP parameter 'post_max_size' is too low. All POST parameters and FILES were set to empty."); $langs->loadLangs(array("errors", "install")); print $langs->trans("ErrorFileSizeTooLarge").' '; @@ -77,7 +77,7 @@ if (GETPOST('sendit', 'alpha') && getDolGlobalString('MAIN_UPLOAD_DOC') && !empt if (GETPOST('section_dir', 'alpha')) { $generatethumbs = 0; } - $allowoverwrite = (GETPOST('overwritefile', 'int') ? 1 : 0); + $allowoverwrite = (GETPOSTINT('overwritefile') ? 1 : 0); if (!empty($upload_dirold) && getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) { $result = dol_add_file_process($upload_dirold, $allowoverwrite, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '', $generatethumbs, $object); @@ -130,7 +130,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissionto $fileold = $upload_dirold."/".$urlfile; } } - $linkid = GETPOST('linkid', 'int'); + $linkid = GETPOSTINT('linkid'); if ($urlfile) { // delete of a file @@ -192,7 +192,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissionto require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; $link = new Link($db); - $f = $link->fetch(GETPOST('linkid', 'int')); + $f = $link->fetch(GETPOSTINT('linkid')); if ($f) { $link->url = GETPOST('link', 'alpha'); if (substr($link->url, 0, 7) != 'http://' && substr($link->url, 0, 8) != 'https://' && substr($link->url, 0, 7) != 'file://') { @@ -299,12 +299,12 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissionto } // Update properties in ECM table - if (GETPOST('ecmfileid', 'int') > 0) { + if (GETPOSTINT('ecmfileid') > 0) { $shareenabled = GETPOST('shareenabled', 'alpha'); include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; $ecmfile = new EcmFiles($db); - $result = $ecmfile->fetch(GETPOST('ecmfileid', 'int')); + $result = $ecmfile->fetch(GETPOSTINT('ecmfileid')); if ($result > 0) { if ($shareenabled) { if (empty($ecmfile->share)) { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 551c7b7c069..651b48e40a4 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -85,7 +85,7 @@ if (!$error && $massaction == 'confirm_presend') { $listofobjectref = array(); $contactidtosend = array(); $attachedfilesThirdpartyObj = array(); - $oneemailperrecipient = (GETPOST('oneemailperrecipient', 'int') ? 1 : 0); + $oneemailperrecipient = (GETPOSTINT('oneemailperrecipient') ? 1 : 0); if (!$error) { $objecttmp = new $objectclass($db); @@ -1270,7 +1270,7 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoadd) { $db->begin(); if (GETPOSTISSET('pricerate')) { - $pricepercentage=GETPOST('pricerate', 'int'); + $pricepercentage=GETPOSTINT('pricerate'); if ($pricepercentage == 0) { setEventMessages($langs->trans("RecordsModified", 0), null); } else { @@ -1768,7 +1768,7 @@ if (!$error && ($massaction == 'clonetasks' || ($action == 'clonetasks' && $conf $taskid = $clone_task->create($user); if ($taskid > 0) { - $result = $clone_task->add_contact(GETPOST("userid", 'int'), 'TASKEXECUTIVE', 'internal'); + $result = $clone_task->add_contact(GETPOSTINT("userid"), 'TASKEXECUTIVE', 'internal'); $num++; } else { if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { @@ -1786,7 +1786,7 @@ if (!$error && ($massaction == 'clonetasks' || ($action == 'clonetasks' && $conf if (!$error) { setEventMessage($langs->trans('NumberOfTasksCloned', $num)); - header("Refresh: 1;URL=".DOL_URL_ROOT.'/projet/tasks.php?id=' . GETPOST('projectid', 'int')); + header("Refresh: 1;URL=".DOL_URL_ROOT.'/projet/tasks.php?id=' . GETPOSTINT('projectid')); } } diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index 1ca6c3d3697..27fb7649100 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -42,10 +42,10 @@ if ($action == 'update' && is_array($arrayofparameters) && !empty($user->admin)) // Modify constant only if key was posted (avoid resetting key to the null value) if (GETPOSTISSET($key)) { if (!empty($val['type']) && preg_match('/category:/', $val['type'])) { - if (GETPOST($key, 'int') == '-1') { + if (GETPOSTINT($key) == '-1') { $val_const = ''; } else { - $val_const = GETPOST($key, 'int'); + $val_const = GETPOSTINT($key); } } elseif ($val['type'] == 'html') { $val_const = GETPOST($key, 'restricthtml'); diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php index 1e3efe420be..5f27c2a9091 100644 --- a/htdocs/core/actions_setnotes.inc.php +++ b/htdocs/core/actions_setnotes.inc.php @@ -59,9 +59,9 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel', $outputlangs->setDefaultLang($newlang); } $model = $object->model_pdf; - $hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); - $hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); - $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); + $hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); + $hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); + $hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); //see #21072: Update a public note with a "document model not found" is not really a problem : the PDF is not created/updated //but the note is saved, so just add a notification will be enough diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index f5ea99e4b36..11c2392f953 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -53,10 +53,10 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call $urlsource = GETPOST("urlsource", 'alpha'); $search_doc_ref = GETPOST('search_doc_ref', 'alpha'); - $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; + $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'aZ09comma'); $sortorder = GETPOST("sortorder", 'aZ09comma'); - $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); + $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -321,7 +321,7 @@ if ($type == 'directory') { $param .= '&website='.urlencode(GETPOST('website', 'alpha')); } if (!preg_match('/pageid=/', $param)) { - $param .= '&pageid='.urlencode(GETPOST('pageid', 'int')); + $param .= '&pageid='.urlencode(GETPOSTINT('pageid')); } //if (!preg_match('/backtopage=/',$param)) $param.='&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid); } diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 07c1b8b13b1..680e46a244c 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -74,7 +74,7 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call } $websitekey = GETPOST('websitekey', 'alpha'); -$pageid = GETPOST('pageid', 'int'); +$pageid = GETPOSTINT('pageid'); // Load translation files required by the page $langs->load("ecm"); diff --git a/htdocs/core/ajax/ajaxinvoiceline.php b/htdocs/core/ajax/ajaxinvoiceline.php index f575bf326ac..2ce44ea57e3 100644 --- a/htdocs/core/ajax/ajaxinvoiceline.php +++ b/htdocs/core/ajax/ajaxinvoiceline.php @@ -34,7 +34,7 @@ if (!defined('NOREQUIREAJAX')) { require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -$invoice_id = GETPOST('id', 'int'); // id of thirdparty +$invoice_id = GETPOSTINT('id'); // id of thirdparty $action = GETPOST('action', 'aZ09'); $htmlname = GETPOST('htmlname', 'alpha'); diff --git a/htdocs/core/ajax/ajaxstatusprospect.php b/htdocs/core/ajax/ajaxstatusprospect.php index 6fcb0dcfd78..1b389a32d4f 100644 --- a/htdocs/core/ajax/ajaxstatusprospect.php +++ b/htdocs/core/ajax/ajaxstatusprospect.php @@ -43,8 +43,8 @@ if (!defined('NOREQUIRESOC')) { require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; -$idstatus = GETPOST('id', 'int'); -$idprospect = GETPOST('prospectid', 'int'); +$idstatus = GETPOSTINT('id'); +$idprospect = GETPOSTINT('prospectid'); $action = GETPOST('action', 'aZ09'); $prospectstatic = new Client($db); diff --git a/htdocs/core/ajax/ajaxtooltip.php b/htdocs/core/ajax/ajaxtooltip.php index f76498c3b3c..782123ca317 100644 --- a/htdocs/core/ajax/ajaxtooltip.php +++ b/htdocs/core/ajax/ajaxtooltip.php @@ -47,7 +47,7 @@ $objecttype = GETPOST('objecttype', 'aZ09arobase'); // 'module' or 'myobject@mym $params = array('fromajaxtooltip' => 1); if (GETPOSTISSET('infologin')) { - $params['infologin'] = GETPOST('infologin', 'int'); + $params['infologin'] = GETPOSTINT('infologin'); } if (GETPOSTISSET('option')) { $params['option'] = GETPOST('option', 'restricthtml'); diff --git a/htdocs/core/ajax/bankconciliate.php b/htdocs/core/ajax/bankconciliate.php index c67f1455b42..deed93cecc4 100644 --- a/htdocs/core/ajax/bankconciliate.php +++ b/htdocs/core/ajax/bankconciliate.php @@ -60,8 +60,8 @@ top_httphead(); if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'dvnext') { // Increase date $al = new AccountLine($db); - $al->datev_next(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->datev_next(GETPOSTINT('rowid')); + $al->fetch(GETPOSTINT('rowid')); print ''.dol_print_date($al->datev, "day").''; @@ -71,8 +71,8 @@ if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consoli if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'dvprev') { // Decrease date $al = new AccountLine($db); - $al->datev_previous(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->datev_previous(GETPOSTINT('rowid')); + $al->fetch(GETPOSTINT('rowid')); print ''.dol_print_date($al->datev, "day").''; @@ -82,8 +82,8 @@ if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consoli if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'donext') { // Increase date $al = new AccountLine($db); - $al->dateo_next(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->dateo_next(GETPOSTINT('rowid')); + $al->fetch(GETPOSTINT('rowid')); print ''.dol_print_date($al->dateo, "day").''; @@ -93,8 +93,8 @@ if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consoli if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'doprev') { // Decrease date $al = new AccountLine($db); - $al->dateo_previous(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->dateo_previous(GETPOSTINT('rowid')); + $al->fetch(GETPOSTINT('rowid')); print ''.dol_print_date($al->dateo, "day").''; diff --git a/htdocs/core/ajax/box.php b/htdocs/core/ajax/box.php index 621d6878098..82bcdf68983 100644 --- a/htdocs/core/ajax/box.php +++ b/htdocs/core/ajax/box.php @@ -41,10 +41,10 @@ if (!defined('NOREQUIRESOC')) { require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; -$boxid = GETPOST('boxid', 'int'); +$boxid = GETPOSTINT('boxid'); $boxorder = GETPOST('boxorder'); -$zone = GETPOST('zone', 'int'); -$userid = GETPOST('userid', 'int'); +$zone = GETPOSTINT('zone'); +$userid = GETPOSTINT('userid'); // Security check if ($userid != $user->id) { diff --git a/htdocs/core/ajax/check_notifications.php b/htdocs/core/ajax/check_notifications.php index 4408e327e2b..e636b499745 100644 --- a/htdocs/core/ajax/check_notifications.php +++ b/htdocs/core/ajax/check_notifications.php @@ -95,7 +95,7 @@ $eventfound = array(); //$eventfound[]=array('type'=>'agenda', 'id'=>1, 'tipo'=>'eee', 'location'=>'aaa'); // TODO Remove use of $_SESSION['auto_check_events_not_before']. Seems not used. -if (empty($_SESSION['auto_check_events_not_before']) || $time >= $_SESSION['auto_check_events_not_before'] || GETPOST('forcechecknow', 'int')) { +if (empty($_SESSION['auto_check_events_not_before']) || $time >= $_SESSION['auto_check_events_not_before'] || GETPOSTINT('forcechecknow')) { /*$time_update = (int) $conf->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY; // Always defined if (!empty($_SESSION['auto_check_events_not_before'])) { diff --git a/htdocs/core/ajax/constantonoff.php b/htdocs/core/ajax/constantonoff.php index 603de7408c0..7a7139fa6ff 100644 --- a/htdocs/core/ajax/constantonoff.php +++ b/htdocs/core/ajax/constantonoff.php @@ -49,7 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; $action = GETPOST('action', 'aZ09'); // set or del $name = GETPOST('name', 'alpha'); -$entity = GETPOST('entity', 'int'); +$entity = GETPOSTINT('entity'); $value = (GETPOST('value', 'aZ09') != '' ? GETPOST('value', 'aZ09') : 1); // Security check diff --git a/htdocs/core/ajax/contacts.php b/htdocs/core/ajax/contacts.php index 4577fccf3c6..7c2f113510c 100644 --- a/htdocs/core/ajax/contacts.php +++ b/htdocs/core/ajax/contacts.php @@ -34,10 +34,10 @@ if (!defined('NOREQUIREAJAX')) { // Load Dolibarr environment require '../../main.inc.php'; -$id = GETPOST('id', 'int'); // id of thirdparty +$id = GETPOSTINT('id'); // id of thirdparty $action = GETPOST('action', 'aZ09'); $htmlname = GETPOST('htmlname', 'alpha'); -$showempty = GETPOST('showempty', 'int'); +$showempty = GETPOSTINT('showempty'); // Security check $result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); diff --git a/htdocs/core/ajax/extraparams.php b/htdocs/core/ajax/extraparams.php index 0adef3e9d74..9b63da251f5 100644 --- a/htdocs/core/ajax/extraparams.php +++ b/htdocs/core/ajax/extraparams.php @@ -39,7 +39,7 @@ if (!defined('NOREQUIRESOC')) { include '../../main.inc.php'; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $element = GETPOST('element', 'aZ09arobase'); $htmlelement = GETPOST('htmlelement', 'alpha'); $type = GETPOST('type', 'alpha'); diff --git a/htdocs/core/ajax/fileupload.php b/htdocs/core/ajax/fileupload.php index 1825477758a..44e0c943bc1 100644 --- a/htdocs/core/ajax/fileupload.php +++ b/htdocs/core/ajax/fileupload.php @@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/fileupload.class.php'; // Class to u require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; -$id = GETPOST('fk_element', 'int'); +$id = GETPOSTINT('fk_element'); $element = GETPOST('element', 'alpha'); // 'myobject' (myobject=mymodule) or 'myobject@mymodule' or 'myobject_mysubobject' (myobject=mymodule) $elementupload = $element; diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index 1bc87d06145..e70ea0b98e0 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -44,10 +44,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $element = GETPOST('element', 'alpha'); // 'myobject' (myobject=mymodule) or 'myobject@mymodule' or 'myobject_mysubobject' (myobject=mymodule) $field = GETPOST('field', 'alpha'); -$value = GETPOST('value', 'int'); +$value = GETPOSTINT('value'); $format = 'int'; // Load object according to $id and $element diff --git a/htdocs/core/ajax/selectobject.php b/htdocs/core/ajax/selectobject.php index edc5eb32998..aa702375d3e 100644 --- a/htdocs/core/ajax/selectobject.php +++ b/htdocs/core/ajax/selectobject.php @@ -45,7 +45,7 @@ $extrafields = new ExtraFields($db); $objectdesc = GETPOST('objectdesc', 'alphanohtml', 0, null, null, 1); $htmlname = GETPOST('htmlname', 'aZ09'); -$outjson = (GETPOST('outjson', 'int') ? GETPOST('outjson', 'int') : 0); +$outjson = (GETPOSTINT('outjson') ? GETPOSTINT('outjson') : 0); $id = GETPOSTINT('id'); $objectfield = GETPOST('objectfield', 'alpha'); // 'MyObject:field' or 'MyModule_MyObject:field' or 'MyObject:option_field' or 'MyModule_MyObject:option_field' diff --git a/htdocs/core/ajax/vatrates.php b/htdocs/core/ajax/vatrates.php index a1049287f53..06173974d97 100644 --- a/htdocs/core/ajax/vatrates.php +++ b/htdocs/core/ajax/vatrates.php @@ -33,11 +33,11 @@ if (!defined('NOREQUIREAJAX')) { // Load Dolibarr environment require '../../main.inc.php'; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); // 'getSellerVATRates' or 'getBuyerVATRates' $htmlname = GETPOST('htmlname', 'alpha'); $selected = (GETPOST('selected') ? GETPOST('selected') : '-1'); -$productid = (GETPOST('productid', 'int') ? GETPOST('productid', 'int') : 0); +$productid = (GETPOSTINT('productid') ? GETPOSTINT('productid') : 0); // Security check $result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); diff --git a/htdocs/core/bookmarks_page.php b/htdocs/core/bookmarks_page.php index e7ced61cff3..a24918273d8 100644 --- a/htdocs/core/bookmarks_page.php +++ b/htdocs/core/bookmarks_page.php @@ -56,10 +56,10 @@ $left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left'); */ // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access. -if (empty($dolibarr_nocache) && GETPOST('cache', 'int')) { - header('Cache-Control: max-age='.GETPOST('cache', 'int').', public'); +if (empty($dolibarr_nocache) && GETPOSTINT('cache')) { + header('Cache-Control: max-age='.GETPOSTINT('cache').', public'); // For a .php, we must set an Expires to avoid to have it forced to an expired value by the web server - header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + GETPOST('cache', 'int')).' GMT'); + header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + GETPOSTINT('cache')).' GMT'); // HTTP/1.0 header('Pragma: token=public'); } else { diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index c6db2ca40e5..74b31a3daaf 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -106,7 +106,7 @@ class box_graph_invoices_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { - $endyear = GETPOST($param_year, 'int'); + $endyear = GETPOSTINT($param_year); $shownb = GETPOST($param_shownb, 'alpha'); $showtot = GETPOST($param_showtot, 'alpha'); } else { diff --git a/htdocs/core/boxes/box_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php index cd3ee464eb2..f6decd57660 100644 --- a/htdocs/core/boxes/box_graph_invoices_peryear.php +++ b/htdocs/core/boxes/box_graph_invoices_peryear.php @@ -102,7 +102,7 @@ class box_graph_invoices_peryear extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { - $endyear = GETPOST($param_year, 'int'); + $endyear = GETPOSTINT($param_year); $showtot = GETPOST($param_showtot, 'alpha'); } else { $tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true); diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 97fa847f897..818398324c8 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -102,7 +102,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { - $endyear = GETPOST($param_year, 'int'); + $endyear = GETPOSTINT($param_year); $shownb = GETPOST($param_shownb, 'alpha'); $showtot = GETPOST($param_showtot, 'alpha'); } else { diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index f0021fe403a..ce11fe9e93d 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -105,7 +105,7 @@ class box_graph_orders_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { - $endyear = GETPOST($param_year, 'int'); + $endyear = GETPOSTINT($param_year); $shownb = GETPOST($param_shownb, 'alpha'); $showtot = GETPOST($param_showtot, 'alpha'); } else { diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index ca1da74b1bc..9b7e40ab20f 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -104,7 +104,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { - $endyear = GETPOST($param_year, 'int'); + $endyear = GETPOSTINT($param_year); $shownb = GETPOST($param_shownb, 'alpha'); $showtot = GETPOST($param_showtot, 'alpha'); } else { diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 7bb406ff64e..a90b8604060 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -80,7 +80,7 @@ class box_graph_product_distribution extends ModeleBoxes $param_showordernb = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showordernb'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { - $year = GETPOST($param_year, 'int'); + $year = GETPOSTINT($param_year); $showinvoicenb = GETPOST($param_showinvoicenb, 'alpha'); $showpropalnb = GETPOST($param_showpropalnb, 'alpha'); $showordernb = GETPOST($param_showordernb, 'alpha'); diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 796ba81a306..0192ecf2b12 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -105,7 +105,7 @@ class box_graph_propales_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { - $endyear = GETPOST($param_year, 'int'); + $endyear = GETPOSTINT($param_year); $shownb = GETPOST($param_shownb, 'alpha'); $showtot = GETPOST($param_showtot, 'alpha'); } else { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 33bd720fbdf..9f18717db03 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6177,11 +6177,11 @@ abstract class CommonObject if (in_array($key_type, array('date'))) { // Clean parameters // TODO GMT date in memory must be GMT so we should add gm=true in parameters - $value_key = dol_mktime(0, 0, 0, GETPOST($postfieldkey."month", 'int'), GETPOST($postfieldkey."day", 'int'), GETPOST($postfieldkey."year", 'int')); + $value_key = dol_mktime(0, 0, 0, GETPOSTINT($postfieldkey."month"), GETPOSTINT($postfieldkey."day"), GETPOSTINT($postfieldkey."year")); } elseif (in_array($key_type, array('datetime'))) { // Clean parameters // TODO GMT date in memory must be GMT so we should add gm=true in parameters - $value_key = dol_mktime(GETPOST($postfieldkey."hour", 'int'), GETPOST($postfieldkey."min", 'int'), 0, GETPOST($postfieldkey."month", 'int'), GETPOST($postfieldkey."day", 'int'), GETPOST($postfieldkey."year", 'int')); + $value_key = dol_mktime(GETPOSTINT($postfieldkey."hour"), GETPOSTINT($postfieldkey."min"), 0, GETPOSTINT($postfieldkey."month"), GETPOSTINT($postfieldkey."day"), GETPOSTINT($postfieldkey."year")); } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) { $value_arr = GETPOST($postfieldkey, 'array'); // check if an array if (!empty($value_arr)) { @@ -7760,9 +7760,9 @@ abstract class CommonObject } $paramforthenewlink = ''; $paramforthenewlink .= (GETPOSTISSET('action') ? '&action='.GETPOST('action', 'aZ09') : ''); - $paramforthenewlink .= (GETPOSTISSET('id') ? '&id='.GETPOST('id', 'int') : ''); + $paramforthenewlink .= (GETPOSTISSET('id') ? '&id='.GETPOSTINT('id') : ''); $paramforthenewlink .= (GETPOSTISSET('origin') ? '&origin='.GETPOST('origin', 'aZ09') : ''); - $paramforthenewlink .= (GETPOSTISSET('originid') ? '&originid='.GETPOST('originid', 'int') : ''); + $paramforthenewlink .= (GETPOSTISSET('originid') ? '&originid='.GETPOSTINT('originid') : ''); $paramforthenewlink .= '&fk_'.strtolower($class).'=--IDFORBACKTOPAGE--'; // TODO Add JavaScript code to add input fields already filled into $paramforthenewlink so we won't loose them when going back to main page $out .= ''; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 2153ad048a2..7bcdab198e0 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2049,7 +2049,7 @@ class ExtraFields $expand_display = false; if (is_array($extrafield_param_list) && count($extrafield_param_list) > 0) { $extrafield_collapse_display_value = intval($extrafield_param_list[0]); - $expand_display = ((isset($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key]) || GETPOST('ignorecollapsesetup', 'int')) ? (empty($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key]) ? false : true) : ($extrafield_collapse_display_value == 2 ? false : true)); + $expand_display = ((isset($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key]) || GETPOSTINT('ignorecollapsesetup')) ? (empty($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key]) ? false : true) : ($extrafield_collapse_display_value == 2 ? false : true)); } $disabledcookiewrite = 0; if ($mode == 'create') { @@ -2207,13 +2207,13 @@ class ExtraFields if (in_array($key_type, array('date'))) { // Clean parameters - $value_key = dol_mktime(12, 0, 0, GETPOST("options_".$key."month", 'int'), GETPOST("options_".$key."day", 'int'), GETPOST("options_".$key."year", 'int')); + $value_key = dol_mktime(12, 0, 0, GETPOSTINT("options_".$key."month"), GETPOSTINT("options_".$key."day"), GETPOSTINT("options_".$key."year")); } elseif (in_array($key_type, array('datetime'))) { // Clean parameters - $value_key = dol_mktime(GETPOST("options_".$key."hour", 'int'), GETPOST("options_".$key."min", 'int'), GETPOST("options_".$key."sec", 'int'), GETPOST("options_".$key."month", 'int'), GETPOST("options_".$key."day", 'int'), GETPOST("options_".$key."year", 'int'), 'tzuserrel'); + $value_key = dol_mktime(GETPOSTINT("options_".$key."hour"), GETPOSTINT("options_".$key."min"), GETPOSTINT("options_".$key."sec"), GETPOSTINT("options_".$key."month"), GETPOSTINT("options_".$key."day"), GETPOSTINT("options_".$key."year"), 'tzuserrel'); } elseif (in_array($key_type, array('datetimegmt'))) { // Clean parameters - $value_key = dol_mktime(GETPOST("options_".$key."hour", 'int'), GETPOST("options_".$key."min", 'int'), GETPOST("options_".$key."sec", 'int'), GETPOST("options_".$key."month", 'int'), GETPOST("options_".$key."day", 'int'), GETPOST("options_".$key."year", 'int'), 'gmt'); + $value_key = dol_mktime(GETPOSTINT("options_".$key."hour"), GETPOSTINT("options_".$key."min"), GETPOSTINT("options_".$key."sec"), GETPOSTINT("options_".$key."month"), GETPOSTINT("options_".$key."day"), GETPOSTINT("options_".$key."year"), 'gmt'); } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) { $value_arr = GETPOST("options_".$key, 'array'); // check if an array if (!empty($value_arr)) { @@ -2304,14 +2304,14 @@ class ExtraFields $value_key = array(); // values provided as a component year, month, day, etc. if (GETPOST($dateparamname_start . 'year')) { - $value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int')); + $value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year')); } if (GETPOST($dateparamname_start . 'year')) { - $value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int')); + $value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year')); } } elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) { // Clean parameters - $value_key = dol_mktime(12, 0, 0, GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int')); + $value_key = dol_mktime(12, 0, 0, GETPOSTINT($keysuffix."options_".$key.$keyprefix."month"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."day"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."year")); } else { continue; // Value was not provided, we should not set it. } @@ -2320,26 +2320,26 @@ class ExtraFields $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; if (GETPOST($dateparamname_start . 'year') && GETPOST($dateparamname_end . 'year')) { // values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc. - $dateparamname_end_hour = GETPOST($dateparamname_end . 'hour', 'int') != '-1' ? GETPOST($dateparamname_end . 'hour', 'int') : '23'; - $dateparamname_end_min = GETPOST($dateparamname_end . 'min', 'int') != '-1' ? GETPOST($dateparamname_end . 'min', 'int') : '59'; - $dateparamname_end_sec = GETPOST($dateparamname_end . 'sec', 'int') != '-1' ? GETPOST($dateparamname_end . 'sec', 'int') : '59'; + $dateparamname_end_hour = GETPOSTINT($dateparamname_end . 'hour') != '-1' ? GETPOSTINT($dateparamname_end . 'hour') : '23'; + $dateparamname_end_min = GETPOSTINT($dateparamname_end . 'min') != '-1' ? GETPOSTINT($dateparamname_end . 'min') : '59'; + $dateparamname_end_sec = GETPOSTINT($dateparamname_end . 'sec') != '-1' ? GETPOSTINT($dateparamname_end . 'sec') : '59'; if ($key_type == 'datetimegmt') { $value_key = array( - 'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'gmt'), - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'gmt') + 'start' => dol_mktime(GETPOSTINT($dateparamname_start . 'hour'), GETPOSTINT($dateparamname_start . 'min'), GETPOSTINT($dateparamname_start . 'sec'), GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'gmt'), + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'gmt') ); } else { $value_key = array( - 'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'tzuserrel'), - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'tzuserrel') + 'start' => dol_mktime(GETPOSTINT($dateparamname_start . 'hour'), GETPOSTINT($dateparamname_start . 'min'), GETPOSTINT($dateparamname_start . 'sec'), GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'tzuserrel'), + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'tzuserrel') ); } } elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) { // Clean parameters if ($key_type == 'datetimegmt') { - $value_key = dol_mktime(GETPOST($keysuffix."options_".$key.$keyprefix."hour", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."min", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."sec", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int'), 'gmt'); + $value_key = dol_mktime(GETPOSTINT($keysuffix."options_".$key.$keyprefix."hour"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."min"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."sec"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."month"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."day"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."year"), 'gmt'); } else { - $value_key = dol_mktime(GETPOST($keysuffix."options_".$key.$keyprefix."hour", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."min", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."sec", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int'), 'tzuserrel'); + $value_key = dol_mktime(GETPOSTINT($keysuffix."options_".$key.$keyprefix."hour"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."min"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."sec"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."month"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."day"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."year"), 'tzuserrel'); } } else { continue; // Value was not provided, we should not set it. diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 78e5d7e0e9e..731b0514ef9 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -521,7 +521,7 @@ class FormMail extends Form // Zone to select email template if (count($modelmail_array) > 0) { - $model_mail_selected_id = GETPOSTISSET('modelmailselected') ? GETPOST('modelmailselected', 'int') : ($arraydefaultmessage->id > 0 ? $arraydefaultmessage->id : 0); + $model_mail_selected_id = GETPOSTISSET('modelmailselected') ? GETPOSTINT('modelmailselected') : ($arraydefaultmessage->id > 0 ? $arraydefaultmessage->id : 0); // If list of template is filled $out .= '
'."\n"; diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index 1852fc9f878..d6e0e56f688 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -774,10 +774,10 @@ class FormSetupItem // Modify constant only if key was posted (avoid resetting key to the null value) if ($this->type != 'title') { if (preg_match('/category:/', $this->type)) { - if (GETPOST($this->confKey, 'int') == '-1') { + if (GETPOSTINT($this->confKey) == '-1') { $val_const = ''; } else { - $val_const = GETPOST($this->confKey, 'int'); + $val_const = GETPOSTINT($this->confKey); } } elseif ($this->type == 'multiselect') { $val = GETPOST($this->confKey, 'array'); diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 06e42777894..b240c62cd7c 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -320,7 +320,7 @@ class FormTicket dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); $classname = ucfirst($subelement); $objectsrc = new $classname($this->db); - $objectsrc->fetch(GETPOST('originid', 'int')); + $objectsrc->fetch(GETPOSTINT('originid')); if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) { $objectsrc->fetch_lines(); @@ -639,7 +639,7 @@ class FormTicket print $langs->trans("AssignedTo"); print '
'; print ''; } @@ -648,7 +648,7 @@ class FormTicket if (isModEnabled('project') && !$this->ispublic) { $formproject = new FormProjets($this->db); print ''; } } @@ -658,7 +658,7 @@ class FormTicket $formcontract = new FormContract($this->db); print ''; } } @@ -1371,7 +1371,7 @@ class FormTicket print "\n\n"; - $send_email = GETPOST('send_email', 'int') ? GETPOST('send_email', 'int') : 0; + $send_email = GETPOSTINT('send_email') ? GETPOSTINT('send_email') : 0; // Example 1 : Adding jquery code print ''; } - $checked = (GETPOST('superadmin', 'int') ? ' checked' : ''); - $disabled = (GETPOST('superadmin', 'int') ? '' : ' disabled'); + $checked = (GETPOSTINT('superadmin') ? ' checked' : ''); + $disabled = (GETPOSTINT('superadmin') ? '' : ' disabled'); print '
'; print img_picto('', 'user', 'class="pictofixedwidth"'); - print $form->select_dolusers(GETPOST('fk_user_assign', 'int'), 'fk_user_assign', 1); + print $form->select_dolusers(GETPOSTINT('fk_user_assign'), 'fk_user_assign', 1); print '
'; - print img_picto('', 'project').$formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); + print img_picto('', 'project').$formproject->select_projects(-1, GETPOSTINT('projectid'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); print '
'; print img_picto('', 'contract'); - print $formcontract->select_contract(-1, GETPOST('contactid', 'int'), 'contractid', 0, 1, 1); + print $formcontract->select_contract(-1, GETPOSTINT('contactid'), 'contractid', 0, 1, 1); print '
'; } - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/variants/tpl', ($permissiontoedit ? 1 : 0)); + $object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1, '/variants/tpl', ($permissiontoedit ? 1 : 0)); if (!empty($object->lines) || ($permissiontoedit && $action != 'selectlines' && $action != 'editline')) { print '
'; diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 83449b1fccb..e34cf104d40 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination2ValuePair.cla $langs->loadLangs(array("products", "other")); -$id = GETPOST('id', 'int'); -$valueid = GETPOST('valueid', 'int'); +$id = GETPOSTINT('id'); +$valueid = GETPOSTINT('valueid'); $ref = GETPOST('ref', 'alpha'); $weight_impact = price2num(GETPOST('weight_impact', 'alpha'), 2); $price_impact_percent = (bool) GETPOST('price_impact_percent'); @@ -47,7 +47,7 @@ $form = new Form($db); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $cancel = GETPOST('cancel', 'alpha'); @@ -115,8 +115,8 @@ if ($action == 'add') { } if ($action == 'create' && GETPOST('selectvariant', 'alpha')) { // We click on select combination $action = 'add'; - $attribute_id = GETPOST('attribute', 'int'); - $attribute_value_id = GETPOST('value', 'int'); + $attribute_id = GETPOSTINT('attribute'); + $attribute_value_id = GETPOSTINT('value'); if ($attribute_id> 0 && $attribute_value_id > 0) { $feature = $attribute_id . '-' . $attribute_value_id; $selectedvariant[$feature] = $feature; diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index a16e6677780..4115d3b4c8f 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -32,7 +32,7 @@ $langs->loadLangs(array("products", "other")); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -41,13 +41,13 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -83,8 +83,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } $search['nb_of_values'] = GETPOST('search_nb_of_values', 'alpha'); @@ -412,9 +412,9 @@ foreach ($search as $key => $val) { } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } @@ -439,7 +439,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 0c22ac89a53..c5b582cc254 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -133,7 +133,7 @@ $original_file = GETPOST('file', 'alphanohtml'); // Do not use urldecode here ( $hashp = GETPOST('hashp', 'aZ09', 1); // Must be read only by GET $modulepart = GETPOST('modulepart', 'alpha', 1); // Must be read only by GET $urlsource = GETPOST('urlsource', 'alpha'); -$entity = (GETPOST('entity', 'int') ? GETPOST('entity', 'int') : $conf->entity); +$entity = (GETPOSTINT('entity') ? GETPOSTINT('entity') : $conf->entity); // Security check if (empty($modulepart) && empty($hashp)) { diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index 69cc920f1c5..f12b7ee8869 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -35,7 +35,7 @@ global $conf, $db, $hookmanager, $langs, $user; $langs->loadLangs(array('other')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -43,7 +43,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'targetcard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOSTINT('lineid'); // Initialize technical objects $object = new Target($db); @@ -148,10 +148,10 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; if ($action == 'set_thirdparty' && $permissiontoadd) { - $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); + $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', '', 'date', '', $user, $triggermodname); } if ($action == 'classin' && $permissiontoadd) { - $object->setProject(GETPOST('projectid', 'int')); + $object->setProject(GETPOSTINT('projectid')); } // Actions to send emails @@ -408,7 +408,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Show object lines $result = $object->getLinesArray(); - print ' + print ' @@ -426,7 +426,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1); + $object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1); } // Form to add new line diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index ec84caa8e46..83deb784f41 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -39,7 +39,7 @@ $langs->loadLangs(array('other')); // Get Parameters $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -51,13 +51,13 @@ if (empty($mode)) { $mode = 'modulesetup'; } -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -95,8 +95,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -447,7 +447,7 @@ $arrayofmassactions = array( if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/webportal/class/html.formcardwebportal.class.php b/htdocs/webportal/class/html.formcardwebportal.class.php index 1f4c31726ca..d0d9531436e 100644 --- a/htdocs/webportal/class/html.formcardwebportal.class.php +++ b/htdocs/webportal/class/html.formcardwebportal.class.php @@ -335,8 +335,8 @@ class FormCardWebPortal } $value = dol_mktime($timeHours, $timeMinutes, $timeSeconds, $dateMonth, $dateDay, $dateYear); } elseif ($object->fields[$key]['type'] == 'duration') { - if (GETPOST($key . 'hour', 'int') != '' || GETPOST($key . 'min', 'int') != '') { - $value = 60 * 60 * GETPOST($key . 'hour', 'int') + 60 * GETPOST($key . 'min', 'int'); + if (GETPOSTINT($key . 'hour') != '' || GETPOSTINT($key . 'min') != '') { + $value = 60 * 60 * GETPOSTINT($key . 'hour') + 60 * GETPOSTINT($key . 'min'); } else { $value = ''; } @@ -655,7 +655,7 @@ class FormCardWebPortal $html .= '
'; if (in_array($val['type'], array('int', 'integer'))) { - $value = GETPOSTISSET($key) ? GETPOST($key, 'int') : $object->$key; + $value = GETPOSTISSET($key) ? GETPOSTINT($key) : $object->$key; } elseif ($val['type'] == 'double') { $value = GETPOSTISSET($key) ? price2num(GETPOST($key, 'alphanohtml')) : $object->$key; } elseif (preg_match('/^text/', $val['type'])) { diff --git a/htdocs/webportal/class/html.formlistwebportal.class.php b/htdocs/webportal/class/html.formlistwebportal.class.php index 1ba917f382a..c850c424377 100644 --- a/htdocs/webportal/class/html.formlistwebportal.class.php +++ b/htdocs/webportal/class/html.formlistwebportal.class.php @@ -142,10 +142,10 @@ class FormListWebPortal // set form list $this->action = GETPOST('action', 'aZ09'); $this->object = $object; - $this->limit = GETPOSTISSET('limit') ? (int) GETPOST('limit', 'int') : -1; + $this->limit = GETPOSTISSET('limit') ? GETPOSTINT('limit') : -1; $this->sortfield = GETPOST('sortfield', 'aZ09comma'); $this->sortorder = GETPOST('sortorder', 'aZ09comma'); - $this->page = GETPOSTISSET('page') ? (int) GETPOST('page', 'int') : 1; + $this->page = GETPOSTISSET('page') ? GETPOSTINT('page') : 1; $this->titleKey = $objectclass . 'ListTitle'; // Initialize array of search criteria @@ -303,7 +303,7 @@ class FormListWebPortal $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { - $sql .= " WHERE t.entity IN (" . getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)) . ")"; + $sql .= " WHERE t.entity IN (" . getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)) . ")"; } else { $sql .= " WHERE 1 = 1"; } @@ -413,9 +413,9 @@ class FormListWebPortal } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_' . $key . 'month=' . ((int) GETPOST('search_' . $key . 'month', 'int')); - $param .= '&search_' . $key . 'day=' . ((int) GETPOST('search_' . $key . 'day', 'int')); - $param .= '&search_' . $key . 'year=' . ((int) GETPOST('search_' . $key . 'year', 'int')); + $param .= '&search_' . $key . 'month=' . (GETPOSTINT('search_' . $key . 'month')); + $param .= '&search_' . $key . 'day=' . (GETPOSTINT('search_' . $key . 'day')); + $param .= '&search_' . $key . 'year=' . (GETPOSTINT('search_' . $key . 'year')); } elseif ($search[$key] != '') { $param .= '&search_' . $key . '=' . urlencode($search[$key]); } diff --git a/htdocs/webportal/controllers/document.controller.class.php b/htdocs/webportal/controllers/document.controller.class.php index 9f5cd408867..d09b4dc5fb2 100644 --- a/htdocs/webportal/controllers/document.controller.class.php +++ b/htdocs/webportal/controllers/document.controller.class.php @@ -89,8 +89,8 @@ class DocumentController extends Controller $action = GETPOST('action', 'aZ09'); $original_file = GETPOST('file', 'alphanohtml'); // Do not use urldecode here ($_GET are already decoded by PHP). $modulepart = GETPOST('modulepart', 'alpha'); - $entity = GETPOST('entity', 'int') ? GETPOST('entity', 'int') : $conf->entity; - $socId = (int) GETPOST('soc_id', 'int'); + $entity = GETPOSTINT('entity') ? GETPOSTINT('entity') : $conf->entity; + $socId = GETPOSTINT('soc_id'); // Security check if (empty($modulepart)) { diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 0cf1abe101e..d55b81d1151 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -62,10 +62,10 @@ if (!$user->hasRight('website', 'read')) { $conf->dol_hide_leftmenu = 1; // Force hide of left menu. $error = 0; -$websiteid = GETPOST('websiteid', 'int'); +$websiteid = GETPOSTINT('websiteid'); $websitekey = GETPOST('website', 'alpha'); $page = GETPOST('page', 'alpha'); -$pageid = GETPOST('pageid', 'int'); +$pageid = GETPOSTINT('pageid'); $pageref = GETPOST('pageref', 'alphanohtml'); $action = GETPOST('action', 'aZ09'); @@ -76,8 +76,8 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'websitelist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$dol_hide_topmenu = GETPOST('dol_hide_topmenu', 'int'); -$dol_hide_leftmenu = GETPOST('dol_hide_leftmenu', 'int'); +$dol_hide_topmenu = GETPOSTINT('dol_hide_topmenu'); +$dol_hide_leftmenu = GETPOSTINT('dol_hide_leftmenu'); $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); $type_container = GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha'); @@ -142,10 +142,10 @@ if (GETPOST('refreshsite') || GETPOST('refreshsite_x') || GETPOST('refreshsite.x } // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -342,8 +342,8 @@ if ($action == 'replacesite' || $mode == 'replacesite') { $containertype = GETPOST('optioncontainertype', 'aZ09') != '-1' ? GETPOST('optioncontainertype', 'aZ09') : ''; $langcode = GETPOST('optionlanguage', 'aZ09'); $otherfilters = array(); - if (GETPOST('optioncategory', 'int') > 0) { - $otherfilters['category'] = GETPOST('optioncategory', 'int'); + if (GETPOSTINT('optioncategory') > 0) { + $otherfilters['category'] = GETPOSTINT('optioncategory'); } $listofpages = getPagesFromSearchCriterias($containertype, $algo, $searchkey, 1000, $sortfield, $sortorder, $langcode, $otherfilters, -1); @@ -430,36 +430,36 @@ if ($action == 'renamefile') { // Must be after include DOL_DOCUMENT_ROOT.'/core if ($action == 'setwebsiteonline' && $usercanedit) { $website->setStatut($website::STATUS_VALIDATED, null, '', 'WEBSITE_MODIFY', 'status'); - header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('websitepage', 'int')); + header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOSTINT('website').'&pageid='.GETPOSTINT('websitepage')); exit; } if ($action == 'setwebsiteoffline' && $usercanedit) { $result = $website->setStatut($website::STATUS_DRAFT, null, '', 'WEBSITE_MODIFY', 'status'); - header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('websitepage', 'int')); + header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOSTINT('website').'&pageid='.GETPOSTINT('websitepage')); exit; } if ($action == 'seteditinline') { // No need of write permission dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 1); setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'warnings'); //dolibarr_set_const($db, 'WEBSITE_SUBCONTAINERSINLINE', 0); // Force disable of 'Include dynamic content' - header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('pageid', 'int')); + header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOSTINT('website').'&pageid='.GETPOSTINT('pageid')); exit; } if ($action == 'unseteditinline') { // No need of write permission dolibarr_del_const($db, 'WEBSITE_EDITINLINE'); - header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('pageid', 'int')); + header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOSTINT('website').'&pageid='.GETPOSTINT('pageid')); exit; } if ($action == 'setshowsubcontainers') { // No need of write permission dolibarr_set_const($db, 'WEBSITE_SUBCONTAINERSINLINE', 1); //dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 0); // Force disable of edit inline - header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('pageid', 'int')); + header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOSTINT('website').'&pageid='.GETPOSTINT('pageid')); exit; } if ($action == 'unsetshowsubcontainers') { // No need of write permission dolibarr_del_const($db, 'WEBSITE_SUBCONTAINERSINLINE'); - header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('pageid', 'int')); + header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOSTINT('website').'&pageid='.GETPOSTINT('pageid')); exit; } @@ -505,7 +505,7 @@ if ($massaction == 'setcategory' && GETPOST('confirmmassaction', 'alpha') && $us $db->begin(); - $categoryid = GETPOST('setcategory', 'int'); + $categoryid = GETPOSTINT('setcategory'); if ($categoryid > 0) { $tmpwebsitepage = new WebsitePage($db); $category = new Categorie($db); @@ -544,7 +544,7 @@ if ($massaction == 'delcategory' && GETPOST('confirmmassaction', 'alpha') && $us $db->begin(); - $categoryid = GETPOST('setcategory', 'int'); + $categoryid = GETPOSTINT('setcategory'); if ($categoryid > 0) { $tmpwebsitepage = new WebsitePage($db); $category = new Categorie($db); @@ -648,8 +648,8 @@ if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha') && $userca $containertype = GETPOST('optioncontainertype', 'aZ09') != '-1' ? GETPOST('optioncontainertype', 'aZ09') : ''; $langcode = GETPOST('optionlanguage', 'aZ09'); $otherfilters = array(); - if (GETPOST('optioncategory', 'int') > 0) { - $otherfilters['category'] = GETPOST('optioncategory', 'int'); + if (GETPOSTINT('optioncategory') > 0) { + $otherfilters['category'] = GETPOSTINT('optioncategory'); } // Now we reload list @@ -1152,7 +1152,7 @@ if ($action == 'addcontainer' && $usercanedit) { $substitutionarray['__WEBSITE_CREATE_BY__'] = $user->getFullName($langs); // Define id of page the new page is translation of - $pageidfortranslation = (GETPOST('pageidfortranslation', 'int') > 0 ? GETPOST('pageidfortranslation', 'int') : 0); + $pageidfortranslation = (GETPOSTINT('pageidfortranslation') > 0 ? GETPOSTINT('pageidfortranslation') : 0); if ($pageidfortranslation > 0) { // Check if the page we are translation of is already a translation of a source page. if yes, we will use source id instead $objectpagetmp = new WebsitePage($db); @@ -1353,7 +1353,7 @@ if ($action == 'confirm_deletesite' && $confirm == 'yes' && $permissiontodelete) $db->begin(); - $res = $object->fetch(GETPOST('id', 'int')); + $res = $object->fetch(GETPOSTINT('id')); $website = $object; if ($res > 0) { @@ -1468,8 +1468,8 @@ if (!GETPOSTISSET('pageid')) { $containertype = GETPOST('optioncontainertype', 'aZ09') != '-1' ? GETPOST('optioncontainertype', 'aZ09') : ''; $langcode = GETPOST('optionlanguage', 'aZ09'); $otherfilters = array(); - if (GETPOST('optioncategory', 'int') > 0) { - $otherfilters['category'] = GETPOST('optioncategory', 'int'); + if (GETPOSTINT('optioncategory') > 0) { + $otherfilters['category'] = GETPOSTINT('optioncategory'); } $listofpages = getPagesFromSearchCriterias($containertype, $algo, $searchkey, 1000, $sortfield, $sortorder, $langcode, $otherfilters); @@ -2009,12 +2009,12 @@ if ($action == 'updatemeta' && $usercanedit) { $objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml')); $objectpage->allowed_in_frames = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09'); $objectpage->htmlheader = trim(GETPOST('htmlheader', 'none')); - $objectpage->fk_page = (GETPOST('pageidfortranslation', 'int') > 0 ? GETPOST('pageidfortranslation', 'int') : 0); + $objectpage->fk_page = (GETPOSTINT('pageidfortranslation') > 0 ? GETPOSTINT('pageidfortranslation') : 0); $objectpage->author_alias = trim(GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml')); $objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS', 'alpha'); $objectpage->fk_object = GETPOST('WEBSITE_OBJECTID', 'aZ09'); - $newdatecreation = dol_mktime(GETPOST('datecreationhour', 'int'), GETPOST('datecreationmin', 'int'), GETPOST('datecreationsec', 'int'), GETPOST('datecreationmonth', 'int'), GETPOST('datecreationday', 'int'), GETPOST('datecreationyear', 'int')); + $newdatecreation = dol_mktime(GETPOSTINT('datecreationhour'), GETPOSTINT('datecreationmin'), GETPOSTINT('datecreationsec'), GETPOSTINT('datecreationmonth'), GETPOSTINT('datecreationday'), GETPOSTINT('datecreationyear')); if ($newdatecreation) { $objectpage->date_creation = $newdatecreation; } @@ -2168,7 +2168,7 @@ if ($usercanedit && (($action == 'updatesource' || $action == 'updatecontent' || $db->begin(); $objectnew = new Website($db); - $result = $objectnew->createFromClone($user, GETPOST('id', 'int'), GETPOST('siteref', 'aZ09'), (GETPOST('newlang', 'aZ09') ? GETPOST('newlang', 'aZ09') : '')); + $result = $objectnew->createFromClone($user, GETPOSTINT('id'), GETPOSTINT('siteref'), (GETPOSTINT('newlang') ? GETPOSTINT('newlang') : '')); if ($result < 0) { $error++; @@ -2195,7 +2195,7 @@ if ($usercanedit && (($action == 'updatesource' || $action == 'updatecontent' || setEventMessages($langs->trans("LanguageMustNotBeSameThanClonedPage"), null, 'errors'); $action = 'preview'; } - if (GETPOST('newwebsite', 'int') != $object->id) { + if (GETPOSTINT('newwebsite') != $object->id) { $error++; setEventMessages($langs->trans("WebsiteMustBeSameThanClonedPageIfTranslation"), null, 'errors'); $action = 'preview'; @@ -2205,7 +2205,7 @@ if ($usercanedit && (($action == 'updatesource' || $action == 'updatecontent' || if (!$error) { $db->begin(); - $newwebsiteid = GETPOST('newwebsite', 'int'); + $newwebsiteid = GETPOSTINT('newwebsite'); $pathofwebsitenew = $pathofwebsite; $tmpwebsite = new Website($db); @@ -4751,7 +4751,7 @@ if ($mode == 'replacesite' || $massaction == 'replace') { if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } - if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { + if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } diff --git a/htdocs/website/samples/wrapper.php b/htdocs/website/samples/wrapper.php index 313dfd2c438..e6f78442c1e 100644 --- a/htdocs/website/samples/wrapper.php +++ b/htdocs/website/samples/wrapper.php @@ -15,10 +15,10 @@ $encoding = ''; // Parameters to download files $hashp = GETPOST('hashp', 'aZ09'); $modulepart = GETPOST('modulepart', 'aZ09'); -$entity = GETPOST('entity', 'int') ? GETPOST('entity', 'int') : $conf->entity; +$entity = GETPOSTINT('entity') ? GETPOSTINT('entity') : $conf->entity; $original_file = GETPOST("file", "alpha"); $l = GETPOST('l', 'aZ09'); -$limit = GETPOST('limit', 'int'); +$limit = GETPOSTINT('limit'); // Parameters for RSS $rss = GETPOST('rss', 'aZ09'); diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 48123970e20..6194a540789 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/website/lib/websiteaccount.lib.php'; $langs->loadLangs(array("website", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index 4825fc196b4..c5c998aef4f 100644 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -37,7 +37,7 @@ global $conf, $db, $hookmanager, $langs, $user; $langs->loadLangs(array('mrp', 'other')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -56,10 +56,10 @@ $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); // Load variables for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php index 3e5791f0108..0dc3d05c6d5 100644 --- a/htdocs/workstation/workstation_card.php +++ b/htdocs/workstation/workstation_card.php @@ -38,7 +38,7 @@ global $conf, $db, $hookmanager, $langs, $user; $langs->loadLangs(array('mrp', 'other')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php index 5dba65f6776..2c5f77c6173 100644 --- a/htdocs/workstation/workstation_document.php +++ b/htdocs/workstation/workstation_document.php @@ -40,14 +40,14 @@ $langs->loadLangs(array('companies', 'mails', 'other', 'mrp')); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); -$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$id = (GETPOSTINT('socid') ? GETPOSTINT('socid') : GETPOSTINT('id')); $ref = GETPOST('ref', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index f573f6d1a27..1e6b89f4937 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -38,7 +38,7 @@ $langs->loadLangs(array('mrp', 'other')); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -47,14 +47,14 @@ $backtopage = GETPOST('backtopage', 'alpha'); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -93,8 +93,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -255,7 +255,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { - $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)).")"; + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; } else { $sql .= " WHERE 1 = 1"; } @@ -400,9 +400,9 @@ foreach ($search as $key => $val) { } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } @@ -424,7 +424,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/workstation/workstation_note.php b/htdocs/workstation/workstation_note.php index 8f16aca5b3f..f2be1c32504 100644 --- a/htdocs/workstation/workstation_note.php +++ b/htdocs/workstation/workstation_note.php @@ -35,7 +35,7 @@ global $conf, $db, $hookmanager, $langs, $user; $langs->loadLangs(array('mrp', 'companies')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); From c0a4c049a42bac3307160a89d0cf1d10107ebed0 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 27 Feb 2024 14:06:30 +0100 Subject: [PATCH 0251/1862] Fix php warning (#28442) * Fix php warning * Fix blank line --- ...nterface_20_modWorkflow_WorkflowManager.class.php | 12 ++++++++++-- .../expedition/class/expeditionlinebatch.class.php | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index e2602d2afb9..945ece57a4b 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -398,7 +398,11 @@ class InterfaceWorkflowManager extends DolibarrTriggers } foreach ($shipping->lines as $shippingline) { - $qtyshipped[$shippingline->fk_product] += $shippingline->qty; + if (isset($qtyshipped[$shippingline->fk_product])) { + $qtyshipped[$shippingline->fk_product] += $shippingline->qty; + } else { + $qtyshipped[$shippingline->fk_product] = $shippingline->qty; + } } } } @@ -411,7 +415,11 @@ class InterfaceWorkflowManager extends DolibarrTriggers if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES') && $orderline->product_type > 0) { continue; } - $qtyordred[$orderline->fk_product] += $orderline->qty; + if (isset($qtyordred[$shippingline->fk_product])) { + $qtyordred[$orderline->fk_product] += $orderline->qty; + } else { + $qtyordred[$orderline->fk_product] = $orderline->qty; + } } } //dol_syslog(var_export($qtyordred,true),LOG_DEBUG); diff --git a/htdocs/expedition/class/expeditionlinebatch.class.php b/htdocs/expedition/class/expeditionlinebatch.class.php index 032ab9aff34..9bd94895f31 100644 --- a/htdocs/expedition/class/expeditionlinebatch.class.php +++ b/htdocs/expedition/class/expeditionlinebatch.class.php @@ -226,8 +226,8 @@ class ExpeditionLineBatch extends CommonObject $obj = $this->db->fetch_object($resql); $tmp = new self($this->db); - $tmp->sellby = $this->db->jdate($obj->sellby ? $obj->sellby : $obj->oldsellby); - $tmp->eatby = $this->db->jdate($obj->eatby ? $obj->eatby : $obj->oldeatby); + $tmp->sellby = $this->db->jdate(($fk_product > 0 && $obj->sellby) ? $obj->sellby : $obj->oldsellby); + $tmp->eatby = $this->db->jdate(($fk_product > 0 && $obj->eatby) ? $obj->eatby : $obj->oldeatby); $tmp->batch = $obj->batch; $tmp->id = $obj->rowid; $tmp->fk_origin_stock = $obj->fk_origin_stock; From 65da16f0de0e65efcb68922de1bf6f4a9daecb55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 14:06:45 +0100 Subject: [PATCH 0252/1862] fix phpstan (#28455) --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6782fbc31a3..50d22620a20 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -17,7 +17,7 @@ * Copyright (C) 2012-2015 Raphaël Doursenaud * Copyright (C) 2014-2023 Alexandre Spangaro * Copyright (C) 2018-2022 Ferran Marcet - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Christophe Battarel * Copyright (C) 2018 Josep Lluis Amador @@ -2465,7 +2465,7 @@ class Form * 'warehouseclosed' = count products from closed warehouses, * 'warehouseinternal' = count products from warehouses for internal correct/transfer only * @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...]) - * @param string $nooutput No print, return the output into a string + * @param int $nooutput No print if 1, return the output into a string * @param int $status_purchase Purchase status: -1=No filter on purchase status, 0=Products not on purchase, 1=Products on purchase * @return void|string */ From a351bc05e5619bd5db1c0a181ca2e1e4d5cdd864 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 27 Feb 2024 14:08:07 +0100 Subject: [PATCH 0253/1862] New: Phan Plugin (with fixer) for GETPOST->GETPOSTINT (#28447) * New: Phan Plugin (with fixer) for GETPOST->GETPOSTINT # New: Phan Plugin (with fixer) for GETPOST->GETPOSTINT This detects GETPOST calls with second parameter 'int' and can convert to GETPOSTINT * New: Fixer for deprecated module names --- dev/tools/phan/config_fixer.php | 31 +++++ .../plugins/DeprecatedModuleNameFixer.php | 126 ++++++++++++++++++ dev/tools/phan/plugins/GetPostFixerPlugin.php | 98 ++++++++++++++ .../plugins/GetPostFixerPlugin/fixers.php | 123 +++++++++++++++++ 4 files changed, 378 insertions(+) create mode 100644 dev/tools/phan/plugins/DeprecatedModuleNameFixer.php create mode 100644 dev/tools/phan/plugins/GetPostFixerPlugin.php create mode 100644 dev/tools/phan/plugins/GetPostFixerPlugin/fixers.php diff --git a/dev/tools/phan/config_fixer.php b/dev/tools/phan/config_fixer.php index d5607844f26..841495e2a53 100644 --- a/dev/tools/phan/config_fixer.php +++ b/dev/tools/phan/config_fixer.php @@ -4,6 +4,30 @@ define('DOL_PROJECT_ROOT', __DIR__.'/../../..'); define('DOL_DOCUMENT_ROOT', DOL_PROJECT_ROOT.'/htdocs'); define('PHAN_DIR', __DIR__); + +$DEPRECATED_MODULE_MAPPING = array( + 'actioncomm' => 'agenda', + 'adherent' => 'member', + 'adherent_type' => 'member_type', + 'banque' => 'bank', + 'categorie' => 'category', + 'commande' => 'order', + 'contrat' => 'contract', + 'entrepot' => 'stock', + 'expedition' => 'delivery_note', + 'facture' => 'invoice', + 'ficheinter' => 'intervention', + 'product_fournisseur_price' => 'productsupplierprice', + 'product_price' => 'productprice', + 'projet' => 'project', + 'propale' => 'propal', + 'socpeople' => 'contact', +); + +$deprecatedModuleNameRegex = '/^(?!(?:'.implode('|', array_keys($DEPRECATED_MODULE_MAPPING)).')$).*/'; + +require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php'; + /** * This configuration will be read and overlaid on top of the * default configuration. Command line arguments will be applied @@ -71,6 +95,8 @@ return [ .'|htdocs/includes/restler/.*' // @phpstan-ignore-line // Included as stub (did not seem properly analysed by phan without it) .'|htdocs/includes/stripe/.*' // @phpstan-ignore-line + //.'|htdocs/[^c][^o][^r][^e][^/].*' // For testing @phpstan-ignore-line + //.'|htdocs/[^h].*' // For testing on restricted set @phpstan-ignore-line .')@', // @phpstan-ignore-line // A list of plugin files to execute. @@ -82,9 +108,14 @@ return [ // // Alternately, you can pass in the full path to a PHP file // with the plugin's implementation (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php') + 'ParamMatchRegexPlugin' => [ + '/^isModEnabled$/' => [0, $deprecatedModuleNameRegex, "DeprecatedModuleName"], + ], 'plugins' => [ + __DIR__.'/plugins/ParamMatchRegexPlugin.php', //'DeprecateAliasPlugin', // __DIR__.'/plugins/NoVarDumpPlugin.php', + __DIR__.'/plugins/GetPostFixerPlugin.php', //'PHPDocToRealTypesPlugin', /* diff --git a/dev/tools/phan/plugins/DeprecatedModuleNameFixer.php b/dev/tools/phan/plugins/DeprecatedModuleNameFixer.php new file mode 100644 index 00000000000..19caf46d95d --- /dev/null +++ b/dev/tools/phan/plugins/DeprecatedModuleNameFixer.php @@ -0,0 +1,126 @@ + + */ + +declare(strict_types=1); + +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; + +/** + * Implements --automatic-fix for GetPostFixerPlugin + * + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + $DEPRECATED_MODULE_MAPPING = array( + 'actioncomm' => 'agenda', + 'adherent' => 'member', + 'adherent_type' => 'member_type', + 'banque' => 'bank', + 'categorie' => 'category', + 'commande' => 'order', + 'contrat' => 'contract', + 'entrepot' => 'stock', + 'expedition' => 'delivery_note', + 'facture' => 'invoice', + 'ficheinter' => 'intervention', + 'product_fournisseur_price' => 'productsupplierprice', + 'product_price' => 'productprice', + 'projet' => 'project', + 'propale' => 'propal', + 'socpeople' => 'contact', + ); + + $line = $instance->getLine(); + $expected_name = 'isModEnabled'; + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) != 1) { + print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + print "Type$i: ".get_class($argument).PHP_EOL; + } + + $arg1 = $arguments[0]; + + if ($arg1 instanceof ArgumentExpression && $arg1->expression instanceof StringLiteral) { + // Get the string value of the StringLiteral + $stringValue = $arg1->expression->getStringContentsText(); + } else { + print "Expression is not string ".get_class($arg1)."/".get_class($arg1->expression)."- Skip $instance".PHP_EOL; + continue; + } + print "Fixture elem on $line - $actual_name('$stringValue') - $instance".PHP_EOL; + + // Check that module is deprecated + if (isset($DEPRECATED_MODULE_MAPPING[$stringValue])) { + $replacement = $DEPRECATED_MODULE_MAPPING[$stringValue]; + } else { + print "Module is not deprecated in $expected_name - Skip $instance".PHP_EOL; + continue; + } + + // Get the first argument (delimiter) + $moduleargument = $arguments[0]; + + $arg_start_pos = $moduleargument->getStartPosition() + 1; + $arg_end_pos = $moduleargument->getEndPosition() - 1; + + // Remove deprecated module name + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'DeprecatedModuleName', + $fix + ); +}); diff --git a/dev/tools/phan/plugins/GetPostFixerPlugin.php b/dev/tools/phan/plugins/GetPostFixerPlugin.php new file mode 100644 index 00000000000..4953bf34943 --- /dev/null +++ b/dev/tools/phan/plugins/GetPostFixerPlugin.php @@ -0,0 +1,98 @@ + + */ + +use ast\Node; +use Phan\CodeBase; +use Phan\Language\Context; +use Phan\AST\UnionTypeVisitor; +//use Phan\Language\Element\FunctionInterface; +use Phan\Language\UnionType; +use Phan\Language\Type; +use Phan\PluginV3; +use Phan\PluginV3\AnalyzeFunctionCallCapability; +use Phan\Language\Element\FunctionInterface; +use Phan\Config; + +/* + * 'GetPostFixerPlugin' => [ '\\Foo::bar', '\\Baz::bing' ], + * 'plugins' => [ + * __DIR__.'plugins/GetPostFixerPlugin.php', + * [...] + * ] + */ + +/** + * Prints out call sites of given functions or methods. + */ +final class GetPostFixerPlugin extends PluginV3 implements AnalyzeFunctionCallCapability +{ + /** + * @param CodeBase $code_base Code base + * + * @return array + */ + public function getAnalyzeFunctionCallClosures(CodeBase $code_base): array + { + static $function_call_closures; + + if ($function_call_closures === null) { + $function_call_closures = []; + $self = $this; + $func = 'GETPOST'; + $function_call_closures[$func] + = static function (CodeBase $code_base, Context $context, FunctionInterface $function, array $args, ?Node $node = null) use ($self, $func) { + self::handleCall($code_base, $context, $node, $function, $args, $func, $self); + }; + } + return $function_call_closures; + } + + /** + * @param CodeBase $code_base Code base + * @param Context $context Context + * @param ?Node $node Node + * @param FunctionInterface $function Visited function information + * @param array $args Arguments to the function + * @param string $func_to_analyze Name of the function to analyze (as we defined it) + * @param GetPostFixerPlugin $self This visitor + * + * @return void + */ + private static function handleCall(CodeBase $code_base, Context $context, ?Node $node, FunctionInterface $function, array $args, string $func_to_analyze, $self): void + { + $expr = $args[1] ?? null; + if ($expr === null) { + return; + } + try { + $expr_type = UnionTypeVisitor::unionTypeFromNode($code_base, $context, $expr, false); + } catch (Exception $_) { + return; + } + + $expr_value = $expr_type->getRealUnionType()->asValueOrNullOrSelf(); + if (!is_string($expr_value)) { + return; + } + if ($expr_value !== 'int') { + return; + } + + $self->emitIssue( + $code_base, + $context, + 'GetPostShouldBeGetPostInt', + 'Convert {FUNCTION} to {FUNCTION}', + [(string) $function->getFQSEN(), "GETPOSTINT"] + ); + } +} + +if (Config::isIssueFixingPluginEnabled()) { + require_once __DIR__ . '/GetPostFixerPlugin/fixers.php'; +} + +return new GetPostFixerPlugin(); diff --git a/dev/tools/phan/plugins/GetPostFixerPlugin/fixers.php b/dev/tools/phan/plugins/GetPostFixerPlugin/fixers.php new file mode 100644 index 00000000000..662a553eb62 --- /dev/null +++ b/dev/tools/phan/plugins/GetPostFixerPlugin/fixers.php @@ -0,0 +1,123 @@ + + */ + +declare(strict_types=1); + +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; + +/** + * Implements --automatic-fix for GetPostFixerPlugin + * + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + $line = $instance->getLine(); + $new_name = (string) $instance->getTemplateParameters()[1]; + if ($new_name !== "GETPOSTINT") { + return null; + } + + $function_repr = (string) $instance->getTemplateParameters()[0]; + if (!preg_match('{\\\\(\w+)}', $function_repr, $match)) { + return null; + } + $expected_name = $match[1]; + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) != 3) { + print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + print "Type$i: ".get_class($argument).PHP_EOL; + } + + $arg2 = $arguments[2]; + + if ($arg2 instanceof ArgumentExpression && $arg2->expression instanceof StringLiteral) { + // Get the string value of the StringLiteral + $stringValue = $arg2->expression->getStringContentsText(); + } else { + print "Expression is not string ".get_class($arg2)."/".get_class($arg2->expression)."- Skip $instance".PHP_EOL; + continue; + } + print "Fixture elem on $line - $new_name - $function_repr - arg: $stringValue".PHP_EOL; + + // Get the first argument (delimiter) + $delimiter = $arguments[1]; + // Get the second argument + $secondArgument = $arguments[2]; + + // Get the start position of the delimiter + $arg_start_pos = $delimiter->getStartPosition(); + + // Get the end position of the second argument + $arg_end_pos = $secondArgument->getEndPosition(); + + + + // @phan-suppress-next-line PhanThrowTypeAbsentForCall + $start = $callableExpression->getStartPosition(); + // @phan-suppress-next-line PhanThrowTypeAbsentForCall + $end = $callableExpression->getEndPosition(); + + // Remove second argument + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, ""); + + // Replace call with GETPOSTINT + $edits[] = new FileEdit($start, $end, (($file_contents[$start] ?? '') === '\\' ? '\\' : '') . $new_name); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'GetPostShouldBeGetPostInt', + $fix + ); +}); From a03c64ff4049782fab98cd86541f8c0786018634 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 27 Feb 2024 15:29:44 +0100 Subject: [PATCH 0254/1862] Fix: Replace deprecated module tests embedded in strings (#28459) --- .../core/modules/mailings/fraise.modules.php | 2 +- htdocs/core/modules/modAgenda.class.php | 358 +++++++++--------- htdocs/core/modules/modCategorie.class.php | 226 +++++------ .../class/conferenceorboothattendee.class.php | 48 +-- .../class/fournisseur.commande.class.php | 100 ++--- .../class/fournisseur.facture-rec.class.php | 90 ++--- .../fourn/class/fournisseur.facture.class.php | 2 +- .../canvas/company/tpl/card_view.tpl.php | 2 +- .../canvas/individual/tpl/card_view.tpl.php | 2 +- htdocs/societe/class/societe.class.php | 200 +++++----- htdocs/webservices/admin/index.php | 6 +- 11 files changed, 518 insertions(+), 518 deletions(-) diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 59e82deddc2..1547ce1d866 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -41,7 +41,7 @@ class mailing_fraise extends MailingTargets public $require_module = array('adherent'); - public $enabled = 'isModEnabled("adherent")'; + public $enabled = 'isModEnabled("member")'; /** * @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/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 86fca2796c1..82c372f8249 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -107,15 +107,15 @@ class modAgenda extends DolibarrModules // Boxes //------ $this->boxes = array( - 0=>array('file'=>'box_actions.php', 'enabledbydefaulton'=>'Home'), - 1=>array('file'=>'box_actions_future.php', 'enabledbydefaulton'=>'Home') + 0 => array('file' => 'box_actions.php', 'enabledbydefaulton' => 'Home'), + 1 => array('file' => 'box_actions_future.php', 'enabledbydefaulton' => 'Home') ); // Cronjobs //------------ $datestart = dol_now(); $this->cronjobs = array( - 0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>5, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'isModEnabled("agenda")', 'datestart'=>$datestart), + 0 => array('label' => 'SendEmailsReminders', 'jobtype' => 'method', 'class' => 'comm/action/class/actioncomm.class.php', 'objectname' => 'ActionComm', 'method' => 'sendEmailsReminder', 'parameters' => '', 'comment' => 'SendEMailsReminder', 'frequency' => 5, 'unitfrequency' => 60, 'priority' => 10, 'status' => 1, 'test' => 'isModEnabled("agenda")', 'datestart' => $datestart), ); // Permissions @@ -205,206 +205,206 @@ class modAgenda extends DolibarrModules // 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both // $r++; $this->menu[$r] = array( - 'fk_menu'=>0, - 'type'=>'top', - 'titre'=>'TMenuAgenda', + 'fk_menu' => 0, + 'type' => 'top', + 'titre' => 'TMenuAgenda', 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth"'), - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/index.php', - 'langs'=>'agenda', - 'position'=>86, - 'perms'=>'$user->hasRight("agenda", "myactions", "read") || $user->hasRight("resource", "read")', - 'enabled'=>'isModEnabled("agenda") || isModEnabled("resource")', - 'target'=>'', - 'user'=>2, + 'mainmenu' => 'agenda', + 'url' => '/comm/action/index.php', + 'langs' => 'agenda', + 'position' => 86, + 'perms' => '$user->hasRight("agenda", "myactions", "read") || $user->hasRight("resource", "read")', + 'enabled' => 'isModEnabled("agenda") || isModEnabled("resource")', + 'target' => '', + 'user' => 2, ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=0', - 'type'=>'left', - 'titre'=>'Actions', + 'fk_menu' => 'r=0', + 'type' => 'left', + 'titre' => 'Actions', 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda', - 'langs'=>'agenda', - 'position'=>100, - 'perms'=>'$user->hasRight("agenda", "myactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2, + 'mainmenu' => 'agenda', + 'url' => '/comm/action/index.php?mainmenu=agenda&leftmenu=agenda', + 'langs' => 'agenda', + 'position' => 100, + 'perms' => '$user->hasRight("agenda", "myactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2, ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=1', - 'type'=>'left', - 'titre'=>'NewAction', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create', - 'langs'=>'commercial', - 'position'=>101, - 'perms'=>'($user->hasRight("agenda", "myactions", "create") || $user->hasRight("agenda", "allactions", "create"))', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=1', + 'type' => 'left', + 'titre' => 'NewAction', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create', + 'langs' => 'commercial', + 'position' => 101, + 'perms' => '($user->hasRight("agenda", "myactions", "create") || $user->hasRight("agenda", "allactions", "create"))', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; // Calendar $this->menu[$r] = array( - 'fk_menu'=>'r=1', - 'type'=>'left', - 'titre'=>'Calendar', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda', - 'langs'=>'agenda', - 'position'=>140, - 'perms'=>'$user->hasRight("agenda", "myactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=1', + 'type' => 'left', + 'titre' => 'Calendar', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda', + 'langs' => 'agenda', + 'position' => 140, + 'perms' => '$user->hasRight("agenda", "myactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=3', - 'type'=>'left', - 'titre'=>'MenuToDoMyActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine', - 'langs'=>'agenda', - 'position'=>141, - 'perms'=>'$user->hasRight("agenda", "myactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=3', + 'type' => 'left', + 'titre' => 'MenuToDoMyActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine', + 'langs' => 'agenda', + 'position' => 141, + 'perms' => '$user->hasRight("agenda", "myactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=3', - 'type'=>'left', - 'titre'=>'MenuDoneMyActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine', - 'langs'=>'agenda', - 'position'=>142, - 'perms'=>'$user->hasRight("agenda", "myactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=3', + 'type' => 'left', + 'titre' => 'MenuDoneMyActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine', + 'langs' => 'agenda', + 'position' => 142, + 'perms' => '$user->hasRight("agenda", "myactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=3', - 'type'=>'left', - 'titre'=>'MenuToDoActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1', - 'langs'=>'agenda', - 'position'=>143, - 'perms'=>'$user->hasRight("agenda", "allactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=3', + 'type' => 'left', + 'titre' => 'MenuToDoActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1', + 'langs' => 'agenda', + 'position' => 143, + 'perms' => '$user->hasRight("agenda", "allactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=3', - 'type'=>'left', - 'titre'=>'MenuDoneActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1', - 'langs'=>'agenda', - 'position'=>144, - 'perms'=>'$user->hasRight("agenda", "allactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=3', + 'type' => 'left', + 'titre' => 'MenuDoneActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1', + 'langs' => 'agenda', + 'position' => 144, + 'perms' => '$user->hasRight("agenda", "allactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); // List $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=1', - 'type'=>'left', - 'titre'=>'List', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda', - 'langs'=>'agenda', - 'position'=>110, - 'perms'=>'$user->hasRight("agenda", "myactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=1', + 'type' => 'left', + 'titre' => 'List', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda', + 'langs' => 'agenda', + 'position' => 110, + 'perms' => '$user->hasRight("agenda", "myactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=8', - 'type'=>'left', - 'titre'=>'MenuToDoMyActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine', - 'langs'=>'agenda', - 'position'=>111, - 'perms'=>'$user->hasRight("agenda", "myactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=8', + 'type' => 'left', + 'titre' => 'MenuToDoMyActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine', + 'langs' => 'agenda', + 'position' => 111, + 'perms' => '$user->hasRight("agenda", "myactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=8', - 'type'=>'left', - 'titre'=>'MenuDoneMyActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine', - 'langs'=>'agenda', - 'position'=>112, - 'perms'=>'$user->hasRight("agenda", "myactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=8', + 'type' => 'left', + 'titre' => 'MenuDoneMyActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine', + 'langs' => 'agenda', + 'position' => 112, + 'perms' => '$user->hasRight("agenda", "myactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=8', - 'type'=>'left', - 'titre'=>'MenuToDoActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1', - 'langs'=>'agenda', - 'position'=>113, - 'perms'=>'$user->hasRight("agenda", "allactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=8', + 'type' => 'left', + 'titre' => 'MenuToDoActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1', + 'langs' => 'agenda', + 'position' => 113, + 'perms' => '$user->hasRight("agenda", "allactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=8', - 'type'=>'left', - 'titre'=>'MenuDoneActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1', - 'langs'=>'agenda', - 'position'=>114, - 'perms'=>'$user->hasRight("agenda", "allactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=8', + 'type' => 'left', + 'titre' => 'MenuDoneActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1', + 'langs' => 'agenda', + 'position' => 114, + 'perms' => '$user->hasRight("agenda", "allactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; // Reports $this->menu[$r] = array( - 'fk_menu'=>'r=1', - 'type'=>'left', - 'titre'=>'Reportings', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda', - 'langs'=>'agenda', - 'position'=>160, - 'perms'=>'$user->hasRight("agenda", "allactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=1', + 'type' => 'left', + 'titre' => 'Reportings', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda', + 'langs' => 'agenda', + 'position' => 160, + 'perms' => '$user->hasRight("agenda", "allactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; // Categories @@ -413,11 +413,11 @@ class modAgenda extends DolibarrModules 'type' => 'left', 'titre' => 'Categories', 'mainmenu' => 'agenda', - 'url'=>'/categories/index.php?mainmenu=agenda&leftmenu=agenda&type=10', + 'url' => '/categories/index.php?mainmenu=agenda&leftmenu=agenda&type=10', 'langs' => 'agenda', 'position' => 170, 'perms' => '$user->hasRight("agenda", "allactions", "read")', - 'enabled' => 'isModEnabled("categorie")', + 'enabled' => 'isModEnabled("category")', 'target' => '', 'user' => 2 ); @@ -432,13 +432,13 @@ class modAgenda extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = "ExportDataset_event1"; $this->export_permission[$r] = array(array("agenda", "export")); - $this->export_fields_array[$r] = array('ac.id'=>"IdAgenda", 'ac.ref_ext'=>"ExternalRef",'ac.ref'=>"Ref", 'ac.datec'=>"DateCreation", 'ac.datep'=>"DateActionBegin", - 'ac.datep2'=>"DateActionEnd", 'ac.location' => 'Location', 'ac.label'=>"Title", 'ac.note'=>"Note", 'ac.percent'=>"Percentage", 'ac.durationp'=>"Duration", - 'ac.fk_user_author'=>'CreatedById', 'ac.fk_user_action'=>'ActionsOwnedBy', 'ac.fk_user_mod'=>'ModifiedBy', 'ac.transparency'=>"Transparency", 'ac.priority'=>"Priority", 'ac.fk_element'=>"ElementID", 'ac.elementtype'=>"ElementType", - 'cac.libelle'=>"ActionType", 'cac.code'=>"Code", - 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', - 'co.code'=>'CountryCode', 's.phone'=>'Phone', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.idprof5'=>'ProfId5', 's.idprof6'=>'ProfId6', - 's.code_compta'=>'CustomerAccountancyCode', 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', + $this->export_fields_array[$r] = array('ac.id' => "IdAgenda", 'ac.ref_ext' => "ExternalRef",'ac.ref' => "Ref", 'ac.datec' => "DateCreation", 'ac.datep' => "DateActionBegin", + 'ac.datep2' => "DateActionEnd", 'ac.location' => 'Location', 'ac.label' => "Title", 'ac.note' => "Note", 'ac.percent' => "Percentage", 'ac.durationp' => "Duration", + 'ac.fk_user_author' => 'CreatedById', 'ac.fk_user_action' => 'ActionsOwnedBy', 'ac.fk_user_mod' => 'ModifiedBy', 'ac.transparency' => "Transparency", 'ac.priority' => "Priority", 'ac.fk_element' => "ElementID", 'ac.elementtype' => "ElementType", + 'cac.libelle' => "ActionType", 'cac.code' => "Code", + 's.rowid' => "IdCompany", 's.nom' => 'CompanyName', 's.address' => 'Address', 's.zip' => 'Zip', 's.town' => 'Town', + 'co.code' => 'CountryCode', 's.phone' => 'Phone', 's.siren' => 'ProfId1', 's.siret' => 'ProfId2', 's.ape' => 'ProfId3', 's.idprof4' => 'ProfId4', 's.idprof5' => 'ProfId5', 's.idprof6' => 'ProfId6', + 's.code_compta' => 'CustomerAccountancyCode', 's.code_compta_fournisseur' => 'SupplierAccountancyCode', 's.tva_intra' => 'VATIntra', 'p.ref' => 'ProjectRef', ); // Add multicompany field @@ -448,21 +448,21 @@ class modAgenda extends DolibarrModules $this->export_fields_array[$r]['ac.entity'] = 'Entity'; } } - $this->export_TypeFields_array[$r] = array('ac.ref_ext'=>"Text", 'ac.ref'=>"Text", 'ac.datec'=>"Date", 'ac.datep'=>"Date", - 'ac.datep2'=>"Date", 'ac.location' => 'Text', 'ac.label'=>"Text", 'ac.note'=>"Text", 'ac.percent'=>"Numeric", - 'ac.durationp'=>"Duree",'ac.fk_user_author'=>'Numeric', 'ac.fk_user_action'=>'Numeric', 'ac.fk_user_mod'=>'Numeric', 'ac.transparency'=>"Numeric", 'ac.priority'=>"Numeric", 'ac.fk_element'=>"Numeric", 'ac.elementtype'=>"Text", - 'cac.libelle'=>"List:c_actioncomm:libelle:libelle", 'cac.code'=>"Text", - 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', - 'co.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.idprof5'=>'Text', 's.idprof6'=>'Text', - 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text', - 'p.ref' => 'Text', 'ac.entity'=>'List:entity:label:rowid' + $this->export_TypeFields_array[$r] = array('ac.ref_ext' => "Text", 'ac.ref' => "Text", 'ac.datec' => "Date", 'ac.datep' => "Date", + 'ac.datep2' => "Date", 'ac.location' => 'Text', 'ac.label' => "Text", 'ac.note' => "Text", 'ac.percent' => "Numeric", + 'ac.durationp' => "Duree",'ac.fk_user_author' => 'Numeric', 'ac.fk_user_action' => 'Numeric', 'ac.fk_user_mod' => 'Numeric', 'ac.transparency' => "Numeric", 'ac.priority' => "Numeric", 'ac.fk_element' => "Numeric", 'ac.elementtype' => "Text", + 'cac.libelle' => "List:c_actioncomm:libelle:libelle", 'cac.code' => "Text", + 's.nom' => 'Text', 's.address' => 'Text', 's.zip' => 'Text', 's.town' => 'Text', + 'co.code' => 'Text', 's.phone' => 'Text', 's.siren' => 'Text', 's.siret' => 'Text', 's.ape' => 'Text', 's.idprof4' => 'Text', 's.idprof5' => 'Text', 's.idprof6' => 'Text', + 's.code_compta' => 'Text', 's.code_compta_fournisseur' => 'Text', 's.tva_intra' => 'Text', + 'p.ref' => 'Text', 'ac.entity' => 'List:entity:label:rowid' ); - $this->export_entities_array[$r] = array('ac.id'=>"action", 'ac.ref_ext'=>"action", 'ac.ref'=>"action", 'ac.datec'=>"action", 'ac.datep'=>"action", - 'ac.datep2'=>"action", 'ac.location' => 'action', 'ac.label'=>"action", 'ac.note'=>"action", 'ac.percent'=>"action", 'ac.durationp'=>"action",'ac.fk_user_author'=>'user', 'ac.fk_user_action'=>'user', 'ac.fk_user_mod'=>'user', 'ac.transparency'=>"action", 'ac.priority'=>"action", 'ac.fk_element'=>"action", 'ac.elementtype'=>"action", - 's.rowid'=>"company", 's.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', - 'co.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.idprof5'=>'company', 's.idprof6'=>'company', - 's.code_compta'=>'company', 's.code_compta_fournisseur'=>'company', 's.tva_intra'=>'company', + $this->export_entities_array[$r] = array('ac.id' => "action", 'ac.ref_ext' => "action", 'ac.ref' => "action", 'ac.datec' => "action", 'ac.datep' => "action", + 'ac.datep2' => "action", 'ac.location' => 'action', 'ac.label' => "action", 'ac.note' => "action", 'ac.percent' => "action", 'ac.durationp' => "action",'ac.fk_user_author' => 'user', 'ac.fk_user_action' => 'user', 'ac.fk_user_mod' => 'user', 'ac.transparency' => "action", 'ac.priority' => "action", 'ac.fk_element' => "action", 'ac.elementtype' => "action", + 's.rowid' => "company", 's.nom' => 'company', 's.address' => 'company', 's.zip' => 'company', 's.town' => 'company', + 'co.code' => 'company', 's.phone' => 'company', 's.siren' => 'company', 's.siret' => 'company', 's.ape' => 'company', 's.idprof4' => 'company', 's.idprof5' => 'company', 's.idprof6' => 'company', + 's.code_compta' => 'company', 's.code_compta_fournisseur' => 'company', 's.tva_intra' => 'company', 'p.ref' => 'project', ); diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 43c92e4810c..20aced509b9 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -165,10 +165,10 @@ class modCategorie extends DolibarrModules } // Definition of vars - $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.type'=>"Type", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification"); - $this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.type'=>"Numeric", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text'); + $this->export_fields_array[$r] = array('cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.type' => "Type", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategoryID", 'pcat.label' => "ParentCategoryLabel", 'cat.color' => "Color", 'cat.date_creation' => "DateCreation", 'cat.tms' => "DateLastModification"); + $this->export_TypeFields_array[$r] = array('cat.rowid' => 'Numeric', 'cat.label' => "Text", 'cat.type' => "Numeric", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text'); $this->export_entities_array[$r] = array(); // We define here only fields that use another picto - $this->export_help_array[$r] = array('cat.type'=>$typeexample); + $this->export_help_array[$r] = array('cat.type' => $typeexample); $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'categorie as cat'; @@ -182,9 +182,9 @@ class modCategorie extends DolibarrModules $this->export_icon[$r] = $this->picto; $this->export_enabled[$r] = 'isModEnabled("product") || isModEnabled("service")'; $this->export_permission[$r] = array(array("categorie", "lire"), array("produit", "export")); - $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", 'p.rowid'=>'ProductId', 'p.ref'=>'Ref', 'p.label'=>'Label'); - $this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.label'=>'Text'); - $this->export_entities_array[$r] = array('p.rowid'=>'product', 'p.ref'=>'product', 'p.label'=>'product'); // We define here only fields that use another picto + $this->export_fields_array[$r] = array('cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategoryID", 'pcat.label' => "ParentCategoryLabel", 'cat.color' => "Color", 'cat.date_creation' => "DateCreation", 'cat.tms' => "DateLastModification", 'p.rowid' => 'ProductId', 'p.ref' => 'Ref', 'p.label' => 'Label'); + $this->export_TypeFields_array[$r] = array('cat.rowid' => 'Numeric', 'cat.label' => "Text", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text', 'p.rowid' => 'Numeric', 'p.ref' => 'Text', 'p.label' => 'Text'); + $this->export_entities_array[$r] = array('p.rowid' => 'product', 'p.ref' => 'product', 'p.label' => 'product'); // We define here only fields that use another picto $keyforselect = 'product'; $keyforelement = 'product'; @@ -208,28 +208,28 @@ class modCategorie extends DolibarrModules $this->export_enabled[$r] = 'isModEnabled("supplier_order") || isModEnabled("supplier_invoice")'; $this->export_permission[$r] = array(array("categorie", "lire"), array("fournisseur", "lire")); $this->export_fields_array[$r] = array( - 'cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", - 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", - 's.rowid'=>'IdThirdParty', 's.nom'=>'Name', 's.prefix_comm'=>"Prefix", 's.fournisseur'=>"Supplier", 's.datec'=>"DateCreation", 's.tms'=>"DateLastModification", 's.code_fournisseur'=>"SupplierCode", - 's.address'=>"Address", 's.zip'=>"Zip", 's.town'=>"Town", 'c.label'=>"Country", 'c.code'=>"CountryCode", - 's.phone'=>"Phone", 's.fax'=>"Fax", 's.url'=>"Url", 's.email'=>"Email", - 's.siret'=>"ProfId1", 's.siren'=>"ProfId2", 's.ape'=>"ProfId3", 's.idprof4'=>"ProfId4", 's.tva_intra'=>"VATIntraShort", 's.capital'=>"Capital", 's.note_public'=>"NotePublic", - 't.libelle'=>'ThirdPartyType' + 'cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategoryID", 'pcat.label' => "ParentCategoryLabel", + 'cat.color' => "Color", 'cat.date_creation' => "DateCreation", 'cat.tms' => "DateLastModification", + 's.rowid' => 'IdThirdParty', 's.nom' => 'Name', 's.prefix_comm' => "Prefix", 's.fournisseur' => "Supplier", 's.datec' => "DateCreation", 's.tms' => "DateLastModification", 's.code_fournisseur' => "SupplierCode", + 's.address' => "Address", 's.zip' => "Zip", 's.town' => "Town", 'c.label' => "Country", 'c.code' => "CountryCode", + 's.phone' => "Phone", 's.fax' => "Fax", 's.url' => "Url", 's.email' => "Email", + 's.siret' => "ProfId1", 's.siren' => "ProfId2", 's.ape' => "ProfId3", 's.idprof4' => "ProfId4", 's.tva_intra' => "VATIntraShort", 's.capital' => "Capital", 's.note_public' => "NotePublic", + 't.libelle' => 'ThirdPartyType' ); $this->export_TypeFields_array[$r] = array( - 'cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', - 's.rowid'=>'List:societe:nom', 's.nom'=>'Text', 's.prefix_comm'=>"Text", 's.fournisseur'=>"Text", 's.datec'=>"Date", 's.tms'=>"Date", 's.code_fournisseur'=>"Text", - 's.address'=>"Text", 's.zip'=>"Text", 's.town'=>"Text", 'c.label'=>"List:c_country:label:label", 'c.code'=>"Text", - 's.phone'=>"Text", 's.fax'=>"Text", 's.url'=>"Text", 's.email'=>"Text", - 's.siret'=>"Text", 's.siren'=>"Text", 's.ape'=>"Text", 's.idprof4'=>"Text", 's.tva_intra'=>"Text", 's.capital'=>"Numeric", 's.note_public'=>"Text", - 't.libelle'=>'List:c_typent:libelle:code' + 'cat.rowid' => 'Numeric', 'cat.label' => "Text", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text', + 's.rowid' => 'List:societe:nom', 's.nom' => 'Text', 's.prefix_comm' => "Text", 's.fournisseur' => "Text", 's.datec' => "Date", 's.tms' => "Date", 's.code_fournisseur' => "Text", + 's.address' => "Text", 's.zip' => "Text", 's.town' => "Text", 'c.label' => "List:c_country:label:label", 'c.code' => "Text", + 's.phone' => "Text", 's.fax' => "Text", 's.url' => "Text", 's.email' => "Text", + 's.siret' => "Text", 's.siren' => "Text", 's.ape' => "Text", 's.idprof4' => "Text", 's.tva_intra' => "Text", 's.capital' => "Numeric", 's.note_public' => "Text", + 't.libelle' => 'List:c_typent:libelle:code' ); $this->export_entities_array[$r] = array( - 's.rowid'=>'company', 's.nom'=>'company', 's.prefix_comm'=>"company", 's.fournisseur'=>"company", 's.datec'=>"company", 's.tms'=>"company", 's.code_fournisseur'=>"company", - 's.address'=>"company", 's.zip'=>"company", 's.town'=>"company", 'c.label'=>"company", 'c.code'=>"company", - 's.phone'=>"company", 's.fax'=>"company", 's.url'=>"company", 's.email'=>"company", - 's.siret'=>"company", 's.siren'=>"company", 's.ape'=>"company", 's.idprof4'=>"company", 's.tva_intra'=>"company", 's.capital'=>"company", 's.note_public'=>"company", - 't.libelle'=>'company' + 's.rowid' => 'company', 's.nom' => 'company', 's.prefix_comm' => "company", 's.fournisseur' => "company", 's.datec' => "company", 's.tms' => "company", 's.code_fournisseur' => "company", + 's.address' => "company", 's.zip' => "company", 's.town' => "company", 'c.label' => "company", 'c.code' => "company", + 's.phone' => "company", 's.fax' => "company", 's.url' => "company", 's.email' => "company", + 's.siret' => "company", 's.siren' => "company", 's.ape' => "company", 's.idprof4' => "company", 's.tva_intra' => "company", 's.capital' => "company", 's.note_public' => "company", + 't.libelle' => 'company' ); // We define here only fields that use another picto $keyforselect = 'societe'; @@ -256,28 +256,28 @@ class modCategorie extends DolibarrModules $this->export_enabled[$r] = 'isModEnabled("societe")'; $this->export_permission[$r] = array(array("categorie", "lire"), array("societe", "export")); $this->export_fields_array[$r] = array( - 'cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", - 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", - 's.rowid'=>'IdThirdParty', 's.nom'=>'Name', 's.prefix_comm'=>"Prefix", 's.client'=>"Customer", 's.datec'=>"DateCreation", 's.tms'=>"DateLastModification", 's.code_client'=>"CustomerCode", - 's.address'=>"Address", 's.zip'=>"Zip", 's.town'=>"Town", 'c.label'=>"Country", 'c.code'=>"CountryCode", - 's.phone'=>"Phone", 's.fax'=>"Fax", 's.url'=>"Url", 's.email'=>"Email", - 's.siret'=>"ProfId1", 's.siren'=>"ProfId2", 's.ape'=>"ProfId3", 's.idprof4'=>"ProfId4", 's.tva_intra'=>"VATIntraShort", 's.capital'=>"Capital", 's.note_public'=>"NotePublic", - 't.libelle'=>'ThirdPartyType', 'pl.code'=>'ProspectLevel', 'st.code'=>'ProspectStatus' + 'cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategoryID", 'pcat.label' => "ParentCategoryLabel", + 'cat.color' => "Color", 'cat.date_creation' => "DateCreation", 'cat.tms' => "DateLastModification", + 's.rowid' => 'IdThirdParty', 's.nom' => 'Name', 's.prefix_comm' => "Prefix", 's.client' => "Customer", 's.datec' => "DateCreation", 's.tms' => "DateLastModification", 's.code_client' => "CustomerCode", + 's.address' => "Address", 's.zip' => "Zip", 's.town' => "Town", 'c.label' => "Country", 'c.code' => "CountryCode", + 's.phone' => "Phone", 's.fax' => "Fax", 's.url' => "Url", 's.email' => "Email", + 's.siret' => "ProfId1", 's.siren' => "ProfId2", 's.ape' => "ProfId3", 's.idprof4' => "ProfId4", 's.tva_intra' => "VATIntraShort", 's.capital' => "Capital", 's.note_public' => "NotePublic", + 't.libelle' => 'ThirdPartyType', 'pl.code' => 'ProspectLevel', 'st.code' => 'ProspectStatus' ); $this->export_TypeFields_array[$r] = array( - 'cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', - 's.rowid'=>'List:societe:nom', 's.nom'=>'Text', 's.prefix_comm'=>"Text", 's.client'=>"Text", 's.datec'=>"Date", 's.tms'=>"Date", 's.code_client'=>"Text", - 's.address'=>"Text", 's.zip'=>"Text", 's.town'=>"Text", 'c.label'=>"List:c_country:label:label", 'c.code'=>"Text", - 's.phone'=>"Text", 's.fax'=>"Text", 's.url'=>"Text", 's.email'=>"Text", - 's.siret'=>"Text", 's.siren'=>"Text", 's.ape'=>"Text", 's.idprof4'=>"Text", 's.tva_intra'=>"Text", 's.capital'=>"Numeric", 's.note_public'=>"Text", - 't.libelle'=>'List:c_typent:libelle:code', 'pl.code'=>'List:c_prospectlevel:label:code', 'st.code'=>'List:c_stcomm:libelle:code' + 'cat.rowid' => 'Numeric', 'cat.label' => "Text", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text', + 's.rowid' => 'List:societe:nom', 's.nom' => 'Text', 's.prefix_comm' => "Text", 's.client' => "Text", 's.datec' => "Date", 's.tms' => "Date", 's.code_client' => "Text", + 's.address' => "Text", 's.zip' => "Text", 's.town' => "Text", 'c.label' => "List:c_country:label:label", 'c.code' => "Text", + 's.phone' => "Text", 's.fax' => "Text", 's.url' => "Text", 's.email' => "Text", + 's.siret' => "Text", 's.siren' => "Text", 's.ape' => "Text", 's.idprof4' => "Text", 's.tva_intra' => "Text", 's.capital' => "Numeric", 's.note_public' => "Text", + 't.libelle' => 'List:c_typent:libelle:code', 'pl.code' => 'List:c_prospectlevel:label:code', 'st.code' => 'List:c_stcomm:libelle:code' ); $this->export_entities_array[$r] = array( - 's.rowid'=>'company', 's.nom'=>'company', 's.prefix_comm'=>"company", 's.client'=>"company", 's.datec'=>"company", 's.tms'=>"company", 's.code_client'=>"company", - 's.address'=>"company", 's.zip'=>"company", 's.town'=>"company", 'c.label'=>"company", 'c.code'=>"company", - 's.phone'=>"company", 's.fax'=>"company", 's.url'=>"company", 's.email'=>"company", - 's.siret'=>"company", 's.siren'=>"company", 's.ape'=>"company", 's.idprof4'=>"company", 's.tva_intra'=>"company", 's.capital'=>"company", 's.note_public'=>"company", - 't.libelle'=>'company', 'pl.code'=>'company', 'st.code'=>'company' + 's.rowid' => 'company', 's.nom' => 'company', 's.prefix_comm' => "company", 's.client' => "company", 's.datec' => "company", 's.tms' => "company", 's.code_client' => "company", + 's.address' => "company", 's.zip' => "company", 's.town' => "company", 'c.label' => "company", 'c.code' => "company", + 's.phone' => "company", 's.fax' => "company", 's.url' => "company", 's.email' => "company", + 's.siret' => "company", 's.siren' => "company", 's.ape' => "company", 's.idprof4' => "company", 's.tva_intra' => "company", 's.capital' => "company", 's.note_public' => "company", + 't.libelle' => 'company', 'pl.code' => 'company', 'st.code' => 'company' ); // We define here only fields that use another picto $keyforselect = 'societe'; @@ -303,11 +303,11 @@ class modCategorie extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3]; $this->export_label[$r] = 'CatMemberList'; $this->export_icon[$r] = $this->picto; - $this->export_enabled[$r] = 'isModEnabled("adherent")'; + $this->export_enabled[$r] = 'isModEnabled("member")'; $this->export_permission[$r] = array(array("categorie", "lire"), array("adherent", "export")); - $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'MemberId', 'p.lastname'=>'LastName', 'p.firstname'=>'Firstname'); - $this->export_TypeFields_array[$r] = array('cat.rowid'=>"Numeric", 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.lastname'=>'Text', 'p.firstname'=>'Text'); - $this->export_entities_array[$r] = array('p.rowid'=>'member', 'p.lastname'=>'member', 'p.firstname'=>'member'); // We define here only fields that use another picto + $this->export_fields_array[$r] = array('cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategoryID", 'pcat.label' => "ParentCategoryLabel", 'p.rowid' => 'MemberId', 'p.lastname' => 'LastName', 'p.firstname' => 'Firstname'); + $this->export_TypeFields_array[$r] = array('cat.rowid' => "Numeric", 'cat.label' => "Text", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text', 'p.lastname' => 'Text', 'p.firstname' => 'Text'); + $this->export_entities_array[$r] = array('p.rowid' => 'member', 'p.lastname' => 'member', 'p.firstname' => 'member'); // We define here only fields that use another picto $keyforselect = 'adherent'; $keyforelement = 'member'; @@ -331,27 +331,27 @@ class modCategorie extends DolibarrModules $this->export_enabled[$r] = 'isModEnabled("societe")'; $this->export_permission[$r] = array(array("categorie", "lire"), array("societe", "contact", "export")); $this->export_fields_array[$r] = array( - 'cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", - 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", + 'cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategoryID", 'pcat.label' => "ParentCategoryLabel", + 'cat.color' => "Color", 'cat.date_creation' => "DateCreation", 'cat.tms' => "DateLastModification", 'p.rowid' => 'ContactId', 'civ.label' => 'UserTitle', 'p.lastname' => 'LastName', 'p.firstname' => 'Firstname', 'p.address' => 'Address', 'p.zip' => 'Zip', 'p.town' => 'Town', 'c.code' => 'CountryCode', 'c.label' => 'Country', 'p.birthday' => 'DateOfBirth', 'p.poste' => 'PostOrFunction', 'p.phone' => 'Phone', 'p.phone_perso' => 'PhonePerso', 'p.phone_mobile' => 'PhoneMobile', 'p.fax' => 'Fax', 'p.email' => 'Email', 'p.note_private' => 'NotePrivate', 'p.note_public' => 'NotePublic', 'p.statut' => 'Status', - 's.nom'=>"Name", 's.client'=>"Customer", 's.fournisseur'=>"Supplier", 's.status'=>"Status", - 's.address'=>"Address", 's.zip'=>"Zip", 's.town'=>"Town", - 's.phone'=>"Phone", 's.fax'=>"Fax", 's.url'=>"Url", 's.email'=>"Email" + 's.nom' => "Name", 's.client' => "Customer", 's.fournisseur' => "Supplier", 's.status' => "Status", + 's.address' => "Address", 's.zip' => "Zip", 's.town' => "Town", + 's.phone' => "Phone", 's.fax' => "Fax", 's.url' => "Url", 's.email' => "Email" ); $this->export_TypeFields_array[$r] = array( - 'cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', - 'civ.label' => 'List:c_civility:label:label', 'p.rowid'=>'Numeric', 'p.lastname' => 'Text', 'p.firstname' => 'Text', + 'cat.rowid' => 'Numeric', 'cat.label' => "Text", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text', + 'civ.label' => 'List:c_civility:label:label', 'p.rowid' => 'Numeric', 'p.lastname' => 'Text', 'p.firstname' => 'Text', 'p.address' => 'Text', 'p.zip' => 'Text', 'p.town' => 'Text', 'c.code' => 'Text', 'c.label' => 'List:c_country:label:label', 'p.birthday' => 'Date', 'p.poste' => 'Text', 'p.phone' => 'Text', 'p.phone_perso' => 'Text', 'p.phone_mobile' => 'Text', 'p.fax' => 'Text', 'p.email' => 'Text', 'p.note_private' => 'Text', 'p.note_public' => 'Text', 'p.statut' => 'Boolean', - 's.nom'=>"Text", 's.client'=>"Boolean", 's.fournisseur'=>"Boolean", 's.status'=>"Boolean", - 's.address'=>"Text", 's.zip'=>"Text", 's.town'=>"Text", - 's.phone'=>"Text", 's.fax'=>"Text", 's.url'=>"Text", 's.email'=>"Text" + 's.nom' => "Text", 's.client' => "Boolean", 's.fournisseur' => "Boolean", 's.status' => "Boolean", + 's.address' => "Text", 's.zip' => "Text", 's.town' => "Text", + 's.phone' => "Text", 's.fax' => "Text", 's.url' => "Text", 's.email' => "Text" ); $this->export_entities_array[$r] = array( 'p.rowid' => 'contact', 'civ.label' => 'contact', 'p.lastname' => 'contact', 'p.firstname' => 'contact', @@ -359,9 +359,9 @@ class modCategorie extends DolibarrModules 'p.birthday' => 'contact', 'p.poste' => 'contact', 'p.phone' => 'contact', 'p.phone_perso' => 'contact', 'p.phone_mobile' => 'contact', 'p.fax' => 'contact', 'p.email' => 'contact', 'p.note_private' => 'contact', 'p.note_public' => 'contact', 'p.statut' => 'contact', - 's.nom'=>"company", 's.client'=>"company", 's.fournisseur'=>"company", 's.status'=>"company", - 's.address'=>"company", 's.zip'=>"company", 's.town'=>"company", - 's.phone'=>"company", 's.fax'=>"company", 's.url'=>"company", 's.email'=>"company" + 's.nom' => "company", 's.client' => "company", 's.fournisseur' => "company", 's.status' => "company", + 's.address' => "company", 's.zip' => "company", 's.town' => "company", + 's.phone' => "company", 's.fax' => "company", 's.url' => "company", 's.email' => "company" ); // We define here only fields that use another picto $keyforselect = 'socpeople'; @@ -390,9 +390,9 @@ class modCategorie extends DolibarrModules $this->export_icon[$r] = $this->picto; $this->export_enabled[$r] = "isModEnabled('project')"; $this->export_permission[$r] = array(array("categorie", "lire"), array("projet", "export")); - $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel", 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", 'p.rowid'=>'ProjectId', 'p.ref'=>'Ref', 's.rowid'=>"IdThirdParty", 's.nom'=>"Name"); - $this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 's.rowid'=>"Numeric", 's.nom'=>"Text"); - $this->export_entities_array[$r] = array('p.rowid'=>'project', 'p.ref'=>'project', 's.rowid'=>"company", 's.nom'=>"company"); // We define here only fields that use another picto + $this->export_fields_array[$r] = array('cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategory", 'pcat.label' => "ParentCategoryLabel", 'cat.color' => "Color", 'cat.date_creation' => "DateCreation", 'cat.tms' => "DateLastModification", 'p.rowid' => 'ProjectId', 'p.ref' => 'Ref', 's.rowid' => "IdThirdParty", 's.nom' => "Name"); + $this->export_TypeFields_array[$r] = array('cat.rowid' => 'Numeric', 'cat.label' => "Text", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text', 'p.rowid' => 'Numeric', 'p.ref' => 'Text', 's.rowid' => "Numeric", 's.nom' => "Text"); + $this->export_entities_array[$r] = array('p.rowid' => 'project', 'p.ref' => 'project', 's.rowid' => "company", 's.nom' => "company"); // We define here only fields that use another picto $keyforselect = 'projet'; $keyforelement = 'project'; @@ -416,9 +416,9 @@ class modCategorie extends DolibarrModules $this->export_icon[$r] = $this->picto; $this->export_enabled[$r] = 'isModEnabled("user")'; $this->export_permission[$r] = array(array("categorie", "lire"), array("user", "export")); - $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel", 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", 'p.rowid'=>'UserID', 'p.login'=>'Login', 'p.lastname'=>'Lastname', 'p.firstname'=>'Firstname'); - $this->export_TypeFields_array[$r] = array('cat.rowid'=>"Numeric", 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.login'=>'Text', 'p.lastname'=>'Text', 'p.firstname'=>'Text'); - $this->export_entities_array[$r] = array('p.rowid'=>'user', 'p.login'=>'user', 'p.lastname'=>'user', 'p.firstname'=>'user'); // We define here only fields that use another picto + $this->export_fields_array[$r] = array('cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategory", 'pcat.label' => "ParentCategoryLabel", 'cat.color' => "Color", 'cat.date_creation' => "DateCreation", 'cat.tms' => "DateLastModification", 'p.rowid' => 'UserID', 'p.login' => 'Login', 'p.lastname' => 'Lastname', 'p.firstname' => 'Firstname'); + $this->export_TypeFields_array[$r] = array('cat.rowid' => "Numeric", 'cat.label' => "Text", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text', 'p.rowid' => 'Numeric', 'p.login' => 'Text', 'p.lastname' => 'Text', 'p.firstname' => 'Text'); + $this->export_entities_array[$r] = array('p.rowid' => 'user', 'p.login' => 'user', 'p.lastname' => 'user', 'p.firstname' => 'user'); // We define here only fields that use another picto $keyforselect = 'user'; $keyforelement = 'user'; @@ -453,12 +453,12 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatList"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('ca'=>MAIN_DB_PREFIX.'categorie'); + $this->import_tables_array[$r] = array('ca' => MAIN_DB_PREFIX.'categorie'); $this->import_fields_array[$r] = array( - 'ca.label'=>"Label*", 'ca.type'=>"Type*", 'ca.description'=>"Description", + 'ca.label' => "Label*", 'ca.type' => "Type*", 'ca.description' => "Description", 'ca.fk_parent' => 'ParentCategory' ); - $this->import_regex_array[$r] = array('ca.type'=>'^(0|1|2|3|4|5|6|7|8|9|10|11)$'); + $this->import_regex_array[$r] = array('ca.type' => '^(0|1|2|3|4|5|6|7|8|9|10|11)$'); $this->import_convertvalue_array[$r] = array( 'ca.fk_parent' => array( 'rule' => 'fetchidfromcodeandlabel', @@ -471,10 +471,10 @@ class modCategorie extends DolibarrModules ); $this->import_examplevalues_array[$r] = array( - 'ca.label'=>"My Category Label", 'ca.type'=>$typeexample, 'ca.description'=>"My Category description", // $typeexample built above in exports + 'ca.label' => "My Category Label", 'ca.type' => $typeexample, 'ca.description' => "My Category description", // $typeexample built above in exports 'ca.fk_parent' => 'rowid or label' ); - $this->import_updatekeys_array[$r] = array('ca.label'=>'Label', 'ca.type' => 'Type'); + $this->import_updatekeys_array[$r] = array('ca.label' => 'Label', 'ca.type' => 'Type'); // 0 Products if (isModEnabled("product")) { @@ -483,15 +483,15 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatProdLinks"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('cp'=>MAIN_DB_PREFIX.'categorie_product'); - $this->import_fields_array[$r] = array('cp.fk_categorie'=>"Category*", 'cp.fk_product'=>"Product*"); - $this->import_regex_array[$r] = array('cp.fk_categorie'=>'rowid@'.MAIN_DB_PREFIX.'categorie:type=0'); + $this->import_tables_array[$r] = array('cp' => MAIN_DB_PREFIX.'categorie_product'); + $this->import_fields_array[$r] = array('cp.fk_categorie' => "Category*", 'cp.fk_product' => "Product*"); + $this->import_regex_array[$r] = array('cp.fk_categorie' => 'rowid@'.MAIN_DB_PREFIX.'categorie:type=0'); $this->import_convertvalue_array[$r] = array( - 'cp.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cp.fk_product'=>array('rule'=>'fetchidfromref', 'classfile'=>'/product/class/product.class.php', 'class'=>'Product', 'method'=>'fetch', 'element'=>'Product') + 'cp.fk_categorie' => array('rule' => 'fetchidfromref', 'classfile' => '/categories/class/categorie.class.php', 'class' => 'Categorie', 'method' => 'fetch', 'element' => 'category'), + 'cp.fk_product' => array('rule' => 'fetchidfromref', 'classfile' => '/product/class/product.class.php', 'class' => 'Product', 'method' => 'fetch', 'element' => 'Product') ); - $this->import_examplevalues_array[$r] = array('cp.fk_categorie'=>"rowid or label", 'cp.fk_product'=>"rowid or ref"); + $this->import_examplevalues_array[$r] = array('cp.fk_categorie' => "rowid or label", 'cp.fk_product' => "rowid or ref"); $this->import_updatekeys_array[$r] = array('cp.fk_categorie' => 'Category', 'cp.fk_product' => 'ProductRef'); } @@ -502,18 +502,18 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatSupLinks"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('cs'=>MAIN_DB_PREFIX.'categorie_fournisseur'); - $this->import_fields_array[$r] = array('cs.fk_categorie'=>"Category*", 'cs.fk_soc'=>"Supplier*"); + $this->import_tables_array[$r] = array('cs' => MAIN_DB_PREFIX.'categorie_fournisseur'); + $this->import_fields_array[$r] = array('cs.fk_categorie' => "Category*", 'cs.fk_soc' => "Supplier*"); $this->import_regex_array[$r] = array( - 'cs.fk_categorie'=>'rowid@'.MAIN_DB_PREFIX.'categorie:type=1', - 'cs.fk_soc'=>'rowid@'.MAIN_DB_PREFIX.'societe:fournisseur>0' + 'cs.fk_categorie' => 'rowid@'.MAIN_DB_PREFIX.'categorie:type=1', + 'cs.fk_soc' => 'rowid@'.MAIN_DB_PREFIX.'societe:fournisseur>0' ); $this->import_convertvalue_array[$r] = array( - 'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cs.fk_soc'=>array('rule'=>'fetchidfromref', 'classfile'=>'/societe/class/societe.class.php', 'class'=>'Societe', 'method'=>'fetch', 'element'=>'ThirdParty') + 'cs.fk_categorie' => array('rule' => 'fetchidfromref', 'classfile' => '/categories/class/categorie.class.php', 'class' => 'Categorie', 'method' => 'fetch', 'element' => 'category'), + 'cs.fk_soc' => array('rule' => 'fetchidfromref', 'classfile' => '/societe/class/societe.class.php', 'class' => 'Societe', 'method' => 'fetch', 'element' => 'ThirdParty') ); - $this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_soc'=>"rowid or name"); + $this->import_examplevalues_array[$r] = array('cs.fk_categorie' => "rowid or label", 'cs.fk_soc' => "rowid or name"); } // 2 Customers @@ -523,18 +523,18 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatCusLinks"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('cs'=>MAIN_DB_PREFIX.'categorie_societe'); - $this->import_fields_array[$r] = array('cs.fk_categorie'=>"Category*", 'cs.fk_soc'=>"Customer*"); + $this->import_tables_array[$r] = array('cs' => MAIN_DB_PREFIX.'categorie_societe'); + $this->import_fields_array[$r] = array('cs.fk_categorie' => "Category*", 'cs.fk_soc' => "Customer*"); $this->import_regex_array[$r] = array( - 'cs.fk_categorie'=>'rowid@'.MAIN_DB_PREFIX.'categorie:type=2', - 'cs.fk_soc'=>'rowid@'.MAIN_DB_PREFIX.'societe:client>0' + 'cs.fk_categorie' => 'rowid@'.MAIN_DB_PREFIX.'categorie:type=2', + 'cs.fk_soc' => 'rowid@'.MAIN_DB_PREFIX.'societe:client>0' ); $this->import_convertvalue_array[$r] = array( - 'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cs.fk_soc'=>array('rule'=>'fetchidfromref', 'classfile'=>'/societe/class/societe.class.php', 'class'=>'Societe', 'method'=>'fetch', 'element'=>'ThirdParty') + 'cs.fk_categorie' => array('rule' => 'fetchidfromref', 'classfile' => '/categories/class/categorie.class.php', 'class' => 'Categorie', 'method' => 'fetch', 'element' => 'category'), + 'cs.fk_soc' => array('rule' => 'fetchidfromref', 'classfile' => '/societe/class/societe.class.php', 'class' => 'Societe', 'method' => 'fetch', 'element' => 'ThirdParty') ); - $this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_soc'=>"rowid or name"); + $this->import_examplevalues_array[$r] = array('cs.fk_categorie' => "rowid or label", 'cs.fk_soc' => "rowid or name"); } // 3 Members @@ -544,15 +544,15 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatMembersLinks"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('cm'=>MAIN_DB_PREFIX.'categorie_contact'); - $this->import_fields_array[$r] = array('cm.fk_categorie'=>"Category*", 'cm.fk_member'=>"Member*"); - $this->import_regex_array[$r] = array('cm.fk_categorie'=>'rowid@'.MAIN_DB_PREFIX.'categorie:type=3'); + $this->import_tables_array[$r] = array('cm' => MAIN_DB_PREFIX.'categorie_contact'); + $this->import_fields_array[$r] = array('cm.fk_categorie' => "Category*", 'cm.fk_member' => "Member*"); + $this->import_regex_array[$r] = array('cm.fk_categorie' => 'rowid@'.MAIN_DB_PREFIX.'categorie:type=3'); $this->import_convertvalue_array[$r] = array( - 'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cs.fk_member'=>array('rule'=>'fetchidfromref', 'classfile'=>'/adherents/class/adherent.class.php', 'class'=>'Adherent', 'method'=>'fetch', 'element'=>'Member') + 'cs.fk_categorie' => array('rule' => 'fetchidfromref', 'classfile' => '/categories/class/categorie.class.php', 'class' => 'Categorie', 'method' => 'fetch', 'element' => 'category'), + 'cs.fk_member' => array('rule' => 'fetchidfromref', 'classfile' => '/adherents/class/adherent.class.php', 'class' => 'Adherent', 'method' => 'fetch', 'element' => 'Member') ); - $this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_member'=>"rowid or ref"); + $this->import_examplevalues_array[$r] = array('cs.fk_categorie' => "rowid or label", 'cs.fk_member' => "rowid or ref"); } // 4 Contacts/Addresses @@ -562,18 +562,18 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatContactsLinks"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('cc'=>MAIN_DB_PREFIX.'categorie_contact'); - $this->import_fields_array[$r] = array('cc.fk_categorie'=>"Category*", 'cc.fk_socpeople'=>"IdContact*"); + $this->import_tables_array[$r] = array('cc' => MAIN_DB_PREFIX.'categorie_contact'); + $this->import_fields_array[$r] = array('cc.fk_categorie' => "Category*", 'cc.fk_socpeople' => "IdContact*"); $this->import_regex_array[$r] = array( - 'cc.fk_categorie'=>'rowid@'.MAIN_DB_PREFIX.'categorie:type=4' + 'cc.fk_categorie' => 'rowid@'.MAIN_DB_PREFIX.'categorie:type=4' //'cc.fk_socpeople'=>'rowid@'.MAIN_DB_PREFIX.'socpeople' ); $this->import_convertvalue_array[$r] = array( - 'cc.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), + 'cc.fk_categorie' => array('rule' => 'fetchidfromref', 'classfile' => '/categories/class/categorie.class.php', 'class' => 'Categorie', 'method' => 'fetch', 'element' => 'category'), //'cc.fk_socpeople'=>array('rule'=>'fetchidfromref','classfile'=>'/contact/class/contact.class.php','class'=>'Contact','method'=>'fetch','element'=>'Contact') ); - $this->import_examplevalues_array[$r] = array('cc.fk_categorie'=>"rowid or label", 'cc.fk_socpeople'=>"rowid"); + $this->import_examplevalues_array[$r] = array('cc.fk_categorie' => "rowid or label", 'cc.fk_socpeople' => "rowid"); } // 5 Bank accounts, TODO ? @@ -585,15 +585,15 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatProjectsLinks"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('cp'=>MAIN_DB_PREFIX.'categorie_project'); - $this->import_fields_array[$r] = array('cp.fk_categorie'=>"Category*", 'cp.fk_project'=>"Project*"); - $this->import_regex_array[$r] = array('cp.fk_categorie'=>'rowid@'.MAIN_DB_PREFIX.'categorie:type=6'); + $this->import_tables_array[$r] = array('cp' => MAIN_DB_PREFIX.'categorie_project'); + $this->import_fields_array[$r] = array('cp.fk_categorie' => "Category*", 'cp.fk_project' => "Project*"); + $this->import_regex_array[$r] = array('cp.fk_categorie' => 'rowid@'.MAIN_DB_PREFIX.'categorie:type=6'); $this->import_convertvalue_array[$r] = array( - 'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cs.fk_project'=>array('rule'=>'fetchidfromref', 'classfile'=>'/projet/class/project.class.php', 'class'=>'Project', 'method'=>'fetch', 'element'=>'Project') + 'cs.fk_categorie' => array('rule' => 'fetchidfromref', 'classfile' => '/categories/class/categorie.class.php', 'class' => 'Categorie', 'method' => 'fetch', 'element' => 'category'), + 'cs.fk_project' => array('rule' => 'fetchidfromref', 'classfile' => '/projet/class/project.class.php', 'class' => 'Project', 'method' => 'fetch', 'element' => 'Project') ); - $this->import_examplevalues_array[$r] = array('cp.fk_categorie'=>"rowid or label", 'cp.fk_project'=>"rowid or ref"); + $this->import_examplevalues_array[$r] = array('cp.fk_categorie' => "rowid or label", 'cp.fk_project' => "rowid or ref"); } // 7 Users @@ -603,15 +603,15 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatUsersLinks"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('cu'=>MAIN_DB_PREFIX.'categorie_user'); - $this->import_fields_array[$r] = array('cu.fk_categorie'=>"Category*", 'cu.fk_user'=>"User*"); - $this->import_regex_array[$r] = array('cu.fk_categorie'=>'rowid@'.MAIN_DB_PREFIX.'categorie:type=7'); + $this->import_tables_array[$r] = array('cu' => MAIN_DB_PREFIX.'categorie_user'); + $this->import_fields_array[$r] = array('cu.fk_categorie' => "Category*", 'cu.fk_user' => "User*"); + $this->import_regex_array[$r] = array('cu.fk_categorie' => 'rowid@'.MAIN_DB_PREFIX.'categorie:type=7'); $this->import_convertvalue_array[$r] = array( - 'cu.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cu.fk_user'=>array('rule'=>'fetchidfromref', 'classfile'=>'/user/class/user.class.php', 'class'=>'User', 'method'=>'fetch', 'element'=>'User') + 'cu.fk_categorie' => array('rule' => 'fetchidfromref', 'classfile' => '/categories/class/categorie.class.php', 'class' => 'Categorie', 'method' => 'fetch', 'element' => 'category'), + 'cu.fk_user' => array('rule' => 'fetchidfromref', 'classfile' => '/user/class/user.class.php', 'class' => 'User', 'method' => 'fetch', 'element' => 'User') ); - $this->import_examplevalues_array[$r] = array('cu.fk_categorie'=>"rowid or label", 'cu.fk_user'=>"rowid or login"); + $this->import_examplevalues_array[$r] = array('cu.fk_categorie' => "rowid or label", 'cu.fk_user' => "rowid or login"); } // 8 Bank Lines, TODO ? diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index b137fd538ad..eecb06e137c 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -101,29 +101,29 @@ class ConferenceOrBoothAttendee extends CommonObject * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), + 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => 2, 'index' => 1, 'comment' => "Reference of object"), //'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>15, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150'), - 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'autofocusoncreate'=>1, 'searchall'=>1, 'csslist'=>'tdoverflowmax150'), - 'firstname' => array('type'=>'varchar(100)', 'label'=>'Firstname', 'enabled'=>'1', 'position'=>31, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1, 'csslist'=>'tdoverflowmax125'), - 'lastname' => array('type'=>'varchar(100)', 'label'=>'Lastname', 'enabled'=>'1', 'position'=>32, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1, 'csslist'=>'tdoverflowmax125'), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label'=>'ThirdParty', 'enabled'=>'isModEnabled("societe")', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'picto'=>'company', 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150'), - 'email_company' => array('type'=>'mail', 'label'=>'EmailCompany', 'enabled'=>'1', 'position'=>41, 'notnull'=>0, 'visible'=>-2, 'searchall'=>1), - 'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1, 'showoncombobox'=>'1',), - 'fk_invoice' => array('type'=>'integer:Facture:compta/facture/class/facture.class.php', 'label'=>'Invoice', 'enabled'=>'isModEnabled("facture")', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'index'=>0, 'picto'=>'bill', 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150'), - 'amount' => array('type'=>'price', 'label'=>'AmountPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfRegistrationPaid",), - 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>3,), - 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>3,), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2, 'css'=>'nowraponall'), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,), - 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>-1, 'visible'=>-2), - 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,), - 'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>0,), - 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), - 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), - 'ip' => array('type'=>'varchar(250)', 'label'=>'IPAddress', 'enabled'=>'1', 'position'=>900, 'notnull'=>-1, 'visible'=>-2,), - 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'default'=>0, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Canceled'),), + 'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1', 'label' => 'Project', 'enabled' => "isModEnabled('project')", 'position' => 20, 'notnull' => 1, 'visible' => 0, 'index' => 1, 'picto' => 'project', 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), + 'email' => array('type' => 'mail', 'label' => 'EmailAttendee', 'enabled' => '1', 'position' => 30, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'autofocusoncreate' => 1, 'searchall' => 1, 'csslist' => 'tdoverflowmax150'), + 'firstname' => array('type' => 'varchar(100)', 'label' => 'Firstname', 'enabled' => '1', 'position' => 31, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'csslist' => 'tdoverflowmax125'), + 'lastname' => array('type' => 'varchar(100)', 'label' => 'Lastname', 'enabled' => '1', 'position' => 32, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'csslist' => 'tdoverflowmax125'), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'position' => 40, 'notnull' => -1, 'visible' => 1, 'index' => 1, 'help' => "OrganizationEventLinkToThirdParty", 'picto' => 'company', 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), + 'email_company' => array('type' => 'mail', 'label' => 'EmailCompany', 'enabled' => '1', 'position' => 41, 'notnull' => 0, 'visible' => -2, 'searchall' => 1), + 'date_subscription' => array('type' => 'datetime', 'label' => 'DateOfRegistration', 'enabled' => '1', 'position' => 56, 'notnull' => 1, 'visible' => 1, 'showoncombobox' => '1',), + 'fk_invoice' => array('type' => 'integer:Facture:compta/facture/class/facture.class.php', 'label' => 'Invoice', 'enabled' => 'isModEnabled("invoice")', 'position' => 57, 'notnull' => 0, 'visible' => 1, 'index' => 0, 'picto' => 'bill', 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), + 'amount' => array('type' => 'price', 'label' => 'AmountPaid', 'enabled' => '1', 'position' => 57, 'notnull' => 0, 'visible' => 1, 'default' => 'null', 'isameasure' => '1', 'help' => "AmountOfRegistrationPaid",), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => '1', 'position' => 61, 'notnull' => 0, 'visible' => 3,), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => '1', 'position' => 62, 'notnull' => 0, 'visible' => 3,), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 500, 'notnull' => 1, 'visible' => -2, 'css' => 'nowraponall'), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => '1', 'position' => 501, 'notnull' => 0, 'visible' => -2,), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => '1', 'position' => 510, 'notnull' => -1, 'visible' => -2), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => '1', 'position' => 511, 'notnull' => -1, 'visible' => -2,), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => '1', 'position' => 600, 'notnull' => 0, 'visible' => 0,), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => '1', 'position' => 1000, 'notnull' => -1, 'visible' => -2,), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => '1', 'position' => 1010, 'notnull' => -1, 'visible' => 0,), + 'ip' => array('type' => 'varchar(250)', 'label' => 'IPAddress', 'enabled' => '1', 'position' => 900, 'notnull' => -1, 'visible' => -2,), + 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => '1', 'position' => 1000, 'default' => 0, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '9' => 'Canceled'),), ); public $rowid; public $ref; @@ -209,7 +209,7 @@ class ConferenceOrBoothAttendee extends CommonObject if (isset($conf->global->EVENTORGANIZATION_FILTERATTENDEES_TYPE) && getDolGlobalString('EVENTORGANIZATION_FILTERATTENDEES_TYPE') !== '' && getDolGlobalString('EVENTORGANIZATION_FILTERATTENDEES_TYPE') !== '-1') { - $this->fields['fk_soc']['type'] .= ' AND client = '.((int) getDolGlobalInt('EVENTORGANIZATION_FILTERATTENDEES_TYPE', 0)); + $this->fields['fk_soc']['type'] .= ' AND client = '.((int) getDolGlobalInt('EVENTORGANIZATION_FILTERATTENDEES_TYPE', 0)); } // Example to show how to set values of fields definition dynamically @@ -841,7 +841,7 @@ class ConferenceOrBoothAttendee extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('conferenceorboothattendeedao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 1647eac9258..7a3ecf3dae6 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -355,51 +355,51 @@ class CommandeFournisseur extends CommonOrder * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>10), - 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25, 'searchall'=>1), - 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35), - 'ref_supplier' =>array('type'=>'varchar(255)', 'label'=>'RefOrderSupplierShort', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>1), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>45), - 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>710), - 'date_approve' =>array('type'=>'datetime', 'label'=>'DateApprove', 'enabled'=>1, 'visible'=>-1, 'position'=>720), - 'date_approve2' =>array('type'=>'datetime', 'label'=>'DateApprove2', 'enabled'=>1, 'visible'=>3, 'position'=>725), - 'date_commande' =>array('type'=>'date', 'label'=>'OrderDateShort', 'enabled'=>1, 'visible'=>1, 'position'=>70), - 'date_livraison' =>array('type'=>'datetime', 'label'=>'DeliveryDate', 'enabled'=>'empty($conf->global->ORDER_DISABLE_DELIVERY_DATE)', 'visible'=>1, 'position'=>74), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>3, 'position'=>41), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>3, 'notnull'=>-1, 'position'=>80), - 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>3, 'position'=>711), - 'fk_user_approve' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserApproval', 'enabled'=>1, 'visible'=>3, 'position'=>721), - 'fk_user_approve2' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserApproval2', 'enabled'=>1, 'visible'=>3, 'position'=>726), - 'source' =>array('type'=>'smallint(6)', 'label'=>'Source', 'enabled'=>1, 'visible'=>3, 'notnull'=>1, 'position'=>100), - 'billed' =>array('type'=>'smallint(6)', 'label'=>'Billed', 'enabled'=>1, 'visible'=>1, 'position'=>710), - 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'AmountHT', 'enabled'=>1, 'visible'=>1, 'position'=>130, 'isameasure'=>1), - 'total_tva' =>array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'enabled'=>1, 'visible'=>1, 'position'=>135, 'isameasure'=>1), - 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'LT1', 'enabled'=>1, 'visible'=>3, 'position'=>140, 'isameasure'=>1), - 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LT2', 'enabled'=>1, 'visible'=>3, 'position'=>145, 'isameasure'=>1), - 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'AmountTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>150, 'isameasure'=>1), - 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>750, 'searchall'=>1), - 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>760, 'searchall'=>1), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPDF', 'enabled'=>1, 'visible'=>0, 'position'=>165), - 'fk_input_method' =>array('type'=>'integer', 'label'=>'OrderMode', 'enabled'=>1, 'visible'=>3, 'position'=>170), - 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>3, 'position'=>175), - 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>3, 'position'=>180), - 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>0, 'position'=>190), - 'fk_account' =>array('type'=>'integer', 'label'=>'BankAccount', 'enabled'=>'isModEnabled("banque")', 'visible'=>3, 'position'=>200), - 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>1, 'visible'=>3, 'position'=>205), - 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLocation', 'enabled'=>1, 'visible'=>3, 'position'=>210), - 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>0, 'position'=>215), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Currency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>220), - 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'CurrencyRate', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>225), - 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>230), - 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>235), - 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>240), - 'date_creation' =>array('type'=>'datetime', 'label'=>'Date creation', 'enabled'=>1, 'visible'=>-1, 'position'=>500), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'isModEnabled("societe")', 'visible'=>1, 'notnull'=>1, 'position'=>50), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>1000, 'index'=>1), - 'tms'=>array('type'=>'datetime', 'label'=>"DateModificationShort", 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>501), - 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>0, 'position'=>700), - 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>701), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>0, 'position'=>900), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 10), + 'ref' => array('type' => 'varchar(255)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'showoncombobox' => 1, 'position' => 25, 'searchall' => 1), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 35), + 'ref_supplier' => array('type' => 'varchar(255)', 'label' => 'RefOrderSupplierShort', 'enabled' => 1, 'visible' => 1, 'position' => 40, 'searchall' => 1), + 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Project', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 45), + 'date_valid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 710), + 'date_approve' => array('type' => 'datetime', 'label' => 'DateApprove', 'enabled' => 1, 'visible' => -1, 'position' => 720), + 'date_approve2' => array('type' => 'datetime', 'label' => 'DateApprove2', 'enabled' => 1, 'visible' => 3, 'position' => 725), + 'date_commande' => array('type' => 'date', 'label' => 'OrderDateShort', 'enabled' => 1, 'visible' => 1, 'position' => 70), + 'date_livraison' => array('type' => 'datetime', 'label' => 'DeliveryDate', 'enabled' => 'empty($conf->global->ORDER_DISABLE_DELIVERY_DATE)', 'visible' => 1, 'position' => 74), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => 3, 'position' => 41), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => 3, 'notnull' => -1, 'position' => 80), + 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => 3, 'position' => 711), + 'fk_user_approve' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserApproval', 'enabled' => 1, 'visible' => 3, 'position' => 721), + 'fk_user_approve2' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserApproval2', 'enabled' => 1, 'visible' => 3, 'position' => 726), + 'source' => array('type' => 'smallint(6)', 'label' => 'Source', 'enabled' => 1, 'visible' => 3, 'notnull' => 1, 'position' => 100), + 'billed' => array('type' => 'smallint(6)', 'label' => 'Billed', 'enabled' => 1, 'visible' => 1, 'position' => 710), + 'total_ht' => array('type' => 'double(24,8)', 'label' => 'AmountHT', 'enabled' => 1, 'visible' => 1, 'position' => 130, 'isameasure' => 1), + 'total_tva' => array('type' => 'double(24,8)', 'label' => 'AmountVAT', 'enabled' => 1, 'visible' => 1, 'position' => 135, 'isameasure' => 1), + 'localtax1' => array('type' => 'double(24,8)', 'label' => 'LT1', 'enabled' => 1, 'visible' => 3, 'position' => 140, 'isameasure' => 1), + 'localtax2' => array('type' => 'double(24,8)', 'label' => 'LT2', 'enabled' => 1, 'visible' => 3, 'position' => 145, 'isameasure' => 1), + 'total_ttc' => array('type' => 'double(24,8)', 'label' => 'AmountTTC', 'enabled' => 1, 'visible' => -1, 'position' => 150, 'isameasure' => 1), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 750, 'searchall' => 1), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 760, 'searchall' => 1), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'ModelPDF', 'enabled' => 1, 'visible' => 0, 'position' => 165), + 'fk_input_method' => array('type' => 'integer', 'label' => 'OrderMode', 'enabled' => 1, 'visible' => 3, 'position' => 170), + 'fk_cond_reglement' => array('type' => 'integer', 'label' => 'PaymentTerm', 'enabled' => 1, 'visible' => 3, 'position' => 175), + 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'PaymentMode', 'enabled' => 1, 'visible' => 3, 'position' => 180), + 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => 0, 'position' => 190), + 'fk_account' => array('type' => 'integer', 'label' => 'BankAccount', 'enabled' => 'isModEnabled("bank")', 'visible' => 3, 'position' => 200), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => 1, 'visible' => 3, 'position' => 205), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLocation', 'enabled' => 1, 'visible' => 3, 'position' => 210), + 'fk_multicurrency' => array('type' => 'integer', 'label' => 'Fk multicurrency', 'enabled' => 1, 'visible' => 0, 'position' => 215), + 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'Currency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 220), + 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'CurrencyRate', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 225), + 'multicurrency_total_ht' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountHT', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 230), + 'multicurrency_total_tva' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountVAT', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 235), + 'multicurrency_total_ttc' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountTTC', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 240), + 'date_creation' => array('type' => 'datetime', 'label' => 'Date creation', 'enabled' => 1, 'visible' => -1, 'position' => 500), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => 1, 'notnull' => 1, 'position' => 50), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 1000, 'index' => 1), + 'tms' => array('type' => 'datetime', 'label' => "DateModificationShort", 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 501), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => 0, 'position' => 700), + 'fk_statut' => array('type' => 'smallint(6)', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'position' => 701), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => 0, 'position' => 900), ); @@ -1091,7 +1091,7 @@ class CommandeFournisseur extends CommonOrder global $action; $hookmanager->initHooks(array($this->element . 'dao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; @@ -1881,7 +1881,7 @@ class CommandeFournisseur extends CommonOrder if (!$error) { // Hook of thirdparty module if (is_object($hookmanager)) { - $parameters = array('objFrom'=>$objFrom); + $parameters = array('objFrom' => $objFrom); $action = ''; $reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -2280,7 +2280,7 @@ class CommandeFournisseur extends CommonOrder // Method change if qty < 0 if (getDolGlobalString('SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN') && $qty < 0) { - $result = $mouv->livraison($user, $product, $entrepot, $qty*(-1), $price, $comment, $now, $eatby, $sellby, $batch, 0, $inventorycode); + $result = $mouv->livraison($user, $product, $entrepot, $qty * (-1), $price, $comment, $now, $eatby, $sellby, $batch, 0, $inventorycode); } else { $result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch, '', 0, $inventorycode); } @@ -3526,7 +3526,7 @@ class CommandeFournisseur extends CommonOrder $qtywished = array(); $supplierorderdispatch = new CommandeFournisseurDispatch($this->db); - $filter = array('t.fk_commande'=>$this->id); + $filter = array('t.fk_commande' => $this->id); if (getDolGlobalString('SUPPLIER_ORDER_USE_DISPATCH_STATUS')) { $filter['t.status'] = 1; // Restrict to lines with status validated } @@ -3714,7 +3714,7 @@ class CommandeFournisseur extends CommonOrder $return .= ''; } if (property_exists($this, 'socid') || property_exists($this, 'total_tva')) { - $return .='
'.$this->socid.''; + $return .= '
'.$this->socid.''; } if (property_exists($this, 'billed')) { $return .= '
'.$langs->trans("Billed").' : '.yn($this->billed).''; diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index ccb9f6749a4..8a85a32e37a 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -192,52 +192,52 @@ class FactureFournisseurRec extends CommonInvoice * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'titre' =>array('type'=>'varchar(100)', 'label'=>'Titre', 'enabled'=>1, 'showoncombobox' => 1, 'visible'=>-1, 'position'=>15), - 'ref_supplier' =>array('type'=>'varchar(180)', 'label'=>'RefSupplier', 'enabled'=>1, 'showoncombobox' => 1, 'visible'=>-1, 'position'=>20), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>25, 'index'=>1), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'isModEnabled("societe")', 'visible'=>-1, 'notnull'=>1, 'position'=>30), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>35), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>40), - 'suspended' =>array('type'=>'integer', 'label'=>'Suspended', 'enabled'=>1, 'visible'=>-1, 'position'=>225), - 'libelle' =>array('type'=>'varchar(100)', 'label'=>'Libelle', 'enabled'=>1, 'showoncombobox' => 0, 'visible'=>-1, 'position'=>15), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'titre' => array('type' => 'varchar(100)', 'label' => 'Titre', 'enabled' => 1, 'showoncombobox' => 1, 'visible' => -1, 'position' => 15), + 'ref_supplier' => array('type' => 'varchar(180)', 'label' => 'RefSupplier', 'enabled' => 1, 'showoncombobox' => 1, 'visible' => -1, 'position' => 20), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 25, 'index' => 1), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'notnull' => 1, 'position' => 30), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 35), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 40), + 'suspended' => array('type' => 'integer', 'label' => 'Suspended', 'enabled' => 1, 'visible' => -1, 'position' => 225), + 'libelle' => array('type' => 'varchar(100)', 'label' => 'Libelle', 'enabled' => 1, 'showoncombobox' => 0, 'visible' => -1, 'position' => 15), - 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'Localtax1', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'isameasure'=>1), - 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'Localtax2', 'enabled'=>1, 'visible'=>-1, 'position'=>65, 'isameasure'=>1), - 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'Total', 'enabled'=>1, 'visible'=>-1, 'position'=>70, 'isameasure'=>1), - 'total_tva' =>array('type'=>'double(24,8)', 'label'=>'Tva', 'enabled'=>1, 'visible'=>-1, 'position'=>55, 'isameasure'=>1), - 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>75, 'isameasure'=>1), + 'localtax1' => array('type' => 'double(24,8)', 'label' => 'Localtax1', 'enabled' => 1, 'visible' => -1, 'position' => 60, 'isameasure' => 1), + 'localtax2' => array('type' => 'double(24,8)', 'label' => 'Localtax2', 'enabled' => 1, 'visible' => -1, 'position' => 65, 'isameasure' => 1), + 'total_ht' => array('type' => 'double(24,8)', 'label' => 'Total', 'enabled' => 1, 'visible' => -1, 'position' => 70, 'isameasure' => 1), + 'total_tva' => array('type' => 'double(24,8)', 'label' => 'Tva', 'enabled' => 1, 'visible' => -1, 'position' => 55, 'isameasure' => 1), + 'total_ttc' => array('type' => 'double(24,8)', 'label' => 'Total ttc', 'enabled' => 1, 'visible' => -1, 'position' => 75, 'isameasure' => 1), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>210), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>85), - 'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>'isModEnabled("banque")', 'visible'=>-1, 'position'=>175), - 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Fk cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'Fk mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>95), - 'date_lim_reglement' =>array('type'=>'date', 'label'=>'Date lim reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>100), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'position' => 80), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 210), + 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label' => 'Fk projet', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 85), + 'fk_account' => array('type' => 'integer', 'label' => 'Fk account', 'enabled' => 'isModEnabled("bank")', 'visible' => -1, 'position' => 175), + 'fk_cond_reglement' => array('type' => 'integer', 'label' => 'Fk cond reglement', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'Fk mode reglement', 'enabled' => 1, 'visible' => -1, 'position' => 95), + 'date_lim_reglement' => array('type' => 'date', 'label' => 'Date lim reglement', 'enabled' => 1, 'visible' => -1, 'position' => 100), - 'note_private' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>105), - 'note_public' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), - 'modelpdf' =>array('type'=>'varchar(255)', 'label'=>'Modelpdf', 'enabled'=>1, 'visible'=>-1, 'position'=>115), + 'note_private' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 105), + 'note_public' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 110), + 'modelpdf' => array('type' => 'varchar(255)', 'label' => 'Modelpdf', 'enabled' => 1, 'visible' => -1, 'position' => 115), - 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>-1, 'position'=>180), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Multicurrency code', 'enabled'=>1, 'visible'=>-1, 'position'=>185), - 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency tx', 'enabled'=>1, 'visible'=>-1, 'position'=>190, 'isameasure'=>1), - 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ht', 'enabled'=>1, 'visible'=>-1, 'position'=>195, 'isameasure'=>1), - 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total tva', 'enabled'=>1, 'visible'=>-1, 'position'=>200, 'isameasure'=>1), - 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>205, 'isameasure'=>1), + 'fk_multicurrency' => array('type' => 'integer', 'label' => 'Fk multicurrency', 'enabled' => 1, 'visible' => -1, 'position' => 180), + 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'Multicurrency code', 'enabled' => 1, 'visible' => -1, 'position' => 185), + 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'Multicurrency tx', 'enabled' => 1, 'visible' => -1, 'position' => 190, 'isameasure' => 1), + 'multicurrency_total_ht' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total ht', 'enabled' => 1, 'visible' => -1, 'position' => 195, 'isameasure' => 1), + 'multicurrency_total_tva' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total tva', 'enabled' => 1, 'visible' => -1, 'position' => 200, 'isameasure' => 1), + 'multicurrency_total_ttc' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total ttc', 'enabled' => 1, 'visible' => -1, 'position' => 205, 'isameasure' => 1), - 'usenewprice' =>array('type'=>'integer', 'label'=>'UseNewPrice', 'enabled'=>1, 'visible'=>0, 'position'=>155), - 'frequency' =>array('type'=>'integer', 'label'=>'Frequency', 'enabled'=>1, 'visible'=>-1, 'position'=>150), - 'unit_frequency' =>array('type'=>'varchar(2)', 'label'=>'Unit frequency', 'enabled'=>1, 'visible'=>-1, 'position'=>125), + 'usenewprice' => array('type' => 'integer', 'label' => 'UseNewPrice', 'enabled' => 1, 'visible' => 0, 'position' => 155), + 'frequency' => array('type' => 'integer', 'label' => 'Frequency', 'enabled' => 1, 'visible' => -1, 'position' => 150), + 'unit_frequency' => array('type' => 'varchar(2)', 'label' => 'Unit frequency', 'enabled' => 1, 'visible' => -1, 'position' => 125), - 'date_when' =>array('type'=>'datetime', 'label'=>'Date when', 'enabled'=>1, 'visible'=>-1, 'position'=>130), - 'date_last_gen' =>array('type'=>'datetime', 'label'=>'Date last gen', 'enabled'=>1, 'visible'=>-1, 'position'=>135), - 'nb_gen_done' =>array('type'=>'integer', 'label'=>'Nb gen done', 'enabled'=>1, 'visible'=>-1, 'position'=>140), - 'nb_gen_max' =>array('type'=>'integer', 'label'=>'Nb gen max', 'enabled'=>1, 'visible'=>-1, 'position'=>145), - 'revenuestamp' =>array('type'=>'double(24,8)', 'label'=>'RevenueStamp', 'enabled'=>1, 'visible'=>-1, 'position'=>160, 'isameasure'=>1), - 'auto_validate' =>array('type'=>'integer', 'label'=>'Auto validate', 'enabled'=>1, 'visible'=>-1, 'position'=>165), - 'generate_pdf' =>array('type'=>'integer', 'label'=>'Generate pdf', 'enabled'=>1, 'visible'=>-1, 'position'=>170), + 'date_when' => array('type' => 'datetime', 'label' => 'Date when', 'enabled' => 1, 'visible' => -1, 'position' => 130), + 'date_last_gen' => array('type' => 'datetime', 'label' => 'Date last gen', 'enabled' => 1, 'visible' => -1, 'position' => 135), + 'nb_gen_done' => array('type' => 'integer', 'label' => 'Nb gen done', 'enabled' => 1, 'visible' => -1, 'position' => 140), + 'nb_gen_max' => array('type' => 'integer', 'label' => 'Nb gen max', 'enabled' => 1, 'visible' => -1, 'position' => 145), + 'revenuestamp' => array('type' => 'double(24,8)', 'label' => 'RevenueStamp', 'enabled' => 1, 'visible' => -1, 'position' => 160, 'isameasure' => 1), + 'auto_validate' => array('type' => 'integer', 'label' => 'Auto validate', 'enabled' => 1, 'visible' => -1, 'position' => 165), + 'generate_pdf' => array('type' => 'integer', 'label' => 'Generate pdf', 'enabled' => 1, 'visible' => -1, 'position' => 170), ); // END MODULEBUILDER PROPERTIES @@ -1312,7 +1312,7 @@ class FactureFournisseurRec extends CommonInvoice } $saventity = $conf->entity; - $laststep="None"; + $laststep = "None"; while ($i < $num) { // Loop on each template invoice. If $num = 0, test is false at first pass. $line = $this->db->fetch_object($resql); @@ -1323,7 +1323,7 @@ class FactureFournisseurRec extends CommonInvoice $new_fac_fourn = null; $facturerec = new FactureFournisseurRec($this->db); - $laststep="Fetch {$line->rowid}"; + $laststep = "Fetch {$line->rowid}"; $facturerec->fetch($line->rowid); if ($facturerec->id > 0) { @@ -1349,7 +1349,7 @@ class FactureFournisseurRec extends CommonInvoice $new_fac_fourn->libelle = $facturerec->label; // deprecated $invoiceidgenerated = $new_fac_fourn->create($user); - $laststep="Create invoiceidgenerated $invoiceidgenerated"; + $laststep = "Create invoiceidgenerated $invoiceidgenerated"; if ($invoiceidgenerated <= 0) { $this->errors = $new_fac_fourn->errors; $this->error = $new_fac_fourn->error; @@ -1387,7 +1387,7 @@ class FactureFournisseurRec extends CommonInvoice if (!$error && $invoiceidgenerated >= 0) { $facturerec->nb_gen_done++; $facturerec->date_last_gen = dol_now(); - $facturerec->date_when= $facturerec->getNextDate(); + $facturerec->date_when = $facturerec->getNextDate(); $facturerec->update($user); $this->db->commit('createRecurringInvoices Process invoice template id=' .$facturerec->id. ', title=' .$facturerec->title); dol_syslog('createRecurringInvoices Process invoice template ' .$facturerec->title. ' is finished with a success generation'); @@ -1488,7 +1488,7 @@ class FactureFournisseurRec extends CommonInvoice $result .= $linkend; global $action; $hookmanager->initHooks(array($this->element . 'dao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index cab15d4f618..887b5ab425f 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -278,7 +278,7 @@ class FactureFournisseur extends CommonInvoice 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 135), 'fk_facture_source' => array('type' => 'integer', 'label' => 'Fk facture source', 'enabled' => 1, 'visible' => -1, 'position' => 140), 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label' => 'Project', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 145), - 'fk_account' => array('type' => 'integer', 'label' => 'Account', 'enabled' => 'isModEnabled("banque")', 'visible' => -1, 'position' => 150), + 'fk_account' => array('type' => 'integer', 'label' => 'Account', 'enabled' => 'isModEnabled("bank")', 'visible' => -1, 'position' => 150), 'fk_cond_reglement' => array('type' => 'integer', 'label' => 'PaymentTerm', 'enabled' => 1, 'visible' => -1, 'position' => 155), 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'PaymentMode', 'enabled' => 1, 'visible' => -1, 'position' => 160), 'date_lim_reglement' => array('type' => 'date', 'label' => 'DateLimReglement', 'enabled' => 1, 'visible' => -1, 'position' => 165), diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index f649f607280..ecd169d9009 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -249,7 +249,7 @@ for ($i = 1; $i <= 4; $i++) { control->tpl['sales_representatives']; ?> - + trans("LinkedToDolibarrMember"); ?> control->tpl['linked_member']; ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index 3d5d98197f2..e684b5c502d 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -176,7 +176,7 @@ if ($this->control->tpl['action_delete']) { control->tpl['sales_representatives']; ?> - + trans("LinkedToDolibarrMember"); ?> control->tpl['linked_member']; ?> diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 8390295fed6..3405b222938 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -190,90 +190,90 @@ class Societe extends CommonObject * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'), - 'parent' =>array('type'=>'integer', 'label'=>'Parent', 'enabled'=>1, 'visible'=>-1, 'position'=>20), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>30), - 'nom' =>array('type'=>'varchar(128)', 'label'=>'Nom', 'enabled'=>1, 'visible'=>-1, 'position'=>35, 'showoncombobox'=>1), - 'name_alias' =>array('type'=>'varchar(128)', 'label'=>'Name alias', 'enabled'=>1, 'visible'=>-1, 'position'=>36, 'showoncombobox'=>2), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>40, 'index'=>1), - 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>45), - 'code_client' =>array('type'=>'varchar(24)', 'label'=>'CustomerCode', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'code_fournisseur' =>array('type'=>'varchar(24)', 'label'=>'SupplierCode', 'enabled'=>1, 'visible'=>-1, 'position'=>60), - 'code_compta' =>array('type'=>'varchar(24)', 'label'=>'CustomerAccountancyCode', 'enabled'=>1, 'visible'=>-1, 'position'=>65), - 'code_compta_fournisseur' =>array('type'=>'varchar(24)', 'label'=>'SupplierAccountancyCode', 'enabled'=>1, 'visible'=>-1, 'position'=>70), - 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>75), - 'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>85), - 'fk_departement' =>array('type'=>'integer', 'label'=>'State', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'fk_pays' =>array('type'=>'integer:Ccountry:core/class/ccountry.class.php', 'label'=>'Country', 'enabled'=>1, 'visible'=>-1, 'position'=>95), - 'phone' =>array('type'=>'varchar(20)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>-1, 'position'=>100), - 'phone_mobile' =>array('type'=>'varchar(20)', 'label'=>'PhoneMobile', 'enabled'=>1, 'visible'=>-1, 'position'=>102), - 'fax' =>array('type'=>'varchar(20)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>-1, 'position'=>105), - 'url' =>array('type'=>'varchar(255)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>110), - 'email' =>array('type'=>'varchar(128)', 'label'=>'Email', 'enabled'=>1, 'visible'=>-1, 'position'=>115), - 'socialnetworks' =>array('type'=>'text', 'label'=>'Socialnetworks', 'enabled'=>1, 'visible'=>-1, 'position'=>120), - 'fk_effectif' =>array('type'=>'integer', 'label'=>'Workforce', 'enabled'=>1, 'visible'=>-1, 'position'=>170), - 'fk_typent' =>array('type'=>'integer', 'label'=>'TypeOfCompany', 'enabled'=>1, 'visible'=>-1, 'position'=>175, 'csslist'=>'minwidth200'), - 'fk_forme_juridique' =>array('type'=>'integer', 'label'=>'JuridicalStatus', 'enabled'=>1, 'visible'=>-1, 'position'=>180), - 'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'Currency', 'enabled'=>1, 'visible'=>-1, 'position'=>185), - 'siren' =>array('type'=>'varchar(128)', 'label'=>'Idprof1', 'enabled'=>1, 'visible'=>-1, 'position'=>190), - 'siret' =>array('type'=>'varchar(128)', 'label'=>'Idprof2', 'enabled'=>1, 'visible'=>-1, 'position'=>195), - 'ape' =>array('type'=>'varchar(128)', 'label'=>'Idprof3', 'enabled'=>1, 'visible'=>-1, 'position'=>200), - 'idprof4' =>array('type'=>'varchar(128)', 'label'=>'Idprof4', 'enabled'=>1, 'visible'=>-1, 'position'=>205), - 'idprof5' =>array('type'=>'varchar(128)', 'label'=>'Idprof5', 'enabled'=>1, 'visible'=>-1, 'position'=>206), - 'idprof6' =>array('type'=>'varchar(128)', 'label'=>'Idprof6', 'enabled'=>1, 'visible'=>-1, 'position'=>207), - 'tva_intra' =>array('type'=>'varchar(20)', 'label'=>'Tva intra', 'enabled'=>1, 'visible'=>-1, 'position'=>210), - 'capital' =>array('type'=>'double(24,8)', 'label'=>'Capital', 'enabled'=>1, 'visible'=>-1, 'position'=>215), - 'fk_stcomm' =>array('type'=>'integer', 'label'=>'CommercialStatus', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>220), - 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>225), - 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>230), - 'prefix_comm' =>array('type'=>'varchar(5)', 'label'=>'Prefix comm', 'enabled'=>"getDolGlobalInt('SOCIETE_USEPREFIX')", 'visible'=>-1, 'position'=>235), - 'client' =>array('type'=>'tinyint(4)', 'label'=>'Client', 'enabled'=>1, 'visible'=>-1, 'position'=>240), - 'fournisseur' =>array('type'=>'tinyint(4)', 'label'=>'Fournisseur', 'enabled'=>1, 'visible'=>-1, 'position'=>245), - 'supplier_account' =>array('type'=>'varchar(32)', 'label'=>'Supplier account', 'enabled'=>1, 'visible'=>-1, 'position'=>250), - 'fk_prospectlevel' =>array('type'=>'varchar(12)', 'label'=>'ProspectLevel', 'enabled'=>1, 'visible'=>-1, 'position'=>255), - 'customer_bad' =>array('type'=>'tinyint(4)', 'label'=>'Customer bad', 'enabled'=>1, 'visible'=>-1, 'position'=>260), - 'customer_rate' =>array('type'=>'double', 'label'=>'Customer rate', 'enabled'=>1, 'visible'=>-1, 'position'=>265), - 'supplier_rate' =>array('type'=>'double', 'label'=>'Supplier rate', 'enabled'=>1, 'visible'=>-1, 'position'=>270), - 'fk_user_creat' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>275), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>280), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), + 'parent' => array('type' => 'integer', 'label' => 'Parent', 'enabled' => 1, 'visible' => -1, 'position' => 20), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 25), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 30), + 'nom' => array('type' => 'varchar(128)', 'label' => 'Nom', 'enabled' => 1, 'visible' => -1, 'position' => 35, 'showoncombobox' => 1), + 'name_alias' => array('type' => 'varchar(128)', 'label' => 'Name alias', 'enabled' => 1, 'visible' => -1, 'position' => 36, 'showoncombobox' => 2), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 40, 'index' => 1), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 45), + 'code_client' => array('type' => 'varchar(24)', 'label' => 'CustomerCode', 'enabled' => 1, 'visible' => -1, 'position' => 55), + 'code_fournisseur' => array('type' => 'varchar(24)', 'label' => 'SupplierCode', 'enabled' => 1, 'visible' => -1, 'position' => 60), + 'code_compta' => array('type' => 'varchar(24)', 'label' => 'CustomerAccountancyCode', 'enabled' => 1, 'visible' => -1, 'position' => 65), + 'code_compta_fournisseur' => array('type' => 'varchar(24)', 'label' => 'SupplierAccountancyCode', 'enabled' => 1, 'visible' => -1, 'position' => 70), + 'address' => array('type' => 'varchar(255)', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 75), + 'zip' => array('type' => 'varchar(25)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80), + 'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -1, 'position' => 85), + 'fk_departement' => array('type' => 'integer', 'label' => 'State', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'fk_pays' => array('type' => 'integer:Ccountry:core/class/ccountry.class.php', 'label' => 'Country', 'enabled' => 1, 'visible' => -1, 'position' => 95), + 'phone' => array('type' => 'varchar(20)', 'label' => 'Phone', 'enabled' => 1, 'visible' => -1, 'position' => 100), + 'phone_mobile' => array('type' => 'varchar(20)', 'label' => 'PhoneMobile', 'enabled' => 1, 'visible' => -1, 'position' => 102), + 'fax' => array('type' => 'varchar(20)', 'label' => 'Fax', 'enabled' => 1, 'visible' => -1, 'position' => 105), + 'url' => array('type' => 'varchar(255)', 'label' => 'Url', 'enabled' => 1, 'visible' => -1, 'position' => 110), + 'email' => array('type' => 'varchar(128)', 'label' => 'Email', 'enabled' => 1, 'visible' => -1, 'position' => 115), + 'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => -1, 'position' => 120), + 'fk_effectif' => array('type' => 'integer', 'label' => 'Workforce', 'enabled' => 1, 'visible' => -1, 'position' => 170), + 'fk_typent' => array('type' => 'integer', 'label' => 'TypeOfCompany', 'enabled' => 1, 'visible' => -1, 'position' => 175, 'csslist' => 'minwidth200'), + 'fk_forme_juridique' => array('type' => 'integer', 'label' => 'JuridicalStatus', 'enabled' => 1, 'visible' => -1, 'position' => 180), + 'fk_currency' => array('type' => 'varchar(3)', 'label' => 'Currency', 'enabled' => 1, 'visible' => -1, 'position' => 185), + 'siren' => array('type' => 'varchar(128)', 'label' => 'Idprof1', 'enabled' => 1, 'visible' => -1, 'position' => 190), + 'siret' => array('type' => 'varchar(128)', 'label' => 'Idprof2', 'enabled' => 1, 'visible' => -1, 'position' => 195), + 'ape' => array('type' => 'varchar(128)', 'label' => 'Idprof3', 'enabled' => 1, 'visible' => -1, 'position' => 200), + 'idprof4' => array('type' => 'varchar(128)', 'label' => 'Idprof4', 'enabled' => 1, 'visible' => -1, 'position' => 205), + 'idprof5' => array('type' => 'varchar(128)', 'label' => 'Idprof5', 'enabled' => 1, 'visible' => -1, 'position' => 206), + 'idprof6' => array('type' => 'varchar(128)', 'label' => 'Idprof6', 'enabled' => 1, 'visible' => -1, 'position' => 207), + 'tva_intra' => array('type' => 'varchar(20)', 'label' => 'Tva intra', 'enabled' => 1, 'visible' => -1, 'position' => 210), + 'capital' => array('type' => 'double(24,8)', 'label' => 'Capital', 'enabled' => 1, 'visible' => -1, 'position' => 215), + 'fk_stcomm' => array('type' => 'integer', 'label' => 'CommercialStatus', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 220), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 225), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 230), + 'prefix_comm' => array('type' => 'varchar(5)', 'label' => 'Prefix comm', 'enabled' => "getDolGlobalInt('SOCIETE_USEPREFIX')", 'visible' => -1, 'position' => 235), + 'client' => array('type' => 'tinyint(4)', 'label' => 'Client', 'enabled' => 1, 'visible' => -1, 'position' => 240), + 'fournisseur' => array('type' => 'tinyint(4)', 'label' => 'Fournisseur', 'enabled' => 1, 'visible' => -1, 'position' => 245), + 'supplier_account' => array('type' => 'varchar(32)', 'label' => 'Supplier account', 'enabled' => 1, 'visible' => -1, 'position' => 250), + 'fk_prospectlevel' => array('type' => 'varchar(12)', 'label' => 'ProspectLevel', 'enabled' => 1, 'visible' => -1, 'position' => 255), + 'customer_bad' => array('type' => 'tinyint(4)', 'label' => 'Customer bad', 'enabled' => 1, 'visible' => -1, 'position' => 260), + 'customer_rate' => array('type' => 'double', 'label' => 'Customer rate', 'enabled' => 1, 'visible' => -1, 'position' => 265), + 'supplier_rate' => array('type' => 'double', 'label' => 'Supplier rate', 'enabled' => 1, 'visible' => -1, 'position' => 270), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'position' => 275), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 280), //'remise_client' =>array('type'=>'double', 'label'=>'CustomerDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>285, 'isameasure'=>1), //'remise_supplier' =>array('type'=>'double', 'label'=>'SupplierDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>290, 'isameasure'=>1), - 'mode_reglement' =>array('type'=>'tinyint(4)', 'label'=>'Mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>295), - 'cond_reglement' =>array('type'=>'tinyint(4)', 'label'=>'Cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>300), - 'deposit_percent' =>array('type'=>'varchar(63)', 'label'=>'DepositPercent', 'enabled'=>1, 'visible'=>-1, 'position'=>301), - 'mode_reglement_supplier' =>array('type'=>'integer', 'label'=>'Mode reglement supplier', 'enabled'=>1, 'visible'=>-1, 'position'=>305), - 'cond_reglement_supplier' =>array('type'=>'integer', 'label'=>'Cond reglement supplier', 'enabled'=>1, 'visible'=>-1, 'position'=>308), - 'outstanding_limit' =>array('type'=>'double(24,8)', 'label'=>'OutstandingBill', 'enabled'=>1, 'visible'=>-1, 'position'=>310, 'isameasure'=>1), - 'order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Order min amount', 'enabled'=>'isModEnabled("commande") && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>315, 'isameasure'=>1), - 'supplier_order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Supplier order min amount', 'enabled'=>'isModEnabled("commande") && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>320, 'isameasure'=>1), - 'fk_shipping_method' =>array('type'=>'integer', 'label'=>'Fk shipping method', 'enabled'=>1, 'visible'=>-1, 'position'=>330), - 'tva_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Tva assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>335), - 'localtax1_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Localtax1 assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>340), - 'localtax1_value' =>array('type'=>'double(6,3)', 'label'=>'Localtax1 value', 'enabled'=>1, 'visible'=>-1, 'position'=>345), - 'localtax2_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Localtax2 assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>350), - 'localtax2_value' =>array('type'=>'double(6,3)', 'label'=>'Localtax2 value', 'enabled'=>1, 'visible'=>-1, 'position'=>355), - 'vat_reverse_charge' =>array('type'=>'tinyint(4)', 'label'=>'Vat reverse charge', 'enabled'=>1, 'visible'=>-1, 'position'=>335), - 'barcode' =>array('type'=>'varchar(255)', 'label'=>'Barcode', 'enabled'=>1, 'visible'=>-1, 'position'=>360), - 'price_level' =>array('type'=>'integer', 'label'=>'Price level', 'enabled'=>'$conf->global->PRODUIT_MULTIPRICES || getDolGlobalString("PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES")', 'visible'=>-1, 'position'=>365), - 'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>-1, 'position'=>370), - 'canvas' =>array('type'=>'varchar(32)', 'label'=>'Canvas', 'enabled'=>1, 'visible'=>-1, 'position'=>375), - 'fk_barcode_type' =>array('type'=>'integer', 'label'=>'Fk barcode type', 'enabled'=>1, 'visible'=>-1, 'position'=>405), - 'webservices_url' =>array('type'=>'varchar(255)', 'label'=>'Webservices url', 'enabled'=>1, 'visible'=>-1, 'position'=>410), - 'webservices_key' =>array('type'=>'varchar(128)', 'label'=>'Webservices key', 'enabled'=>1, 'visible'=>-1, 'position'=>415), - 'fk_incoterms' =>array('type'=>'integer', 'label'=>'Fk incoterms', 'enabled'=>1, 'visible'=>-1, 'position'=>425), - 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'Location incoterms', 'enabled'=>1, 'visible'=>-1, 'position'=>430), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>435), - 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270), - 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>-1, 'position'=>440), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Multicurrency code', 'enabled'=>1, 'visible'=>-1, 'position'=>445), - 'fk_account' =>array('type'=>'integer', 'label'=>'PaymentBankAccount', 'enabled'=>1, 'visible'=>-1, 'position'=>450), - 'fk_warehouse' =>array('type'=>'integer', 'label'=>'Warehouse', 'enabled'=>1, 'visible'=>-1, 'position'=>455), - 'logo' =>array('type'=>'varchar(255)', 'label'=>'Logo', 'enabled'=>1, 'visible'=>-1, 'position'=>400), - 'logo_squarred' =>array('type'=>'varchar(255)', 'label'=>'Logo squarred', 'enabled'=>1, 'visible'=>-1, 'position'=>401), - 'status' =>array('type'=>'tinyint(4)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000), + 'mode_reglement' => array('type' => 'tinyint(4)', 'label' => 'Mode reglement', 'enabled' => 1, 'visible' => -1, 'position' => 295), + 'cond_reglement' => array('type' => 'tinyint(4)', 'label' => 'Cond reglement', 'enabled' => 1, 'visible' => -1, 'position' => 300), + 'deposit_percent' => array('type' => 'varchar(63)', 'label' => 'DepositPercent', 'enabled' => 1, 'visible' => -1, 'position' => 301), + 'mode_reglement_supplier' => array('type' => 'integer', 'label' => 'Mode reglement supplier', 'enabled' => 1, 'visible' => -1, 'position' => 305), + 'cond_reglement_supplier' => array('type' => 'integer', 'label' => 'Cond reglement supplier', 'enabled' => 1, 'visible' => -1, 'position' => 308), + 'outstanding_limit' => array('type' => 'double(24,8)', 'label' => 'OutstandingBill', 'enabled' => 1, 'visible' => -1, 'position' => 310, 'isameasure' => 1), + 'order_min_amount' => array('type' => 'double(24,8)', 'label' => 'Order min amount', 'enabled' => 'isModEnabled("order") && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible' => -1, 'position' => 315, 'isameasure' => 1), + 'supplier_order_min_amount' => array('type' => 'double(24,8)', 'label' => 'Supplier order min amount', 'enabled' => 'isModEnabled("order") && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible' => -1, 'position' => 320, 'isameasure' => 1), + 'fk_shipping_method' => array('type' => 'integer', 'label' => 'Fk shipping method', 'enabled' => 1, 'visible' => -1, 'position' => 330), + 'tva_assuj' => array('type' => 'tinyint(4)', 'label' => 'Tva assuj', 'enabled' => 1, 'visible' => -1, 'position' => 335), + 'localtax1_assuj' => array('type' => 'tinyint(4)', 'label' => 'Localtax1 assuj', 'enabled' => 1, 'visible' => -1, 'position' => 340), + 'localtax1_value' => array('type' => 'double(6,3)', 'label' => 'Localtax1 value', 'enabled' => 1, 'visible' => -1, 'position' => 345), + 'localtax2_assuj' => array('type' => 'tinyint(4)', 'label' => 'Localtax2 assuj', 'enabled' => 1, 'visible' => -1, 'position' => 350), + 'localtax2_value' => array('type' => 'double(6,3)', 'label' => 'Localtax2 value', 'enabled' => 1, 'visible' => -1, 'position' => 355), + 'vat_reverse_charge' => array('type' => 'tinyint(4)', 'label' => 'Vat reverse charge', 'enabled' => 1, 'visible' => -1, 'position' => 335), + 'barcode' => array('type' => 'varchar(255)', 'label' => 'Barcode', 'enabled' => 1, 'visible' => -1, 'position' => 360), + 'price_level' => array('type' => 'integer', 'label' => 'Price level', 'enabled' => '$conf->global->PRODUIT_MULTIPRICES || getDolGlobalString("PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES")', 'visible' => -1, 'position' => 365), + 'default_lang' => array('type' => 'varchar(6)', 'label' => 'Default lang', 'enabled' => 1, 'visible' => -1, 'position' => 370), + 'canvas' => array('type' => 'varchar(32)', 'label' => 'Canvas', 'enabled' => 1, 'visible' => -1, 'position' => 375), + 'fk_barcode_type' => array('type' => 'integer', 'label' => 'Fk barcode type', 'enabled' => 1, 'visible' => -1, 'position' => 405), + 'webservices_url' => array('type' => 'varchar(255)', 'label' => 'Webservices url', 'enabled' => 1, 'visible' => -1, 'position' => 410), + 'webservices_key' => array('type' => 'varchar(128)', 'label' => 'Webservices key', 'enabled' => 1, 'visible' => -1, 'position' => 415), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'Fk incoterms', 'enabled' => 1, 'visible' => -1, 'position' => 425), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'Location incoterms', 'enabled' => 1, 'visible' => -1, 'position' => 430), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 435), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => -1, 'position' => 270), + 'fk_multicurrency' => array('type' => 'integer', 'label' => 'Fk multicurrency', 'enabled' => 1, 'visible' => -1, 'position' => 440), + 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'Multicurrency code', 'enabled' => 1, 'visible' => -1, 'position' => 445), + 'fk_account' => array('type' => 'integer', 'label' => 'PaymentBankAccount', 'enabled' => 1, 'visible' => -1, 'position' => 450), + 'fk_warehouse' => array('type' => 'integer', 'label' => 'Warehouse', 'enabled' => 1, 'visible' => -1, 'position' => 455), + 'logo' => array('type' => 'varchar(255)', 'label' => 'Logo', 'enabled' => 1, 'visible' => -1, 'position' => 400), + 'logo_squarred' => array('type' => 'varchar(255)', 'label' => 'Logo squarred', 'enabled' => 1, 'visible' => -1, 'position' => 401), + 'status' => array('type' => 'tinyint(4)', 'label' => 'Status', 'enabled' => 1, 'visible' => -1, 'position' => 500), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 1000), ); /** @@ -2681,7 +2681,7 @@ class Societe extends CommonObject { // phpcs:enable $error = 0; - $this->context = array('commercial_modified'=>$commid); + $this->context = array('commercial_modified' => $commid); $result = $this->call_trigger('COMPANY_UNLINK_SALE_REPRESENTATIVE', $user); if ($result < 0) { @@ -3004,13 +3004,13 @@ class Societe extends CommonObject global $action; $hookmanager->initHooks(array('thirdpartydao')); $parameters = array( - 'id'=>$this->id, + 'id' => $this->id, 'getnomurl' => &$result, - 'withpicto '=> $withpicto, - 'option'=> $option, - 'maxlen'=> $maxlen, - 'notooltip'=> $notooltip, - 'save_lastsearch_value'=> $save_lastsearch_value + 'withpicto ' => $withpicto, + 'option' => $option, + 'maxlen' => $maxlen, + 'notooltip' => $notooltip, + 'save_lastsearch_value' => $save_lastsearch_value ); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { @@ -3622,7 +3622,7 @@ class Societe extends CommonObject global $conf; if (getDolGlobalString('SOCIETE_CODECOMPTA_ADDON')) { - $module=getDolGlobalString('SOCIETE_CODECOMPTA_ADDON'); + $module = getDolGlobalString('SOCIETE_CODECOMPTA_ADDON'); $res = false; $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); foreach ($dirsociete as $dirroot) { @@ -3939,7 +3939,7 @@ class Societe extends CommonObject $action = ''; $hookmanager->initHooks(array('idprofurl')); - $parameters = array('idprof'=>$idprof, 'company'=>$thirdparty); + $parameters = array('idprof' => $idprof, 'company' => $thirdparty); $reshook = $hookmanager->executeHooks('getIdProfUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { if (getDolGlobalString('MAIN_DISABLEPROFIDRULES')) { @@ -4442,7 +4442,7 @@ class Societe extends CommonObject $this->forme_juridique_code = getDolGlobalString('MAIN_INFO_SOCIETE_FORME_JURIDIQUE'); $this->email = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL'); $this->default_lang = getDolGlobalString('MAIN_LANG_DEFAULT', 'auto'); - $this->logo =getDolGlobalString('MAIN_INFO_SOCIETE_LOGO'); + $this->logo = getDolGlobalString('MAIN_INFO_SOCIETE_LOGO'); $this->logo_small = getDolGlobalString('MAIN_INFO_SOCIETE_LOGO_SMALL'); $this->logo_mini = getDolGlobalString('MAIN_INFO_SOCIETE_LOGO_MINI'); $this->logo_squarred = getDolGlobalString('MAIN_INFO_SOCIETE_LOGO_SQUARRED'); @@ -4743,7 +4743,7 @@ class Societe extends CommonObject $outstandingOpened += $obj->total_ttc; } } - return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax, 'refs'=>$arrayofref); // 'opened' is 'incl taxes' + return array('opened' => $outstandingOpened, 'total_ht' => $outstandingTotal, 'total_ttc' => $outstandingTotalIncTax, 'refs' => $arrayofref); // 'opened' is 'incl taxes' } else { return array(); } @@ -4786,7 +4786,7 @@ class Societe extends CommonObject $outstandingOpened += $obj->total_ttc; } } - return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax, 'refs'=>$arrayofref); // 'opened' is 'incl taxes' + return array('opened' => $outstandingOpened, 'total_ht' => $outstandingTotal, 'total_ttc' => $outstandingTotalIncTax, 'refs' => $arrayofref); // 'opened' is 'incl taxes' } else { return array(); } @@ -4845,7 +4845,7 @@ class Societe extends CommonObject if ($obj->status != $tmpobject::STATUS_DRAFT // Not a draft && !($obj->status == $tmpobject::STATUS_ABANDONED && $obj->close_code == 'replaced') // Not a replaced invoice - ) { + ) { $outstandingTotal += $obj->total_ht; $outstandingTotalIncTax += $obj->total_ttc; } @@ -4877,7 +4877,7 @@ class Societe extends CommonObject $arrayofrefopened[$obj->rowid] = $obj->ref; } } - return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax, 'refs'=>$arrayofref, 'refsopened'=>$arrayofrefopened); // 'opened' is 'incl taxes' + return array('opened' => $outstandingOpened, 'total_ht' => $outstandingTotal, 'total_ttc' => $outstandingTotalIncTax, 'refs' => $arrayofref, 'refsopened' => $arrayofrefopened); // 'opened' is 'incl taxes' } else { dol_syslog("Sql error ".$this->db->lasterror, LOG_ERR); return array(); @@ -4947,7 +4947,7 @@ class Societe extends CommonObject dol_print_error($this->db, $companybankaccount->error, $companybankaccount->errors); } $result = $companybankaccount->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); - $this->last_main_doc=$companybankaccount->last_main_doc; + $this->last_main_doc = $companybankaccount->last_main_doc; } else { // Positionne le modele sur le nom du modele a utiliser if (!dol_strlen($modele)) { @@ -5284,8 +5284,8 @@ class Societe extends CommonObject 'civility' => $obj->civility, 'lastname' => $obj->lastname, 'firstname' => $obj->firstname, - 'email'=>$obj->email, - 'login'=> (empty($obj->login) ? '' : $obj->login), + 'email' => $obj->email, + 'login' => (empty($obj->login) ? '' : $obj->login), 'photo' => (empty($obj->photo) ? '' : $obj->photo), 'statuscontact' => $obj->statuscontact, 'rowid' => $obj->rowid, @@ -5484,7 +5484,7 @@ class Societe extends CommonObject if (!$error) { - $this->context = array('merge'=>1, 'mergefromid'=>$soc_origin->id, 'mergefromname'=>$soc_origin->name); + $this->context = array('merge' => 1, 'mergefromid' => $soc_origin->id, 'mergefromname' => $soc_origin->name); // Call trigger $result = $this->call_trigger('COMPANY_MODIFY', $user); diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index 6c70a42cd95..91fcad393d0 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -105,11 +105,11 @@ $webservices = array( 'thirdparty' => 'isModEnabled("societe")', 'contact' => 'isModEnabled("societe")', 'productorservice' => '(isModEnabled("product") || isModEnabled("service"))', - 'order' => 'isModEnabled("commande")', - 'invoice' => 'isModEnabled("facture")', + 'order' => 'isModEnabled("order")', + 'invoice' => 'isModEnabled("invoice")', 'supplier_invoice' => 'isModEnabled("fournisseur")', 'actioncomm' => 'isModEnabled("agenda")', - 'category' => 'isModEnabled("categorie")', + 'category' => 'isModEnabled("category")', 'project' => 'isModEnabled("project")', 'other' => '' ); From ec8f2a420d9aa26f352e2d0109af5d746630261f Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 27 Feb 2024 15:29:58 +0100 Subject: [PATCH 0255/1862] Fix: Use of deprecated fichinter in dynamic modulename (#28456) # Fix: Use of deprecated fichinter in dynamic modulename The modulename is computed dynamically and could use deprecated fichinter module name. Also optimised the test. --- htdocs/api/index.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 2a9375f58c0..d55fe8d38d5 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -233,12 +233,10 @@ if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $ $modulenameforenabled = $module; if ($module == 'propale') { $modulenameforenabled = 'propal'; - } - if ($module == 'supplierproposal') { + } elseif ($module == 'supplierproposal') { $modulenameforenabled = 'supplier_proposal'; - } - if ($module == 'ficheinter') { - $modulenameforenabled = 'ficheinter'; + } elseif ($module == 'ficheinter') { + $modulenameforenabled = 'intervention'; } dol_syslog("Found module file ".$file." - module=".$module." - modulenameforenabled=".$modulenameforenabled." - moduledirforclass=".$moduledirforclass); From fc597c4171d645ed520d3267bf87c0016e09256f Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 27 Feb 2024 15:30:37 +0100 Subject: [PATCH 0256/1862] Fix: Replace deprecated modulename with new in isModEnabled (#28452) * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. --- htdocs/accountancy/admin/defaultaccounts.php | 4 +- htdocs/accountancy/admin/productaccount.php | 2 +- htdocs/adherents/admin/member.php | 12 +-- htdocs/adherents/card.php | 6 +- htdocs/adherents/class/adherent.class.php | 4 +- htdocs/adherents/list.php | 2 +- htdocs/adherents/subscription.php | 24 +++--- htdocs/adherents/subscription/card.php | 8 +- htdocs/adherents/subscription/list.php | 2 +- htdocs/admin/commande.php | 8 +- htdocs/admin/delivery.php | 2 +- htdocs/admin/dict.php | 14 ++-- htdocs/admin/facture.php | 2 +- htdocs/admin/fckeditor.php | 4 +- htdocs/admin/ldap.php | 4 +- htdocs/admin/mails_templates.php | 14 ++-- htdocs/admin/pdf_other.php | 2 +- htdocs/admin/propal.php | 8 +- htdocs/admin/stock.php | 14 ++-- htdocs/admin/supplier_proposal.php | 2 +- htdocs/admin/workflow.php | 20 ++--- htdocs/blockedlog/class/blockedlog.class.php | 6 +- htdocs/comm/action/card.php | 6 +- htdocs/comm/action/class/actioncomm.class.php | 2 +- .../comm/action/class/cactioncomm.class.php | 6 +- htdocs/comm/card.php | 54 ++++++------- htdocs/comm/index.php | 16 ++-- htdocs/comm/mailing/advtargetemailing.php | 2 +- htdocs/comm/propal/card.php | 24 +++--- htdocs/comm/propal/list.php | 10 +-- htdocs/comm/recap-client.php | 2 +- htdocs/commande/card.php | 22 ++--- htdocs/commande/class/commande.class.php | 2 +- htdocs/commande/index.php | 6 +- htdocs/commande/list.php | 18 ++--- htdocs/commande/list_det.php | 20 ++--- htdocs/compta/accounting-files.php | 6 +- htdocs/compta/bank/bankentries_list.php | 4 +- htdocs/compta/bank/card.php | 8 +- htdocs/compta/bank/class/account.class.php | 2 +- .../bank/class/paymentvarious.class.php | 6 +- htdocs/compta/bank/line.php | 4 +- htdocs/compta/bank/list.php | 6 +- htdocs/compta/bank/various_payment/card.php | 8 +- htdocs/compta/bank/various_payment/list.php | 4 +- htdocs/compta/charges/index.php | 12 +-- htdocs/compta/facture/card.php | 26 +++--- .../facture/class/api_invoices.class.php | 8 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/compta/facture/list.php | 6 +- htdocs/compta/facture/stats/index.php | 6 +- htdocs/compta/index.php | 10 +-- htdocs/compta/localtax/card.php | 4 +- .../compta/localtax/class/localtax.class.php | 6 +- htdocs/compta/paiement.php | 6 +- htdocs/compta/paiement/card.php | 6 +- .../compta/paiement/class/paiement.class.php | 2 +- htdocs/compta/paiement/list.php | 4 +- htdocs/compta/paiement_charge.php | 2 +- htdocs/compta/paiement_vat.php | 2 +- htdocs/compta/payment_sc/card.php | 4 +- htdocs/compta/payment_vat/card.php | 4 +- htdocs/compta/recap-compta.php | 4 +- htdocs/compta/resultat/clientfourn.php | 2 +- htdocs/compta/resultat/index.php | 8 +- htdocs/compta/sociales/card.php | 10 +-- .../class/paymentsocialcontribution.class.php | 2 +- htdocs/compta/sociales/list.php | 2 +- htdocs/compta/sociales/payments.php | 8 +- htdocs/compta/stats/cabyuser.php | 4 +- htdocs/compta/stats/casoc.php | 4 +- htdocs/compta/tva/card.php | 10 +-- htdocs/compta/tva/class/paymentvat.class.php | 2 +- htdocs/compta/tva/class/tva.class.php | 6 +- htdocs/compta/tva/list.php | 2 +- htdocs/compta/tva/payments.php | 6 +- .../actions_contactcard_common.class.php | 6 +- htdocs/contact/card.php | 22 ++--- htdocs/contact/consumption.php | 8 +- htdocs/contact/list.php | 2 +- htdocs/contrat/card.php | 4 +- htdocs/contrat/index.php | 2 +- htdocs/contrat/list.php | 6 +- htdocs/contrat/services_list.php | 2 +- htdocs/core/actions_addupdatedelete.inc.php | 4 +- htdocs/core/ajax/selectsearchbox.php | 16 ++-- htdocs/core/boxes/box_activity.php | 8 +- .../core/boxes/box_dolibarr_state_board.php | 10 +-- .../boxes/box_graph_product_distribution.php | 22 ++--- htdocs/core/boxes/box_members_by_tags.php | 2 +- htdocs/core/boxes/box_members_by_type.php | 2 +- .../core/boxes/box_members_last_modified.php | 2 +- .../boxes/box_members_last_subscriptions.php | 2 +- .../box_members_subscriptions_by_year.php | 2 +- htdocs/core/class/html.form.class.php | 22 ++--- htdocs/core/class/html.formmail.class.php | 16 ++-- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/core/customreports.php | 14 ++-- htdocs/core/lib/admin.lib.php | 2 +- htdocs/core/lib/agenda.lib.php | 4 +- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/lib/contact.lib.php | 2 +- htdocs/core/lib/expedition.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 8 +- htdocs/core/lib/invoice.lib.php | 6 +- htdocs/core/lib/ldap.lib.php | 4 +- htdocs/core/lib/order.lib.php | 6 +- htdocs/core/lib/pdf.lib.php | 4 +- htdocs/core/lib/product.lib.php | 10 +-- htdocs/core/lib/project.lib.php | 20 ++--- htdocs/core/lib/propal.lib.php | 4 +- htdocs/core/menus/standard/auguria.lib.php | 6 +- htdocs/core/menus/standard/eldy.lib.php | 80 +++++++++---------- .../doc/pdf_standard.modules.php | 4 +- .../mailings/advthirdparties.modules.php | 2 +- .../modules/mailings/thirdparties.modules.php | 2 +- htdocs/core/modules/modCategorie.class.php | 4 +- htdocs/core/modules/modUser.class.php | 2 +- .../doc/doc_generic_project_odt.modules.php | 24 +++--- .../project/doc/pdf_beluga.modules.php | 10 +-- .../task/doc/doc_generic_task_odt.modules.php | 10 +-- .../modules/rapport/pdf_paiement.class.php | 12 +-- htdocs/core/tpl/advtarget.tpl.php | 6 +- htdocs/core/tpl/onlinepaymentlinks.tpl.php | 8 +- ...e_20_modWorkflow_WorkflowManager.class.php | 18 ++--- ..._50_modNotification_Notification.class.php | 4 +- htdocs/datapolicy/admin/setup.php | 2 +- htdocs/delivery/card.php | 6 +- htdocs/delivery/class/delivery.class.php | 2 +- htdocs/don/class/paymentdonation.class.php | 2 +- htdocs/don/paiement/list.php | 4 +- htdocs/don/payment/card.php | 4 +- htdocs/don/payment/payment.php | 2 +- htdocs/ecm/index_auto.php | 22 ++--- htdocs/ecm/search.php | 20 ++--- .../conferenceorbooth_card.php | 2 +- .../conferenceorbooth_contact.php | 2 +- .../conferenceorbooth_document.php | 2 +- .../conferenceorbooth_list.php | 2 +- .../conferenceorboothattendee_card.php | 2 +- .../conferenceorboothattendee_list.php | 4 +- htdocs/expedition/card.php | 8 +- htdocs/expedition/class/expedition.class.php | 2 +- htdocs/expedition/contact.php | 4 +- htdocs/expedition/dispatch.php | 4 +- htdocs/expedition/document.php | 2 +- htdocs/expedition/list.php | 4 +- htdocs/expedition/note.php | 2 +- htdocs/expensereport/card.php | 10 +-- .../class/api_expensereports.class.php | 2 +- .../class/paymentexpensereport.class.php | 2 +- htdocs/expensereport/payment/card.php | 4 +- htdocs/expensereport/payment/list.php | 2 +- htdocs/expensereport/payment/payment.php | 4 +- htdocs/fichinter/card-rec.php | 14 ++-- htdocs/fichinter/card.php | 10 +-- htdocs/fichinter/index.php | 4 +- htdocs/fichinter/list.php | 10 +-- htdocs/fourn/card.php | 10 +-- .../class/api_supplier_invoices.class.php | 4 +- htdocs/fourn/commande/card.php | 6 +- htdocs/fourn/commande/list.php | 2 +- htdocs/fourn/facture/card.php | 10 +-- htdocs/fourn/facture/list.php | 4 +- htdocs/fourn/facture/paiement.php | 4 +- htdocs/fourn/paiement/card.php | 2 +- htdocs/fourn/paiement/document.php | 2 +- htdocs/fourn/paiement/list.php | 2 +- htdocs/index.php | 12 +-- htdocs/install/upgrade2.php | 6 +- .../class/knowledgerecord.class.php | 2 +- .../knowledgerecord_card.php | 6 +- .../knowledgerecord_list.php | 2 +- htdocs/loan/card.php | 2 +- htdocs/loan/class/paymentloan.class.php | 2 +- htdocs/loan/payment/card.php | 4 +- htdocs/loan/payment/payment.php | 2 +- .../mailmanspip/class/mailmanspip.class.php | 4 +- htdocs/main.inc.php | 10 +-- htdocs/paybox/admin/paybox.php | 2 +- htdocs/paypal/admin/paypal.php | 2 +- htdocs/product/card.php | 16 ++-- htdocs/product/class/product.class.php | 6 +- htdocs/product/composition/card.php | 6 +- htdocs/product/index.php | 2 +- htdocs/product/inventory/list.php | 2 +- htdocs/product/list.php | 4 +- htdocs/product/reassort.php | 2 +- htdocs/product/reassortlot.php | 4 +- htdocs/product/stats/card.php | 6 +- htdocs/product/stock/card.php | 6 +- htdocs/product/stock/class/entrepot.class.php | 2 +- htdocs/product/stock/list.php | 6 +- htdocs/product/stock/movement_list.php | 2 +- htdocs/product/stock/product.php | 4 +- htdocs/product/stock/replenish.php | 4 +- htdocs/projet/card.php | 14 ++-- htdocs/projet/comment.php | 2 +- htdocs/projet/contact.php | 4 +- htdocs/projet/element.php | 36 ++++----- htdocs/projet/ganttview.php | 2 +- htdocs/projet/list.php | 8 +- htdocs/projet/tasks.php | 4 +- htdocs/projet/tasks/comment.php | 2 +- htdocs/projet/tasks/contact.php | 2 +- htdocs/projet/tasks/document.php | 2 +- htdocs/projet/tasks/list.php | 4 +- htdocs/projet/tasks/note.php | 2 +- htdocs/projet/tasks/task.php | 2 +- htdocs/projet/tasks/time.php | 4 +- htdocs/public/members/new.php | 2 +- htdocs/public/members/public_card.php | 2 +- htdocs/public/members/public_list.php | 2 +- htdocs/public/payment/paymentok.php | 22 ++--- htdocs/public/stripe/ipn.php | 2 +- htdocs/public/webportal/tpl/home.tpl.php | 4 +- htdocs/public/webportal/tpl/menu.tpl.php | 6 +- htdocs/reception/card.php | 4 +- htdocs/reception/class/reception.class.php | 2 +- htdocs/reception/dispatch.php | 2 +- htdocs/salaries/card.php | 14 ++-- htdocs/salaries/class/api_salaries.class.php | 4 +- htdocs/salaries/class/paymentsalary.class.php | 2 +- htdocs/salaries/list.php | 8 +- htdocs/salaries/paiement_salary.php | 2 +- htdocs/salaries/payment_salary/card.php | 2 +- htdocs/salaries/payments.php | 6 +- htdocs/salaries/virement_request.php | 6 +- htdocs/societe/admin/societe.php | 2 +- .../canvas/actions_card_common.class.php | 2 +- htdocs/societe/card.php | 16 ++-- htdocs/societe/class/societe.class.php | 6 +- htdocs/societe/consumption.php | 8 +- htdocs/societe/contact.php | 4 +- htdocs/societe/index.php | 2 +- htdocs/societe/list.php | 6 +- htdocs/societe/paymentmodes.php | 12 +-- htdocs/societe/societecontact.php | 2 +- htdocs/supplier_proposal/card.php | 6 +- htdocs/supplier_proposal/list.php | 2 +- htdocs/takepos/admin/terminal.php | 4 +- htdocs/takepos/index.php | 2 +- htdocs/takepos/invoice.php | 4 +- htdocs/takepos/pay.php | 2 +- htdocs/ticket/card.php | 8 +- htdocs/ticket/class/ticket.class.php | 4 +- htdocs/user/card.php | 16 ++-- htdocs/user/list.php | 4 +- htdocs/user/param_ihm.php | 6 +- .../class/html.formcardwebportal.class.php | 2 +- .../invoicelist.controller.class.php | 2 +- .../membercard.controller.class.php | 6 +- .../orderlist.controller.class.php | 2 +- .../propallist.controller.class.php | 2 +- htdocs/website/index.php | 8 +- 255 files changed, 842 insertions(+), 842 deletions(-) diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 65a447811cc..982448cebdd 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -92,7 +92,7 @@ if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { $list_account[] = 'ACCOUNTING_VAT_BUY_REVERSE_CHARGES_CREDIT'; $list_account[] = 'ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT'; } -if (isModEnabled('banque')) { +if (isModEnabled('bank')) { $list_account[] = 'ACCOUNTING_ACCOUNT_TRANSFER_CASH'; } if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY')) { @@ -101,7 +101,7 @@ if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY')) { if (isModEnabled('don')) { $list_account[] = 'DONATION_ACCOUNTINGACCOUNT'; } -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { $list_account[] = 'ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT'; } if (isModEnabled('loan')) { diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index aa4c4a3eb00..b625446ca60 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -525,7 +525,7 @@ if ($resql) { // Filter on categories $moreforfilter = ''; - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, $searchCategoryProductList, 'minwidth300', $searchCategoryProductList ? $searchCategoryProductList : 0); /* diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 3faf0de69b8..6a5139cf16b 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -114,7 +114,7 @@ if ($action == 'set_default') { $res8 = dolibarr_set_const($db, 'MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF', GETPOST('MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF', 'alpha'), 'chaine', 0, '', $conf->entity); $res9 = dolibarr_set_const($db, 'MEMBER_SUBSCRIPTION_START_AFTER', GETPOST('MEMBER_SUBSCRIPTION_START_AFTER', 'alpha'), 'chaine', 0, '', $conf->entity); // Use vat for invoice creation - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); $res5 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); if (isModEnabled("product") || isModEnabled("service")) { @@ -394,13 +394,13 @@ print "\n"; // Insert subscription into bank account print ''.$langs->trans("MoreActionsOnSubscription").''; $arraychoices = array('0'=>$langs->trans("None")); -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { $arraychoices['bankdirect'] = $langs->trans("MoreActionBankDirect"); } -if (isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) { +if (isModEnabled("bank") && isModEnabled("societe") && isModEnabled('invoice')) { $arraychoices['invoiceonly'] = $langs->trans("MoreActionInvoiceOnly"); } -if (isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) { +if (isModEnabled("bank") && isModEnabled("societe") && isModEnabled('invoice')) { $arraychoices['bankviainvoice'] = $langs->trans("MoreActionBankViaInvoice"); } print ''; @@ -412,9 +412,9 @@ print ''; print "\n"; // Use vat for invoice creation -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { print ''.$langs->trans("VATToUseForSubscriptions").''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0'=>$langs->trans("NoVatOnSubscription"), 'defaultforfoundationcountry'=>$langs->trans("Default")), getDolGlobalString('ADHERENT_VAT_FOR_SUBSCRIPTIONS', '0'), 0); print ''; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 8b96f6c3844..eeff802a2e4 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1130,7 +1130,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print ''.$form->editfieldkey("Categories", 'memcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1); print img_picto('', 'category').$form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0); @@ -1384,7 +1384,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print ''.$form->editfieldkey("Categories", 'memcats', '', $object, 0).''; print ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1); @@ -1813,7 +1813,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Tags / Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print ''; print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index c03b28d37dd..c187fc05d75 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2258,7 +2258,7 @@ class Adherent extends CommonObject } $datas['address'] = '
'.$langs->trans("Address").': '.dol_format_address($this, 1, ' ', $langs); // show categories for this record only in ajax to not overload lists - if (isModEnabled('categorie') && !$nofetch) { + if (isModEnabled('category') && !$nofetch) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories'] = '
' . $form->showCategories($this->id, Categorie::TYPE_MEMBER, 1); @@ -2997,7 +2997,7 @@ class Adherent extends CommonObject $blockingerrormsg = ''; - if (!isModEnabled('adherent')) { // Should not happen. If module disabled, cron job should not be visible. + if (!isModEnabled('member')) { // Should not happen. If module disabled, cron job should not be visible. $langs->load("agenda"); $this->output = $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Adherent")); return 0; diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 37aba189a17..403026ff209 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -821,7 +821,7 @@ $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('che $moreforfilter = ''; // Filter on categories -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1, $langs->trans("MembersCategoriesShort")); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 3efc9a74ef0..e0c12678e2a 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -273,7 +273,7 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'subscripti $action = 'addsubscription'; } else { // If an amount has been provided, we check also fields that becomes mandatory when amount is not null. - if (isModEnabled('banque') && GETPOST("paymentsave") != 'none') { + if (isModEnabled('bank') && GETPOST("paymentsave") != 'none') { if (GETPOST("subscription")) { if (!GETPOST("label")) { $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")); @@ -583,7 +583,7 @@ print '
'; print ''; // Tags / Categories -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print ''; print '\n"; @@ -779,7 +779,7 @@ if ($action != 'addsubscription' && $action != 'create_thirdparty') { print '\n"; print '\n"; print ''; - if (isModEnabled('banque')) { + if (isModEnabled('bank')) { print ''; @@ -865,11 +865,11 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h $bankviainvoice = 1; } } else { - if (getDolGlobalString('ADHERENT_BANK_USE') == 'bankviainvoice' && isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) { + if (getDolGlobalString('ADHERENT_BANK_USE') == 'bankviainvoice' && isModEnabled('bank') && isModEnabled('societe') && isModEnabled('invoice')) { $bankviainvoice = 1; - } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'bankdirect' && isModEnabled('banque')) { + } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'bankdirect' && isModEnabled('bank')) { $bankdirect = 1; - } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'invoiceonly' && isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) { + } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'invoiceonly' && isModEnabled('bank') && isModEnabled('societe') && isModEnabled('invoice')) { $invoiceonly = 1; } } @@ -1029,7 +1029,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h print '">'; // Complementary action - if ((isModEnabled('banque') || isModEnabled('facture')) && !getDolGlobalString('ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS')) { + if ((isModEnabled('bank') || isModEnabled('invoice')) && !getDolGlobalString('ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS')) { $company = new Societe($db); if ($object->socid) { $result = $company->fetch($object->socid); @@ -1043,12 +1043,12 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h print ''; print '
'; // Add entry into bank account - if (isModEnabled('banque')) { + if (isModEnabled('bank')) { print '
'; } // Add invoice with no payments - if (isModEnabled('societe') && isModEnabled('facture')) { + if (isModEnabled('societe') && isModEnabled('invoice')) { print 'fk_soc)) print ' disabled'; print '>
'; } // Add invoice with payments - if (isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) { + if (isModEnabled('bank') && isModEnabled('societe') && isModEnabled('invoice')) { print 'fk_soc)) print ' disabled'; print '>'; // Bank line - if (isModEnabled("banque") && (getDolGlobalString('ADHERENT_BANK_USE') || $object->fk_bank)) { + if (isModEnabled("bank") && (getDolGlobalString('ADHERENT_BANK_USE') || $object->fk_bank)) { print ''; print ''; @@ -542,8 +542,8 @@ print "\n"; print ''; print ""; print ""; print ''; print ""; print "\n"; print ''; print ""; print "'; } // Synchro member type active -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { print ''; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index cc9b100d393..a8c07357a81 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; // Load translation files required by the page $langsArray=array("errors", "admin", "mails", "languages"); -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { $langsArray[]='members'; } if (isModEnabled('eventorganization')) { @@ -183,7 +183,7 @@ $elementList = array(); $elementList['all'] = '-- '.dol_escape_htmltag($langs->trans("All")).' --'; $elementList['none'] = '-- '.dol_escape_htmltag($langs->trans("None")).' --'; $elementList['user'] = img_picto('', 'user', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToUser')); -if (isModEnabled('adherent') && $user->hasRight('adherent', 'lire')) { +if (isModEnabled('member') && $user->hasRight('adherent', 'lire')) { $elementList['member'] = img_picto('', 'object_member', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToMember')); } if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjobposition', 'read')) { @@ -198,19 +198,19 @@ if (isModEnabled('project')) { if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) { $elementList['propal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendProposal')); } -if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { +if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $elementList['order_send'] = img_picto('', 'order', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendOrder')); } -if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { +if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $elementList['facture_send'] = img_picto('', 'bill', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendInvoice')); } -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { $elementList['shipping_send'] = img_picto('', 'dolly', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendShipment')); } if (isModEnabled("reception")) { $elementList['reception_send'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendReception')); } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $elementList['fichinter_send'] = img_picto('', 'intervention', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendIntervention')); } if (isModEnabled('supplier_proposal')) { @@ -222,7 +222,7 @@ if (isModEnabled("supplier_order") && ($user->hasRight('fournisseur', 'commande' if (isModEnabled("supplier_invoice") && ($user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('supplier_invoice', 'read'))) { $elementList['invoice_supplier_send'] = img_picto('', 'bill', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierInvoice')); } -if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { +if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $elementList['contract'] = img_picto('', 'contract', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendContract')); } if (isModEnabled('ticket') && $user->hasRight('ticket', 'read')) { diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 31becefc379..20603909699 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -234,7 +234,7 @@ if (isModEnabled('supplier_order')) { print ''; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { print load_fiche_titre($langs->trans("Invoices"), '', 'bill'); print '
'; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 0f6d91f26eb..2eb1ed3c820 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -507,7 +507,7 @@ print '
'; print ''; @@ -516,8 +516,8 @@ print "\n"; print ''; print ""; print ""; print ''; print ""; print "'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '\n"; print "\n"; // Option to force stock to be enough before adding a line into document -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { print ''; print ''; print '\n"; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { print ''; print ''; print '\n"; } -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { print ''; print ''; print '\n"; print ''; -if (isModEnabled('banque')) { +if (isModEnabled('bank')) { print ''; } - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { // Categories print ''; // Tags-Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 7bfbe08af9c..e42e58ec2fc 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1660,7 +1660,7 @@ class ActionComm extends CommonObject $datas['note'] .= ''; } // show categories for this record only in ajax to not overload lists - if (isModEnabled('categorie') && !$nofetch) { + if (isModEnabled('category') && !$nofetch) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories'] = '
' . $form->showCategories($this->id, Categorie::TYPE_ACTIONCOMM, 1); diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 93191e69bea..ac9148579b1 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -213,10 +213,10 @@ class CActionComm //var_dump($obj->type.' '.$obj->module.' '); var_dump($user->hasRight('facture', 'lire')); $qualified = 0; // Special cases - if ($obj->module == 'invoice' && isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if ($obj->module == 'invoice' && isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $qualified = 1; } - if ($obj->module == 'order' && isModEnabled('commande') && !$user->hasRight('commande', 'lire')) { + if ($obj->module == 'order' && isModEnabled('order') && !$user->hasRight('commande', 'lire')) { $qualified = 1; } if ($obj->module == 'propal' && isModEnabled("propal") && $user->hasRight('propal', 'lire')) { @@ -228,7 +228,7 @@ class CActionComm if ($obj->module == 'order_supplier' && ((isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'commande', 'lire')) || (!isModEnabled('supplier_order') && $user->hasRight('supplier_order', 'lire')))) { $qualified = 1; } - if ($obj->module == 'shipping' && isModEnabled("expedition") && $user->hasRight('expedition', 'lire')) { + if ($obj->module == 'shipping' && isModEnabled("delivery_note") && $user->hasRight('expedition', 'lire')) { $qualified = 1; } // For case module = 'myobject@eventorganization' diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 72357539c84..c00ff438490 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -41,48 +41,48 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } // Load translation files required by the page $langs->loadLangs(array('companies', 'banks')); -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $langs->load("contracts"); } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $langs->load("orders"); } -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { $langs->load("sendings"); } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { $langs->load("bills"); } if (isModEnabled('project')) { $langs->load("projects"); } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $langs->load("interventions"); } if (isModEnabled('notification')) { @@ -440,7 +440,7 @@ if ($object->id > 0) { print ""; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Default bank account for payments print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1); @@ -744,7 +744,7 @@ if ($action != 'addsubscription' && $action != 'create_thirdparty') { print_liste_field_titre('DateStart', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre('DateEnd', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); - if (isModEnabled('banque')) { + if (isModEnabled('bank')) { print_liste_field_titre('Account', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); } print "
'.dol_print_date($db->jdate($objp->dateh), 'day')."'.dol_print_date($db->jdate($objp->datef), 'day')."'.price($objp->subscription).''; if ($objp->bid) { $accountstatic->label = $objp->label; @@ -808,7 +808,7 @@ if ($action != 'addsubscription' && $action != 'create_thirdparty') { if (empty($num)) { $colspan = 6; - if (isModEnabled('banque')) { + if (isModEnabled('bank')) { $colspan++; } print '
'.$langs->trans("None").'
'.$langs->trans("BankTransactionLine").''; if ($object->fk_bank) { $bankline = new AccountLine($db); @@ -282,7 +282,7 @@ if ($rowid && $action != 'edit') { $formquestion=array(); //$formquestion['text']=''.$langs->trans("ThisWillAlsoDeleteBankRecord").''; $text = $langs->trans("ConfirmDeleteSubscription"); - if (isModEnabled("banque") && getDolGlobalString('ADHERENT_BANK_USE')) { + if (isModEnabled("bank") && getDolGlobalString('ADHERENT_BANK_USE')) { $text .= '
'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord"); } print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id, $langs->trans("DeleteSubscription"), $text, "confirm_delete", $formquestion, 0, 1); @@ -337,7 +337,7 @@ if ($rowid && $action != 'edit') { print '
'.$langs->trans("Label").''.dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)).'
'.$langs->trans("BankTransactionLine").''; if ($object->fk_bank > 0) { $bankline = new AccountLine($db); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index ddd2728d169..28ad3ef7dd7 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -95,7 +95,7 @@ $arrayfields = array( 'd.firstname'=>array('label'=>"Firstname", 'checked'=>1), 'd.login'=>array('label'=>"Login", 'checked'=>1), 't.libelle'=>array('label'=>"Label", 'checked'=>1), - 'd.bank'=>array('label'=>"BankAccount", 'checked'=>1, 'enabled'=>(isModEnabled('banque'))), + 'd.bank'=>array('label'=>"BankAccount", 'checked'=>1, 'enabled'=>(isModEnabled('bank'))), /*'d.note_public'=>array('label'=>"NotePublic", 'checked'=>0), 'd.note_private'=>array('label'=>"NotePrivate", 'checked'=>0),*/ 'c.dateadh'=>array('label'=>"DateSubscription", 'checked'=>1, 'position'=>100), diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 445535a55e4..9a4ba84d3c7 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -533,7 +533,7 @@ print ''; print ''; print $langs->trans("PaymentMode").''; -if (!isModEnabled('facture')) { +if (!isModEnabled('invoice')) { print ''; } print '
".$langs->trans("SuggestPaymentByRIBOnAccount").""; -if (!isModEnabled('facture')) { - if (isModEnabled("banque")) { +if (!isModEnabled('invoice')) { + if (isModEnabled("bank")) { $sql = "SELECT rowid, label"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql .= " WHERE clos = 0"; @@ -581,7 +581,7 @@ print "
".$langs->trans("SuggestPaymentByChequeToAddress").""; -if (!isModEnabled('facture')) { +if (!isModEnabled('invoice')) { print '
".$langs->trans("SuggestPaymentByRIBOnAccount").""; -if (isModEnabled('banque')) { +if (isModEnabled('bank')) { $sql = "SELECT rowid, label"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql .= " WHERE clos = 0"; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 71105f078b5..5dc257a55d2 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -65,10 +65,10 @@ $conditions = array( 'NOTE_PRIVATE' => 1, 'SOCIETE' => 1, 'PRODUCTDESC' => (isModEnabled("product") || isModEnabled("service")), - 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande') || isModEnabled('supplier_proposal') || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), + 'DETAILS' => (isModEnabled('invoice') || isModEnabled("propal") || isModEnabled('order') || isModEnabled('supplier_proposal') || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), 'USERSIGN' => 1, 'MAILING' => isModEnabled('mailing'), - 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')), + 'MAIL' => (isModEnabled('invoice') || isModEnabled("propal") || isModEnabled('order')), 'TICKET' => isModEnabled('ticket'), 'SPECIALCHAR' => 1, ); diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index dcf59d40d8b..53d52fdfe92 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -169,14 +169,14 @@ if (isModEnabled('societe')) { } // Synchro member active -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { print '
' . $langs->trans("LDAPDnMemberActive") . ''; print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_ACTIVE'), 'activemembers', array(), 2); print '' . $langs->trans("LDAPDnMemberActiveExample") . '
' . $langs->trans("LDAPDnMemberTypeActive") . ''; print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_TYPE_ACTIVE'), 'activememberstypes', array(), 2); print '' . $langs->trans("LDAPDnMemberTypeActiveExample") . '
'; print ''; print $langs->trans("PaymentMode").''; -if (!isModEnabled('facture')) { +if (!isModEnabled('invoice')) { print ''; } print '
".$langs->trans("SuggestPaymentByRIBOnAccount").""; -if (!isModEnabled('facture')) { - if (isModEnabled("banque")) { +if (!isModEnabled('invoice')) { + if (isModEnabled("bank")) { $sql = "SELECT rowid, label"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql .= " WHERE clos = 0"; @@ -555,7 +555,7 @@ print "
".$langs->trans("SuggestPaymentByChequeToAddress").""; -if (!isModEnabled('facture')) { +if (!isModEnabled('invoice')) { print '
'.$langs->trans("DeStockOnBill").''; -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { if ($conf->use_javascript_ajax) { if ($disabled) { print img_picto($langs->trans("Disabled"), 'off', 'class="opacitymedium"'); @@ -246,7 +246,7 @@ print ''; print '
'.$langs->trans("DeStockOnValidateOrder").''; -if (isModEnabled('commande')) { +if (isModEnabled('order')) { if ($conf->use_javascript_ajax) { if ($disabled) { print img_picto($langs->trans("Disabled"), 'off', 'class="opacitymedium"'); @@ -270,7 +270,7 @@ print ''; print '
'.$langs->trans("DeStockOnShipment").''; -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT', array(), null, 0, 0, 0, 2, 1, '', '', 'reposition'); } else { @@ -287,7 +287,7 @@ print ''; print '
'.$langs->trans("DeStockOnShipmentOnClosing").''; -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(), null, 0, 0, 0, 2, 1, '', '', 'reposition'); } else { @@ -433,7 +433,7 @@ print "
'.$langs->trans("StockMustBeEnoughForInvoice").''; @@ -447,7 +447,7 @@ if (isModEnabled('facture')) { print "
'.$langs->trans("StockMustBeEnoughForOrder").''; @@ -461,7 +461,7 @@ if (isModEnabled('commande')) { print "
'.$langs->trans("StockMustBeEnoughForShipment").''; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index ef3dfb2fd99..82a55ca18d6 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -532,7 +532,7 @@ print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '; print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL'); diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 41b77c4e7a0..1628db01977 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -63,36 +63,36 @@ $workflowcodes = array( 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array( 'family'=>'create', 'position'=>10, - 'enabled'=>(isModEnabled("propal") && isModEnabled('commande')), + 'enabled'=>(isModEnabled("propal") && isModEnabled('order')), 'picto'=>'order' ), 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array( 'family'=>'create', 'position'=>20, - 'enabled'=>(isModEnabled('commande') && isModEnabled('facture')), + 'enabled'=>(isModEnabled('order') && isModEnabled('invoice')), 'picto'=>'bill' ), 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array( 'family'=>'create', 'position'=>25, - 'enabled'=>(isModEnabled('ticket') && isModEnabled('ficheinter')), + 'enabled'=>(isModEnabled('ticket') && isModEnabled('intervention')), 'picto'=>'ticket' ), - 'separator1'=>array('family'=>'separator', 'position'=>25, 'title'=>'', 'enabled'=>((isModEnabled("propal") && isModEnabled('commande')) || (isModEnabled('commande') && isModEnabled('facture')) || (isModEnabled('ticket') && isModEnabled('ficheinter')))), + 'separator1'=>array('family'=>'separator', 'position'=>25, 'title'=>'', 'enabled'=>((isModEnabled("propal") && isModEnabled('order')) || (isModEnabled('order') && isModEnabled('invoice')) || (isModEnabled('ticket') && isModEnabled('intervention')))), // Automatic classification of proposal 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array( 'family'=>'classify_proposal', 'position'=>30, - 'enabled'=>(isModEnabled("propal") && isModEnabled('commande')), + 'enabled'=>(isModEnabled("propal") && isModEnabled('order')), 'picto'=>'propal', 'warning'=>'' ), 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array( 'family'=>'classify_proposal', 'position'=>31, - 'enabled'=>(isModEnabled("propal") && isModEnabled('facture')), + 'enabled'=>(isModEnabled("propal") && isModEnabled('invoice')), 'picto'=>'propal', 'warning'=>'' ), @@ -101,19 +101,19 @@ $workflowcodes = array( 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array( // when shipping validated 'family'=>'classify_order', 'position'=>40, - 'enabled'=>(isModEnabled("expedition") && isModEnabled('commande')), + 'enabled'=>(isModEnabled("delivery_note") && isModEnabled('order')), 'picto'=>'order' ), 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array( // when shipping closed 'family'=>'classify_order', 'position'=>41, - 'enabled'=>(isModEnabled("expedition") && isModEnabled('commande')), + 'enabled'=>(isModEnabled("delivery_note") && isModEnabled('order')), 'picto'=>'order' ), 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array( 'family'=>'classify_order', 'position'=>42, - 'enabled'=>(isModEnabled('facture') && isModEnabled('commande')), + 'enabled'=>(isModEnabled('invoice') && isModEnabled('order')), 'picto'=>'order', 'warning'=>'' ), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card. @@ -166,7 +166,7 @@ $workflowcodes = array( 'WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE' => array( 'family' => 'classify_shipping', 'position' => 91, - 'enabled' => isModEnabled("expedition") && isModEnabled("facture") && getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0', + 'enabled' => isModEnabled("delivery_note") && isModEnabled("invoice") && getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0', 'picto' => 'shipment' ), diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 23c40994d9b..451720bbd59 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -146,7 +146,7 @@ class BlockedLog $this->trackedevents = array(); // Customer Invoice/Facture / Payment - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE'; $this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE'; $this->trackedevents['BILL_SENTBYMAIL'] = 'logBILL_SENTBYMAIL'; @@ -188,14 +188,14 @@ class BlockedLog */ // Members - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE'; $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY'; $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE'; } // Bank - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $this->trackedevents['PAYMENT_VARIOUS_CREATE'] = 'logPAYMENT_VARIOUS_CREATE'; $this->trackedevents['PAYMENT_VARIOUS_MODIFY'] = 'logPAYMENT_VARIOUS_MODIFY'; $this->trackedevents['PAYMENT_VARIOUS_DELETE'] = 'logPAYMENT_VARIOUS_DELETE'; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index bcad30ffa91..4eb7fa3ad6b 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1457,7 +1457,7 @@ if ($action == 'create') { print '
'.$langs->trans("Location").'
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1); @@ -2027,7 +2027,7 @@ if ($id > 0) { print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1); $c = new Categorie($db); @@ -2452,7 +2452,7 @@ if ($id > 0) { } // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_ACTIONCOMM, 1); print "
'; print ''; print ''; print ''; // Bank Account - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) { print ''; @@ -2004,7 +2004,7 @@ if ($action == 'create') { print ''; // Shipping Method - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) { $shipping_method_id = $soc->shipping_method_id; } @@ -2025,7 +2025,7 @@ if ($action == 'create') { // Delivery delay print '
'; @@ -512,7 +512,7 @@ if ($object->id > 0) { } if ($object->client) { - if (isModEnabled('commande') && getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT')) { + if (isModEnabled('order') && getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT')) { print ''."\n"; print '
'; @@ -607,7 +607,7 @@ if ($object->id > 0) { } // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $langs->load("categories"); print '
'.$langs->trans("CustomersCategoriesShort").''; @@ -623,7 +623,7 @@ if ($object->id > 0) { include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; // Module Adherent - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $langs->load("members"); $langs->load("users"); @@ -721,7 +721,7 @@ if ($object->id > 0) { } } - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { // Box commandes $tmp = $object->getOutstandingOrders(); $outstandingOpened = $tmp['opened']; @@ -742,7 +742,7 @@ if ($object->id > 0) { } } - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { // Box factures $tmp = $object->getOutstandingBills('customer', 0); $outstandingOpened = $tmp['opened']; @@ -917,7 +917,7 @@ if ($object->id > 0) { /* * Latest orders */ - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $param =""; $sql = "SELECT s.nom, s.rowid"; @@ -1028,7 +1028,7 @@ if ($object->id > 0) { /* * Latest shipments */ - if (isModEnabled("expedition") && $user->hasRight('expedition', 'lire')) { + if (isModEnabled("delivery_note") && $user->hasRight('expedition', 'lire')) { $sql = 'SELECT e.rowid as id'; $sql .= ', e.ref, e.entity'; $sql .= ', e.date_creation'; @@ -1126,7 +1126,7 @@ if ($object->id > 0) { /* * Latest contracts */ - if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { + if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup, c.entity,"; $sql .= " c.last_main_doc, c.model_pdf"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; @@ -1234,7 +1234,7 @@ if ($object->id > 0) { /* * Latest interventions */ - if (isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire')) { + if (isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire')) { $sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate, f.entity"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f"; $sql .= " WHERE f.fk_soc = s.rowid"; @@ -1320,7 +1320,7 @@ if ($object->id > 0) { /* * Latest invoices templates */ - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $sql = 'SELECT f.rowid as id, f.titre as ref'; $sql .= ', f.total_ht'; $sql .= ', f.total_tva'; @@ -1421,7 +1421,7 @@ if ($object->id > 0) { /* * Latest invoices */ - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $sql = 'SELECT f.rowid as facid, f.ref, f.type'; $sql .= ', f.total_ht'; $sql .= ', f.total_tva'; @@ -1579,7 +1579,7 @@ if ($object->id > 0) { print ''; } - if (isModEnabled('commande') && $user->hasRight('commande', 'creer') && $object->status == 1) { + if (isModEnabled('order') && $user->hasRight('commande', 'creer') && $object->status == 1) { $langs->load("orders"); print ''; } @@ -1589,7 +1589,7 @@ if ($object->id > 0) { print ''; } - if (isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'creer') && $object->status == 1) { + if (isModEnabled('intervention') && $user->hasRight('ficheinter', 'creer') && $object->status == 1) { $langs->load("fichinter"); print ''; } @@ -1601,14 +1601,14 @@ if ($object->id > 0) { print ''; } - if (isModEnabled('facture') && $object->status == 1) { + if (isModEnabled('invoice') && $object->status == 1) { if (!$user->hasRight('facture', 'creer')) { $langs->load("bills"); print ''; } else { $langs->loadLangs(array("orders", "bills")); - if (isModEnabled('commande')) { + if (isModEnabled('order')) { if ($object->client != 0 && $object->client != 2) { if (!empty($orders2invoice) && $orders2invoice > 0) { print ''; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 67823d4b12f..77f0c7ea647 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -39,10 +39,10 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } @@ -96,14 +96,14 @@ if (isModEnabled("propal")) { if (isModEnabled('supplier_proposal')) { $supplierproposalstatic = new SupplierProposal($db); } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $orderstatic = new Commande($db); } if (isModEnabled("supplier_order")) { $supplierorderstatic = new CommandeFournisseur($db); } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $fichinterstatic = new Fichinter($db); } @@ -323,7 +323,7 @@ if (isModEnabled('supplier_proposal') && $user->hasRight("supplier_proposal", "l * Draft sales orders */ -if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { +if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; @@ -518,7 +518,7 @@ if ((isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMO /* * Draft interventions */ -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $sql = "SELECT f.rowid, f.ref, s.nom as name, f.fk_statut, f.duree as duration"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; @@ -817,7 +817,7 @@ if ((isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $use /* * Latest contracts */ -if (isModEnabled('contrat') && $user->hasRight("contrat", "lire") && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT +if (isModEnabled('contract') && $user->hasRight("contrat", "lire") && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT $staticcontrat = new Contrat($db); $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; @@ -1014,7 +1014,7 @@ if (isModEnabled("propal") && $user->hasRight("propal", "lire")) { /* * Opened (validated) order */ -if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { +if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $sql = "SELECT c.rowid as commandeid, c.total_ttc, c.total_ht, c.total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index 4742d6b66e7..adfb7feeffb 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Load translation files required by the page $langs->loadLangs(array('mails', 'companies')); -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $langs->load("categories"); } diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index d22278ad585..9c30198f3e7 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -757,7 +757,7 @@ if (empty($reshook)) { if ( !$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOSTINT('generate_deposit') == 'on' - && !empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && $user->hasRight('facture', 'creer') + && !empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer') ) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; @@ -1991,7 +1991,7 @@ if ($action == 'create') { print '
'.$langs->trans('AvailabilityPeriod'); - if (isModEnabled('commande')) { + if (isModEnabled('order')) { print ' ('.$langs->trans('AfterOrder').')'; } print ''; @@ -2284,7 +2284,7 @@ if ($action == 'create') { // It may also break step of creating an order when invoicing must be done from orders and not from proposal $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); - if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && $user->hasRight('facture', 'creer')) { + if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $object->fetchObjectLinked(); @@ -2674,7 +2674,7 @@ if ($action == 'create') { // Delivery delay print '
'; print ''; // Shipping Method - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { print ''; $out .= ''; $out .= ''; $out .= ''; @@ -263,7 +263,7 @@ if ($action == 'edit') { $out .= 'Post-prompt'; $out .= ''; $out .= ''; $out .= ''; $out .= ''; @@ -307,7 +307,7 @@ if ($action == 'edit' || $action == 'create') { $out .= 'pre-Prompt'; $out .= ''; $out .= ''; $out .= ''; $out .= ''; @@ -315,8 +315,9 @@ if ($action == 'edit' || $action == 'create') { $out .= 'Post-prompt'; $out .= ''; $out .= ''; $out .= ''; $out .= ''; From 5008a324c633ef650d9dac68c16e6eaac6fed370 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 11:24:09 +0100 Subject: [PATCH 1262/1862] Fix warning --- htdocs/accountancy/admin/accountmodel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index dbe02a3ff02..e14477b9158 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -191,10 +191,10 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { // Si verif ok et action add, on ajoute la ligne if ($ok && GETPOST('actionadd', 'alpha')) { + $newid = 0; if ($tabrowid[$id]) { // Get free id for insert - $newid = 0; - $sql = "SELECT MAX(".$db->sanitize($tabrowid[$id]).") newid FROM ".$db->sanitize($tabname[$id]); + $sql = "SELECT MAX(".$db->sanitize($tabrowid[$id]).") as newid FROM ".$db->sanitize($tabname[$id]); $result = $db->query($sql); if ($result) { $obj = $db->fetch_object($result); From fc753daa26352a838228982f5d01faf042eda0c1 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 11:58:23 +0100 Subject: [PATCH 1263/1862] NEW functionality for delete contact of company list --- htdocs/core/lib/company.lib.php | 14 ++++++++++++++ htdocs/langs/en_US/users.lang | 2 ++ htdocs/societe/contact.php | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index d8113ce1356..62e6840351d 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1417,6 +1417,13 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl print ''; } + // Delete + if ($user->hasRight('societe', 'contact', 'delete')) { + print ''; + print img_delete(); + print ''; + } + print ''; } @@ -1513,6 +1520,13 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl print ''; } + // Delete + if ($user->hasRight('societe', 'contact', 'delete')) { + print ''; + print img_delete(); + print ''; + } + print ''; } diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index c4695d86791..3cfa2ee7236 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -134,3 +134,5 @@ UserPublicPageDesc=You can enable a virtual card for this user. An url with the EnablePublicVirtualCard=Enable the user's virtual business card UserEnabledDisabled=User status changed: %s AlternativeEmailForOAuth2=Alternative Email for OAuth2 login +ConfirmDeleteContact= Are you sure that you want delete this contact ? +ContactDeleted= Contact has been delete successfully diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 1fd810a9793..c56ca5ccfb4 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -133,6 +133,27 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; } +if ($action == 'confirm_delete') { + $id = GETPOST('id', 'int'); + if (!empty($id) && $socid > 0) { + $sql = "DELETE t, et FROM llx_socpeople AS t"; + $sql .= " LEFT JOIN llx_socpeople_extrafields AS et ON t.rowid = et.fk_object"; + $sql .= " WHERE t.fk_soc = ".((int) $socid); + $sql .= " AND t.rowid = ".((int) $id); + $sql .= " AND ((t.fk_user_creat = ".((int) $user->id)." AND t.priv = 1) OR t.priv = 0)"; + + $result = $db->query($sql); + if (!$result) { + $error++; + setEventMessages($db->lasterror(), null, 'errors'); + } else { + $db->commit(); + setEventMessages('ContactDeleted', null, 'mesgs'); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$socid); + exit(); + } + } +} /* * View @@ -184,6 +205,18 @@ if ($action != 'presend') { $result = show_contacts($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id, 1); } } +if ($action == 'delete') { + $formconfirm = $form->formconfirm( + $_SERVER["PHP_SELF"].'?id='.GETPOST('id').'&socid='.$object->id, + $langs->trans('Delete'), + $langs->trans('ConfirmDeleteContact', GETPOST('id', 'alpha')), + 'confirm_delete', + '', + 0, + 1 + ); + print $formconfirm; +} // End of page llxFooter(); From fb85f17ef4d9cb8a0bad6193ec4f5ad0d207dfa7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 12:09:35 +0100 Subject: [PATCH 1264/1862] FIX: Better error management in loading a website template --- htdocs/core/lib/files.lib.php | 23 +++++++++++++++-------- htdocs/core/lib/functions.lib.php | 2 +- htdocs/website/class/website.class.php | 19 ++++++++++++++----- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 960d9ee7eec..5b18aee94af 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -857,14 +857,14 @@ function dol_copy($srcfile, $destfile, $newmask = '0', $overwriteifexists = 1, $ /** * Copy a dir to another dir. This include recursive subdirectories. * - * @param string $srcfile Source file (a directory) - * @param string $destfile Destination file (a directory) - * @param string $newmask Mask for new file ('0' by default means getDolGlobalString('MAIN_UMASK')). Example: '0666' - * @param int $overwriteifexists Overwrite file if exists (1 by default) + * @param string $srcfile Source file (a directory) + * @param string $destfile Destination file (a directory) + * @param string $newmask Mask for new file ('0' by default means getDolGlobalString('MAIN_UMASK')). Example: '0666' + * @param int $overwriteifexists Overwrite file if exists (1 by default) * @param array $arrayreplacement Array to use to replace filenames with another one during the copy (works only on file names, not on directory names). - * @param int $excludesubdir 0=Do not exclude subdirectories, 1=Exclude subdirectories, 2=Exclude subdirectories if name is not a 2 chars (used for country codes subdirectories). - * @param string[] $excludefileext Exclude some file extensions - * @return int Return integer <0 if error, 0 if nothing done (all files already exists and overwriteifexists=0), >0 if OK + * @param int $excludesubdir 0=Do not exclude subdirectories, 1=Exclude subdirectories, 2=Exclude subdirectories if name is not a 2 chars (used for country codes subdirectories). + * @param string[] $excludefileext Exclude some file extensions + * @return int Return integer <0 if error, 0 if nothing done (all files already exists and overwriteifexists=0), >0 if OK * @see dol_copy() */ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayreplacement = null, $excludesubdir = 0, $excludefileext = null) @@ -878,6 +878,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep } $destexists = dol_is_dir($destfile); + //if (! $overwriteifexists && $destexists) return 0; // The overwriteifexists is for files only, so propagated to dol_copy only. if (!$destexists) { @@ -888,7 +889,13 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep $dirmaskdec = octdec(getDolGlobalString('MAIN_UMASK')); } $dirmaskdec |= octdec('0200'); // Set w bit required to be able to create content for recursive subdirs files - dol_mkdir($destfile, '', decoct($dirmaskdec)); + + $result = dol_mkdir($destfile, '', decoct($dirmaskdec)); + + if (!dol_is_dir($destfile)) { + // The output directory does not exists and we failed to create it. So we stop here. + return -1; + } } $ossrcfile = dol_osencode($srcfile); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bcc2e9864e9..e74be328a4b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7424,7 +7424,7 @@ function dol_mkdir($dir, $dataroot = '', $newmask = '') } $dirmaskdec |= octdec('0111'); // Set x bit required for directories if (!@mkdir($ccdir_osencoded, $dirmaskdec)) { - // Si le is_dir a renvoye une fausse info, alors on passe ici. + // If the is_dir has returned a false information, we arrive here dol_syslog("functions.lib::dol_mkdir: Fails to create directory '".$ccdir."' or directory already exists.", LOG_WARNING); $nberr++; } else { diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 47d572654be..7bfe8b0373e 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -1262,8 +1262,17 @@ class Website extends CommonObject $error++; } - dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/medias/image/websitekey', $conf->website->dir_output.'/'.$object->ref.'/medias/image/'.$object->ref, 0, 1); // Medias can be shared, do not overwrite if exists - dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/medias/js/websitekey', $conf->website->dir_output.'/'.$object->ref.'/medias/js/'.$object->ref, 0, 1); // Medias can be shared, do not overwrite if exists + $result = dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/medias/image/websitekey', $conf->website->dir_output.'/'.$object->ref.'/medias/image/'.$object->ref, 0, 1); + if ($result < 0) { + $this->errors[] = 'Failed to copy files into '.$conf->website->dir_output.'/'.$object->ref.'/medias/image/'.$object->ref.'.'; + return -5; + } + + $result = dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/medias/js/websitekey', $conf->website->dir_output.'/'.$object->ref.'/medias/js/'.$object->ref, 0, 1); + if ($result < 0) { + $this->errors[] = 'Failed to copy files into '.$conf->website->dir_output.'/'.$object->ref.'/medias/js/'.$object->ref.'.'; + return -5; + } $sqlfile = $conf->website->dir_temp."/".$object->ref.'/website_pages.sql'; @@ -1301,13 +1310,13 @@ class Website extends CommonObject $newid = ($reg[2] + $maxrowid); $aliasesarray = explode(',', $reg[3]); - dol_syslog("Found ID ".$oldid." to replace with ID ".$newid." and shortcut aliases to create: ".$reg[3]); + dol_syslog("In sql source file, we have the page ID ".$oldid." to replace with the new ID ".$newid.", and we must create the shortcut aliases: ".$reg[3]); - dol_move($conf->website->dir_output.'/'.$object->ref.'/page'.$oldid.'.tpl.php', $conf->website->dir_output.'/'.$object->ref.'/page'.$newid.'.tpl.php', 0, 1, 0, 0); + //dol_move($conf->website->dir_output.'/'.$object->ref.'/page'.$oldid.'.tpl.php', $conf->website->dir_output.'/'.$object->ref.'/page'.$newid.'.tpl.php', 0, 1, 0, 0); $objectpagestatic->fetch($newid); - // The move is not enough, so we regenerate pageX.tpl.php + // We regenerate the pageX.tpl.php $filetpl = $conf->website->dir_output.'/'.$object->ref.'/page'.$newid.'.tpl.php'; $result = dolSavePageContent($filetpl, $object, $objectpagestatic); if (!$result) { From 0903b4da87bde9285b5be6d8991ee989a44d8c13 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 14 Mar 2024 12:35:19 +0100 Subject: [PATCH 1265/1862] disable auto correct login field on smartphone --- htdocs/core/tpl/login.tpl.php | 2 +- htdocs/core/tpl/passwordforgotten.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 7f460587248..1567392285a 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -180,7 +180,7 @@ if ($disablenofollow) { } ?> -" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autofocus="autofocus" /> +" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autofocus="autofocus" autocapitalize="off" autocomplete="off" spellcheck="false" autocorrect="off" /> diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 6fe5ddad2d6..4b6cd2392f2 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -129,7 +129,7 @@ if (!empty($disablenofollow)) {
-" id="username" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" /> +" id="username" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autocapitalize="off" autocomplete="off" spellcheck="false" autocorrect="off" />
From 1c9129497ff25e1f06eb54a5d70b713838eec5b6 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 14 Mar 2024 12:36:01 +0100 Subject: [PATCH 1266/1862] autocomplete on --- htdocs/core/tpl/login.tpl.php | 2 +- htdocs/core/tpl/passwordforgotten.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 1567392285a..cbb89e80b3b 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -180,7 +180,7 @@ if ($disablenofollow) { } ?> -" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autofocus="autofocus" autocapitalize="off" autocomplete="off" spellcheck="false" autocorrect="off" /> +" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autofocus="autofocus" autocapitalize="off" autocomplete="on" spellcheck="false" autocorrect="off" /> diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 4b6cd2392f2..8d78c4fa41a 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -129,7 +129,7 @@ if (!empty($disablenofollow)) {
-" id="username" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autocapitalize="off" autocomplete="off" spellcheck="false" autocorrect="off" /> +" id="username" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autocapitalize="off" autocomplete="on" spellcheck="false" autocorrect="off" />
From c664cdae0f62775af2dd58b8a4a9494b4728d4bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 12:39:42 +0100 Subject: [PATCH 1267/1862] NEW Init of a module with a website template copy also the preview --- htdocs/core/modules/DolibarrModules.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 15fbe56aa32..04081ba6a02 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -453,7 +453,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $err += $this->insert_tabs(); } - // Insert activation of module's parts + // Insert activation of module's parts. Copy website templates into doctemplates. if (!$err) { $err += $this->insert_module_parts(); } @@ -2310,6 +2310,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $this->errors[] = ($errormsg ? $errormsg : $langs->trans('ErrorFailToCreateZip', $dest)); } } + + // Copy also the preview website_xxx.jpg file + $docs = dol_dir_list($srcroot, 'files', 0, 'website_.*\.jpg$'); + foreach ($docs as $cursorfile) { + $src = $srcroot.'/'.$cursorfile['name']; + $dest = DOL_DATA_ROOT.'/doctemplates/websites/'.$cursorfile['name']; + + dol_copy($src, $dest); + } } $entity = $conf->entity; // Reset the current entity From 5399e3aef5c0d6a43134ef1d8c54964a074a6574 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 12:59:35 +0100 Subject: [PATCH 1268/1862] Debug import website template --- htdocs/website/class/website.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 7bfe8b0373e..290f18606f9 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -1305,7 +1305,11 @@ class Website extends CommonObject // Warning fgets with second parameter that is null or 0 hang. $buf = fgets($fp, 65000); + $newid = 0; + + // Scan the line if (preg_match('/^-- Page ID (\d+)\s[^\s]+\s(\d+).*Aliases\s(.*)\s--;/i', $buf, $reg)) { + // Example of line: "-- Page ID 179 -> 1__+MAX_llx_website_page__ - Aliases about-us --;" $oldid = $reg[1]; $newid = ($reg[2] + $maxrowid); $aliasesarray = explode(',', $reg[3]); @@ -1313,7 +1317,15 @@ class Website extends CommonObject dol_syslog("In sql source file, we have the page ID ".$oldid." to replace with the new ID ".$newid.", and we must create the shortcut aliases: ".$reg[3]); //dol_move($conf->website->dir_output.'/'.$object->ref.'/page'.$oldid.'.tpl.php', $conf->website->dir_output.'/'.$object->ref.'/page'.$newid.'.tpl.php', 0, 1, 0, 0); + } elseif (preg_match('/^-- Page ID (\d+).*Aliases\s(.*)\s--;/i', $buf, $reg)) { + // Example of line: "-- Page ID 1__+MAX_llx_website_page__ - Aliases about-us --;" + $newid = ($reg[1] + $maxrowid); + $aliasesarray = explode(',', $reg[2]); + dol_syslog("In sql source file, we have the page with the new ID ".$newid.", and we must create the shortcut aliases: ".$reg[3]); + } + + if ($newid) { $objectpagestatic->fetch($newid); // We regenerate the pageX.tpl.php From b51be1117180fe5c146d1ebeb1144d3e6c69a9cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 13:39:24 +0100 Subject: [PATCH 1269/1862] Clean code --- htdocs/website/class/website.class.php | 208 ++----------------------- 1 file changed, 12 insertions(+), 196 deletions(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 290f18606f9..5f91c26ebd2 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -1244,7 +1244,8 @@ class Website extends CommonObject $arrayreplacement['__LOGO_MINI_KEY__'] = $this->db->escape($mysoc->logo_mini); $arrayreplacement['__LOGO_KEY__'] = $this->db->escape($mysoc->logo); - // Copy containers + + // Copy containers directory dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/containers', $conf->website->dir_output.'/'.$object->ref, 0, 1); // Overwrite if exists // Make replacement into css and htmlheader file @@ -1297,7 +1298,7 @@ class Website extends CommonObject $objectpagestatic = new WebsitePage($this->db); - // Make replacement of IDs + // Regenerate the php files for pages $fp = fopen($sqlfile, "r"); if ($fp) { while (!feof($fp)) { @@ -1367,7 +1368,7 @@ class Website extends CommonObject } } - // Regenerate index page to point to the new index page + // Regenerate the index.php page to point to the new index page $pathofwebsite = $conf->website->dir_output.'/'.$object->ref; dolSaveIndexPage($pathofwebsite, $pathofwebsite.'/index.php', $pathofwebsite.'/page'.$object->fk_default_home.'.tpl.php', $pathofwebsite.'/wrapper.php', $object); @@ -1705,173 +1706,20 @@ class Website extends CommonObject // Export on target sources $resultarray = dol_uncompress($pathtotmpzip, $destdir); + // Remove the file README and LICENSE from the $destdir (already into the containers directory) + dol_delete_file($destdir.'/README.md'); + dol_delete_file($destdir.'/LICENSE'); + + // Remove non required files (will be re-generated during the import) + dol_delete_file($destdir.'/containers/index.php'); + dol_delete_file($destdir.'/containers/master.inc.php'); + if (!empty($resultarray)) { setEventMessages("Error, failed to unzip the export into target dir", null, 'errors'); } else { setEventMessages("Website content written into ".$destdirrel, null, 'mesgs'); } - /* - $sourcedir = $conf->website->dir_output."/".$website->ref; - - // Get array with hash of files (for the last sync) - $fichierEtat = $sourcedir . '/filelist-'.dol_sanitizeFileName($destdir).'.txt'; - $etatPrecedent = $this->checkPreviousState($fichierEtat); - - // Get list of all source files of the website - $arraySourcedir = dol_dir_list($sourcedir); - - // Get list of modified files - $modifications = []; - foreach ($arraySourcedir as $file) { - if (substr($file['name'], -4) === '.old') { - continue; - } - $hashActuel = hash_file('md5', $file['fullname']); - - // Check whether the file is new or has been modified - if (!isset($etatPrecedent[$file['name']]) || $etatPrecedent[$file['name']] !== $hashActuel) { - $modifications[] = $file; - } - - $etatPrecedent[$file['name']] = $hashActuel; // we store he new hash to record it later on disk. - } - - $arraydestdir = dol_dir_list($destdir, "all", 1); - $differences = []; - $names = array_column($arraydestdir, 'name'); - $namesSource = array_column($arraySourcedir, 'name'); - - if (count($modifications) > 1) { - foreach ($modifications as $fichierModifie) { - $nomFichierModifie = $fichierModifie['name']; - if ($nomFichierModifie == basename($fichierEtat)) { - continue; - } - $success = 0; - - //check if it is a new file - if ((!preg_match('/^page\d+\.tpl\.php$/', $nomFichierModifie)) && (!in_array($nomFichierModifie, $names))) { - if (file_exists($fichierModifie['fullname']) && dol_is_dir($destdir.'/containers')) { - $cp = dol_copy($fichierModifie['fullname'], $destdir.'/containers/'.$nomFichierModifie, '0664'); - if ($cp > 0) { - if (file_exists($destdir.'/containers/'.$nomFichierModifie)) { - $tabnumpage = array(); - foreach ($arraydestdir as $fileDest) { - if ($this->extractNumberFromFilename($fileDest['name']) !== -1) { - $tabnumpage[] = $this->extractNumberFromFilename($fileDest['name']); - } - } - $getContentSource = file_get_contents($destdir.'/containers/'.$nomFichierModifie); - $nextpage = max($tabnumpage) + 1; - $chaineModifiee = preg_replace('/page\d+\.tpl\.php/', 'page' . $nextpage . '.tpl.php', $getContentSource); - $write = file_put_contents($destdir.'/containers/'.$nomFichierModifie, $chaineModifiee); - if ($write !== false) { - if (!touch($destdir.'/containers/'."page" . $nextpage . ".tpl.php")) { - setEventMessages("Please check permission to create page" . $nextpage . ".tpl.php in template ".$website->name_template."", null, 'errors'); - } - $filesFound = ''; - foreach ($arraySourcedir as $file) { - if ($file['name'] == $nomFichierModifie) { - $fileContent = file_get_contents($file['fullname']); - $matches = array(); - if (preg_match("/page\d+\.tpl\.php/", $fileContent, $matches)) { - $filesFound = $matches[0]; - break; - } - } - } - foreach ($arraySourcedir as $file) { - if ($file['name'] == $filesFound) { - if (!is_writable($file['fullname'])) { - dolChmod($file['fullname'], '0664'); - } - $diff = $this->showDifferences(file_get_contents($destdir.'/containers/'."page" . $nextpage . ".tpl.php"), file_get_contents($file['fullname']), array($nextpage,$this->extractNumberFromFilename($file['name']))); - if ($diff != -1) { - $replace = $this->replaceLineUsingNum($destdir.'/containers/'."page" . $nextpage . ".tpl.php", $diff); - if ($replace !== false) { - setEventMessages("Copy file page".$nextpage.".tpl.php in template ".$this->name_template." with success", null, 'warnings'); - } - } - } - } - } - } - - $this->saveState($etatPrecedent, $fichierEtat); - setEventMessages("file ".$nomFichierModifie." was created in template ".$website->name_template."", null, 'warnings'); - - header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website->ref); - exit(); - } - } else { - setEventMessages("Error, target dir containers not found", null, 'errors'); - $error = 1; - break; - } - } - - // Find the corresponding file in the destination folder - if (!$error && in_array($nomFichierModifie, $namesSource)) { - foreach ($arraydestdir as $destFile) { - if ($destFile['name'] == $nomFichierModifie) { - $sourceContent = file_get_contents($fichierModifie['fullname']); - $destContent = file_get_contents($destFile['fullname']); - - if ($sourceContent !== $destContent) { - $differences[$nomFichierModifie] = $this->showDifferences($destContent, $sourceContent); - if (count($differences[$nomFichierModifie]) > 0) { - $result = $this->replaceLineUsingNum($destFile['fullname'], $differences[$nomFichierModifie]); - if ($result >= 0) { - setEventMessages("file ".$nomFichierModifie." was modified in template ".$website->name_template."", null, 'warnings'); - } else { - if ($result == -2) { - setEventMessages("No permissions to write into file ".$destdirrel.'/'.$nomFichierModifie." from the current website ".$website->name_template."", null, 'errors'); - - header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website->ref); - exit(); - } - setEventMessages("file ".$nomFichierModifie." was not modified", null, 'errors'); - } - } - } - } - - if (preg_match('/page(\d+)\.tpl\.php/', $nomFichierModifie)) { - $differences[$nomFichierModifie] = $this->compareFichierModifie($sourcedir, $destdir, $fichierModifie); - if (count($differences[$nomFichierModifie]) > 0) { - $result = $this->replaceLineUsingNum($differences[$nomFichierModifie]['file_destination']['fullname'], $differences[$nomFichierModifie]); - if ($result !== false) { - if ($result == -2) { - setEventMessages("No permissions to write into file ".$destdirrel.'/'.$differences[$nomFichierModifie]['file_destination']['name']." from the current website ".$website->name_template."", null, 'errors'); - header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website->ref); - exit(); - } - $success++; - } - } - } - } - } - } - if ($success > 0) { - // Save the state file filelist.txt - $this->saveState($etatPrecedent, $fichierEtat); - setEventMessages("file ".$differences[$nomFichierModifie]['file_destination']['name']." was modified in template ".$website->name_template."", null, 'warnings'); - - header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website->ref); - exit(); - } - } else { - setEventMessages("No file has been modified", null, 'errors'); - } - - // save state file - if (!$error) { - $this->saveState($etatPrecedent, $fichierEtat); - } - */ - header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website->ref); exit(); } @@ -1939,38 +1787,6 @@ class Website extends CommonObject return file_put_contents($pathname, serialize($etat)); } - /** - * create file for save state of all files in folder - * - * @param string $sourcedir path of folder - * @return void - */ - /* - public function initFilesStatus($sourcedir) - { - $fichierEtat = $sourcedir . '/filelist-lastwrite-doctemplates.txt'; - - $etatPrecedent = $this->checkPreviousState($fichierEtat); - - // for first save state when create file - if (empty($etatPrecedent)) { - $arraySourcedir = dol_dir_list($sourcedir, "files"); - $etatFichiers = []; - - foreach ($arraySourcedir as $file) { - // Ignore .old files and the status file itself - if (substr($file['name'], -4) === '.old' || $file['name'] === basename($fichierEtat)) { - continue; - } - - $hashActuel = hash_file('md5', $file['fullname']); - $etatFichiers[$file['name']] = $hashActuel; - } - $this->saveState($etatFichiers, $fichierEtat); - } - } - */ - /** * Compare two files has not same name but same content * @param string $dossierSource filepath of folder source From 1134d9a7f06a4481a59361ec4577dc7403ca5603 Mon Sep 17 00:00:00 2001 From: William Mead Date: Thu, 14 Mar 2024 13:39:43 +0100 Subject: [PATCH 1270/1862] Deleted userdoneid. Cleaned code. --- htdocs/comm/action/class/actioncomm.class.php | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index dff69c1ab21..b8364ea8dbc 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -240,12 +240,6 @@ class ActionComm extends CommonObject */ public $userownerid; - /** - * @var int Id of user that has done the event. Used only if AGENDA_ENABLE_DONEBY is set. - * @deprecated Use $userownerid instead - */ - public $userdoneid; - /** * @var int[] Array of contact ids */ @@ -494,7 +488,6 @@ class ActionComm extends CommonObject } $userownerid = $this->userownerid; - $userdoneid = $this->userdoneid; // Be sure assigned user is defined as an array of array('id'=>,'mandatory'=>,...). if (empty($this->userassigned) || count($this->userassigned) == 0 || !is_array($this->userassigned)) { @@ -544,7 +537,6 @@ class ActionComm extends CommonObject $sql .= "fk_contact,"; $sql .= "fk_user_author,"; $sql .= "fk_user_action,"; - $sql .= "fk_user_done,"; $sql .= "label,percent,priority,fulldayevent,location,"; $sql .= "transparency,"; $sql .= "fk_element,"; @@ -583,7 +575,6 @@ class ActionComm extends CommonObject $sql .= ((isset($this->contact_id) && $this->contact_id > 0) ? ((int) $this->contact_id) : "null").", "; // deprecated, use ->socpeopleassigned $sql .= (isset($user->id) && $user->id > 0 ? $user->id : "null").", "; $sql .= ($userownerid > 0 ? $userownerid : "null").", "; - $sql .= ($userdoneid > 0 ? $userdoneid : "null").", "; $sql .= "'".$this->db->escape($this->label)."', "; $sql .= "'".$this->db->escape($this->percentage)."', "; $sql .= "'".$this->db->escape($this->priority)."', "; @@ -812,7 +803,7 @@ class ActionComm extends CommonObject $sql .= " a.fk_soc,"; $sql .= " a.fk_project,"; $sql .= " a.fk_user_author, a.fk_user_mod,"; - $sql .= " a.fk_user_action, a.fk_user_done,"; + $sql .= " a.fk_user_action,"; $sql .= " a.fk_contact, a.percent as percentage,"; $sql .= " a.fk_element as elementid, a.elementtype,"; $sql .= " a.priority, a.fulldayevent, a.location, a.transparency,"; @@ -1162,16 +1153,9 @@ class ActionComm extends CommonObject $this->fk_project = 0; } - // Check parameters - if ($this->percentage == 0 && $this->userdoneid > 0) { - $this->error = "ErrorCantSaveADoneUserWithZeroPercentage"; - return -1; - } - $socid = (($this->socid > 0) ? $this->socid : 0); $contactid = (($this->contact_id > 0) ? $this->contact_id : 0); $userownerid = ($this->userownerid ? $this->userownerid : 0); - $userdoneid = ($this->userdoneid ? $this->userdoneid : 0); // If a type_id is set, we must also have the type_code set if ($this->type_id > 0) { @@ -1209,7 +1193,6 @@ class ActionComm extends CommonObject $sql .= ", transparency = '".$this->db->escape($this->transparency)."'"; $sql .= ", fk_user_mod = ".((int) $user->id); $sql .= ", fk_user_action = ".($userownerid > 0 ? ((int) $userownerid) : "null"); - $sql .= ", fk_user_done = ".($userdoneid > 0 ? ((int) $userdoneid) : "null"); if (!empty($this->fk_element)) { $sql .= ", fk_element=".($this->fk_element ? ((int) $this->fk_element) : "null"); } @@ -1432,7 +1415,7 @@ class ActionComm extends CommonObject } $sql .= " AND a.entity IN (".getEntity('agenda').")"; if (!$user->hasRight('agenda', 'allactions', 'read')) { - $sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id)." OR a.fk_user_done = ".((int) $user->id); + $sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id); $sql .= " OR ar.fk_element = ".((int) $user->id); $sql .= ")"; } @@ -2004,7 +1987,6 @@ class ActionComm extends CommonObject $buildfile = true; $login = ''; $logina = ''; - $logind = ''; $logint = ''; $eventorganization = ''; @@ -2355,9 +2337,6 @@ class ActionComm extends CommonObject if ($logint) { $more = $langs->transnoentities("ActionsToDoBy").' '.$logint; } - if ($logind) { - $more = $langs->transnoentities("ActionsDoneBy").' '.$logind; - } if ($eventorganization) { $langs->load("eventorganization"); $title = $langs->transnoentities("OrganizedEvent").(empty($eventarray[0]['label']) ? '' : ' '.$eventarray[0]['label']); From 93a2ab24c8600133530f40c07c543cd08904e28d Mon Sep 17 00:00:00 2001 From: William Mead Date: Thu, 14 Mar 2024 13:43:44 +0100 Subject: [PATCH 1271/1862] Deleted AGENDA_ENABLE_DONEBY option. Cleaned code. --- htdocs/comm/action/card.php | 47 ------------------------------------- 1 file changed, 47 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index f5d96eec190..1e27f3d54f8 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -426,12 +426,6 @@ if (empty($reshook) && $action == 'add') { } } - if (!$error && getDolGlobalString('AGENDA_ENABLE_DONEBY')) { - if (GETPOST("doneby") > 0) { - $object->userdoneid = GETPOSTINT("doneby"); - } - } - $object->note_private = trim(GETPOST("note", "restricthtml")); if (GETPOSTISSET("contactid")) { @@ -877,12 +871,6 @@ if (empty($reshook) && $action == 'update') { $object->transparency = $transparency; // We set transparency on event (even if we can also store it on each user, standard says this property is for event) // TODO store also transparency on owner user - if (getDolGlobalString('AGENDA_ENABLE_DONEBY')) { - if (GETPOST("doneby")) { - $object->userdoneid = GETPOSTINT("doneby"); - } - } - // Check parameters if (GETPOSTISSET('actioncode') && !GETPOST('actioncode', 'aZ09')) { // actioncode is '0' $error++; @@ -1230,16 +1218,6 @@ if ($action == 'create') { setdatefields(); }); - $("#selectcomplete").change(function() { - console.log("we change the complete status - set the doneby"); - if ($("#selectcomplete").val() == 100) { - if ($("#doneby").val() <= 0) $("#doneby").val(\''.((int) $user->id).'\'); - } - if ($("#selectcomplete").val() == 0) { - $("#doneby").val(-1); - } - }); - $("#actioncode").change(function() { if ($("#actioncode").val() == \'AC_RDV\') $("#dateend").addClass("fieldrequired"); else $("#dateend").removeClass("fieldrequired"); @@ -1444,13 +1422,6 @@ if ($action == 'create') { print ''; print ''; - // Done by - if (getDolGlobalString('AGENDA_ENABLE_DONEBY')) { - print '
'; - } - // Location if (!getDolGlobalString('AGENDA_DISABLE_LOCATION')) { print ''; @@ -1995,13 +1966,6 @@ if ($id > 0) { }*/ print ''; - // Realised by - if (getDolGlobalString('AGENDA_ENABLE_DONEBY')) { - print ''; - } - // Location if (!getDolGlobalString('AGENDA_DISABLE_LOCATION')) { print ''; @@ -2427,17 +2391,6 @@ if ($id > 0) { */ print ' '; - // Done by - if (getDolGlobalString('AGENDA_ENABLE_DONEBY')) { - print ''; - } - // Categories if (isModEnabled('category')) { print ''; } - // rate indirect - if (!empty($arrayfields['cr.rate_indirect']['checked'])) { - print ''; - } // Fields from hook $parameters = array('arrayfields'=>$arrayfields); @@ -545,9 +531,6 @@ if ($resql) { if (!empty($arrayfields['cr.rate']['checked'])) { print_liste_field_titre($arrayfields['cr.rate']['label'], $_SERVER["PHP_SELF"], "cr.rate", "", $param, "", $sortfield, $sortorder); } - if (!empty($arrayfields['cr.rate_indirect']['checked'])) { - print_liste_field_titre($arrayfields['cr.rate_indirect']['label'], $_SERVER["PHP_SELF"], "cr.rate_indirect", "", $param, "", $sortfield, $sortorder); - } // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); @@ -576,23 +559,6 @@ if ($resql) { print ''; print ''; - // LRR Calculate Rate Direct - print ''; - print ''; print ''; - print ''; print ''; print ''."\n"; print ''."\n"; print ''."\n"; +// @phan-suppress-next-line PhanTypeSuspiciousStringExpression (user is defined in the stdClass) print ''."\n"; print ''."\n"; print ''."\n"; From f252a283d21d2801020abbaadc8e8592feee8045 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 02:09:17 +0100 Subject: [PATCH 1819/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/class/CSMSFile.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 4e34d9a284f..e602896e82f 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -69,6 +69,9 @@ class CSMSFile public $priority; public $class; public $message; + /** + * @var bool + */ public $nostop; public $socid; @@ -242,7 +245,7 @@ class CSMSFile fwrite($fp, "Priority: ".$this->priority."\n"); fwrite($fp, "Class: ".$this->class."\n"); fwrite($fp, "Deferred: ".$this->deferred."\n"); - fwrite($fp, "DisableStop: ".$this->nostop."\n"); + fwrite($fp, "DisableStop: ".((string) (int) $this->nostop)."\n"); fwrite($fp, "DeliveryReceipt: ".$this->deliveryreceipt."\n"); fwrite($fp, "Message:\n".$this->message); From f43fd7c934928d14290080ffd24cd531417b9a8d Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 02:09:19 +0100 Subject: [PATCH 1820/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 892fd02fcdb..27a787447ba 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -10135,7 +10135,7 @@ abstract class CommonObject } } else { $error++; - $this->errors[] = "You defined a cascade delete on an object $childObject but there is no method deleteByParentField for it"; + $this->errors[] = "You defined a cascade delete on an object $className/$this->id but there is no method deleteByParentField for it"; break; } } else { From 0cd2b3f06934fce9eb3f51ac5f7ae180439047ca Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 02:09:21 +0100 Subject: [PATCH 1821/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/class/html.formmail.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index edef301c3de..7d369ebe4f4 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -179,6 +179,9 @@ class FormMail extends Form public $substit = array(); public $substit_lines = array(); + /** + * @var array{models:string,langmodels?:string,fileinit?:string[],returnurl:string} + */ public $param = array(); public $withtouser = array(); From 2b7f9b2a865f5e7b5731ba3820ef4e738687dc3a Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 02:09:23 +0100 Subject: [PATCH 1822/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/class/interfaces.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 72564645e59..4bc69ddc7e6 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2009 Laurent Destailleur * Copyright (C) 2006 Rodolphe Quiedeville * Copyright (C) 2010 Regis Houssin + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -81,16 +82,16 @@ class Interfaces // Check parameters if (!is_object($object) || !is_object($conf)) { // Error - $error = 'function run_triggers called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf); + $error = 'function run_triggers called with wrong parameters action='.$action.' object='.((string) (int) is_object($object)).' user='.((string) (int) is_object($user)).' langs='.((string) (int) is_object($langs)).' conf='.((string) (int) is_object($conf)); dol_syslog(get_class($this).'::run_triggers '.$error, LOG_ERR); $this->errors[] = $error; return -1; } if (!is_object($langs)) { // Warning - dol_syslog(get_class($this).'::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING); + dol_syslog(get_class($this).'::run_triggers was called with wrong parameters action='.$action.' object='.((string) (int) is_object($object)).' user='.((string) (int) is_object($user)).' langs='.((string) (int) is_object($langs)).' conf='.((string) (int) is_object($conf)), LOG_WARNING); } if (!is_object($user)) { // Warning - dol_syslog(get_class($this).'::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING); + dol_syslog(get_class($this).'::run_triggers was called with wrong parameters action='.$action.' object='.((string) (int) is_object($object)).' user='.((string) (int) is_object($user)).' langs='.((string) (int) is_object($langs)).' conf='.((string) (int) is_object($conf)), LOG_WARNING); $user = new User($this->db); } From 4728b1ec5e06536477c4eaa4e8335c14387a453a Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 02:09:25 +0100 Subject: [PATCH 1823/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/lib/bank.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index ffde1206773..5c22a696d6d 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -189,7 +189,7 @@ function bank_admin_prepare_head($object) * Prepare array with list of tabs * * @param Object $object Object related to tabs - * @param Object $num val to account statement + * @param string $num val to account statement * @return array Array of tabs to shoc */ function account_statement_prepare_head($object, $num) From 50379954541b6b2b6c87eddfeed127d9c8dfc07f Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 02:09:27 +0100 Subject: [PATCH 1824/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/lib/functions.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4a1beee4bcf..0931f402eb1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3306,7 +3306,7 @@ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = 'auto', 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); + dol_syslog("Warning dol_tz_string contains an invalid value ".json_encode($_SESSION["dol_tz_string"] ?? null), LOG_WARNING); $default_timezone = @date_default_timezone_get(); } } elseif (strrpos($gm, "tz,") !== false) { @@ -7074,7 +7074,7 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, $buyer_country_code = $thirdparty_buyer->country_code; $buyer_in_cee = isInEEC($thirdparty_buyer); - dol_syslog("get_default_tva: seller use vat=".$seller_use_vat.", seller country=".$seller_country_code.", seller in cee=".$seller_in_cee.", buyer vat number=".$thirdparty_buyer->tva_intra." buyer country=".$buyer_country_code.", buyer in cee=".$buyer_in_cee.", idprod=".$idprod.", idprodfournprice=".$idprodfournprice.", SERVICE_ARE_ECOMMERCE_200238EC=".(getDolGlobalString('SERVICES_ARE_ECOMMERCE_200238EC') ? $conf->global->SERVICES_ARE_ECOMMERCE_200238EC : '')); + dol_syslog("get_default_tva: seller use vat=".$seller_use_vat.", seller country=".$seller_country_code.", seller in cee=".((string) (int) $seller_in_cee).", buyer vat number=".$thirdparty_buyer->tva_intra." buyer country=".$buyer_country_code.", buyer in cee=".((string) (int) $buyer_in_cee).", idprod=".$idprod.", idprodfournprice=".$idprodfournprice.", SERVICE_ARE_ECOMMERCE_200238EC=".(getDolGlobalString('SERVICES_ARE_ECOMMERCE_200238EC') ? $conf->global->SERVICES_ARE_ECOMMERCE_200238EC : '')); // If services are eServices according to EU Council Directive 2002/38/EC (http://ec.europa.eu/taxation_customs/taxation/vat/traders/e-commerce/article_1610_en.htm) // we use the buyer VAT. @@ -11763,7 +11763,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * @param string $label Label or tooltip of button if $text is provided. Also used as tooltip in title attribute. Can be escaped HTML content or full simple text. * @param string $text Optional : short label on button. Can be escaped HTML content or full simple text. * @param string $actionType 'default', 'danger', 'email', 'clone', 'cancel', 'delete', ... - * @param string|array $url Url for link or array of subbutton description ('label'=>, 'url'=>, 'lang'=>, 'perm'=> ) + * @param string|array $url Url for link or array of subbutton description ('label'=>, 'url'=>, 'lang'=>, 'perm'=> ) * Example when an array is used: $arrayforbutaction = array( * 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), * 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("order"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), From b683ad4b66e73885cba57372d44a277982982726 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 02:34:37 +0100 Subject: [PATCH 1825/1862] Fix $labelToUse --- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index baf4e960678..b4e95f3fa18 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -11,6 +11,7 @@ * Copyright (C) 2018 Frédéric France * Copyright (C) 2022 Anthony Berton * Copyright (C) 2022 Alexandre Spangaro + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1921,7 +1922,7 @@ class pdf_sponge extends ModelePDFFactures // Credit note if ($creditnoteamount) { $labeltouse = ($outputlangs->transnoentities("CreditNotesOrExcessReceived") != "CreditNotesOrExcessReceived") ? $outputlangs->transnoentities("CreditNotesOrExcessReceived") : $outputlangs->transnoentities("CreditNotes"); - $labeltouse .= (is_object($outputlangsbis) ? (' / '.($outputlangsbis->transnoentities("CreditNotesOrExcessReceived") != "CreditNotesOrExcessReceived") ? $outputlangsbis->transnoentities("CreditNotesOrExcessReceived") : $outputlangsbis->transnoentities("CreditNotes")) : ''); + $labeltouse .= (is_object($outputlangsbis) ? (' / '.(($outputlangsbis->transnoentities("CreditNotesOrExcessReceived") != "CreditNotesOrExcessReceived") ? $outputlangsbis->transnoentities("CreditNotesOrExcessReceived") : $outputlangsbis->transnoentities("CreditNotes"))) : ''); $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $labeltouse, 0, 'L', 0); From 0284ef4b6672bff053368feddd3e1f150585699f Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 02:38:30 +0100 Subject: [PATCH 1826/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/lib/modulebuilder.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index b05628a951e..54107b65144 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -547,12 +547,12 @@ function compareFirstValue($a, $b) /** * Rewriting all permissions after any actions * @param string $file filename or path - * @param array $permissions permissions existing in file + * @param array $permissions permissions existing in file * @param int|null $key key for permission needed * @param array|null $right $right to update or add * @param string|null $objectname name of object * @param string|null $module name of module - * @param int $action 0 for delete, 1 for add, 2 for update, -1 when delete object completely, -2 for generate rights after add + * @param int<-2,2> $action 0 for delete, 1 for add, 2 for update, -1 when delete object completely, -2 for generate rights after add * @return int 1 if OK,-1 if KO */ function reWriteAllPermissions($file, $permissions, $key, $right, $objectname, $module, $action) From 02ea350a340a57f1ef7730ccb3b63bad1eda58c6 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 02:38:32 +0100 Subject: [PATCH 1827/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/menus/standard/auguria.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index ddbd7fab4b9..c12fbc08c45 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -92,6 +92,7 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout // Complete param to force leftmenu to '' to close open menu when we click on a link with no leftmenu defined. if ((!preg_match('/mainmenu/i', $param)) && (!preg_match('/leftmenu/i', $param)) && !empty($newTabMenu[$i]['url'])) { + // @phan-suppress-next-line PhanTypeSuspiciousStringExpression $param .= ($param ? '&' : '').'mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu='; } if ((!preg_match('/mainmenu/i', $param)) && (!preg_match('/leftmenu/i', $param)) && empty($newTabMenu[$i]['url'])) { From bbf2fb82e7fa71bccf5c410ce07d9dd1f05094c7 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 02:38:34 +0100 Subject: [PATCH 1828/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/menus/standard/eldy.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 9c5d138dfc6..165e09c12b5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -506,6 +506,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $param = (isset($tmp[1]) ? $tmp[1] : ''); if ((!preg_match('/mainmenu/i', $param)) || !preg_match('/leftmenu/i', $param)) { + // @phan-suppress-next-line PhanTypeSuspiciousStringExpression $param .= ($param ? '&' : '').'mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu='; } //$url.="idmenu=".$newTabMenu[$i]['rowid']; // Already done by menuLoad From 1fc3c3a46d1f9e73f59cf44b472a22111c5eb689 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 02:38:36 +0100 Subject: [PATCH 1829/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/menus/standard/empty.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index b69c34b8111..3d70364cbf9 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -370,6 +370,8 @@ class MenuManager return 0; } + '@phan-var-force array,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string}> $menu_array'; + if (empty($noout)) { $alt = 0; $altok = 0; From f9c3d1d48db8baef798b8112fa0df044f7b27a3e Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 16:40:21 +0100 Subject: [PATCH 1830/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/photos_resize.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 393cb4067c1..70c8da59d2a 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -3,6 +3,7 @@ * Copyright (C) 2009 Meos * Copyright (C) 2012 Regis Houssin * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -581,7 +582,7 @@ if (!empty($conf->use_javascript_ajax)) { - + From e67d1de5bd6692db886a231d46c1997e64c9e75e Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 16:40:24 +0100 Subject: [PATCH 1831/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/tpl/advtarget.tpl.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index a4c13f5cd4f..42aba1b10ba 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -108,8 +108,11 @@ print ''."\n"; print ''."\n"; @@ -339,7 +342,7 @@ if (!getDolGlobalString('MAIN_EXTRAFIELDS_DISABLED')) { $std_soc = new Societe($db); $action_search = 'query'; - $parameters = array('advtarget'=>1); + $parameters = array('advtarget' => 1); if (!empty($advTarget->id)) { $parameters = array('array_query' => $advTarget->filtervalue); } From 9d4aede5c7a5c1741ba054ed934db7fc3cd5b0b5 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 16:40:26 +0100 Subject: [PATCH 1832/1862] Fix PhanTypeSuspiciousStringExpression --- .../triggers/interface_20_modWorkflow_WorkflowManager.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 1edea428b6f..3aaff1fe943 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -56,7 +56,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) * * @param string $action Event action code - * @param Object $object Object + * @param CommonObject $object Object * @param User $user Object user * @param Translate $langs Object langs * @param conf $conf Object conf From 22e370c011ffdb4723e19e35a4d89611c6cb8f86 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 16:40:28 +0100 Subject: [PATCH 1833/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/debugbar/class/DataCollector/DolibarrCollector.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/debugbar/class/DataCollector/DolibarrCollector.php b/htdocs/debugbar/class/DataCollector/DolibarrCollector.php index c074068dba1..a114937ce59 100644 --- a/htdocs/debugbar/class/DataCollector/DolibarrCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolibarrCollector.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -63,6 +64,7 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid $info = $langs->trans('Host').': '.$conf->db->host.'
'; $info .= $langs->trans('Port').': '.$conf->db->port.'
'; $info .= $langs->trans('Name').': '.$conf->db->name.'
'; + // @phan-suppress-next-line PhanTypeSuspiciousStringExpression $info .= $langs->trans('User').': '.$conf->db->user.'
'; $info .= $langs->trans('Type').': '.$conf->db->type.'
'; $info .= $langs->trans('Prefix').': '.$conf->db->prefix.'
'; From fe18e88383448ce0f5b975bceb7f74121b09a1a4 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 16:40:31 +0100 Subject: [PATCH 1834/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/don/list.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 13ffaf15511..907ec01e668 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2019 Thibault FOUCART + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -465,10 +466,10 @@ while ($i < $imaxinloop) { if (!empty($obj->socid) && $company->id > 0) { print "
"; } else { - print ""; + print ""; } } else { - print ""; + print ""; } print ""; print ''; From 7f4c1fbd06482f295725f0983b3c7e442bee6319 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 16:40:34 +0100 Subject: [PATCH 1835/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/emailcollector/class/emailcollector.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index ef98b294f70..792440a0db7 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -3495,6 +3495,7 @@ class EmailCollector extends CommonObject $params[strtolower($x->attribute)] = $x->value; } } + '@phan-var-force array{filename?:string,name?:string,charset?:string} $params'; // ATTACHMENT // Any part with a filename is an attachment, From f4c8bc5b1d9b3c5b41335e863c019b394d21dca2 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 16:40:36 +0100 Subject: [PATCH 1836/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/expedition/class/expedition.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 7454e0b7832..dac6efee52c 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -3050,7 +3050,8 @@ class ExpeditionLigne extends CommonObjectLine // update lot if (!empty($batch) && isModEnabled('productbatch')) { - dol_syslog(get_class($this)."::update expedition batch id=$expedition_batch_id, batch_id=$batch_id, batch=$batch"); + $batch_id_str = $batch_id ?? 'null'; + dol_syslog(get_class($this)."::update expedition batch id=$expedition_batch_id, batch_id=$batch_id_str, batch=$batch"); if (empty($batch_id) || empty($this->fk_product)) { dol_syslog(get_class($this).'::update missing fk_origin_stock (batch_id) and/or fk_product', LOG_ERR); From c79ca14dd952ebbcf6190591d423588ed1423f63 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 19:59:47 +0100 Subject: [PATCH 1837/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/boxes/modules_boxes.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 3ada87e0a10..11af741a6a4 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -194,12 +194,12 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo /** * Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function) * - * @param array $head Array with properties of box title - * @param array> $contents Array with properties of box lines + * @param array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title + * @param array> $contents Array with properties of box lines * @param int $nooutput No print, only return string * @return string */ - public function showBox($head = null, $contents = null, $nooutput = 0) + public function showBox($head, $contents, $nooutput = 0) { global $langs, $user, $conf; @@ -231,7 +231,6 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo $out .= "\n\n"; $out .= '
'."\n"; - if (!empty($head['text']) || !empty($head['sublink']) || !empty($head['subpicto']) || $nblines) { $out .= '
'; - if (isModEnabled('commande')) { + if (isModEnabled('order')) { print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')'); } else { print $langs->trans('AvailabilityPeriod'); @@ -2695,7 +2695,7 @@ if ($action == 'create') { print '
'; print ''; } - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) { // Bank Account print ''; if (getDolGlobalString('LDAP_SERVER_TYPE') == "activedirectory") { $ldap = new Ldap(); $result = $ldap->connectBind(); - ($result > 0) ? ($userSID = $ldap->getObjectSid($object->login)) : $userSID = ''; + $userSID = ''; + if ($result > 0) { + $userSID = $ldap->getObjectSid($object->login); + } print ''; print ''; print "\n"; From 769fafbdea5890d29e53ed34f63942fac61198c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 13 Mar 2024 18:24:59 +0100 Subject: [PATCH 1242/1862] fix warnings --- .../conferenceorboothattendee_note.php | 54 ++----------------- 1 file changed, 4 insertions(+), 50 deletions(-) diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php index 99768a9b738..66caf29a247 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_note.php +++ b/htdocs/eventorganization/conferenceorboothattendee_note.php @@ -1,6 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,59 +23,12 @@ * \brief Tab for notes on ConferenceOrBoothAttendee */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; - $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; -dol_include_once('/eventorganization/class/conferenceorboothattendee.class.php'); -dol_include_once('/eventorganization/lib/eventorganization_conferenceorboothattendee.lib.php'); +require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorboothattendee.class.php'; +require_once DOL_DOCUMENT_ROOT . '/eventorganization/lib/eventorganization_conferenceorboothattendee.lib.php'; // Load translation files required by the page $langs->loadLangs(array('eventorganization', 'companies')); From 3cc9467ee4a00f6bfb8604e84ca210309bec651a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2024 18:39:51 +0100 Subject: [PATCH 1243/1862] Clean code --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index c3cfdf85fca..91e7d127486 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -198,7 +198,7 @@ class CMailFile } } if (empty($this->sendmode)) { - $this->sendmode = (getDolGlobalString('MAIN_MAIL_SENDMODE') ? $conf->global->MAIN_MAIL_SENDMODE : 'mail'); + $this->sendmode = getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'); } // Add a Feedback-ID. Must be used for stats on spam report only. From ec7ff74f2561cd685cf9fd75751c6fae0e67d25b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 13 Mar 2024 18:45:02 +0100 Subject: [PATCH 1244/1862] clean code --- htdocs/ai/admin/custom_prompt.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/htdocs/ai/admin/custom_prompt.php b/htdocs/ai/admin/custom_prompt.php index 699479bbb9e..c791479eca8 100644 --- a/htdocs/ai/admin/custom_prompt.php +++ b/htdocs/ai/admin/custom_prompt.php @@ -1,6 +1,7 @@ * Copyright (C) 2022 Alice Adminson + * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -137,7 +138,7 @@ if ($action == 'updatePrompts') { $newConfigurationsJson = json_encode($currentConfigurations, JSON_UNESCAPED_UNICODE); $result = dolibarr_set_const($db, 'AI_CONFIGURATIONS_PROMPT', $newConfigurationsJson, 'chaine', 0, '', $conf->entity); if (!$error) { - $action = 'dodo'; + $action = ''; if ($result) { header("Location: ".$_SERVER['PHP_SELF']); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -165,9 +166,6 @@ if ($action == 'confirm_deleteproperty' && GETPOST('confirm') == 'yes') { } } } -if ($action == 'confirm_deleteproperty') { - var_dump(GETPOST('confirm'));exit; -} /* @@ -344,7 +342,7 @@ if ($action == 'edit' || $action == 'create') { $('#postPromptInput').val(''); } }); - + $('.showInputBtn').click(function() { event.preventDefault(); var index = $(this).data('index'); @@ -357,7 +355,7 @@ if ($action == 'edit' || $action == 'create') { $(this).html($(this).data('icon-cancel')); $(this).data('state', 'cancel'); - } else { + } else { $('#prePromptInput_'+index).attr('disabled', 'disabled'); $('#postPromptInput_'+index).attr('disabled', 'disabled'); @@ -367,8 +365,8 @@ if ($action == 'edit' || $action == 'create') { } }); }); - - + + "; print $out; From 45a68ba612d3d4bf8b442605a784428690e72c1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2024 20:17:26 +0100 Subject: [PATCH 1245/1862] Better error management --- htdocs/core/lib/files.lib.php | 14 +++++----- htdocs/core/lib/modulebuilder.lib.php | 27 +++++++++++++++---- htdocs/langs/en_US/errors.lang | 2 +- htdocs/modulebuilder/index.php | 21 ++++++++------- .../core/modules/modMyModule.class.php | 10 +++++-- 5 files changed, 49 insertions(+), 25 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index d19e28faa01..960d9ee7eec 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -644,19 +644,17 @@ function dol_fileperm($pathoffile) /** * Make replacement of strings into a file. * - * @param string $srcfile Source file (can't be a directory) + * @param string $srcfile Source file (can't be a directory) * @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...) - * @param string $destfile Destination file (can't be a directory). If empty, will be same than source file. - * @param string $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666' - * @param int $indexdatabase 1=index new file into database. - * @param int $arrayreplacementisregex 1=Array of replacement is already an array with key that is a regex. Warning: the key must be escaped with preg_quote for '/' - * @return int Return integer <0 if error, 0 if nothing done (dest file already exists), >0 if OK + * @param string $destfile Destination file (can't be a directory). If empty, will be same than source file. + * @param string $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666' + * @param int $indexdatabase 1=index new file into database. + * @param int $arrayreplacementisregex 1=Array of replacement is already an array with key that is a regex. Warning: the key must be escaped with preg_quote for '/' + * @return int Return integer <0 if error, 0 if nothing done (dest file already exists), >0 if OK * @see dol_copy() */ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask = '0', $indexdatabase = 0, $arrayreplacementisregex = 0) { - global $conf; - dol_syslog("files.lib.php::dolReplaceInFile srcfile=".$srcfile." destfile=".$destfile." newmask=".$newmask." indexdatabase=".$indexdatabase." arrayreplacementisregex=".$arrayreplacementisregex); if (empty($srcfile)) { diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index 19d9c9319a2..68e8b982cce 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -456,20 +456,37 @@ function dolGetListOfObjectClasses($destdir) return -1; } + /** - * function for check if comment begin an end exist in modMyModule class - * @param string $file filename or path - * @param int $number 0 = For Menus,1 = For permissions, 2 = For Dictionaries - * @return int 1 if OK , -1 if KO + * Function to check if comment begin an end exist in modMyModule class + * + * @param string $file Filename or path + * @param int $number 0 = For Menus,1 = For permissions, 2 = For Dictionaries + * @return int 1 if OK , -1 if KO */ function checkExistComment($file, $number) { if (!file_exists($file)) { return -1; } + $content = file_get_contents($file); if ($number === 0) { - if (strpos($content, '/* BEGIN MODULEBUILDER LEFTMENU MYOBJECT */') !== false && strpos($content, '/* END MODULEBUILDER LEFTMENU MYOBJECT */') !== false) { + $ret = 0; + if (strpos($content, '/* BEGIN MODULEBUILDER TOPMENU MYOBJECT */') !== false) { + $ret++; + } + if (strpos($content, '/* END MODULEBUILDER TOPMENU MYOBJECT */') !== false) { + $ret++; + } + if (strpos($content, '/* BEGIN MODULEBUILDER LEFTMENU MYOBJECT */') !== false) { + $ret++; + } + if (strpos($content, '/* END MODULEBUILDER LEFTMENU MYOBJECT */') !== false) { + $ret++; + } + + if ($ret == 4) { return 1; } } elseif ($number === 1) { diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 3290d9a2251..fe7cb304610 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -374,7 +374,7 @@ WarningModuleNeedRefresh = Module %s has been disabled. Don't forget to e WarningPermissionAlreadyExist=Existing permissions for this object WarningGoOnAccountancySetupToAddAccounts=If this list is empty, go into menu %s - %s - %s to load or create accounts for your chart of account. WarningCorrectedInvoiceNotFound=Corrected invoice not found -WarningCommentNotFound=Please check placement of start and end comments for %s section in file %s before submitting your action +WarningCommentNotFound=Warning: Can't find the start and/or end comments for the section %s into the file %s WarningAlreadyReverse=Stock movement already reversed SwissQrOnlyVIR = SwissQR invoice can only be added on invoices set to be paid with credit transfer payments. diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 6d1a5a85d06..1e78c341f06 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1017,6 +1017,8 @@ if ($dirins && $action == 'confirm_removefile' && !empty($module)) { // Init an object if ($dirins && $action == 'initobject' && $module && $objectname) { + $warning = 0; + $objectname = ucfirst($objectname); $dirins = $dirread = $listofmodules[strtolower($module)]['moduledescriptorrootpath']; @@ -1365,13 +1367,12 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { } } - if (!$error) { foreach ($filetogenerate as $srcfile => $destfile) { $result = dol_copy($srcdir.'/'.$srcfile, $destdir.'/'.$destfile, $newmask, 0); if ($result <= 0) { if ($result < 0) { - $error++; + $warning++; $langs->load("errors"); setEventMessages($langs->trans("ErrorFailToCopyFile", $srcdir.'/'.$srcfile, $destdir.'/'.$destfile), null, 'errors'); } else { @@ -1383,6 +1384,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { '/myobject\.class\.php/' => strtolower($objectname).'.class.php', '/myobject\.lib\.php/' => strtolower($objectname).'.lib.php', ); + dolReplaceInFile($destdir.'/'.$destfile, $arrayreplacement, '', 0, 0, 1); } } @@ -1529,8 +1531,8 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { if (!$counter) { $checkComment = checkExistComment($moduledescriptorfile, 0); if ($checkComment < 0) { - $error++; - setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Menus"), "mod".$module."class.php"), null, 'warnings'); + $warning++; + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Menus"), basename($moduledescriptorfile)), null, 'warnings'); } else { $arrayofreplacement = array('/* END MODULEBUILDER LEFTMENU MYOBJECT */' => '/*LEFTMENU '.strtoupper($objectname).'*/'.$stringtoadd."\n\t\t".'/*END LEFTMENU '.strtoupper($objectname).'*/'."\n\t\t".'/* END MODULEBUILDER LEFTMENU MYOBJECT */'); dolReplaceInFile($moduledescriptorfile, $arrayofreplacement); @@ -1580,7 +1582,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { if (is_numeric($object) && $object <= 0) { $pathoffiletoeditsrc = $destdir.'/class/'.strtolower($objectname).'.class.php'; setEventMessages($langs->trans('ErrorFailToCreateFile', $pathoffiletoeditsrc), null, 'errors'); - $error++; + $warning++; } // check if documentation was generate and add table of properties object $file = $destdir.'/class/'.strtolower($objectname).'.class.php'; @@ -1610,7 +1612,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { // check if module is enabled if (isModEnabled(strtolower($module))) { $result = unActivateModule(strtolower($module)); - dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); if ($result) { setEventMessages($result, null, 'errors'); } @@ -1898,11 +1900,12 @@ if ($dirins && $action == 'confirm_deletemodule') { } else { $error++; $langs->load("errors"); - dol_print_error($db, $langs->trans("ErrorFailedToLoadModuleDescriptorForXXX", $module)); - exit; + setEventMessages($langs->trans("ErrorFailedToLoadModuleDescriptorForXXX", $module), null, 'warnings'); } - $moduleobj->remove(); + if ($moduleobj) { + $moduleobj->remove(); + } $result = dol_delete_dir_recursive($dir); diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 0b166dd54b1..53c7957cf78 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -28,6 +28,7 @@ */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; + /** * Description and activation class for module MyModule */ @@ -303,8 +304,10 @@ class modMyModule extends DolibarrModules // Main menu entries to add $this->menu = array(); $r = 0; + // Add here entries to declare new menus - /* BEGIN MODULEBUILDER TOPMENU */ + + /* BEGIN MODULEBUILDER TOPMENU MYOBJECT */ $this->menu[$r++] = array( 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'top', // This is a Top menu entry @@ -320,7 +323,8 @@ class modMyModule extends DolibarrModules 'target'=>'', 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both ); - /* END MODULEBUILDER TOPMENU */ + /* END MODULEBUILDER TOPMENU MYOBJECT */ + /* BEGIN MODULEBUILDER LEFTMENU MYOBJECT */ /*$this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode @@ -366,6 +370,8 @@ class modMyModule extends DolibarrModules 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both );*/ /* END MODULEBUILDER LEFTMENU MYOBJECT */ + + // Exports profiles provided by this module $r = 1; /* BEGIN MODULEBUILDER EXPORT MYOBJECT */ From 345edd56fb7de26ad1e90f5a2c1c2f7651e7550e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 13 Mar 2024 21:07:56 +0100 Subject: [PATCH 1246/1862] clean code --- htdocs/hrm/class/evaluation.class.php | 39 ++---------------- htdocs/hrm/class/evaluationdet.class.php | 44 ++------------------- htdocs/hrm/class/job.class.php | 40 ++----------------- htdocs/hrm/class/position.class.php | 38 +----------------- htdocs/hrm/class/skill.class.php | 41 ++----------------- htdocs/hrm/class/skilldet.class.php | 35 +---------------- htdocs/hrm/class/skillrank.class.php | 50 +----------------------- 7 files changed, 18 insertions(+), 269 deletions(-) diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 06eb51043b1..d44468aaf8f 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -30,8 +30,7 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluationdet.class.php'; -//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; -//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + /** * Class for Evaluation @@ -322,8 +321,7 @@ class Evaluation extends CommonObject $result = $object->createCommon($user); if ($result < 0) { $error++; - $this->error = $object->error; - $this->errors = $object->errors; + $this->setErrorsFromObject($object); } if (!$error) { @@ -920,8 +918,7 @@ class Evaluation extends CommonObject $result = $objectline->fetchAll('ASC', '', 0, 0, '(fk_evaluation:=:'.((int) $this->id).')'); if (is_numeric($result)) { - $this->error = $objectline->error; - $this->errors = $objectline->errors; + $this->setErrorsFromObject($objectline); return $result; } else { $this->lines = $result; @@ -1022,36 +1019,6 @@ class Evaluation extends CommonObject return $result; } - /** - * Action executed by scheduler - * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' - * Use public function doScheduledJob($param1, $param2, ...) to get parameters - * - * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) - */ - public function doScheduledJob() - { - global $conf, $langs; - - //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log'; - - $error = 0; - $this->output = ''; - $this->error = ''; - - dol_syslog(__METHOD__, LOG_DEBUG); - - $now = dol_now(); - - $this->db->begin(); - - // ... - - $this->db->commit(); - - return $error; - } - /** * Return clicable link of object (with eventually picto) * diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index f0f2612d0c1..5635afc434f 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -28,10 +28,9 @@ */ // Put here all includes required by your class file -require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/commonobjectline.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php'; -//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; -//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + /** * Class for EvaluationLine @@ -288,8 +287,7 @@ class EvaluationLine extends CommonObjectLine $result = $object->createCommon($user); if ($result < 0) { $error++; - $this->error = $object->error; - $this->errors = $object->errors; + $this->setErrorsFromObject($object); } if (!$error) { @@ -890,8 +888,7 @@ class EvaluationLine extends CommonObjectLine $result = $objectline->fetchAll('ASC', 'position', 0, 0, '(fk_evaluationdet:=:'.((int) $this->id).')'); if (is_numeric($result)) { - $this->error = $objectline->error; - $this->errors = $objectline->errors; + $this->setErrorsFromObject($objectline); return $result; } else { $this->lines = $result; @@ -992,37 +989,4 @@ class EvaluationLine extends CommonObjectLine return $result; } - - /** - * Action executed by scheduler - * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' - * Use public function doScheduledJob($param1, $param2, ...) to get parameters - * - * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) - */ - public function doScheduledJob() - { - global $conf, $langs; - - //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log'; - - $error = 0; - $this->output = ''; - $this->error = ''; - - dol_syslog(__METHOD__, LOG_DEBUG); - - $now = dol_now(); - - $this->db->begin(); - - // ... - - $this->db->commit(); - - return $error; - } } - - -require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index c0ec08939d4..19c22de1b02 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -29,8 +29,7 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; -//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + /** * Class for Job @@ -292,8 +291,7 @@ class Job extends CommonObject $result = $object->createCommon($user); if ($result < 0) { $error++; - $this->error = $object->error; - $this->errors = $object->errors; + $this->setErrorsFromObject($object); } if (!$error) { @@ -928,8 +926,7 @@ class Job extends CommonObject $result = $objectline->fetchAll('ASC', 'position', 0, 0, '(fk_job:=:'.((int) $this->id).')'); if (is_numeric($result)) { - $this->error = $objectline->error; - $this->errors = $objectline->errors; + $this->setErrorsFromObject($objectline); return $result; } else { $this->lines = $result; @@ -1031,36 +1028,6 @@ class Job extends CommonObject return $result; } - /** - * Action executed by scheduler - * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' - * Use public function doScheduledJob($param1, $param2, ...) to get parameters - * - * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) - */ - public function doScheduledJob() - { - global $conf, $langs; - - //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log'; - - $error = 0; - $this->output = ''; - $this->error = ''; - - dol_syslog(__METHOD__, LOG_DEBUG); - - $now = dol_now(); - - $this->db->begin(); - - // ... - - $this->db->commit(); - - return $error; - } - /** * Return clicable link of object (with eventually picto) * @@ -1097,6 +1064,7 @@ class Job extends CommonObject $return .= ''; return $return; } + /** * function for get required skills associate to job object * @param int $id Id of object diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index f15e98131ca..68467a84c43 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -29,8 +29,6 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; -//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; -//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; /** * Class for Position @@ -301,8 +299,7 @@ class Position extends CommonObject $result = $object->createCommon($user); if ($result < 0) { $error++; - $this->error = $object->error; - $this->errors = $object->errors; + $this->setErrorsFromObject($object); } if (!$error) { @@ -970,8 +967,7 @@ class Position extends CommonObject $result = $objectline->fetchAll('ASC', 'position', 0, 0, '(fk_position:=:'.((int) $this->id).')'); if (is_numeric($result)) { - $this->error = $objectline->error; - $this->errors = $objectline->errors; + $this->setErrorsFromObject($objectline); return $result; } else { $this->lines = $result; @@ -1088,36 +1084,6 @@ class Position extends CommonObject return $result; } - /** - * Action executed by scheduler - * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' - * Use public function doScheduledJob($param1, $param2, ...) to get parameters - * - * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) - */ - public function doScheduledJob() - { - global $conf, $langs; - - //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log'; - - $error = 0; - $this->output = ''; - $this->error = ''; - - dol_syslog(__METHOD__, LOG_DEBUG); - - $now = dol_now(); - - $this->db->begin(); - - // ... - - $this->db->commit(); - - return $error; - } - /** * Return clicable link of object (with eventually picto) * diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index aefd68a0bea..bd2fea61de8 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -29,8 +29,6 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; -//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; /** * Class for Skill @@ -351,8 +349,7 @@ class Skill extends CommonObject $result = $object->createCommon($user); if ($result < 0) { $error++; - $this->error = $object->error; - $this->errors = $object->errors; + $this->setErrorsFromObject($object); } if (!$error) { @@ -414,8 +411,7 @@ class Skill extends CommonObject if (is_array($this->lines)) { return (count($this->lines) > 0) ? $this->lines : array(); } elseif ($this->lines < 0) { - $this->errors = array_merge($this->errors, $skilldet->errors); - $this->error = $skilldet->error; + $this->setErrorsFromObject($skilldet); return $this->lines; } return []; @@ -969,8 +965,7 @@ class Skill extends CommonObject $result = $objectline->fetchAll('ASC', 'rankorder', 0, 0, '(fk_skill:=:'.((int) $this->id).')'); if (is_numeric($result)) { - $this->error = $objectline->error; - $this->errors = $objectline->errors; + $this->setErrorsFromObject($objectline); return $result; } else { $this->lines = $result; @@ -1072,36 +1067,6 @@ class Skill extends CommonObject return $result; } - /** - * Action executed by scheduler - * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' - * Use public function doScheduledJob($param1, $param2, ...) to get parameters - * - * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) - */ - public function doScheduledJob() - { - global $conf, $langs; - - //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log'; - - $error = 0; - $this->output = ''; - $this->error = ''; - - dol_syslog(__METHOD__, LOG_DEBUG); - - $now = dol_now(); - - $this->db->begin(); - - // ... - - $this->db->commit(); - - return $error; - } - /** * @param int $code number of code label * @return int|string diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index 83ccae8c5ab..edfc3886843 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -29,8 +29,6 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; -//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; -//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; /** * Class for Skilldet @@ -283,8 +281,7 @@ class Skilldet extends CommonObjectLine $result = $object->createCommon($user); if ($result < 0) { $error++; - $this->error = $object->error; - $this->errors = $object->errors; + $this->setErrorsFromObject($object); } if (!$error) { @@ -959,34 +956,4 @@ class Skilldet extends CommonObjectLine return $result; } - - /** - * Action executed by scheduler - * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' - * Use public function doScheduledJob($param1, $param2, ...) to get parameters - * - * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) - */ - public function doScheduledJob() - { - global $conf, $langs; - - //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log'; - - $error = 0; - $this->output = ''; - $this->error = ''; - - dol_syslog(__METHOD__, LOG_DEBUG); - - $now = dol_now(); - - $this->db->begin(); - - // ... - - $this->db->commit(); - - return $error; - } } diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 245a6d8ba6c..27400f33638 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -309,8 +309,7 @@ class SkillRank extends CommonObject $result = $object->createCommon($user); if ($result < 0) { $error++; - $this->error = $object->error; - $this->errors = $object->errors; + $this->setErrorsFromObject($object); } if (!$error) { @@ -1033,51 +1032,4 @@ class SkillRank extends CommonObject return $result; } - - /** - * Action executed by scheduler - * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' - * Use public function doScheduledJob($param1, $param2, ...) to get parameters - * - * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) - */ - public function doScheduledJob() - { - global $conf, $langs; - - //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log'; - - $error = 0; - $this->output = ''; - $this->error = ''; - - dol_syslog(__METHOD__, LOG_DEBUG); - - $now = dol_now(); - - $this->db->begin(); - - // ... - - $this->db->commit(); - - return $error; - } - - /** - * @param array $val - * @param string $key - * @param string $value - * @param string $moreparam - * @param string $keysuffix - * @param string $keyprefix - * @param string $morecss - * @return string - */ - // public function showOutputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '') - // { - // if ($key == "rank") { - // return displayRankInfos($this); - // } else return parent::showOutputField($val, $key, $value, $moreparam, $keysuffix, $keyprefix, $morecss); - // } } From 93d2cad7fec316ef245917b09ef028ff8dba0ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 13 Mar 2024 21:33:51 +0100 Subject: [PATCH 1247/1862] fix warnings --- htdocs/user/messaging.php | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/htdocs/user/messaging.php b/htdocs/user/messaging.php index f28ee2aa0cc..319a00e9f5e 100644 --- a/htdocs/user/messaging.php +++ b/htdocs/user/messaging.php @@ -6,6 +6,7 @@ * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2015 Marcos García + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,6 +51,8 @@ if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } +$id = GETPOSTINT('userid') ? GETPOSTINT('userid') : GETPOSTINT('id'); +$ref = GETPOST('ref', 'alpha'); $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); @@ -74,6 +77,9 @@ if (!$sortorder) { $object = new User($db); if ($id > 0 || !empty($ref)) { $result = $object->fetch($id, $ref, '', 1); + if ($result <= 0) { + accessforbidden('User not found'); + } $object->getrights(); } @@ -81,18 +87,17 @@ if ($id > 0 || !empty($ref)) { $hookmanager->initHooks(array('agendathirdparty', 'globalcard')); // Security check -$userid = GETPOSTINT('userid') ? GETPOSTINT('userid') : GETPOSTINT('id'); if ($user->id) { - $userId = $user->id; + $id = $user->id; } -$result = $object->fetch($userid); -if ($result <= 0) { - accessforbidden('User not found'); +// Security check +$socid = 0; +if ($user->socid > 0) { + $socid = $user->socid; } - -$result = restrictedArea($user, 'user', $userId, '&user'); - +$feature2 = (($socid && $user->hasRight('user', 'self', 'creer')) ? '' : 'user'); +$result = restrictedArea($user, 'user', $id, 'user&user', $feature2); /* @@ -153,7 +158,7 @@ $morehtmlref .= dolButtonToOpenUrlInDialogPopup('publicvirtualcard', $langs->tra dol_banner_tab($object, 'id', $linkback, $user->hasRight('user', 'user', 'lire') || $user->admin, 'rowid', 'ref', $morehtmlref); -$object->info($userid); +$object->info($id); print '
'; @@ -196,7 +201,7 @@ if (isModEnabled('agenda')) { if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allaactions', 'read'))) { print '
'; - $param = '&userid='.urlencode((string) ($userid)); + $param = '&userid='.urlencode((string) ($id)); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } @@ -208,7 +213,7 @@ if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || // Try to know count of actioncomm from cache require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; $cachekey = 'count_events_user_'.$object->id; - //$nbEvent = dol_getcache($cachekey); // TODO Add nb into badge in menu so we can get it from cache also here + $nbEvent = dol_getcache($cachekey); // TODO Add nb into badge in menu so we can get it from cache also here $titlelist = $langs->trans("ActionsOnCompany").(is_numeric($nbEvent) ? '('.$nbEvent.')' : ''); if (!empty($conf->dol_optimize_smallscreen)) { From a0b26ae7cd293306e8908ff166e41bfc2cbe07e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2024 21:41:55 +0100 Subject: [PATCH 1248/1862] FIX Amount of localtaxes in foreign currency was wrong on screen and PDF --- htdocs/comm/propal/card.php | 8 ++++++-- htdocs/comm/propal/class/propal.class.php | 2 ++ htdocs/commande/card.php | 8 ++++++-- htdocs/commande/class/commande.class.php | 2 ++ htdocs/compta/facture/card.php | 8 ++++++-- htdocs/compta/facture/class/facture.class.php | 2 ++ .../commande/doc/pdf_einstein.modules.php | 17 +++++++++++++---- .../commande/doc/pdf_eratosthene.modules.php | 17 +++++++++++++---- .../modules/facture/doc/pdf_crabe.modules.php | 19 +++++++++++++------ .../facture/doc/pdf_sponge.modules.php | 19 +++++++++++++------ .../modules/propale/doc/pdf_azur.modules.php | 19 +++++++++++++------ .../modules/propale/doc/pdf_cyan.modules.php | 19 +++++++++++++------ 12 files changed, 102 insertions(+), 38 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3e201e1f683..97ed893601d 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2857,7 +2857,9 @@ if ($action == 'create') { print '
'; print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + $object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); + + print ''; } print ''; @@ -2866,7 +2868,9 @@ if ($action == 'create') { print ''; print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + $object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); + + print ''; } print ''; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index ec2fa41b991..48efe44c41c 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -272,6 +272,8 @@ class Propal extends CommonObject public $multicurrency_total_ht; public $multicurrency_total_tva; public $multicurrency_total_ttc; + public $multicurrency_total_localtax1; // not in database + public $multicurrency_total_localtax2; // not in database /** diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 71aefc2e708..bf55cdd65e2 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2770,7 +2770,9 @@ if ($action == 'create' && $usercancreate) { print ''; print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + $object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); + + print ''; } print ''; @@ -2780,7 +2782,9 @@ if ($action == 'create' && $usercancreate) { print ''; print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + $object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); + + print ''; } print ''; } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6b6037d62d5..3ab9910376c 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -275,6 +275,8 @@ class Commande extends CommonOrder public $multicurrency_total_ht; public $multicurrency_total_tva; public $multicurrency_total_ttc; + public $multicurrency_total_localtax1; // not in database + public $multicurrency_total_localtax2; // not in database //! key of module source when order generated from a dedicated module ('cashdesk', 'takepos', ...) public $module_source; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 43b1087d89c..4310d340844 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4904,7 +4904,9 @@ if ($action == 'create') { print ''; print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + $object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); + + print ''; } print ''; @@ -4913,7 +4915,9 @@ if ($action == 'create') { print ''; print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + $object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); + + print ''; } print ''; } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index cf84bbd1b44..405d14e39ed 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -262,6 +262,8 @@ class Facture extends CommonInvoice public $multicurrency_total_ht; public $multicurrency_total_tva; public $multicurrency_total_ttc; + public $multicurrency_total_localtax1; // not in database + public $multicurrency_total_localtax2; // not in database /** * @var int Situation cycle reference number diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 3f1a62c1b2b..b9d4661b679 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -988,8 +988,10 @@ class pdf_einstein extends ModelePDFCommandes $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1018,8 +1020,10 @@ class pdf_einstein extends ModelePDFCommandes $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1079,8 +1083,11 @@ class pdf_einstein extends ModelePDFCommandes $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1112,8 +1119,10 @@ class pdf_einstein extends ModelePDFCommandes $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index f6f9cf79bfa..449d29f62a8 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1194,8 +1194,10 @@ class pdf_eratosthene extends ModelePDFCommandes $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1224,8 +1226,10 @@ class pdf_eratosthene extends ModelePDFCommandes $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1285,8 +1289,11 @@ class pdf_eratosthene extends ModelePDFCommandes $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1318,8 +1325,10 @@ class pdf_eratosthene extends ModelePDFCommandes $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index a0b26a8b17c..9a8e48e6f83 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1426,8 +1426,6 @@ class pdf_crabe extends ModelePDFFactures if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL) && $tvaisnull) { // Nothing to do } else { - // FIXME amount of vat not supported with multicurrency - //Local tax 1 before VAT //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1454,8 +1452,10 @@ class pdf_crabe extends ModelePDFFactures $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1485,8 +1485,10 @@ class pdf_crabe extends ModelePDFFactures $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1546,8 +1548,11 @@ class pdf_crabe extends ModelePDFFactures $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1576,8 +1581,10 @@ class pdf_crabe extends ModelePDFFactures $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } //} diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 57596f3edca..1b583bab5f4 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1689,8 +1689,6 @@ class pdf_sponge extends ModelePDFFactures if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL) && $tvaisnull) { // Nothing to do } else { - // FIXME amount of vat not supported with multicurrency - //Local tax 1 before VAT //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1717,8 +1715,10 @@ class pdf_sponge extends ModelePDFFactures $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1748,8 +1748,10 @@ class pdf_sponge extends ModelePDFFactures $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1833,8 +1835,11 @@ class pdf_sponge extends ModelePDFFactures $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1866,8 +1871,10 @@ class pdf_sponge extends ModelePDFFactures $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 85576e467ec..50a5af68ad4 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1168,8 +1168,10 @@ class pdf_azur extends ModelePDFPropales $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1186,8 +1188,6 @@ class pdf_azur extends ModelePDFPropales if ($tvakey != 0) { // On affiche pas taux 0 //$this->atleastoneratenotnull++; - - $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); @@ -1200,8 +1200,10 @@ class pdf_azur extends ModelePDFPropales $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1260,8 +1262,11 @@ class pdf_azur extends ModelePDFPropales $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1292,8 +1297,10 @@ class pdf_azur extends ModelePDFPropales $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 153a0460d84..67e49fca891 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1289,8 +1289,10 @@ class pdf_cyan extends ModelePDFPropales $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1307,8 +1309,6 @@ class pdf_cyan extends ModelePDFPropales if ($tvakey != 0) { // On affiche pas taux 0 //$this->atleastoneratenotnull++; - - $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); @@ -1322,8 +1322,10 @@ class pdf_cyan extends ModelePDFPropales $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1377,8 +1379,11 @@ class pdf_cyan extends ModelePDFPropales $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1410,8 +1415,10 @@ class pdf_cyan extends ModelePDFPropales $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } From 9c876b28419c1c2cfcb398693022ed799caf9ab6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2024 22:22:32 +0100 Subject: [PATCH 1249/1862] Fix phpunit --- htdocs/ai/admin/custom_prompt.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/ai/admin/custom_prompt.php b/htdocs/ai/admin/custom_prompt.php index 699479bbb9e..7790c822249 100644 --- a/htdocs/ai/admin/custom_prompt.php +++ b/htdocs/ai/admin/custom_prompt.php @@ -165,9 +165,6 @@ if ($action == 'confirm_deleteproperty' && GETPOST('confirm') == 'yes') { } } } -if ($action == 'confirm_deleteproperty') { - var_dump(GETPOST('confirm'));exit; -} /* @@ -344,7 +341,7 @@ if ($action == 'edit' || $action == 'create') { $('#postPromptInput').val(''); } }); - + $('.showInputBtn').click(function() { event.preventDefault(); var index = $(this).data('index'); @@ -357,7 +354,7 @@ if ($action == 'edit' || $action == 'create') { $(this).html($(this).data('icon-cancel')); $(this).data('state', 'cancel'); - } else { + } else { $('#prePromptInput_'+index).attr('disabled', 'disabled'); $('#postPromptInput_'+index).attr('disabled', 'disabled'); @@ -367,8 +364,8 @@ if ($action == 'edit' || $action == 'create') { } }); }); - - + + "; print $out; From ee214ae7fd8500afe493720afb4845aa8858b71d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2024 22:39:41 +0100 Subject: [PATCH 1250/1862] Test to avoid not found method --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2f794579b7b..bcc2e9864e9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8322,7 +8322,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, '__USER_SIGNATURE__' => (string) (($usersignature && !getDolGlobalString('MAIN_MAIL_DO_NOT_USE_SIGN')) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($usersignature), 30) : $usersignature) : '') )); - if (is_object($user)) { + if (is_object($user) && ($user instanceof User)) { $substitutionarray = array_merge($substitutionarray, array( '__USER_ID__' => (string) $user->id, '__USER_LOGIN__' => (string) $user->login, From a50bab344e34abb188280bd89ff546d9ca702852 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 00:26:45 +0100 Subject: [PATCH 1251/1862] Fix problem in phpStan --- htdocs/ai/admin/custom_prompt.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/ai/admin/custom_prompt.php b/htdocs/ai/admin/custom_prompt.php index ee62b646604..abdf755ffd5 100644 --- a/htdocs/ai/admin/custom_prompt.php +++ b/htdocs/ai/admin/custom_prompt.php @@ -129,7 +129,6 @@ if ($action == 'update' && !GETPOST('cancel')) { if ($action == 'confirm_deleteproperty') { $key = GETPOST('key', 'alpha'); - //var_dump($currentConfigurations[$key]);exit; if (isset($currentConfigurations[$key])) { unset($currentConfigurations[$key]); From a504207ed1ce43e90f4ceb1409871d8ccbfa7875 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 01:28:30 +0100 Subject: [PATCH 1252/1862] New msg for prompt ai before display result --- htdocs/core/class/html.formmail.class.php | 6 ++++++ htdocs/langs/en_US/help.lang | 1 + htdocs/theme/eldy/global.inc.php | 3 +++ 3 files changed, 10 insertions(+) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index be4e7a242e2..00e2cd60f04 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1454,6 +1454,7 @@ class FormMail extends Form $out .= '\n"; $out .= " From da543ac96d472dfe18ea239086856913a9c22211 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 14 Mar 2024 10:00:48 +0100 Subject: [PATCH 1255/1862] codespell and datee --- dev/tools/codespell/codespell-ignore.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tools/codespell/codespell-ignore.txt b/dev/tools/codespell/codespell-ignore.txt index c71e990a467..0c84807010b 100644 --- a/dev/tools/codespell/codespell-ignore.txt +++ b/dev/tools/codespell/codespell-ignore.txt @@ -57,3 +57,4 @@ dur fonction espace methode +datee From 89d6fe8d5d9638794bbf5de21527e9f37b787c58 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 14 Mar 2024 10:02:23 +0100 Subject: [PATCH 1256/1862] add project list linked by a contact --- htdocs/core/lib/company.lib.php | 98 ++++++++++++++++++++++++++++++++ htdocs/langs/fr_FR/admin.lang | 2 + htdocs/langs/fr_FR/projects.lang | 1 + htdocs/projet/admin/project.php | 12 ++++ 4 files changed, 113 insertions(+) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index d8113ce1356..63f1e382fa7 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -960,6 +960,104 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel dol_print_error($db); } + //projects linked to that thirdpart because of a people of that company is linked to a project + if (getDolGlobalString('PROJECT_DISPLAY_LINKED_BY_CONTACT')) { + print "\n"; + print load_fiche_titre($langs->trans("ProjectsLinkedToThisThirdParty"), '', ''); + + + print '
'."\n"; + print '
'; print $langs->trans('SendingMethod'); @@ -2813,7 +2813,7 @@ if ($action == 'create') { print '
'; print ''; // Bank Account - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_ORDER') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_ORDER') && isModEnabled("bank")) { print ''; } // Shipping Method - if (isModEnabled('expedition')) { + if (isModEnabled('delivery_note')) { print ''; // Shipping Method - if (isModEnabled('expedition')) { + if (isModEnabled('delivery_note')) { print ''; // Tags-Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print ''; $out .= ''; $out .= ''; $out .= ''; $out .= ''; $out .= ''; $out .= ''; + + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; $out .= ''; $out .= ''; $out .= ''; $out .= ''; $out .= ''; @@ -289,15 +318,16 @@ if ($action == 'edit' || $action == 'create') { $out .= 'Post-prompt'; $out .= ''; $out .= ''; $out .= ''; + $out .= ''; } $out .= ''; $out .= '
'; @@ -3057,7 +3057,7 @@ if ($action == 'create') { } // Create a sale order - if (isModEnabled('commande') && $object->statut == Propal::STATUS_SIGNED) { + if (isModEnabled('order') && $object->statut == Propal::STATUS_SIGNED) { if ($usercancreateorder) { print ''.$langs->trans("AddOrder").''; } @@ -3073,7 +3073,7 @@ if ($action == 'create') { } // Create an intervention - if (isModEnabled("service") && isModEnabled('ficheinter') && $object->statut == Propal::STATUS_SIGNED) { + if (isModEnabled("service") && isModEnabled('intervention') && $object->statut == Propal::STATUS_SIGNED) { if ($usercancreateintervention) { $langs->load("interventions"); print ''.$langs->trans("AddIntervention").''; @@ -3081,7 +3081,7 @@ if ($action == 'create') { } // Create contract - if (isModEnabled('contrat') && $object->statut == Propal::STATUS_SIGNED) { + if (isModEnabled('contract') && $object->statut == Propal::STATUS_SIGNED) { $langs->load("contracts"); if ($usercancreatecontract) { @@ -3091,7 +3091,7 @@ if ($action == 'create') { // Create an invoice and classify billed if ($object->statut == Propal::STATUS_SIGNED && !getDolGlobalString('PROPOSAL_ARE_NOT_BILLABLE')) { - if (isModEnabled('facture') && $usercancreateinvoice) { + if (isModEnabled('invoice') && $usercancreateinvoice) { print ''.$langs->trans("CreateBill").''; } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 7a1626674e5..24c92ad317c 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -51,14 +51,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; } // Load translation files required by the page $langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'categories')); -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { $langs->loadLangs(array('sendings')); } @@ -222,7 +222,7 @@ $arrayfields = array( 'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0), 'p.date_signature'=>array('label'=>"DateSigning", 'checked'=>0), 'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0), - 'p.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'enabled'=>isModEnabled("expedition")), + 'p.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'enabled'=>isModEnabled("delivery_note")), 'p.fk_input_reason'=>array('label'=>"Origin", 'checked'=>0, 'enabled'=>1), 'p.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0), 'p.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0), @@ -1156,14 +1156,14 @@ if ($search_date_signature_endyear) { $moreforfilter .= ''; } // If the user can view products - if (isModEnabled('categorie') && $user->hasRight('categorie', 'read') && ($user->hasRight('product', 'read') || $user->hasRight('service', 'read'))) { + if (isModEnabled('category') && $user->hasRight('categorie', 'read') && ($user->hasRight('product', 'read') || $user->hasRight('service', 'read'))) { $searchCategoryProductOperator = -1; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $tmptitle = $langs->trans('IncludingProductWithTag'); $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, array($search_product_category), 'maxwidth300', $searchCategoryProductOperator, 0, 0, $tmptitle); } - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index 4881fce1920..0c9a7454620 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Load translation files required by the page $langs->load("companies"); -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { $langs->load("bills"); } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c2c6cfe44cf..41cfb6dd96c 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1355,7 +1355,7 @@ if (empty($reshook)) { if ( GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms) - && isModEnabled('facture') && $user->hasRight('facture', 'creer') + && isModEnabled('invoice') && $user->hasRight('facture', 'creer') ) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; @@ -1946,14 +1946,14 @@ if ($action == 'create' && $usercancreate) { print '
'.$langs->trans('BankAccount').''; print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); print '
'.$langs->trans('SendingMethod').''; print img_picto('', 'object_dolly', 'class="pictofixedwidth"'); $form->selectShippingMethod(((GETPOSTISSET('shipping_method_id') && GETPOSTINT('shipping_method_id') != 0) ? GETPOST('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); @@ -2242,7 +2242,7 @@ if ($action == 'create' && $usercancreate) { // It may also break step of creating an order when invoicing must be done from proposals and not from orders $deposit_percent_from_payment_terms = (float) getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); - if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && $user->hasRight('facture', 'creer')) { + if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $object->fetchObjectLinked(); @@ -2593,7 +2593,7 @@ if ($action == 'create' && $usercancreate) { print '
'; $editenable = $usercancreate; print $form->editfieldkey("SendingMethod", 'shippingmethod', '', $object, $editenable); @@ -2750,7 +2750,7 @@ if ($action == 'create' && $usercancreate) { } // Bank Account - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_ORDER') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_ORDER') && isModEnabled("bank")) { print '
'; $editenable = $usercancreate; print $form->editfieldkey("BankAccount", 'bankaccount', '', $object, $editenable); @@ -2971,7 +2971,7 @@ if ($action == 'create' && $usercancreate) { }*/ // Create intervention - $arrayforbutaction[] = array('lang'=>'interventions', 'enabled'=>(isModEnabled("ficheinter") && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0), 'perm'=>$user->hasRight('ficheinter', 'creer'), 'label'=>'AddIntervention', 'url'=>'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid); + $arrayforbutaction[] = array('lang'=>'interventions', 'enabled'=>(isModEnabled("intervention") && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0), 'perm'=>$user->hasRight('ficheinter', 'creer'), 'label'=>'AddIntervention', 'url'=>'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid); /*if (isModEnabled('ficheinter')) { $langs->load("interventions"); @@ -2985,7 +2985,7 @@ if ($action == 'create' && $usercancreate) { }*/ // Create contract - $arrayforbutaction[] = array('lang'=>'contracts', 'enabled'=>(isModEnabled("contrat") && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)), 'perm'=>$user->hasRight('contrat', 'creer'), 'label'=>'AddContract', 'url'=>'/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid); + $arrayforbutaction[] = array('lang'=>'contracts', 'enabled'=>(isModEnabled("contract") && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)), 'perm'=>$user->hasRight('contrat', 'creer'), 'label'=>'AddContract', 'url'=>'/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid); /*if (isModEnabled('contrat') && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) { $langs->load("contracts"); @@ -2995,14 +2995,14 @@ if ($action == 'create' && $usercancreate) { }*/ $numshipping = 0; - if (isModEnabled('expedition')) { + if (isModEnabled('delivery_note')) { $numshipping = $object->countNbOfShipments(); } // Create shipment if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { if ((getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'creer')) || (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'creer'))) { - $arrayforbutaction[] = array('lang'=>'sendings', 'enabled'=>(isModEnabled("expedition") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), 'perm'=>$user->hasRight('expedition', 'creer'), 'label'=>'CreateShipment', 'url'=>'/expedition/shipment.php?id='.$object->id); + $arrayforbutaction[] = array('lang'=>'sendings', 'enabled'=>(isModEnabled("delivery_note") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), 'perm'=>$user->hasRight('expedition', 'creer'), 'label'=>'CreateShipment', 'url'=>'/expedition/shipment.php?id='.$object->id); /* if ($user->hasRight('expedition', 'creer')) { print dolGetButtonAction('', $langs->trans('CreateShipment'), 'default', DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id, ''); @@ -3018,7 +3018,7 @@ if ($action == 'create' && $usercancreate) { // Create bill $arrayforbutaction[] = array( 'lang'=>'bills', - 'enabled'=>(isModEnabled('facture') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0), + 'enabled'=>(isModEnabled('invoice') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0), 'perm'=>($user->hasRight('facture', 'creer') && !getDolGlobalInt('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')), 'label'=>'CreateBill', 'url'=>'/compta/facture/card.php?action=create&token='.newToken().'&origin='.urlencode($object->element).'&originid='.$object->id.'&socid='.$object->socid diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 27071e824ea..cb2f301c2d9 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3825,7 +3825,7 @@ class Commande extends CommonOrder $result = ''; - if (isModEnabled("expedition") && ($option == '1' || $option == '2')) { + if (isModEnabled("delivery_note") && ($option == '1' || $option == '2')) { $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id; } else { $url = DOL_URL_ROOT.'/commande/card.php?id='.$this->id; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 0186d660953..564cfcde895 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -92,7 +92,7 @@ if ($tmp) { /* * Draft orders */ -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; @@ -244,7 +244,7 @@ $max = 10; /* * Orders to process */ -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; @@ -333,7 +333,7 @@ if (isModEnabled('commande')) { /* * Orders that are in process */ -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index c9fa02304f5..b8308827c6c 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -179,7 +179,7 @@ $arrayfields = array( 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55), 'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60, 'csslist'=>'nowraponall'), 'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>!getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position'=>65, 'csslist'=>'nowraponall'), - 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>isModEnabled("expedition")), + 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>isModEnabled("delivery_note")), 'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>-1, 'position'=>67), 'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>-1, 'position'=>68), 'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>-1, 'position'=>69), @@ -202,7 +202,7 @@ $arrayfields = array( 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position'=>135, 'searchall'=>1), 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position'=>140), - 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled("expedition")), 'position'=>990), + 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled("delivery_note")), 'position'=>990), 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position'=>995), 'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999), 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) @@ -893,7 +893,7 @@ if ($search_billed != '' && $search_billed >= 0) { } if ($search_status != '') { if ($search_status <= 3 && $search_status >= -1) { // status from -1 to 3 are real status (other are virtual combination) - if ($search_status == 1 && !isModEnabled('expedition')) { + if ($search_status == 1 && !isModEnabled('delivery_note')) { $sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status "sent" into "validated" } else { $sql .= ' AND c.fk_statut = '.((int) $search_status); // draft, validated, in process or canceled @@ -1150,7 +1150,7 @@ if ($search_status == -2) { $title .= ' - '.$langs->trans('StatusOrderToProcessShort'); } if ($search_status == -3) { - $title .= ' - '.$langs->trans('StatusOrderValidated').', '.(!isModEnabled('expedition') ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); + $title .= ' - '.$langs->trans('StatusOrderValidated').', '.(!isModEnabled('delivery_note') ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); } if ($search_status == -4) { $title .= ' - '.$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"); @@ -1327,7 +1327,7 @@ if ($permissiontovalidate) { if ($permissiontoclose) { $arrayofmassactions['preshipped'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').$langs->trans("ClassifyShipped"); } -if (isModEnabled('facture') && $user->hasRight("facture", "creer")) { +if (isModEnabled('invoice') && $user->hasRight("facture", "creer")) { $arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer"); } if ($permissiontoclose) { @@ -1466,7 +1466,7 @@ if ($user->hasRight("user", "user", "lire")) { } // If the user can view other products/services than his own -if (isModEnabled('categorie') && $user->hasRight("categorie", "lire") && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) { +if (isModEnabled('category') && $user->hasRight("categorie", "lire") && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -1475,7 +1475,7 @@ if (isModEnabled('categorie') && $user->hasRight("categorie", "lire") && ($user- $moreforfilter .= '
'; } // If Categories are enabled & user has rights to see -if (isModEnabled('categorie') && $user->hasRight("categorie", "lire")) { +if (isModEnabled('category') && $user->hasRight("categorie", "lire")) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); @@ -2192,7 +2192,7 @@ while ($i < $imaxinloop) { } // If module invoices enabled and user with invoice creation permissions - if (isModEnabled('facture') && getDolGlobalString('ORDER_BILLING_ALL_CUSTOMER')) { + if (isModEnabled('invoice') && getDolGlobalString('ORDER_BILLING_ALL_CUSTOMER')) { if ($user->hasRight('facture', 'creer')) { if (($obj->fk_statut > 0 && $obj->fk_statut < 3) || ($obj->fk_statut == 3 && $obj->billed == 0)) { print ' '; @@ -2665,7 +2665,7 @@ while ($i < $imaxinloop) { $stock_order = 0; $stock_order_supplier = 0; if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT') || getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) { // What about other options ? - if (isModEnabled('commande')) { + if (isModEnabled('order')) { if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) { $generic_product->load_stats_commande(0, '1,2'); $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty']; diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 38e10afd97e..2be6cd61baf 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -48,7 +48,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -79,7 +79,7 @@ $search_dateorder_end = dol_mktime(23, 59, 59, GETPOSTINT('search_dateorder_end_ $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datedelivery_start_month'), GETPOSTINT('search_datedelivery_start_day'), GETPOSTINT('search_datedelivery_start_year')); $search_datedelivery_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datedelivery_end_month'), GETPOSTINT('search_datedelivery_end_day'), GETPOSTINT('search_datedelivery_end_year')); -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $search_product_category_array = GETPOST("search_category_".Categorie::TYPE_PRODUCT."_list", "array"); $searchCategoryProductOperator = 0; if (GETPOSTISSET('formfilteraction')) { @@ -197,7 +197,7 @@ $arrayfields = array( 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55), 'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60), 'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>!getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position'=>65), - 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>isModEnabled('expedition')), + 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>isModEnabled('delivery_note')), 'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>-1, 'position'=>67), 'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>-1, 'position'=>68), 'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>-1, 'position'=>69), @@ -221,7 +221,7 @@ $arrayfields = array( 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(!getDolGlobalString('MAIN_LIST_ALLOW_PUBLIC_NOTES')), 'position'=>135), 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(!getDolGlobalString('MAIN_LIST_ALLOW_PRIVATE_NOTES')), 'position'=>140), - 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled('expedition')), 'position'=>990), + 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled('delivery_note')), 'position'=>990), 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position'=>995), 'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999), 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) @@ -472,7 +472,7 @@ if ($search_billed != '' && $search_billed >= 0) { } if ($search_status != '') { if ($search_status <= 3 && $search_status >= -1) { // status from -1 to 3 are real status (other are virtual combination) - if ($search_status == 1 && !isModEnabled('expedition')) { + if ($search_status == 1 && !isModEnabled('delivery_note')) { $sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status "sent" into "validated" } else { $sql .= ' AND c.fk_statut = '.((int) $search_status); // draft, validated, in process or canceled @@ -687,7 +687,7 @@ if ($resql) { $title .= ' - '.$langs->trans('StatusOrderToProcessShort'); } if ($search_status == -3) { - $title .= ' - '.$langs->trans('StatusOrderValidated').', '.(!isModEnabled('expedition') ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); + $title .= ' - '.$langs->trans('StatusOrderValidated').', '.(!isModEnabled('delivery_note') ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); } if ($search_status == -4) { $title .= ' - '.$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"); @@ -937,11 +937,11 @@ if ($resql) { $moreforfilter .= '
'; } // Filter on categories - if (isModEnabled("categorie") && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { + if (isModEnabled("category") && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, $search_product_category_array, 'minwidth300imp minwidth300', $searchCategoryProductOperator ? $searchCategoryProductOperator : 0); } - if (isModEnabled("categorie") && $user->hasRight('categorie', 'lire')) { + if (isModEnabled("category") && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); @@ -1678,7 +1678,7 @@ if ($resql) { print $getNomUrl_cache[$obj->socid]; // If module invoices enabled and user with invoice creation permissions - if (isModEnabled('facture') && getDolGlobalString('ORDER_BILLING_ALL_CUSTOMER')) { + if (isModEnabled('invoice') && getDolGlobalString('ORDER_BILLING_ALL_CUSTOMER')) { if ($user->hasRight('facture', 'creer')) { if (($obj->fk_statut > 0 && $obj->fk_statut < 3) || ($obj->fk_statut == 3 && $obj->billed == 0)) { print ' '; @@ -2124,7 +2124,7 @@ if ($resql) { $stock_order = 0; $stock_order_supplier = 0; if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT') || getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) { // What about other options ? - if (isModEnabled('commande')) { + if (isModEnabled('order')) { if (empty($productstat_cache[$obj->fk_product]['stats_order_customer'])) { $generic_product->load_stats_commande(0, '1,2'); $productstat_cache[$obj->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty']; diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index f6a67149aa8..b22abd7b33a 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -135,13 +135,13 @@ if (empty($entity)) { $error = 0; $listofchoices = array( - 'selectinvoices'=>array('label'=>'Invoices', 'picto'=>'bill', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => $user->hasRight('facture', 'lire')), + 'selectinvoices'=>array('label'=>'Invoices', 'picto'=>'bill', 'lang'=>'bills', 'enabled' => isModEnabled('invoice'), 'perms' => $user->hasRight('facture', 'lire')), 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'picto'=>'supplier_invoice', 'lang'=>'bills', 'enabled' => isModEnabled('supplier_invoice'), 'perms' => $user->hasRight('fournisseur', 'facture', 'lire')), 'selectexpensereports'=>array('label'=>'ExpenseReports', 'picto'=>'expensereport', 'lang'=>'trips', 'enabled' => isModEnabled('expensereport'), 'perms' => $user->hasRight('expensereport', 'lire')), 'selectdonations'=>array('label'=>'Donations', 'picto'=>'donation', 'lang'=>'donation', 'enabled' => isModEnabled('don'), 'perms' => $user->hasRight('don', 'lire')), 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'picto'=>'bill', 'enabled' => isModEnabled('tax'), 'perms' => $user->hasRight('tax', 'charges', 'lire')), 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'picto'=>'salary', 'lang'=>'salaries', 'enabled' => isModEnabled('salaries'), 'perms' => $user->hasRight('salaries', 'read')), - 'selectvariouspayment'=>array('label'=>'VariousPayment', 'picto'=>'payment', 'enabled' => isModEnabled('banque'), 'perms' => $user->hasRight('banque', 'lire')), + 'selectvariouspayment'=>array('label'=>'VariousPayment', 'picto'=>'payment', 'enabled' => isModEnabled('bank'), 'perms' => $user->hasRight('banque', 'lire')), 'selectloanspayment'=>array('label'=>'PaymentLoan','picto'=>'loan', 'enabled' => isModEnabled('don'), 'perms' => $user->hasRight('loan', 'read')), ); @@ -643,7 +643,7 @@ if (isModEnabled('multicompany') && is_object($mc)) { print '
'; // Project filter -if (isModEnabled('projet')) { +if (isModEnabled('project')) { $formproject = new FormProjets($db); $langs->load('projects'); print ''.$langs->trans('Project').":"; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 8ca2d819152..e6eacc582a6 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1049,9 +1049,9 @@ if ($resql) { $moreforfilter .= '
'; $moreforfilter .= ''; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $langs->load('categories'); // Bank line diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 369749781b5..d6680d09e8e 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbank.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } if (isModEnabled('accounting')) { @@ -477,7 +477,7 @@ if ($action == 'create') { print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1); @@ -762,7 +762,7 @@ if ($action == 'create') { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; @@ -1037,7 +1037,7 @@ if ($action == 'create') { print ''; // Tags-Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $langs->load('categories'); // Bank line diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 97d34c16fba..d88cb100991 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -39,7 +39,7 @@ if (isModEnabled('accounting')) { if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; } -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -61,7 +61,7 @@ $search_status = GETPOST('search_status') ? GETPOST('search_status', 'alpha') : $optioncss = GETPOST('optioncss', 'alpha'); $search_category_list =""; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $search_category_list = GETPOST("search_category_".Categorie::TYPE_ACCOUNT."_list", "array"); } @@ -400,7 +400,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; $moreforfilter = ''; -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $moreforfilter .= $form->getFilterBox(Categorie::TYPE_ACCOUNT, $search_category_list); } diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 9463e357b42..4b1667cce1d 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -144,7 +144,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $error++; } - if (isModEnabled("banque") && !$object->accountid > 0) { + if (isModEnabled("bank") && !$object->accountid > 0) { $langs->load('errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors'); $error++; @@ -435,7 +435,7 @@ if ($action == 'create') { print ''; // Bank - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; // Number - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; @@ -687,7 +687,7 @@ if ($id) { $bankaccountnotfound = 0; - if (isModEnabled('banque')) { + if (isModEnabled('bank')) { print ''; print ''; print ''; // Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print '"; @@ -317,7 +317,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "ptva.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); } print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "ptva.amount", "", $param, 'class="right"', $sortfield, $sortorder); @@ -356,7 +356,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print $obj->num_payment.''; // Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 8f212f663ab..12fafdd5205 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -53,7 +53,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (isModEnabled('project')) { @@ -3909,7 +3909,7 @@ if ($action == 'create') { print ''; // Bank Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; print ''; print ''; @@ -545,11 +546,11 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print '';*/ } else { $listoftopmenumodes = array( - '0' => $langs->transnoentitiesnoconv("IconAndText"), - '1' => $langs->transnoentitiesnoconv("TextOnly"), - '2' => $langs->transnoentitiesnoconv("IconOnlyAllTextsOnHover"), - '3' => $langs->transnoentitiesnoconv("IconOnlyTextOnHover"), - '4' => $langs->transnoentitiesnoconv("IconOnly"), + $langs->transnoentitiesnoconv("IconAndText"), + $langs->transnoentitiesnoconv("TextOnly"), + $langs->transnoentitiesnoconv("IconOnlyAllTextsOnHover"), + $langs->transnoentitiesnoconv("IconOnlyTextOnHover"), + $langs->transnoentitiesnoconv("IconOnly"), ); print ''; print ''; @@ -637,13 +638,10 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; print '\n"; print ''; print ''; print ''; +print ''; print '\n"; print ''; @@ -778,6 +786,7 @@ $htmltext .= ''; print ''; print ''; print ''; +print ''; print '\n"; print ''; @@ -797,12 +806,13 @@ print ''; print ''; print ''; print ''; +print ''; print ''; print '\n"; print ''; From b3b7afa07aff27b15b417658a8301a6b8efa5bd5 Mon Sep 17 00:00:00 2001 From: William Mead Date: Wed, 13 Mar 2024 16:26:10 +0100 Subject: [PATCH 1219/1862] Fixed warning undefined userId & nbevent. --- htdocs/user/agenda.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/agenda.php b/htdocs/user/agenda.php index 7c692bb9ba4..af23913a051 100644 --- a/htdocs/user/agenda.php +++ b/htdocs/user/agenda.php @@ -89,7 +89,7 @@ if (($object->id != $user->id) && !$user->hasRight('user', 'user', 'lire')) { accessforbidden(); } -$parameters = array('id' => $userId); +$parameters = array('id' => $user->id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -195,7 +195,7 @@ if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || // Try to know count of actioncomm from cache require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; $cachekey = 'count_events_user_'.$object->id; - //$nbEvent = dol_getcache($cachekey); // TODO Add nb into badge in menu so we can get it from cache also here + $nbEvent = dol_getcache($cachekey); $titlelist = $langs->trans("ActionsOnCompany").(is_numeric($nbEvent) ? '('.$nbEvent.')' : ''); if (!empty($conf->dol_optimize_smallscreen)) { From cd727f22a6c0f5cb0f458ea55a18620d560506fa Mon Sep 17 00:00:00 2001 From: William Mead Date: Wed, 13 Mar 2024 16:26:52 +0100 Subject: [PATCH 1220/1862] Fixed event count --- htdocs/core/lib/usergroups.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 87e6e367cb3..2ffc38d1072 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -197,9 +197,9 @@ function user_prepare_head(User $object) if (!is_null($dataretrieved)) { $nbEvent = $dataretrieved; } else { - $sql = "SELECT COUNT(id) as nb"; - $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm"; - $sql .= " WHERE fk_user_done = ".((int) $object->id); + $sql = "SELECT COUNT(ac.id) as nb"; + $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as ac"; + $sql .= " WHERE fk_user_action = ".((int) $object->id); $sql .= " AND entity IN (".getEntity('agenda').")"; $resql = $db->query($sql); if ($resql) { From 04282f9c5f96c3e03390397d4049194619f2f7d4 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 16:45:14 +0100 Subject: [PATCH 1221/1862] Fix PhanTypeInvalidUnaryOperandIncOrDec by typing $error # Fix PhanTypeInvalidUnaryOperandIncOrDec by typing $error For some strange reason phan determined that $error was not an int, so forced the typing to fix the PhanTypeInvalidUnaryOperandIncOrDec notifications in this file --- htdocs/website/index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 31b79d9722e..566a1c2feb9 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1,6 +1,7 @@ * Copyright (C) 2020 Nicolas ZABOURI + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -747,6 +748,8 @@ if ($action == 'addsite' && $usercanedit) { } } +'@phan-var-force int $error'; + // Add page/container if ($action == 'addcontainer' && $usercanedit) { dol_mkdir($pathofwebsite); @@ -761,6 +764,7 @@ if ($action == 'addcontainer' && $usercanedit) { $grabimagesinto = GETPOST('grabimagesinto', 'alpha'); include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; + // The include seems to break typing on variables if (empty($urltograb)) { $error++; From e4331877dfeea79da0165e175e88c9fb747d15f7 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 16:46:21 +0100 Subject: [PATCH 1222/1862] Fix: Remove stray $i++ --- htdocs/barcode/printsheet.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 9dbc437758c..6ee4e9c9ac7 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2006-2017 Laurent Destailleur + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -253,8 +254,6 @@ if (empty($reshook)) { } } - $i++; - // Build and output PDF if (!$error && $mode == 'label') { if (!count($arrayofrecords)) { From 1daa77650cc7bac7bc0e3ffd9764a860263ee2ea Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 16:50:28 +0100 Subject: [PATCH 1223/1862] Fix Initialise array to fix PhanTypeInvalidUnaryOperandIncOrDec --- htdocs/compta/cashcontrol/report.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index 83b0a56e563..5a863e5e410 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -8,6 +8,7 @@ * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2018 Andreu Bisquerra + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,13 +60,13 @@ $sortorder = 'ASC'; $sortfield = 'b.datev,b.dateo,b.rowid'; $arrayfields = array( - 'b.rowid'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), - 'b.dateo'=>array('label'=>$langs->trans("DateOperationShort"), 'checked'=>1), - 'b.num_chq'=>array('label'=>$langs->trans("Number"), 'checked'=>1), - 'ba.ref'=>array('label'=>$langs->trans("BankAccount"), 'checked'=>1), - 'cp.code'=>array('label'=>$langs->trans("PaymentMode"), 'checked'=>1), - 'b.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1, 'position'=>600), - 'b.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1, 'position'=>605), + 'b.rowid' => array('label' => $langs->trans("Ref"), 'checked' => 1), + 'b.dateo' => array('label' => $langs->trans("DateOperationShort"), 'checked' => 1), + 'b.num_chq' => array('label' => $langs->trans("Number"), 'checked' => 1), + 'ba.ref' => array('label' => $langs->trans("BankAccount"), 'checked' => 1), + 'cp.code' => array('label' => $langs->trans("PaymentMode"), 'checked' => 1), + 'b.debit' => array('label' => $langs->trans("Debit"), 'checked' => 1, 'position' => 600), + 'b.credit' => array('label' => $langs->trans("Credit"), 'checked' => 1, 'position' => 605), ); $syear = $object->year_close; @@ -209,7 +210,7 @@ if ($resql) { $transactionspertype = array(); $amountpertype = array(); - $totalarray = array(); + $totalarray = array('nbfield' => 0,'pos' => array()); while ($i < $num) { $objp = $db->fetch_object($resql); From 393dacd59e42b214293f48ab411be46850693b34 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 16:52:05 +0100 Subject: [PATCH 1224/1862] Fix Initialise var to fix PhanTypeInvalidUnaryOperandIncOrDec --- htdocs/core/actions_massactions.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 9649ef6252c..382cb71fca4 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1040,6 +1040,7 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' $objecttmp = new $objectclass($db); $nbok = 0; + $nbignored = 0; $TMsg = array(); //$toselect could contain duplicate entries, cf https://github.com/Dolibarr/dolibarr/issues/26244 @@ -1200,6 +1201,7 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) { } if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd) { + $nbok = 0; $db->begin(); $affecttag_type = GETPOST('affecttag_type', 'alpha'); @@ -1221,7 +1223,6 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd } //For each valid categ type set common categ - $nbok = 0; if (!empty($to_affecttag_type_array)) { foreach ($to_affecttag_type_array as $categ_type) { $contcats = GETPOST('contcats_' . $categ_type, 'array'); @@ -1256,6 +1257,7 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd } if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoadd) { + $nbok = 0; $db->begin(); if (GETPOSTISSET('pricerate')) { $pricepercentage = GETPOSTINT('pricerate'); @@ -1300,6 +1302,7 @@ if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoa } if (!$error && ($action == 'setsupervisor' && $confirm == 'yes') && $permissiontoadd) { + $nbok = 0; $db->begin(); $supervisortoset = GETPOST('supervisortoset'); if (!empty($supervisortoset)) { @@ -1335,6 +1338,7 @@ if (!$error && ($action == 'setsupervisor' && $confirm == 'yes') && $permissiont } if (!$error && ($action == 'affectuser' && $confirm == 'yes') && $permissiontoadd) { + $nbok = 0; $db->begin(); $usertoaffect = GETPOST('usertoaffect'); From a0ea2ed65487a47736e1cba6f50060c9d8793fbb Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 16:55:14 +0100 Subject: [PATCH 1225/1862] Fix: Remove stray $i++ --- htdocs/core/lib/company.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 2384751a523..d8113ce1356 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -2230,7 +2230,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr } $out .= "\n"; - $i++; } if (empty($histo)) { $colspan = 9; From 3ffa85eb496a83176aca506c1837be50896af1d6 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 16:57:50 +0100 Subject: [PATCH 1226/1862] Fix: Remove stray $i++ --- htdocs/core/lib/functions.lib.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2c94e4d4a8c..2f794579b7b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13804,8 +13804,6 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, $out .= ''; $out .= ''; - - $i++; } $out .= "\n"; From dfaa8358fb8a80c92549c5447a2660f6fc0e23b2 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 17:02:37 +0100 Subject: [PATCH 1227/1862] Fix: Comment unused $errorforemail (outside loop) --- htdocs/emailcollector/class/emailcollector.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 518529630fb..8efeda93635 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -3363,7 +3363,7 @@ class EmailCollector extends CommonObject if (empty($mode) && empty($error)) { $res = imap_mail_move($connection, $imapemail, $targetdir, CP_UID); if ($res == false) { - $errorforemail++; + // $errorforemail++; // Not in loop, not needed, not initialised $this->error = imap_last_error(); $this->errors[] = $this->error; From 636d552499835135f171a524be8a082fce3b000d Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 17:03:36 +0100 Subject: [PATCH 1228/1862] Fix: Remove stray $i++ --- htdocs/product/popuprop.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index 455fcf636b8..0af9c8052ae 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -260,7 +260,6 @@ if ($mode && $mode != '-1') { print ''; print ''; print "\n"; - $i++; } } else { print ''; From 8ed09542f23ed5a4d5919880e6d204aee68c865b Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 17:04:40 +0100 Subject: [PATCH 1229/1862] Fix Initialise $error to fix PhanTypeInvalidUnaryOperandIncOrDec --- htdocs/product/stock/movement_card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index d1ae82983e4..eae9deb3ef0 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -5,6 +5,7 @@ * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2019 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -249,6 +250,7 @@ if ($action == "correct_stock") { // Transfer stock from a warehouse to another warehouse if ($action == "transfert_stock" && !$cancel) { + $error = 0; $product = new Product($db); if (!empty($product_id)) { $result = $product->fetch($product_id); From 3183079e306d2e39f157b09e6f39e9ff3ba9f275 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 17:05:36 +0100 Subject: [PATCH 1230/1862] Fix Initialise $error to fix PhanTypeInvalidUnaryOperandIncOrDec --- htdocs/product/stock/movement_list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index fbc888a2793..9a054d18375 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -429,6 +429,7 @@ if ($action == "correct_stock") { // Transfer stock from a warehouse to another warehouse if ($action == "transfert_stock" && !$cancel) { + $error = 0; $product = new Product($db); if (!empty($product_id)) { $result = $product->fetch($product_id); From 29d650960c2a4014ca71a0fa3c1e3884ffda42ef Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 17:08:13 +0100 Subject: [PATCH 1231/1862] Fix Initialise $numline to fix PhanTypeInvalidUnaryOperandIncOrDec --- htdocs/reception/dispatch.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/reception/dispatch.php b/htdocs/reception/dispatch.php index 69055aa130c..94258089bed 100644 --- a/htdocs/reception/dispatch.php +++ b/htdocs/reception/dispatch.php @@ -9,6 +9,7 @@ * Copyright (C) 2017-2022 Ferran Marcet * Copyright (C) 2018-2022 Frédéric France * Copyright (C) 2019-2020 Christophe Battarel + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -304,6 +305,7 @@ $supplierorderdispatch = new CommandeFournisseurDispatch($db); $title = $object->ref." - ".$langs->trans('ReceptionDistribution'); $help_url = 'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; $morejs = array('/fourn/js/lib_dispatch.js.php'); +$numline = 0; llxHeader('', $title, $help_url, '', 0, 0, $morejs); From 344ae9e5b470cde09fd402bf1cff220ea30aac87 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 17:09:04 +0100 Subject: [PATCH 1232/1862] Fix: Remove stray $i++ --- htdocs/societe/admin/societe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 9821a24974b..285beb5742d 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -735,7 +736,6 @@ foreach ($profid as $key => $val) { print "\n"; } - $i++; } // VAT ID From 0127cc76f5e18ee9b69ab0893572a1c2bc3d3294 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 17:10:09 +0100 Subject: [PATCH 1233/1862] Qual: Enable PhanTypeInvalidUnaryOperandIncOrDec (all fixed) --- dev/tools/phan/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 5c021217ac4..4771e953a36 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -482,7 +482,7 @@ return [ 'PhanTypeInvalidPropertyName', 'PhanPluginDuplicateCatchStatementBody', 'PhanPluginUndeclaredVariableIsset', - 'PhanTypeInvalidUnaryOperandIncOrDec', + // 'PhanTypeInvalidUnaryOperandIncOrDec', // 'PhanPluginDescriptionlessCommentOnClass', 'PhanPluginEmptyStatementIf', 'PhanPluginInlineHTMLTrailing', From 8b165963fa078a7f7776154c4194eed9adb89ffb Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Wed, 13 Mar 2024 18:03:10 +0100 Subject: [PATCH 1234/1862] Fix Update prompts for each functions --- htdocs/ai/admin/custom_prompt.php | 74 ++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 10 deletions(-) diff --git a/htdocs/ai/admin/custom_prompt.php b/htdocs/ai/admin/custom_prompt.php index ee62b646604..699479bbb9e 100644 --- a/htdocs/ai/admin/custom_prompt.php +++ b/htdocs/ai/admin/custom_prompt.php @@ -80,8 +80,8 @@ $arrayofaifeatures = array( */ $functioncode = GETPOST('functioncode', 'alpha'); -$pre_prompt = GETPOST('prePrompt', 'alpha'); -$post_prompt = GETPOST('postPrompt', 'alpha'); +$pre_prompt = GETPOST('prePrompt'); +$post_prompt = GETPOST('postPrompt'); // get all configs in const AI $currentConfigurationsJson = getDolGlobalString('AI_CONFIGURATIONS_PROMPT'); @@ -126,10 +126,31 @@ if ($action == 'update' && !GETPOST('cancel')) { $action = 'edit'; } -if ($action == 'confirm_deleteproperty') { +if ($action == 'updatePrompts') { + $key = GETPOST('key', 'alpha'); + + $currentConfigurations[$key] = [ + 'prePrompt' => $pre_prompt, + 'postPrompt' => $post_prompt, + ]; + + $newConfigurationsJson = json_encode($currentConfigurations, JSON_UNESCAPED_UNICODE); + $result = dolibarr_set_const($db, 'AI_CONFIGURATIONS_PROMPT', $newConfigurationsJson, 'chaine', 0, '', $conf->entity); + if (!$error) { + $action = 'dodo'; + if ($result) { + header("Location: ".$_SERVER['PHP_SELF']); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + exit; + } else { + setEventMessages($langs->trans("ErrorUpdating"), null, 'errors'); + } + } +} + +if ($action == 'confirm_deleteproperty' && GETPOST('confirm') == 'yes') { $key = GETPOST('key', 'alpha'); - //var_dump($currentConfigurations[$key]);exit; if (isset($currentConfigurations[$key])) { unset($currentConfigurations[$key]); @@ -144,6 +165,9 @@ if ($action == 'confirm_deleteproperty') { } } } +if ($action == 'confirm_deleteproperty') { + var_dump(GETPOST('confirm'));exit; +} /* @@ -249,7 +273,7 @@ if ($action == 'edit') { $out .= '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_ACCOUNT, 1); print "
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1); diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 3044834f328..d6568fb9855 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1462,7 +1462,7 @@ class Account extends CommonObject $datas['accountancyjournal'] = '
'.$langs->trans('AccountancyJournal').': '.$this->accountancy_journal; } // show categories for this record only in ajax to not overload lists - if (isModEnabled('categorie') && !$nofetch) { + if (isModEnabled('category') && !$nofetch) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories'] = '
' . $form->showCategories($this->id, Categorie::TYPE_ACCOUNT, 1); diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 1254809106d..81f5e8e6320 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -472,11 +472,11 @@ class PaymentVarious extends CommonObject $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); return -5; } - if (isModEnabled("banque") && (empty($this->fk_account) || $this->fk_account <= 0)) { + if (isModEnabled("bank") && (empty($this->fk_account) || $this->fk_account <= 0)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount")); return -6; } - if (isModEnabled("banque") && (empty($this->type_payment) || $this->type_payment <= 0)) { + if (isModEnabled("bank") && (empty($this->type_payment) || $this->type_payment <= 0)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); return -7; } @@ -530,7 +530,7 @@ class PaymentVarious extends CommonObject $this->ref = (string) $this->id; if ($this->id > 0) { - if (isModEnabled("banque") && !empty($this->amount)) { + if (isModEnabled("bank") && !empty($this->amount)) { // Insert into llx_bank require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index 09b24fa6c70..c474b6ce2e1 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'categories', 'compta', 'bills', 'other')); -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { $langs->load("members"); } if (isModEnabled('don')) { @@ -621,7 +621,7 @@ if ($result) { print "
'; print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); @@ -450,7 +450,7 @@ if ($action == 'create') { print '
'.$langs->trans('BankTransactionLine').''; diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 95850bead49..d750864de6f 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -163,8 +163,8 @@ $arrayfields = array( 'datev' =>array('label'=>"DateValue", 'checked'=>-1, 'position'=>130), 'type' =>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>140), 'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>isModEnabled('project')), - 'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>isModEnabled("banque")), - 'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>isModEnabled("banque")), + 'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>isModEnabled("bank")), + 'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>isModEnabled("bank")), 'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>isModEnabled('accounting')), 'subledger' =>array('label'=>"SubledgerAccount", 'checked'=>1, 'position'=>410, "enabled"=>isModEnabled('accounting')), 'debit' =>array('label'=>"Debit", 'checked'=>1, 'position'=>500), diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 5d78d4ad4be..b67014218f5 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -147,7 +147,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); } print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder); @@ -223,7 +223,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { } print $obj->num_payment.''; if ($obj->fk_bank > 0) { //$accountstatic->fetch($obj->fk_bank); @@ -263,7 +263,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print '   '.price($totalpaid)."'; if ($obj->fk_bank > 0) { //$accountstatic->fetch($obj->fk_bank); @@ -392,7 +392,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print '
'.$langs->trans('BankAccount').''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); print $form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); @@ -4814,7 +4814,7 @@ if ($action == 'create') { } // Bank Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print '
'; print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -5140,7 +5140,7 @@ if ($action == 'create') { print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -5160,7 +5160,7 @@ if ($action == 'create') { print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -5183,7 +5183,7 @@ if ($action == 'create') { $i++; } print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -5215,7 +5215,7 @@ if ($action == 'create') { print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -5229,7 +5229,7 @@ if ($action == 'create') { print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -5256,7 +5256,7 @@ if ($action == 'create') { print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -5306,7 +5306,7 @@ if ($action == 'create') { $label = ($langs->trans("PaymentType".$objp->payment_code) != "PaymentType".$objp->payment_code) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; @@ -5730,7 +5730,7 @@ if ($action == 'create') { // Create contract if (getDolGlobalString('CONTRACT_CREATE_FROM_INVOICE')) { - if (isModEnabled('contrat') && $object->status == Facture::STATUS_VALIDATED) { + if (isModEnabled('contract') && $object->status == Facture::STATUS_VALIDATED) { $langs->load("contracts"); if ($usercancreatecontract) { diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index a68ceeb3d0f..ee34766b45c 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1448,7 +1448,7 @@ class Invoices extends DolibarrApi throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if (empty($accountid)) { throw new RestException(400, 'Account ID is mandatory'); } @@ -1506,7 +1506,7 @@ class Invoices extends DolibarrApi throw new RestException(400, 'Payment error : '.$paymentobj->error); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $label = '(CustomerInvoicePayment)'; if ($paymentobj->paiementcode == 'CHQ' && empty($chqemetteur)) { @@ -1569,7 +1569,7 @@ class Invoices extends DolibarrApi } } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if (empty($accountid)) { throw new RestException(400, 'Account ID is mandatory'); } @@ -1653,7 +1653,7 @@ class Invoices extends DolibarrApi $this->db->rollback(); throw new RestException(400, 'Payment error : '.$paymentobj->error); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $label = '(CustomerInvoicePayment)'; if ($paymentobj->paiementcode == 'CHQ' && empty($chqemetteur)) { throw new RestException(400, 'Emetteur is mandatory when payment code is '.$paymentobj->paiementcode); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 12bbd6fa5f0..fc0ff165cd2 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5632,7 +5632,7 @@ class Facture extends CommonInvoice $langs->load("bills"); - if (!isModEnabled('facture')) { // Should not happen. If module disabled, cron job should not be visible. + if (!isModEnabled('invoice')) { // Should not happen. If module disabled, cron job should not be visible. $this->output .= $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Facture")); return 0; } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index d728541b8d9..274ea165a53 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -56,7 +56,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } @@ -1300,7 +1300,7 @@ if ($user->hasRight("user", "user", "lire")) { $moreforfilter .= ''; } // Filter on product tags -if (isModEnabled('categorie') && $user->hasRight("categorie", "lire") && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) { +if (isModEnabled('category') && $user->hasRight("categorie", "lire") && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -1308,7 +1308,7 @@ if (isModEnabled('categorie') && $user->hasRight("categorie", "lire") && ($user- $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); $moreforfilter .= '
'; } -if (isModEnabled('categorie') && $user->hasRight("categorie", "lire")) { +if (isModEnabled('category') && $user->hasRight("categorie", "lire")) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 8e5ca60137a..e49a7c328d4 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -73,7 +73,7 @@ $endyear = $year; /* * View */ -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $langs->load('categories'); } $form = new Form($db); @@ -298,7 +298,7 @@ if ($user->admin) { print '
'; // Category -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { if ($mode == 'customer') { $cat_type = Categorie::TYPE_CUSTOMER; $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index c280a92183e..57748c27950 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -50,7 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills')); -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $langs->load("orders"); } @@ -103,7 +103,7 @@ print load_fiche_titre($langs->trans("InvoicesArea"), '', 'bill'); print '
'; -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { print getNumberInvoicesPieChart('customers'); print '
'; } @@ -113,7 +113,7 @@ if (isModEnabled('fournisseur') || isModEnabled('supplier_invoice')) { print '
'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { print getCustomerInvoiceDraftTable($max, $socid); print '
'; } @@ -127,7 +127,7 @@ print '
'; // Latest modified customer invoices -if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { +if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $langs->load("boxes"); $tmpinvoice = new Facture($db); @@ -580,7 +580,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { /* * Customers orders to be billed */ -if (isModEnabled('facture') && isModEnabled('commande') && $user->hasRight("commande", "lire") && !getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) { +if (isModEnabled('invoice') && isModEnabled('order') && $user->hasRight("commande", "lire") && !getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) { $commandestatic = new Commande($db); $langs->load("orders"); diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index f52b3c2f72e..a7a7c5f5898 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -178,7 +178,7 @@ if ($action == 'create') { // Amount print '
'; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Type payment print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if ($object->fk_account > 0) { $bankline = new AccountLine($db); $bankline->fetch($object->fk_bank); diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 67d5b5b561d..ffc1c3314fb 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -485,11 +485,11 @@ class Localtax extends CommonObject $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); return -4; } - if (isModEnabled("banque") && (empty($this->accountid) || $this->accountid <= 0)) { + if (isModEnabled("bank") && (empty($this->accountid) || $this->accountid <= 0)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount")); return -5; } - if (isModEnabled("banque") && (empty($this->paymenttype) || $this->paymenttype <= 0)) { + if (isModEnabled("bank") && (empty($this->paymenttype) || $this->paymenttype <= 0)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); return -5; } @@ -521,7 +521,7 @@ class Localtax extends CommonObject $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."localtax"); // TODO devrait s'appeler paiementlocaltax if ($this->id > 0) { $ok = 1; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Insertion dans llx_bank require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 2a593eb6543..83620a7e0ad 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -174,7 +174,7 @@ if (empty($reshook)) { $error++; } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // If bank module is on, account is required to enter a payment if (GETPOST('accountid') <= 0) { setEventMessages($langs->transnoentities('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors'); @@ -251,7 +251,7 @@ if (empty($reshook)) { $multicurrency_tx[$key] = $tmpinvoice->multicurrency_tx; } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // If the bank module is active, an account is required to input a payment if (GETPOSTINT('accountid') <= 0) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors'); @@ -501,7 +501,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Bank account print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if ($facture->type != 2) { print ''; } diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index bfdd60e522f..23112324c96 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; } if (isModEnabled('margin')) { @@ -318,7 +318,7 @@ print ''; */ // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { if ($object->fk_account > 0) { if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) { include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 9ecab0282c6..b9fb85f148b 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -707,7 +707,7 @@ class Paiement extends CommonObject $error = 0; $bank_line_id = 0; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if ($accountid <= 0) { $this->error = 'Bad value for parameter accountid='.$accountid; dol_syslog(get_class($this).'::addPaymentToBank '.$this->error, LOG_ERR); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index bbded249fb9..769a0bd9ce7 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -103,8 +103,8 @@ $arrayfields = array( 'p.datep' => array('label'=>"Date", 'checked'=>1, 'position'=>20), 's.nom' => array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), 'c.libelle' => array('label'=>"Type", 'checked'=>1, 'position'=>40), - 'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>50, 'enabled'=>(isModEnabled("banque"))), - 'ba.label' => array('label'=>"BankAccount", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled("banque"))), + 'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>50, 'enabled'=>(isModEnabled("bank"))), + 'ba.label' => array('label'=>"BankAccount", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled("bank"))), 'p.num_paiement' => array('label'=>"Numero", 'checked'=>1, 'position'=>70, 'tooltip'=>"ChequeOrTransferNumber"), 'p.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>80), 'p.statut' => array('label'=>"Status", 'checked'=>1, 'position'=>90, 'enabled'=>(getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION'))), diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index dce1a7f5d83..44a6cb3fe71 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -72,7 +72,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y $error++; $action = 'create'; } - if (isModEnabled("banque") && !(GETPOST("accountid") > 0)) { + if (isModEnabled("bank") && !(GETPOST("accountid") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors'); $error++; $action = 'create'; diff --git a/htdocs/compta/paiement_vat.php b/htdocs/compta/paiement_vat.php index 30fb1768dc7..20b574adac4 100644 --- a/htdocs/compta/paiement_vat.php +++ b/htdocs/compta/paiement_vat.php @@ -70,7 +70,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y $error++; $action = 'create'; } - if (isModEnabled("banque") && !(GETPOSTINT("accountid") > 0)) { + if (isModEnabled("bank") && !(GETPOSTINT("accountid") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToDebit")), null, 'errors'); $error++; $action = 'create'; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 7e6303486d0..55df11fe81b 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; } @@ -146,7 +146,7 @@ print ''; // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { if ($object->bank_account) { $bankline = new AccountLine($db); $bankline->fetch($object->bank_line); diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index f27bec0c8b6..b49e93ebed3 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; } @@ -188,7 +188,7 @@ print ''; // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { if ($object->bank_account) { $bankline = new AccountLine($db); $bankline->fetch($object->bank_line); diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 17281ae721c..b65e13561d7 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; // Load translation files required by the page $langs->load("companies"); -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { $langs->load("bills"); } @@ -117,7 +117,7 @@ if ($id > 0) { dol_banner_tab($object, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 1); print dol_get_fiche_end(); - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { // Invoice list print load_fiche_titre($langs->trans("CustomerPreview")); diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index efa2ed773d4..7c14e3e1d1b 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -1137,7 +1137,7 @@ if ($modecompta == 'BOOKKEEPING') { */ //$conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY = 1; - if (getDolGlobalString('ACCOUNTING_REPORTS_INCLUDE_VARPAY') && isModEnabled("banque") && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { + if (getDolGlobalString('ACCOUNTING_REPORTS_INCLUDE_VARPAY') && isModEnabled("bank") && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { $subtotal_ht = 0; $subtotal_ttc = 0; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 167ca1793f6..bdcca353a85 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -215,7 +215,7 @@ if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') { $subtotal_ht = 0; $subtotal_ttc = 0; -if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -272,7 +272,7 @@ if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta // Nothing from this table } -if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { // On ajoute les paiements clients anciennes version, non lies par paiement_facture if ($modecompta != 'CREANCES-DETTES') { $sql = "SELECT sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; @@ -327,7 +327,7 @@ if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta $subtotal_ht = 0; $subtotal_ttc = 0; -if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; @@ -799,7 +799,7 @@ if (isModEnabled('don') && ($modecompta == 'CREANCES-DETTES' || $modecompta == " * Various Payments */ -if (getDolGlobalString('ACCOUNTING_REPORTS_INCLUDE_VARPAY') && isModEnabled("banque") && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (getDolGlobalString('ACCOUNTING_REPORTS_INCLUDE_VARPAY') && isModEnabled("bank") && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { // decaiss $sql = "SELECT date_format(p.datep, '%Y-%m') AS dm, SUM(p.amount) AS amount FROM ".MAIN_DB_PREFIX."payment_various as p"; diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 6bb11589a2d..c3fdb7f1296 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -427,7 +427,7 @@ if ($action == 'create') { print ''; // Bank Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; @@ -631,7 +631,7 @@ if ($id > 0) { print ''; // Bank account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''."\n"; -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { // Customer Categories print ''; $order = new Commande($db); $order->fetch($expedition->origin_id); diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 1dfc406a9b9..a5017547c34 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index e3e0358fed4..6720301d326 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -579,7 +579,7 @@ class PaymentDonation extends CommonObject $error = 0; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); diff --git a/htdocs/don/paiement/list.php b/htdocs/don/paiement/list.php index 26a4c4c55c2..32162646c27 100644 --- a/htdocs/don/paiement/list.php +++ b/htdocs/don/paiement/list.php @@ -93,8 +93,8 @@ $arrayfields = array( 's.nom' => array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), 'c.code' => array('label'=>"Type", 'checked'=>1, 'position'=>40), 'pd.num_paiement' => array('label'=>"Numero", 'checked'=>1, 'position'=>50, 'tooltip'=>"ChequeOrTransferNumber"), - 'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled("banque"))), - 'ba.label' => array('label'=>"BankAccount", 'checked'=>1, 'position'=>70, 'enabled'=>(isModEnabled("banque"))), + 'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled("bank"))), + 'ba.label' => array('label'=>"BankAccount", 'checked'=>1, 'position'=>70, 'enabled'=>(isModEnabled("bank"))), 'pd.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>80), ); $arrayfields = dol_sort_array($arrayfields, 'position'); diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index 434d75de273..5c4b6f719ee 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; } @@ -125,7 +125,7 @@ print ''; // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { if ($object->bank_account) { $bankline = new AccountLine($db); $bankline->fetch($object->bank_line); diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index 3f704d8c20f..ebf7a741f80 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -67,7 +67,7 @@ if ($action == 'add_payment') { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors'); $error++; } - if (isModEnabled("banque") && !(GETPOSTINT("accountid") > 0)) { + if (isModEnabled("bank") && !(GETPOSTINT("accountid") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors'); $error++; } diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index cd19a296581..a7560e312cb 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -323,17 +323,17 @@ if (!getDolGlobalString('ECM_AUTO_TREE_HIDEN')) { $rowspan++; $sectionauto[] = array('position'=>30, 'level'=>1, 'module'=>'propal', 'test'=>isModEnabled('propal'), 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals"))); } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $rowspan++; - $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contrat'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); + $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contract'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); } - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $rowspan++; - $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>isModEnabled('commande'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); + $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>isModEnabled('order'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $rowspan++; - $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('facture'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); + $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('invoice'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); } if (isModEnabled('supplier_proposal')) { $langs->load("supplier_proposal"); @@ -366,10 +366,10 @@ if (!getDolGlobalString('ECM_AUTO_TREE_HIDEN')) { $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks"))); } - if (isModEnabled('ficheinter')) { + if (isModEnabled('intervention')) { $langs->load("interventions"); $rowspan++; - $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('ficheinter'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); + $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('intervention'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); } if (isModEnabled('expensereport')) { $langs->load("trips"); @@ -381,12 +381,12 @@ if (!getDolGlobalString('ECM_AUTO_TREE_HIDEN')) { $rowspan++; $sectionauto[] = array('position'=>170, 'level'=>1, 'module'=>'holiday', 'test'=>isModEnabled('holiday'), 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays"))); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $langs->load("banks"); $rowspan++; - $sectionauto[] = array('position'=>180, 'level'=>1, 'module'=>'banque', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount"))); + $sectionauto[] = array('position'=>180, 'level'=>1, 'module'=>'banque', 'test'=>isModEnabled('bank'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount"))); $rowspan++; - $sectionauto[] = array('position'=>190, 'level'=>1, 'module'=>'chequereceipt', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("CheckReceipt"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("CheckReceipt"))); + $sectionauto[] = array('position'=>190, 'level'=>1, 'module'=>'chequereceipt', 'test'=>isModEnabled('bank'), 'label'=>$langs->trans("CheckReceipt"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("CheckReceipt"))); } if (isModEnabled('mrp')) { $langs->load("mrp"); diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 0ade7890db6..33fa81665a3 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -127,17 +127,17 @@ if (isModEnabled("propal")) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>isModEnabled('propal'), 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals"))); } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contrat'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); + $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contract'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>isModEnabled('commande'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); + $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>isModEnabled('order'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('facture'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); + $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('invoice'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); } if (isModEnabled('supplier_proposal')) { $langs->load("supplier_proposal"); @@ -161,10 +161,10 @@ if (isModEnabled('project')) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $langs->load("interventions"); $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('ficheinter'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); + $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('intervention'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); } if (isModEnabled('expensereport')) { $langs->load("trips"); @@ -176,10 +176,10 @@ if (isModEnabled('holiday')) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'holiday', 'test'=>isModEnabled('holiday'), 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays"))); } -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { $langs->load("banks"); $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount"))); + $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>isModEnabled('bank'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount"))); } if (isModEnabled('mrp')) { $langs->load("mrp"); diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index a4ed949fc04..06fb0af4299 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -328,7 +328,7 @@ if (!empty($withproject)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index fd335c1409e..bb19456cd2c 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -287,7 +287,7 @@ if (!empty($withproject)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index 8b4db60d47d..a82d6a419c2 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -260,7 +260,7 @@ if (!empty($withproject)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 6b584a30e73..ce211834b8c 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -443,7 +443,7 @@ if ($projectid > 0) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 7cd5f1d2e10..a83218f0a12 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -332,7 +332,7 @@ if (!empty($withproject)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index d844673b9ce..0c9722c4b78 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -543,7 +543,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 15397bf9327..f0e85472b80 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -958,7 +958,7 @@ if ($action == 'create') { // Ref print ''; print ''; print '
'; print $langs->trans('BankAccount'); @@ -5087,7 +5087,7 @@ if ($action == 'create') { if (isModEnabled('project')) { $nbrows++; } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $nbrows++; $nbcols++; } @@ -5116,7 +5116,7 @@ if ($action == 'create') { print ''.$langs->trans('ListOfSituationInvoices').''.$langs->trans('Situation').''.$langs->trans('AmountHT').''.$prev_invoice->getNomUrl(1).''.(($prev_invoice->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$prev_invoice->situation_counter.''.price($prev_invoice->total_ht).''.$object->getNomUrl(1).''.(($object->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$object->situation_counter.''.price($object->total_ht).''.price($total_global_ht).''.$next_invoice->getNomUrl(1).''.(($next_invoice->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$next_invoice->situation_counter.''.price($next_invoice->total_ht).'
'.price($total_global_ht).''.($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('Amount').''.dol_escape_htmltag($label.' '.$objp->num_payment).'
'.$langs->trans("Amount").'
'.$langs->trans("PaymentMode").''; print $form->select_types_paiements(GETPOST("paiementtype"), "paiementtype", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1); @@ -247,7 +247,7 @@ if ($id) { print '
'.$langs->trans("Amount").''.price($object->amount).'
'.$langs->trans('AccountToCredit').'
'.$langs->trans('Amount').''.price($object->amount, '', $disable_delete = 0; // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { $bankline = new AccountLine($db); if ($object->fk_account > 0) { @@ -360,7 +360,7 @@ print '
'.$langs->trans('Amount').''.price($object->amount, 0, $ print '
'.$langs->trans('Note').''.dol_string_onlythesehtmltags(dol_htmlcleanlastbr($object->note_private)).'
'.$langs->trans('Amount').''.price($object->amount, 0, $ print '
'.$langs->trans('Note').''.dol_string_onlythesehtmltags(dol_htmlcleanlastbr($object->note_private)).'
'.$langs->trans('DefaultBankAccount').''; print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(GETPOSTINT('fk_account'), 'fk_account', 0, '', 2, '', 0, '', 1); print '
'; print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -721,7 +721,7 @@ if ($id > 0) { print '\n"; $labeltype = $langs->trans("PaymentType".$objp->type_code) != "PaymentType".$objp->type_code ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "\n"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 0adbfcc4eab..13844252901 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -568,7 +568,7 @@ class PaymentSocialContribution extends CommonObject $error = 0; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index e2f887eb034..951faa2c2b8 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -109,7 +109,7 @@ $arrayfields = array( 'cs.paye' =>array('label'=>"Status", 'checked'=>1, 'position'=>110), ); -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { $arrayfields['cs.fk_account'] = array('checked'=>-1, 'position'=>90, 'label'=>"DefaultBankAccount"); } diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index fb3ecf981cb..dd5a463ecd1 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -226,7 +226,7 @@ print ''; print ''; print ''; print ''; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print ''; print ''; } @@ -246,7 +246,7 @@ print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $pa print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.rowid", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "pc.num_paiement", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber'); -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "pc.fk_bank", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); } @@ -324,7 +324,7 @@ while ($i < min($num, $limit)) { print ''; // Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Bank transaction print ''; print ''; print ''; print ''; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print ''; print ''; } diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 768867e0ddc..eb69cefa804 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -503,10 +503,10 @@ if (count($amount)) { if (isModEnabled("propal") && $key > 0) { print ' '.img_picto($langs->trans("ProposalStats"), "stats").' '; } - if (isModEnabled('commande') && $key > 0) { + if (isModEnabled('order') && $key > 0) { print ' '.img_picto($langs->trans("OrderStats"), "stats").' '; } - if (isModEnabled('facture') && $key > 0) { + if (isModEnabled('invoice') && $key > 0) { print ' '.img_picto($langs->trans("InvoiceStats"), "stats").' '; } print ''; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index afd631a8cdc..6c1b1c3558a 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -691,10 +691,10 @@ if (count($amount)) { if (isModEnabled("propal") && $key > 0) { print ' '.img_picto($langs->trans("ProposalStats"), "stats").' '; } - if (isModEnabled('commande') && $key > 0) { + if (isModEnabled('order') && $key > 0) { print ' '.img_picto($langs->trans("OrderStats"), "stats").' '; } - if (isModEnabled('facture') && $key > 0) { + if (isModEnabled('invoice') && $key > 0) { print ' '.img_picto($langs->trans("InvoiceStats"), "stats").' '; } print ''; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index df825768fee..a77c5979c9d 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -483,7 +483,7 @@ if ($action == 'create') { print "\n"; print ""; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Bank account print ''; // Bank account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } // Sales orders - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $nblines++; $ret = $product->load_stats_commande($socid); if ($ret < 0) { @@ -514,7 +514,7 @@ function show_stats_for_company($product, $socid) print ''; } // Customer invoices - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $nblines++; $ret = $product->load_stats_facture($socid); if ($ret < 0) { @@ -533,7 +533,7 @@ function show_stats_for_company($product, $socid) print ''; } // Customer template invoices - if (isModEnabled("facture") && $user->hasRight('facture', 'lire')) { + if (isModEnabled("invoice") && $user->hasRight('facture', 'lire')) { $nblines++; $ret = $product->load_stats_facturerec($socid); if ($ret < 0) { @@ -572,7 +572,7 @@ function show_stats_for_company($product, $socid) } // Contracts - if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { + if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $nblines++; $ret = $product->load_stats_contrat($socid); if ($ret < 0) { @@ -679,7 +679,7 @@ function show_stats_for_batch($batch, $socid) print ''; // Expeditions - if (isModEnabled('expedition') && $user->hasRight('expedition', 'lire')) { + if (isModEnabled('delivery_note') && $user->hasRight('expedition', 'lire')) { $nblines++; $ret = $batch->loadStatsExpedition($socid); if ($ret < 0) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 515542456cc..6b46a4dbfd2 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -127,9 +127,9 @@ function project_prepare_head(Project $project, $moreparam = '') } if (isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") - || isModEnabled("propal") || isModEnabled('commande') - || isModEnabled('facture') || isModEnabled('contrat') - || isModEnabled('ficheinter') || isModEnabled('agenda') || isModEnabled('deplacement') || isModEnabled('stock')) { + || isModEnabled("propal") || isModEnabled('order') + || isModEnabled('invoice') || isModEnabled('contract') + || isModEnabled('intervention') || isModEnabled('agenda') || isModEnabled('deplacement') || isModEnabled('stock')) { $nbElements = 0; // Enable caching of thirdrparty count Contacts $cachekey = 'count_elements_project_'.$project->id; @@ -143,13 +143,13 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled("propal")) { $nbElements += $project->getElementCount('propal', 'propal'); } - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $nbElements += $project->getElementCount('order', 'commande'); } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $nbElements += $project->getElementCount('invoice', 'facture'); } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $nbElements += $project->getElementCount('invoice_predefined', 'facture_rec'); } if (isModEnabled('supplier_proposal')) { @@ -161,13 +161,13 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled("supplier_invoice")) { $nbElements += $project->getElementCount('invoice_supplier', 'facture_fourn'); } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $nbElements += $project->getElementCount('contract', 'contrat'); } - if (isModEnabled('ficheinter')) { + if (isModEnabled('intervention')) { $nbElements += $project->getElementCount('intervention', 'fichinter'); } - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { $nbElements += $project->getElementCount('shipping', 'expedition'); } if (isModEnabled('mrp')) { @@ -197,7 +197,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled('salaries')) { $nbElements += $project->getElementCount('salaries', 'payment_salary'); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $nbElements += $project->getElementCount('variouspayment', 'payment_various'); } dol_setcache($cachekey, $nbElements, 120); // If setting cache fails, this is not a problem, so we do not test result. diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index f311fc57967..dceaf0bc8a3 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -42,8 +42,8 @@ function propal_prepare_head($object) $head[$h][2] = 'comm'; $h++; - if ((empty($conf->commande->enabled) && ((isModEnabled("expedition") && getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'lire')) - || (isModEnabled("expedition") && getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'lire'))))) { + if ((empty($conf->commande->enabled) && ((isModEnabled("delivery_note") && getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'lire')) + || (isModEnabled("delivery_note") && getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'lire'))))) { $langs->load("sendings"); $text = ''; $head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id; diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 0f2d6695ee8..3b49d190016 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -356,7 +356,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $newmenu = $menuArbo->menuLeftCharger($newmenu, $mainmenu, $leftmenu, ($user->socid ? 1 : 0), 'auguria', $tabMenu); // We update newmenu for special dynamic menus - if (isModEnabled('banque') && $user->hasRight('banque', 'lire') && $mainmenu == 'bank') { // Entry for each bank account + if (isModEnabled('bank') && $user->hasRight('banque', 'lire') && $mainmenu == 'bank') { // Entry for each bank account include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Required for to get Account::TYPE_CASH for example $sql = "SELECT rowid, label, courant, rappro, courant"; @@ -410,7 +410,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $nature = ''; // Must match array $sourceList defined into journals_list.php - if ($objp->nature == 2 && isModEnabled('facture') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { + if ($objp->nature == 2 && isModEnabled('invoice') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { $nature = "sells"; } if ($objp->nature == 3 @@ -418,7 +418,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_PURCHASES')) { $nature = "purchases"; } - if ($objp->nature == 4 && isModEnabled('banque')) { + if ($objp->nature == 4 && isModEnabled('bank')) { $nature = "bank"; } if ($objp->nature == 5 && isModEnabled('expensereport') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) { diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index df29edca3d5..8f8dd72b20b 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -95,7 +95,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Members $tmpentry = array( - 'enabled' => isModEnabled('adherent'), + 'enabled' => isModEnabled('member'), 'perms' => $user->hasRight('adherent', 'lire'), 'module' => 'adherent' ); @@ -151,7 +151,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Products-Services $tmpentry = array( - 'enabled'=> (isModEnabled('product') || isModEnabled('service') || isModEnabled('expedition')), + 'enabled'=> (isModEnabled('product') || isModEnabled('service') || isModEnabled('delivery_note')), 'perms'=> ($user->hasRight('product', 'read') || $user->hasRight('service', 'read') || $user->hasRight('expedition', 'lire')), 'module'=>'product|service' ); @@ -203,7 +203,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Projects $tmpentry = array( - 'enabled'=> (isModEnabled('projet') ? 1 : 0), + 'enabled'=> (isModEnabled('project') ? 1 : 0), 'perms'=> ($user->hasRight('projet', 'lire') ? 1 : 0), 'module'=>'projet' ); @@ -243,12 +243,12 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $tmpentry = array( 'enabled'=>( isModEnabled('propal') - || isModEnabled('commande') + || isModEnabled('order') || isModEnabled('fournisseur') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') - || isModEnabled('contrat') - || isModEnabled('ficheinter') + || isModEnabled('contract') + || isModEnabled('intervention') ) ? 1 : 0, 'perms'=>( $user->hasRight('propal', 'read') @@ -293,7 +293,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Billing - Financial $tmpentry = array( 'enabled'=>( - isModEnabled('facture') || + isModEnabled('invoice') || isModEnabled('don') || isModEnabled('tax') || isModEnabled('salaries') || @@ -327,7 +327,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Bank $tmpentry = array( - 'enabled'=>(isModEnabled('banque') || isModEnabled('prelevement')), + 'enabled'=>(isModEnabled('bank') || isModEnabled('prelevement')), 'perms'=>($user->hasRight('banque', 'lire') || $user->hasRight('prelevement', 'lire') || $user->hasRight('paymentbybanktransfer', 'read')), 'module'=>'banque|prelevement|paymentbybanktransfer' ); @@ -1211,7 +1211,7 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->hasRight("user", "user", "write") || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')), '', 'home'); $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } @@ -1283,7 +1283,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le } // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') || !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) { // Categories prospects/customers @@ -1320,7 +1320,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->hasRight('societe', 'contact', 'lire')); // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); // Categories Contact $newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); @@ -1363,7 +1363,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Customers orders - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $langs->load("orders"); $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 200, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); $newmenu->add("/commande/card.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->hasRight('commande', 'creer')); @@ -1371,7 +1371,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders") { $newmenu->add("/commande/list.php?leftmenu=orders&search_status=0", $langs->trans("StatusOrderDraftShort"), 2, $user->hasRight('commande', 'lire')); $newmenu->add("/commande/list.php?leftmenu=orders&search_status=1", $langs->trans("StatusOrderValidated"), 2, $user->hasRight('commande', 'lire')); - if (isModEnabled('expedition')) { + if (isModEnabled('delivery_note')) { $newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->hasRight('commande', 'lire')); } $newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->hasRight('commande', 'lire')); @@ -1426,7 +1426,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Contrat - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $langs->load("contracts"); $newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->hasRight('contrat', 'lire'), '', $mainmenu, 'contracts', 2000, '', '', '', img_picto('', 'contract', 'class="paddingright pictofixedwidth"')); $newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->hasRight('contrat', 'creer')); @@ -1441,7 +1441,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Interventions - if (isModEnabled('ficheinter')) { + if (isModEnabled('intervention')) { $langs->load("interventions"); $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->hasRight('ficheinter', 'lire'), '', $mainmenu, 'ficheinter', 2200, '', '', '', img_picto('', 'intervention', 'class="paddingright pictofixedwidth"')); $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->hasRight('ficheinter', 'creer'), '', '', '', 201); @@ -1472,7 +1472,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $langs->load("companies"); // Customers invoices - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $langs->load("bills"); $newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills', 0, '', '', '', img_picto('', 'bill', 'class="paddingright pictofixedwidth"')); $newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->hasRight('facture', 'creer')); @@ -1523,9 +1523,9 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Orders - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $langs->load("orders"); - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); } //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire')); @@ -1625,7 +1625,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Various payment - if (isModEnabled('banque') && !getDolGlobalString('BANK_USE_OLD_VARIOUS_PAYMENT')) { + if (isModEnabled('bank') && !getDolGlobalString('BANK_USE_OLD_VARIOUS_PAYMENT')) { $langs->load("banks"); $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'tax_various', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) { @@ -1673,10 +1673,10 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41); $newmenu->add("/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ChartOfSubaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41); $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 60); - if (isModEnabled('banque')) { + if (isModEnabled('bank')) { $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_bank', 70); } - if (isModEnabled('facture') || isModEnabled('supplier_invoice')) { + if (isModEnabled('invoice') || isModEnabled('supplier_invoice')) { $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 80); } if (isModEnabled('tax')) { @@ -1696,7 +1696,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef // Binding // $newmenu->add("", $langs->trans("Binding"), 0, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch'); - if (isModEnabled('facture') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { + if (isModEnabled('invoice') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_customer'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/', $leftmenu)) { $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); @@ -1741,7 +1741,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $nature = ''; // Must match array $sourceList defined into journals_list.php - if ($objp->nature == 2 && isModEnabled('facture') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { + if ($objp->nature == 2 && isModEnabled('invoice') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { $nature = "sells"; } if ($objp->nature == 3 @@ -1749,7 +1749,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_PURCHASES')) { $nature = "purchases"; } - if ($objp->nature == 4 && isModEnabled('banque')) { + if ($objp->nature == 4 && isModEnabled('bank')) { $nature = "bank"; } if ($objp->nature == 5 && isModEnabled('expensereport') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) { @@ -1981,7 +1981,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $langs->loadLangs(array("withdrawals", "banks", "bills", "categories")); // Bank-Cash account - if (isModEnabled('banque')) { + if (isModEnabled('bank')) { $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank', 0, '', '', '', img_picto('', 'bank_account', 'class="paddingright pictofixedwidth"')); $newmenu->add("/compta/bank/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->hasRight('banque', 'configurer')); @@ -1992,7 +1992,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->hasRight('banque', 'transfer')); } - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); $newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->hasRight('categorie', 'creer'), '', $mainmenu, 'tags'); $newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->hasRight('banque', 'configurer'), '', $mainmenu, 'tags'); @@ -2027,7 +2027,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } // Management of checks - if (!getDolGlobalString('BANK_DISABLE_CHECK_DEPOSIT') && isModEnabled('banque') && (isModEnabled('facture') || getDolGlobalString('MAIN_MENU_CHEQUE_DEPOSIT_ON'))) { + if (!getDolGlobalString('BANK_DISABLE_CHECK_DEPOSIT') && isModEnabled('bank') && (isModEnabled('invoice') || getDolGlobalString('MAIN_MENU_CHEQUE_DEPOSIT_ON'))) { $newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->hasRight('banque', 'cheque'), '', $mainmenu, 'checks', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); if (preg_match('/checks/', $leftmenu)) { $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->hasRight('banque', 'cheque')); @@ -2076,12 +2076,12 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme if (isModEnabled('variants')) { $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('product', 'read')); } - if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { + if (isModEnabled('propal') || isModEnabled('order') || isModEnabled('invoice') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->hasRight('product', 'read')); } // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie', 'lire')); @@ -2100,11 +2100,11 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme if (isModEnabled('variants')) { $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('service', 'read')); } - if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { + if (isModEnabled('propal') || isModEnabled('order') || isModEnabled('invoice') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->hasRight('service', 'read')); } // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie', 'lire')); @@ -2126,7 +2126,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); // Categories for warehouses - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $newmenu->add("/categories/index.php?leftmenu=stock&type=9", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } } @@ -2156,7 +2156,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } // Shipments - if (isModEnabled('expedition')) { + if (isModEnabled('delivery_note')) { $langs->load("sendings"); $newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->hasRight('expedition', 'lire'), '', $mainmenu, 'sendings', 0, '', '', '', img_picto('', 'shipment', 'class="paddingright pictofixedwidth"')); $newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->hasRight('expedition', 'creer')); @@ -2238,13 +2238,13 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme global $user, $conf, $langs; if ($mainmenu == 'project') { - if (isModEnabled('projet')) { + if (isModEnabled('project')) { $langs->load("projects"); $search_project_user = GETPOSTINT('search_project_user'); $tmpentry = array( - 'enabled'=>isModEnabled('projet'), + 'enabled'=>isModEnabled('project'), 'perms'=>$user->hasRight('projet', 'lire'), 'module'=>'projet' ); @@ -2279,7 +2279,7 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } @@ -2389,11 +2389,11 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->hasRight('expensereport', 'lire')); $newmenu->add("/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->hasRight('expensereport', 'lire')); } - $newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans("Payments"), 1, ($user->hasRight('expensereport', 'lire')) && isModEnabled('banque')); + $newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans("Payments"), 1, ($user->hasRight('expensereport', 'lire')) && isModEnabled('bank')); $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('expensereport', 'lire')); } - if (isModEnabled('projet')) { + if (isModEnabled('project')) { if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { $langs->load("projects"); @@ -2469,7 +2469,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen global $user, $conf, $langs; if ($mainmenu == 'members') { - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { // Load translation files required by the page $langs->loadLangs(array("members", "compta")); @@ -2487,7 +2487,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->hasRight('adherent', 'export')); - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=cat&type=3", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'read'), '', $mainmenu, 'cat'); } diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index f66eb100208..afdc64bf80c 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -1036,7 +1036,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->MultiCell(15, 3, $outputlangs->transnoentities("Amount"), 0, 'C', 0); $pdf->SetXY($tab3_posx + 35, $tab3_top + 1); $pdf->MultiCell(30, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $pdf->SetXY($tab3_posx + 65, $tab3_top + 1); $pdf->MultiCell(25, 3, $outputlangs->transnoentities("BankAccount"), 0, 'L', 0); } @@ -1076,7 +1076,7 @@ class pdf_standard extends ModeleExpenseReport $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->p_code); $pdf->MultiCell(40, 3, $oper, 0, 'L', 0); - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $pdf->SetXY($tab3_posx + 65, $tab3_top + $y + 1); $pdf->MultiCell(30, 3, $row->baref, 0, 'L', 0); } diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 19339df0ead..fe348963e14 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -248,7 +248,7 @@ class mailing_advthirdparties extends MailingTargets if ($resql) { $num = $this->db->num_rows($resql); - if (!isModEnabled("categorie")) { + if (!isModEnabled("category")) { $num = 0; // Force empty list if category module is not enabled } diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 60c1e2ed153..0d1c0b6931e 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -290,7 +290,7 @@ class mailing_thirdparties extends MailingTargets if ($resql) { $num = $this->db->num_rows($resql); - if (!isModEnabled("categorie")) { + if (!isModEnabled("category")) { $num = 0; // Force empty list if category module is not enabled } diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 20aced509b9..0ead1e5e844 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -136,7 +136,7 @@ class modCategorie extends DolibarrModules if (isModEnabled("societe")) { $typeexample .= ($typeexample ? " / " : "")."2=Customer-Prospect"; } - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $typeexample .= ($typeexample ? " / " : "")."3=Member"; } if (isModEnabled("societe")) { @@ -538,7 +538,7 @@ class modCategorie extends DolibarrModules } // 3 Members - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $r++; $this->import_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3]; $this->import_label[$r] = "CatMembersLinks"; // Translation key diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 4fce2b8021f..f571aad44ff 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -275,7 +275,7 @@ class modUser extends DolibarrModules $keyforelement = 'user'; $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - if (!isModEnabled('adherent')) { + if (!isModEnabled('member')) { unset($this->export_fields_array[$r]['u.fk_member']); unset($this->export_entities_array[$r]['u.fk_member']); } diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 4e37cf0beeb..611bd7f8aa1 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -42,13 +42,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (isModEnabled("supplier_invoice")) { @@ -57,10 +57,10 @@ if (isModEnabled("supplier_invoice")) { if (isModEnabled("supplier_order")) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } if (isModEnabled('deplacement')) { @@ -69,7 +69,7 @@ if (isModEnabled('deplacement')) { if (isModEnabled('agenda')) { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; } -if (isModEnabled('expedition')) { +if (isModEnabled('delivery_note')) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; } @@ -942,19 +942,19 @@ class doc_generic_project_odt extends ModelePDFProjects 'title' => "ListOrdersAssociatedProject", 'class' => 'Commande', 'table' => 'commande', - 'test' => isModEnabled('commande') && $user->hasRight('commande', 'lire') + 'test' => isModEnabled('order') && $user->hasRight('commande', 'lire') ), 'invoice' => array( 'title' => "ListInvoicesAssociatedProject", 'class' => 'Facture', 'table' => 'facture', - 'test' => isModEnabled('facture') && $user->hasRight('facture', 'lire') + 'test' => isModEnabled('invoice') && $user->hasRight('facture', 'lire') ), 'invoice_predefined' => array( 'title' => "ListPredefinedInvoicesAssociatedProject", 'class' => 'FactureRec', 'table' => 'facture_rec', - 'test' => isModEnabled('facture') && $user->hasRight('facture', 'lire') + 'test' => isModEnabled('invoice') && $user->hasRight('facture', 'lire') ), 'proposal_supplier' => array( 'title' => "ListSupplierProposalsAssociatedProject", @@ -978,21 +978,21 @@ class doc_generic_project_odt extends ModelePDFProjects 'title' => "ListContractAssociatedProject", 'class' => 'Contrat', 'table' => 'contrat', - 'test' => isModEnabled('contrat') && $user->hasRight('contrat', 'lire') + 'test' => isModEnabled('contract') && $user->hasRight('contrat', 'lire') ), 'intervention' => array( 'title' => "ListFichinterAssociatedProject", 'class' => 'Fichinter', 'table' => 'fichinter', 'disableamount' => 1, - 'test' => isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire') + 'test' => isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire') ), 'shipping' => array( 'title' => "ListShippingAssociatedProject", 'class' => 'Expedition', 'table' => 'expedition', 'disableamount' => 1, - 'test' => isModEnabled('expedition') && $user->hasRight('expedition', 'lire') + 'test' => isModEnabled('delivery_note') && $user->hasRight('expedition', 'lire') ), 'trip' => array( 'title' => "ListTripAssociatedProject", diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index d87238de508..021e855e417 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -330,7 +330,7 @@ class pdf_beluga extends ModelePDFProjects 'class'=>'Commande', 'table'=>'commande', 'datefieldname'=>'date_commande', - 'test'=> isModEnabled('commande') && $user->hasRight('commande', 'lire'), + 'test'=> isModEnabled('order') && $user->hasRight('commande', 'lire'), 'lang'=>'orders'), 'invoice'=>array( 'name'=>"CustomersInvoices", @@ -339,7 +339,7 @@ class pdf_beluga extends ModelePDFProjects 'margin'=>'add', 'table'=>'facture', 'datefieldname'=>'datef', - 'test'=> isModEnabled('facture') && $user->hasRight('facture', 'lire'), + 'test'=> isModEnabled('invoice') && $user->hasRight('facture', 'lire'), 'lang'=>'bills'), 'invoice_predefined'=>array( 'name'=>"PredefinedInvoices", @@ -347,7 +347,7 @@ class pdf_beluga extends ModelePDFProjects 'class'=>'FactureRec', 'table'=>'facture_rec', 'datefieldname'=>'datec', - 'test'=> isModEnabled('facture') && $user->hasRight('facture', 'lire'), + 'test'=> isModEnabled('invoice') && $user->hasRight('facture', 'lire'), 'lang'=>'bills'), 'order_supplier'=>array( 'name'=>"SuppliersOrders", @@ -372,7 +372,7 @@ class pdf_beluga extends ModelePDFProjects 'class'=>'Contrat', 'table'=>'contrat', 'datefieldname'=>'date_contrat', - 'test'=> isModEnabled('contrat') && $user->hasRight('contrat', 'lire'), + 'test'=> isModEnabled('contract') && $user->hasRight('contrat', 'lire'), 'lang'=>'contract'), 'intervention'=>array( 'name'=>"Interventions", @@ -381,7 +381,7 @@ class pdf_beluga extends ModelePDFProjects 'table'=>'fichinter', 'datefieldname'=>'date_valid', 'disableamount'=>1, - 'test'=>isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire'), + 'test'=>isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire'), 'lang'=>'interventions'), 'trip'=>array( 'name'=>"TripsAndExpenses", diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 5b51371095b..c070f29ce02 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -43,13 +43,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (isModEnabled("supplier_invoice")) { @@ -58,10 +58,10 @@ if (isModEnabled("supplier_invoice")) { if (isModEnabled("supplier_order")) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } if (isModEnabled('deplacement')) { diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 1bc82c23810..8bb3ad2444d 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -215,14 +215,14 @@ class pdf_paiement extends CommonDocGenerator $sql .= ", c.code as paiement_code, p.num_paiement as num_payment"; $sql .= ", p.amount as paiement_amount, f.total_ttc as facture_amount"; $sql .= ", pf.amount as pf_amount"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $sql .= ", ba.ref as bankaccount"; } $sql .= ", p.rowid as prowid"; $sql .= " FROM ".MAIN_DB_PREFIX."paiement as p LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_paiement = c.id"; $sql .= ", ".MAIN_DB_PREFIX."facture as f,"; $sql .= " ".MAIN_DB_PREFIX."paiement_facture as pf,"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $sql .= " ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba,"; } $sql .= " ".MAIN_DB_PREFIX."societe as s"; @@ -230,7 +230,7 @@ class pdf_paiement extends CommonDocGenerator $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid AND pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $sql .= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid "; } $sql .= " AND f.entity IN (".getEntity('invoice').")"; @@ -253,14 +253,14 @@ class pdf_paiement extends CommonDocGenerator $sql .= ", c.code as paiement_code, p.num_paiement as num_payment"; $sql .= ", p.amount as paiement_amount, f.total_ttc as facture_amount"; $sql .= ", pf.amount as pf_amount"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $sql .= ", ba.ref as bankaccount"; } $sql .= ", p.rowid as prowid"; $sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn as p LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_paiement = c.id"; $sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f,"; $sql .= " ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf,"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $sql .= " ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba,"; } $sql .= " ".MAIN_DB_PREFIX."societe as s"; @@ -268,7 +268,7 @@ class pdf_paiement extends CommonDocGenerator $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid AND pf.fk_facturefourn = f.rowid AND pf.fk_paiementfourn = p.rowid"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $sql .= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid "; } $sql .= " AND f.entity IN (".getEntity('invoice').")"; diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index 8d9b566794e..225707f0828 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -256,7 +256,7 @@ if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''."\n"; } -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { // Customer Categories print '
'; print $langs->trans('DefaultBankAccount'); @@ -663,7 +663,7 @@ if ($id > 0) { print '
'; $nbcols = 3; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $nbcols++; } @@ -698,7 +698,7 @@ if ($id > 0) { print '
'.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans('BankAccount').''.$langs->trans("Amount").''.dol_print_date($db->jdate($objp->dp), 'day')."".$labeltype.' '.$objp->num_payment."'.$obj->num_payment.''; $accountlinestatic->id = $obj->fk_bank; @@ -380,7 +380,7 @@ print '    
'.$langs->trans("BankAccount").''; print img_picto('', 'bank_account', 'pictofixedwidth'); @@ -633,7 +633,7 @@ if ($id > 0) { print '
'; print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -716,7 +716,7 @@ if ($id > 0) { print '\n"; $labeltype = $langs->trans("PaymentType".$objp->type_code) != "PaymentType".$objp->type_code ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "\n"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; diff --git a/htdocs/compta/tva/class/paymentvat.class.php b/htdocs/compta/tva/class/paymentvat.class.php index be9df9fe313..0d2d82b0dd0 100644 --- a/htdocs/compta/tva/class/paymentvat.class.php +++ b/htdocs/compta/tva/class/paymentvat.class.php @@ -569,7 +569,7 @@ class PaymentVAT extends CommonObject $error = 0; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index d84a5c5c588..568fea68048 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -587,11 +587,11 @@ class Tva extends CommonObject $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); return -4; } - if (isModEnabled("banque") && (empty($this->accountid) || $this->accountid <= 0)) { + if (isModEnabled("bank") && (empty($this->accountid) || $this->accountid <= 0)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount")); return -5; } - if (isModEnabled("banque") && (empty($this->type_payment) || $this->type_payment <= 0)) { + if (isModEnabled("bank") && (empty($this->type_payment) || $this->type_payment <= 0)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); return -5; } @@ -648,7 +648,7 @@ class Tva extends CommonObject if ($this->id > 0) { $ok = 1; - if (isModEnabled("banque") && !empty($this->amount)) { + if (isModEnabled("bank") && !empty($this->amount)) { // Insert into llx_bank require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 32c982c080c..31d96758fcc 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -91,7 +91,7 @@ $arrayfields = array( 't.status' =>array('checked'=>1, 'position'=>90, 'label'=>"Status"), ); -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { $arrayfields['t.fk_account'] = array('checked'=>1, 'position'=>60, 'label'=>"DefaultBankAccount"); } diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index b877b472551..52405d5e6ce 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -170,7 +170,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "ptva.num_paiement", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber'); - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "ptva.fk_bank", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "bank.ref", "", $param, '', $sortfield, $sortorder); } @@ -258,7 +258,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { // Chq number print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Bank transaction print ''; // A total here has no sense print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; print ''; } diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index ab35f938890..f20a5c170a4 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -193,7 +193,7 @@ abstract class ActionsContactCardCommon $this->object->load_ref_elements(); - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForOrders"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande ? $this->object->ref_commande : $langs->trans("NoContactForAnyOrder"); $i++; @@ -203,12 +203,12 @@ abstract class ActionsContactCardCommon $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal ? $this->object->ref_propal : $langs->trans("NoContactForAnyProposal"); $i++; } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForContracts"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat ? $this->object->ref_contrat : $langs->trans("NoContactForAnyContract"); $i++; } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForInvoices"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_facturation ? $this->object->ref_facturation : $langs->trans("NoContactForAnyInvoice"); $i++; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 3ca3250d3c3..0cf70884978 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -873,7 +873,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print ''; // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $arrayselected = array(); print ''; print ''; @@ -1209,13 +1209,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { print ''; } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { print ''; @@ -1436,7 +1436,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print ''; print ''; } - if (isModEnabled('commande') || isModEnabled("expedition")) { + if (isModEnabled('order') || isModEnabled("delivery_note")) { print ''; } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { print ''; } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { print ''; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 21ba9ed848f..9cf303b037e 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -158,18 +158,18 @@ if (!empty($object->thirdparty->client)) { if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { + if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } } -if (isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire')) { +if (isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire')) { $elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions'); } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 45a39bfee2f..7d5d3858601 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1002,7 +1002,7 @@ if ($user->hasRight('societe', 'client', 'voir')) { $moreforfilter .= ''; } -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('ContactCategoriesShort'); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 231f433f3b4..613403d2f44 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2176,7 +2176,7 @@ if ($action == 'create') { // Create ... buttons $arrayofcreatebutton = array(); - if (isModEnabled('commande') && $object->status > 0 && $object->nbofservicesclosed < $nbofservices) { + if (isModEnabled('order') && $object->status > 0 && $object->nbofservicesclosed < $nbofservices) { $arrayofcreatebutton[] = array( 'url' => '/commande/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, 'label' => $langs->trans('AddOrder'), @@ -2184,7 +2184,7 @@ if ($action == 'create') { 'perm' => $user->hasRight('commande', 'creer') ); } - if (isModEnabled('facture') && $object->status > 0 && $soc->client > 0) { + if (isModEnabled('invoice') && $object->status > 0 && $soc->client > 0) { $arrayofcreatebutton[] = array( 'url' => '/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, 'label' => $langs->trans('CreateBill'), diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 584ea7d0697..f4ea37d3d53 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -239,7 +239,7 @@ print "
'; print $langs->trans('BankAccount'); @@ -664,7 +664,7 @@ if ($id > 0) { print '
'; $nbcols = 3; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $nbcols++; } @@ -699,7 +699,7 @@ if ($id > 0) { print '
'.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans('BankAccount').''.$langs->trans("Amount").''.dol_print_date($db->jdate($objp->dp), 'day')."".$labeltype.' '.$objp->num_payment."' . dol_escape_htmltag($obj->num_payment) . ''; $accountlinestatic->id = $obj->fk_bank; @@ -294,7 +294,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print '    
'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, 'parent', null, null, 1); print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), null, null, null, null, '90%'); @@ -1169,7 +1169,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).''; @@ -1197,7 +1197,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->load_ref_elements(); - if (isModEnabled('commande')) { + if (isModEnabled('order')) { print '
'.$langs->trans("ContactForOrders").''; print $object->ref_commande ? $object->ref_commande : (''.$langs->trans("NoContactForAnyOrder").''); print '
'.$langs->trans("ContactForContracts").''; print $object->ref_contrat ? $object->ref_contrat : (''.$langs->trans("NoContactForAnyContract").''); print '
'.$langs->trans("ContactForInvoices").''; print $object->ref_facturation ? $object->ref_facturation : (''.$langs->trans("NoContactForAnyInvoice").''); print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_CONTACT, 1); @@ -1462,29 +1462,29 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'; - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { print $langs->trans("ContactForOrdersOrShipments"); } else { print $langs->trans("ContactForOrders"); } print ''; $none = $langs->trans("NoContactForAnyOrder"); - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { $none = $langs->trans("NoContactForAnyOrderOrShipments"); } print $object->ref_commande ? $object->ref_commande : $none; print '
'.$langs->trans("ContactForContracts").''; print $object->ref_contrat ? $object->ref_contrat : $langs->trans("NoContactForAnyContract"); print '
'.$langs->trans("ContactForInvoices").''; print $object->ref_facturation ? $object->ref_facturation : $langs->trans("NoContactForAnyInvoice"); print '

"; // Draft contracts -if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { +if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $sql = "SELECT c.rowid, c.ref,"; $sql .= " s.nom as name, s.name_alias, s.logo, s.rowid as socid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 8c5d25cbb97..2b852c38ac6 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -if (isModEnabled("categorie")) { +if (isModEnabled("category")) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -799,7 +799,7 @@ if ($user->hasRight('user', 'user', 'lire')) { $moreforfilter .= ''; } // If the user can view categories of products -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -808,7 +808,7 @@ if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user- $moreforfilter .= '
'; } // Filter on customer categories -if (getDolGlobalString('MAIN_SEARCH_CATEGORY_CUSTOMER_ON_CONTRACT_LIST') && isModEnabled("categorie") && $user->hasRight('categorie', 'lire')) { +if (getDolGlobalString('MAIN_SEARCH_CATEGORY_CUSTOMER_ON_CONTRACT_LIST') && isModEnabled("category") && $user->hasRight('categorie', 'lire')) { $moreforfilter .= '
'; $tmptitle = $langs->transnoentities('CustomersProspectsCategoriesShort'); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"'); diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index eae46a028e6..a0d00d27442 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -528,7 +528,7 @@ $morefilter = ''; $moreforfilter = ''; // If the user can view categories of products -if (isModEnabled('categorie') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { +if (isModEnabled('category') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 1fac2f45c9e..5c37dacedbe 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -189,7 +189,7 @@ if ($action == 'add' && !empty($permissiontoadd)) { $result = $object->create($user); if ($result > 0) { // Creation OK - if (isModEnabled('categorie') && method_exists($object, 'setCategories')) { + if (isModEnabled('category') && method_exists($object, 'setCategories')) { $categories = GETPOST('categories', 'array:int'); $object->setCategories($categories); } @@ -313,7 +313,7 @@ if ($action == 'update' && !empty($permissiontoadd)) { } } - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $categories = GETPOST('categories', 'array'); if (method_exists($object, 'setCategories')) { $object->setCategories($categories); diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index ba7725d06aa..f91e87c8d36 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -69,7 +69,7 @@ $arrayresult = array(); // Define $searchform -if (isModEnabled('adherent') && !getDolGlobalString('MAIN_SEARCHFORM_ADHERENT_DISABLED') && $user->hasRight('adherent', 'lire')) { +if (isModEnabled('member') && !getDolGlobalString('MAIN_SEARCHFORM_ADHERENT_DISABLED') && $user->hasRight('adherent', 'lire')) { $arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } @@ -102,13 +102,13 @@ if (isModEnabled('project') && !getDolGlobalString('MAIN_SEARCHFORM_TASK_DISABLE if (isModEnabled('propal') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED') && $user->hasRight('propal', 'lire')) { $arrayresult['searchintopropal'] = array('position'=>60, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('', 'object_propal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (isModEnabled('commande') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED') && $user->hasRight('commande', 'lire')) { +if (isModEnabled('order') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED') && $user->hasRight('commande', 'lire')) { $arrayresult['searchintoorder'] = array('position'=>70, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('', 'object_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (isModEnabled('expedition') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED') && $user->hasRight('expedition', 'lire')) { +if (isModEnabled('delivery_note') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED') && $user->hasRight('expedition', 'lire')) { $arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (isModEnabled('facture') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED') && $user->hasRight('facture', 'lire')) { +if (isModEnabled('invoice') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED') && $user->hasRight('facture', 'lire')) { $arrayresult['searchintoinvoice'] = array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } @@ -123,7 +123,7 @@ if (((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERM } // Customer payments -if (isModEnabled('facture') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED') && $user->hasRight('facture', 'lire')) { +if (isModEnabled('invoice') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED') && $user->hasRight('facture', 'lire')) { $arrayresult['searchintocustomerpayments'] = array( 'position'=>170, 'img'=>'object_payment', @@ -143,7 +143,7 @@ if (((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERM } // Miscellaneous payments -if (isModEnabled('banque') && !getDolGlobalString('MAIN_SEARCHFORM_MISC_PAYMENTS_DISABLED') && $user->hasRight('banque', 'lire')) { +if (isModEnabled('bank') && !getDolGlobalString('MAIN_SEARCHFORM_MISC_PAYMENTS_DISABLED') && $user->hasRight('banque', 'lire')) { $arrayresult['searchintomiscpayments'] = array( 'position'=>180, 'img'=>'object_payment', @@ -152,10 +152,10 @@ if (isModEnabled('banque') && !getDolGlobalString('MAIN_SEARCHFORM_MISC_PAYMENTS 'url'=>DOL_URL_ROOT.'/compta/bank/various_payment/list.php?leftmenu=tax_various'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : '')); } -if (isModEnabled('contrat') && !getDolGlobalString('MAIN_SEARCHFORM_CONTRACT_DISABLED') && $user->hasRight('contrat', 'lire')) { +if (isModEnabled('contract') && !getDolGlobalString('MAIN_SEARCHFORM_CONTRACT_DISABLED') && $user->hasRight('contrat', 'lire')) { $arrayresult['searchintocontract'] = array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('', 'object_contract', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (isModEnabled('ficheinter') && !getDolGlobalString('MAIN_SEARCHFORM_FICHINTER_DISABLED') && $user->hasRight('ficheinter', 'lire')) { +if (isModEnabled('intervention') && !getDolGlobalString('MAIN_SEARCHFORM_FICHINTER_DISABLED') && $user->hasRight('ficheinter', 'lire')) { $arrayresult['searchintointervention'] = array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('', 'object_intervention', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } if (isModEnabled('knowledgemanagement') && !getDolGlobalString('MAIN_SEARCHFORM_KNOWLEDGEMANAGEMENT_DISABLED') && $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) { diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index b84e74dfe18..88571ed872b 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -53,8 +53,8 @@ class box_activity extends ModeleBoxes $this->enabled = getDolGlobalInt('MAIN_FEATURES_LEVEL'); // Not enabled by default due to bugs (see previous comments) $this->hidden = !( - (isModEnabled('facture') && $user->hasRight('facture', 'read')) - || (isModEnabled('commande') && $user->hasRight('commande', 'read')) + (isModEnabled('invoice') && $user->hasRight('facture', 'read')) + || (isModEnabled('order') && $user->hasRight('commande', 'read')) || (isModEnabled('propal') && $user->hasRight('propal', 'read')) ); } @@ -183,7 +183,7 @@ class box_activity extends ModeleBoxes } // list the summary of the orders - if (isModEnabled('commande') && $user->hasRight("commande", "lire")) { + if (isModEnabled('order') && $user->hasRight("commande", "lire")) { include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $commandestatic = new Commande($this->db); @@ -270,7 +270,7 @@ class box_activity extends ModeleBoxes // list the summary of the bills - if (isModEnabled('facture') && $user->hasRight("facture", "lire")) { + if (isModEnabled('invoice') && $user->hasRight("facture", "lire")) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $facturestatic = new Facture($this->db); diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index a076c096f4c..9785396a49a 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -102,7 +102,7 @@ class box_dolibarr_state_board extends ModeleBoxes ); $conditions = array( 'users' => $user->hasRight('user', 'user', 'lire'), - 'members' => isModEnabled('adherent') && $user->hasRight('adherent', 'lire'), + 'members' => isModEnabled('member') && $user->hasRight('adherent', 'lire'), 'customers' => isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS_STATS'), 'prospects' => isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS_STATS'), 'suppliers' => ( @@ -115,11 +115,11 @@ class box_dolibarr_state_board extends ModeleBoxes 'products' => isModEnabled('product') && $user->hasRight('product', 'read'), 'services' => isModEnabled('service') && $user->hasRight('service', 'read'), 'proposals' => isModEnabled('propal') && $user->hasRight('propal', 'read'), - 'orders' => isModEnabled('commande') && $user->hasRight('commande', 'lire'), - 'invoices' => isModEnabled('facture') && $user->hasRight('facture', 'lire'), + 'orders' => isModEnabled('order') && $user->hasRight('commande', 'lire'), + 'invoices' => isModEnabled('invoice') && $user->hasRight('facture', 'lire'), 'donations' => isModEnabled('don') && $user->hasRight('don', 'lire'), - 'contracts' => isModEnabled('contrat') && $user->hasRight('contrat', 'lire'), - 'interventions' => isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire'), + 'contracts' => isModEnabled('contract') && $user->hasRight('contrat', 'lire'), + 'interventions' => isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire'), 'supplier_orders' => isModEnabled('supplier_order') && $user->hasRight('fournisseur', 'commande', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS'), 'supplier_invoices' => isModEnabled('supplier_invoice') && $user->hasRight('fournisseur', 'facture', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS'), 'supplier_proposals' => isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS'), diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index a90b8604060..079aaff21b2 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -49,8 +49,8 @@ class box_graph_product_distribution extends ModeleBoxes $this->db = $db; $this->hidden = !( - (isModEnabled('facture') && $user->hasRight('facture', 'lire')) - || (isModEnabled('commande') && $user->hasRight('commande', 'lire')) + (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) + || (isModEnabled('order') && $user->hasRight('commande', 'lire')) || (isModEnabled('propal') && $user->hasRight('propal', 'lire')) ); } @@ -96,13 +96,13 @@ class box_graph_product_distribution extends ModeleBoxes $showinvoicenb = 1; $showordernb = 1; } - if (!isModEnabled('facture') || !$user->hasRight('facture', 'lire')) { + if (!isModEnabled('invoice') || !$user->hasRight('facture', 'lire')) { $showinvoicenb = 0; } if (isModEnabled('propal') || !$user->hasRight('propal', 'lire')) { $showpropalnb = 0; } - if (!isModEnabled('commande') || !$user->hasRight('commande', 'lire')) { + if (!isModEnabled('order') || !$user->hasRight('commande', 'lire')) { $showordernb = 0; } @@ -203,7 +203,7 @@ class box_graph_product_distribution extends ModeleBoxes } } - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showordernb) { $langs->load("orders"); @@ -267,7 +267,7 @@ class box_graph_product_distribution extends ModeleBoxes } - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showinvoicenb) { $langs->load("bills"); @@ -358,10 +358,10 @@ class box_graph_product_distribution extends ModeleBoxes $stringtoshow .= ' '.$langs->trans("ForProposals"); $stringtoshow .= ' '; } - if (isModEnabled('commande') || $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') || $user->hasRight('commande', 'lire')) { $stringtoshow .= ' '.$langs->trans("ForCustomersOrders"); } - if (isModEnabled('facture') || $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') || $user->hasRight('facture', 'lire')) { $stringtoshow .= ' '.$langs->trans("ForCustomersInvoices"); $stringtoshow .= '   '; } @@ -384,13 +384,13 @@ class box_graph_product_distribution extends ModeleBoxes $stringtoshow .= '
'; if (isModEnabled('propal') && $showpropalnb) { $stringtoshow .= $px2->show(); - } elseif (isModEnabled('commande') && $showordernb) { + } elseif (isModEnabled('order') && $showordernb) { $stringtoshow .= $px3->show(); } $stringtoshow .= '
'; - if (isModEnabled('facture') && $showinvoicenb) { + if (isModEnabled('invoice') && $showinvoicenb) { $stringtoshow .= $px1->show(); - } elseif (isModEnabled('commande') && $showordernb) { + } elseif (isModEnabled('order') && $showordernb) { $stringtoshow .= $px3->show(); } $stringtoshow .= '
'; diff --git a/htdocs/core/boxes/box_members_by_tags.php b/htdocs/core/boxes/box_members_by_tags.php index 587d7bdcd53..429b8fba2d7 100644 --- a/htdocs/core/boxes/box_members_by_tags.php +++ b/htdocs/core/boxes/box_members_by_tags.php @@ -58,7 +58,7 @@ class box_members_by_tags extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(isModEnabled('adherent') && $user->hasRight('adherent', 'lire')); + $this->hidden = !(isModEnabled('member') && $user->hasRight('adherent', 'lire')); } /** diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 6ce11bfca44..f5412dec5ea 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -58,7 +58,7 @@ class box_members_by_type extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(isModEnabled('adherent') && $user->hasRight('adherent', 'lire')); + $this->hidden = !(isModEnabled('member') && $user->hasRight('adherent', 'lire')); } /** diff --git a/htdocs/core/boxes/box_members_last_modified.php b/htdocs/core/boxes/box_members_last_modified.php index 0c7ed55eb57..2ef36c822dd 100644 --- a/htdocs/core/boxes/box_members_last_modified.php +++ b/htdocs/core/boxes/box_members_last_modified.php @@ -57,7 +57,7 @@ class box_members_last_modified extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(isModEnabled('adherent') && $user->hasRight('adherent', 'lire')); + $this->hidden = !(isModEnabled('member') && $user->hasRight('adherent', 'lire')); } /** diff --git a/htdocs/core/boxes/box_members_last_subscriptions.php b/htdocs/core/boxes/box_members_last_subscriptions.php index 7375dda6562..92d0413c5e7 100644 --- a/htdocs/core/boxes/box_members_last_subscriptions.php +++ b/htdocs/core/boxes/box_members_last_subscriptions.php @@ -57,7 +57,7 @@ class box_members_last_subscriptions extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(isModEnabled('adherent') && $user->hasRight('adherent', 'lire')); + $this->hidden = !(isModEnabled('member') && $user->hasRight('adherent', 'lire')); } /** diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index 6cb43a94187..09df79556bb 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -57,7 +57,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(isModEnabled('adherent') && $user->hasRight('adherent', 'lire')); + $this->hidden = !(isModEnabled('member') && $user->hasRight('adherent', 'lire')); } /** diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 50d22620a20..5c8ea19dc73 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9155,13 +9155,13 @@ class Form // To work with non standard path if ($objecttype == 'facture') { $tplpath = 'compta/' . $element; - if (!isModEnabled('facture')) { + if (!isModEnabled('invoice')) { continue; // Do not show if module disabled } } elseif ($objecttype == 'facturerec') { $tplpath = 'compta/facture'; $tplname = 'linkedobjectblockForRec'; - if (!isModEnabled('facture')) { + if (!isModEnabled('invoice')) { continue; // Do not show if module disabled } } elseif ($objecttype == 'propal') { @@ -9175,7 +9175,7 @@ class Form } } elseif ($objecttype == 'shipping' || $objecttype == 'shipment' || $objecttype == 'expedition') { $tplpath = 'expedition'; - if (!isModEnabled('expedition')) { + if (!isModEnabled('delivery_note')) { continue; // Do not show if module disabled } } elseif ($objecttype == 'reception') { @@ -9185,12 +9185,12 @@ class Form } } elseif ($objecttype == 'delivery') { $tplpath = 'delivery'; - if (!isModEnabled('expedition')) { + if (!isModEnabled('delivery_note')) { continue; // Do not show if module disabled } } elseif ($objecttype == 'ficheinter') { $tplpath = 'fichinter'; - if (!isModEnabled('ficheinter')) { + if (!isModEnabled('intervention')) { continue; // Do not show if module disabled } } elseif ($objecttype == 'invoice_supplier') { @@ -9292,34 +9292,34 @@ class Form 'label' => 'LinkToProposal', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'), 'shipping' => array( - 'enabled' => isModEnabled('expedition'), + 'enabled' => isModEnabled('delivery_note'), 'perms' => 1, 'label' => 'LinkToExpedition', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'), 'order' => array( - 'enabled' => isModEnabled('commande'), + 'enabled' => isModEnabled('order'), 'perms' => 1, 'label' => 'LinkToOrder', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'), 'invoice' => array( - 'enabled' => isModEnabled('facture'), + 'enabled' => isModEnabled('invoice'), 'perms' => 1, 'label' => 'LinkToInvoice', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), 'invoice_template' => array( - 'enabled' => isModEnabled('facture'), + 'enabled' => isModEnabled('invoice'), 'perms' => 1, 'label' => 'LinkToTemplateInvoice', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), 'contrat' => array( - 'enabled' => isModEnabled('contrat'), + 'enabled' => isModEnabled('contract'), 'perms' => 1, 'label' => 'LinkToContract', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "contrat as t, " . $this->db->prefix() . "contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('contract') . ') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' ), 'fichinter' => array( - 'enabled' => isModEnabled('ficheinter'), + 'enabled' => isModEnabled('intervention'), 'perms' => 1, 'label' => 'LinkToIntervention', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('intervention') . ')'), diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 731b0514ef9..606becf17c2 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1917,36 +1917,36 @@ class FormMail extends Form if ($onlinepaymentenabled && getDolGlobalString('PAYMENT_SECURITY_TOKEN')) { $tmparray['__SECUREKEYPAYMENT__'] = getDolGlobalString('PAYMENT_SECURITY_TOKEN'); if (getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) { - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $tmparray['__SECUREKEYPAYMENT_MEMBER__'] = 'SecureKeyPAYMENTUniquePerMember'; } if (isModEnabled('don')) { $tmparray['__SECUREKEYPAYMENT_DONATION__'] = 'SecureKeyPAYMENTUniquePerDonation'; } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $tmparray['__SECUREKEYPAYMENT_INVOICE__'] = 'SecureKeyPAYMENTUniquePerInvoice'; } - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $tmparray['__SECUREKEYPAYMENT_ORDER__'] = 'SecureKeyPAYMENTUniquePerOrder'; } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $tmparray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = 'SecureKeyPAYMENTUniquePerContractLine'; } //Online payment link - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $tmparray['__ONLINEPAYMENTLINK_MEMBER__'] = 'OnlinePaymentLinkUniquePerMember'; } if (isModEnabled('don')) { $tmparray['__ONLINEPAYMENTLINK_DONATION__'] = 'OnlinePaymentLinkUniquePerDonation'; } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $tmparray['__ONLINEPAYMENTLINK_INVOICE__'] = 'OnlinePaymentLinkUniquePerInvoice'; } - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $tmparray['__ONLINEPAYMENTLINK_ORDER__'] = 'OnlinePaymentLinkUniquePerOrder'; } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $tmparray['__ONLINEPAYMENTLINK_CONTRACTLINE__'] = 'OnlinePaymentLinkUniquePerContractLine'; } } diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index b240c62cd7c..4fa8ee3eac6 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -460,7 +460,7 @@ class FormTicket } // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1); diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 31f4fa0ef04..49cecafe544 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -121,16 +121,16 @@ $arrayoftype = array( 'thirdparty' => array('langs'=>'companies', 'label' => 'ThirdParties', 'picto'=>'company', 'ObjectClassName' => 'Societe', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/societe/class/societe.class.php"), 'contact' => array('label' => 'Contacts', 'picto'=>'contact', 'ObjectClassName' => 'Contact', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/contact/class/contact.class.php"), 'proposal' => array('label' => 'Proposals', 'picto'=>'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php"), - 'order' => array('label' => 'Orders', 'picto'=>'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('commande'), 'ClassPath' => "/commande/class/commande.class.php"), - 'invoice' => array('langs'=>'facture', 'label' => 'Invoices', 'picto'=>'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('facture'), 'ClassPath' => "/compta/facture/class/facture.class.php"), - 'invoice_template'=>array('label' => 'PredefinedInvoices', 'picto'=>'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('facture'), 'ClassPath' => "/compta/class/facturerec.class.php", 'langs'=>'bills'), - 'contract' => array('label' => 'Contracts', 'picto'=>'contract', 'ObjectClassName' => 'Contrat', 'enabled' => isModEnabled('contrat'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'), - 'contractdet' => array('label' => 'ContractLines', 'picto'=>'contract', 'ObjectClassName' => 'ContratLigne', 'enabled' => isModEnabled('contrat'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'), + 'order' => array('label' => 'Orders', 'picto'=>'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/commande.class.php"), + 'invoice' => array('langs'=>'facture', 'label' => 'Invoices', 'picto'=>'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture.class.php"), + 'invoice_template'=>array('label' => 'PredefinedInvoices', 'picto'=>'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/class/facturerec.class.php", 'langs'=>'bills'), + 'contract' => array('label' => 'Contracts', 'picto'=>'contract', 'ObjectClassName' => 'Contrat', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'), + 'contractdet' => array('label' => 'ContractLines', 'picto'=>'contract', 'ObjectClassName' => 'ContratLigne', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'), 'bom' => array('label' => 'BOM', 'picto'=>'bom', 'ObjectClassName' => 'Bom', 'enabled' => isModEnabled('bom')), 'mrp' => array('label' => 'MO', 'picto'=>'mrp', 'ObjectClassName' => 'Mo', 'enabled' => isModEnabled('mrp'), 'ClassPath' => "/mrp/class/mo.class.php"), 'ticket' => array('label' => 'Ticket', 'picto'=>'ticket', 'ObjectClassName' => 'Ticket', 'enabled' => isModEnabled('ticket')), - 'member' => array('label' => 'Adherent', 'picto'=>'member', 'ObjectClassName' => 'Adherent', 'enabled' => isModEnabled('adherent'), 'ClassPath' => "/adherents/class/adherent.class.php", 'langs'=>'members'), - 'cotisation' => array('label' => 'Subscriptions', 'picto'=>'member', 'ObjectClassName' => 'Subscription', 'enabled' => isModEnabled('adherent'), 'ClassPath' => "/adherents/class/subscription.class.php", 'langs'=>'members'), + 'member' => array('label' => 'Adherent', 'picto'=>'member', 'ObjectClassName' => 'Adherent', 'enabled' => isModEnabled('member'), 'ClassPath' => "/adherents/class/adherent.class.php", 'langs'=>'members'), + 'cotisation' => array('label' => 'Subscriptions', 'picto'=>'member', 'ObjectClassName' => 'Subscription', 'enabled' => isModEnabled('member'), 'ClassPath' => "/adherents/class/subscription.class.php", 'langs'=>'members'), ); diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index efa664e26fc..270742a3c97 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1769,7 +1769,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Valu print 'mymailmanlist
'; print 'mymailmanlist1,mymailmanlist2
'; print 'TYPE:Type1:mymailmanlist1,TYPE:Type2:mymailmanlist2
'; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print 'CATEG:Categ1:mymailmanlist1,CATEG:Categ2:mymailmanlist2
'; } print '
'; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 3c5df955ae3..73b09437bbb 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -131,7 +131,7 @@ function print_actions_filter( print '
'; } - if (isModEnabled('projet') && $user->hasRight('projet', 'lire')) { + if (isModEnabled('project') && $user->hasRight('projet', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; $formproject = new FormProjets($db); @@ -141,7 +141,7 @@ function print_actions_filter( print ''; } - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $formother = new FormOther($db); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 515f4f4f443..65373fb5b3e 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -180,7 +180,7 @@ function societe_prepare_head(Societe $object) } // Related items - if ((isModEnabled('commande') || isModEnabled('propal') || isModEnabled('facture') || isModEnabled('ficheinter') || isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) + if ((isModEnabled('order') || isModEnabled('propal') || isModEnabled('invoice') || isModEnabled('intervention') || isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && !getDolGlobalString('THIRDPARTIES_DISABLE_RELATED_OBJECT_TAB')) { $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; $head[$h][1] = $langs->trans("Referers"); diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 6a6bcd45213..747540dbfde 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -93,7 +93,7 @@ function contact_prepare_head(Contact $object) } // Related items - if (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || isModEnabled('ficheinter') || isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { + if (isModEnabled('order') || isModEnabled("propal") || isModEnabled('invoice') || isModEnabled('intervention') || isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { $head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id; $head[$tab][1] = $langs->trans("Referers"); $head[$tab][2] = 'consumption'; diff --git a/htdocs/core/lib/expedition.lib.php b/htdocs/core/lib/expedition.lib.php index f431a292704..78975768664 100644 --- a/htdocs/core/lib/expedition.lib.php +++ b/htdocs/core/lib/expedition.lib.php @@ -35,7 +35,7 @@ function expedition_prepare_head(Expedition $object) { global $langs, $conf, $user; - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { $langs->load("sendings"); } $langs->load("orders"); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 40e1aa39219..216472484e0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8362,7 +8362,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__'; $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__'; } - if (isModEnabled('adherent') && (!is_object($object) || $object->element == 'adherent') && (empty($exclude) || !in_array('member', $exclude)) && (empty($include) || in_array('member', $include))) { + if (isModEnabled('member') && (!is_object($object) || $object->element == 'adherent') && (empty($exclude) || !in_array('member', $exclude)) && (empty($include) || in_array('member', $include))) { $substitutionarray['__MEMBER_ID__'] = '__MEMBER_ID__'; $substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__'; $substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__'; @@ -8396,7 +8396,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, /*$substitutionarray['__PROJECT_NOTE_PUBLIC__'] = '__PROJECT_NOTE_PUBLIC__'; $substitutionarray['__PROJECT_NOTE_PRIVATE__'] = '__PROJECT_NOTE_PRIVATE__';*/ } - if (isModEnabled('contrat') && (!is_object($object) || $object->element == 'contract') && (empty($exclude) || !in_array('contract', $exclude)) && (empty($include) || in_array('contract', $include))) { + if (isModEnabled('contract') && (!is_object($object) || $object->element == 'contract') && (empty($exclude) || !in_array('contract', $exclude)) && (empty($include) || in_array('contract', $include))) { $substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = 'Highest date planned for a service start'; $substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = 'Highest date and hour planned for service start'; $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service'; @@ -8405,7 +8405,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if (isModEnabled("propal") && (!is_object($object) || $object->element == 'propal') && (empty($exclude) || !in_array('propal', $exclude)) && (empty($include) || in_array('propal', $include))) { $substitutionarray['__ONLINE_SIGN_URL__'] = 'ToOfferALinkForOnlineSignature'; } - if (isModEnabled("ficheinter") && (!is_object($object) || $object->element == 'fichinter') && (empty($exclude) || !in_array('intervention', $exclude)) && (empty($include) || in_array('intervention', $include))) { + if (isModEnabled("intervention") && (!is_object($object) || $object->element == 'fichinter') && (empty($exclude) || !in_array('intervention', $exclude)) && (empty($include) || in_array('intervention', $include))) { $substitutionarray['__ONLINE_SIGN_FICHINTER_URL__'] = 'ToOfferALinkForOnlineSignature'; } $substitutionarray['__ONLINE_PAYMENT_URL__'] = 'UrlToPayOnlineIfApplicable'; @@ -8422,7 +8422,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__DIRECTDOWNLOAD_URL_CONTRACT__'] = 'Direct download url of a contract'; $substitutionarray['__DIRECTDOWNLOAD_URL_SUPPLIER_PROPOSAL__'] = 'Direct download url of a supplier proposal'; - if (isModEnabled("expedition") && (!is_object($object) || $object->element == 'shipping')) { + if (isModEnabled("delivery_note") && (!is_object($object) || $object->element == 'shipping')) { $substitutionarray['__SHIPPINGTRACKNUM__'] = 'Shipping tracking number'; $substitutionarray['__SHIPPINGTRACKNUMURL__'] = 'Shipping tracking url'; $substitutionarray['__SHIPPINGMETHOD__'] = 'Shipping method'; diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 9a21f14c45c..9e6a39c63f9 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -344,7 +344,7 @@ function getNumberInvoicesPieChart($mode) { global $conf, $db, $langs, $user; - if (($mode == 'customers' && isModEnabled('facture') && $user->hasRight('facture', 'lire')) + if (($mode == 'customers' && isModEnabled('invoice') && $user->hasRight('facture', 'lire')) || ($mode == 'suppliers' && (isModEnabled('fournisseur') || isModEnabled('supplier_invoice')) && $user->hasRight('fournisseur', 'facture', 'lire')) ) { global $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus8, $badgeStatus11; @@ -490,7 +490,7 @@ function getCustomerInvoiceDraftTable($maxCount = 500, $socid = 0) $result = ''; - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $maxofloop = (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD); $tmpinvoice = new Facture($db); @@ -989,7 +989,7 @@ function getCustomerInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) $result = ''; - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $tmpinvoice = new Facture($db); $sql = "SELECT f.rowid, f.ref, f.fk_statut as status, f.datef, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms"; diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index 96d458f01c8..ccf1d9dabe8 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -64,14 +64,14 @@ function ldap_prepare_head() $h++; } - if (isModEnabled('adherent') && getDolGlobalString('LDAP_MEMBER_ACTIVE')) { + if (isModEnabled('member') && getDolGlobalString('LDAP_MEMBER_ACTIVE')) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members.php"; $head[$h][1] = $langs->trans("LDAPMembersSynchro"); $head[$h][2] = 'members'; $h++; } - if (isModEnabled('adherent') && getDolGlobalString('LDAP_MEMBER_TYPE_ACTIVE')) { + if (isModEnabled('member') && getDolGlobalString('LDAP_MEMBER_TYPE_ACTIVE')) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members_types.php"; $head[$h][1] = $langs->trans("LDAPMembersTypesSynchro"); $head[$h][2] = 'memberstypes'; diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 2b39661e6e7..cb3f380fca3 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -34,7 +34,7 @@ function commande_prepare_head(Commande $object) { global $db, $langs, $conf, $user; - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { $langs->load("sendings"); } $langs->load("orders"); @@ -42,7 +42,7 @@ function commande_prepare_head(Commande $object) $h = 0; $head = array(); - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $head[$h][0] = DOL_URL_ROOT.'/commande/card.php?id='.$object->id; $head[$h][1] = $langs->trans("CustomerOrder"); $head[$h][2] = 'order'; @@ -230,7 +230,7 @@ function getCustomerOrderPieChart($socid = 0) $result = ''; - if (!isModEnabled('commande') || !$user->hasRight('commande', 'lire')) { + if (!isModEnabled('order') || !$user->hasRight('commande', 'lire')) { return ''; } diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index cf170a77c75..4cfac0f4413 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -62,7 +62,7 @@ function pdf_admin_prepare_head() // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'pdf_admin'); - if (isModEnabled("propal") || isModEnabled('facture') || isModEnabled('reception')) { + if (isModEnabled("propal") || isModEnabled('invoice') || isModEnabled('reception')) { $head[$h][0] = DOL_URL_ROOT.'/admin/pdf_other.php'; $head[$h][1] = $langs->trans("Others"); $head[$h][2] = 'other'; @@ -1710,7 +1710,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $libelleproduitservice = $prefix_prodserv.$ref_prodserv.$libelleproduitservice; // Add an additional description for the category products - if (getDolGlobalString('CATEGORY_ADD_DESC_INTO_DOC') && $idprod && isModEnabled('categorie')) { + if (getDolGlobalString('CATEGORY_ADD_DESC_INTO_DOC') && $idprod && isModEnabled('category')) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $categstatic = new Categorie($db); // recovering the list of all the categories linked to product diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index a631d7ff826..976e6c4cf15 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -476,7 +476,7 @@ function show_stats_for_company($product, $socid) print '
'.$langs->trans("CustomersCategoryShort"); if (!empty($array_query['cust_categ'])) { @@ -448,7 +448,7 @@ print '
'; print '
'."\n"; print '
'.$langs->trans("ContactCategoriesShort"); if (!empty($array_query['contact_categ'])) { diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php index 0fc08a043f8..b5e24042ee3 100644 --- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -30,7 +30,7 @@ print ''.$langs->trans("FollowingUrlAreAvailableToMakePayments").':
'.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'free')."

\n"; -if (isModEnabled('commande')) { +if (isModEnabled('order')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'order')."
\n"; @@ -52,7 +52,7 @@ if (isModEnabled('commande')) { } print '
'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'invoice')."
\n"; @@ -74,7 +74,7 @@ if (isModEnabled('facture')) { } print '
'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'contractline')."
\n"; @@ -96,7 +96,7 @@ if (isModEnabled('contrat')) { } print '
'; } -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'membersubscription')."
\n"; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 945ece57a4b..0de09d491f0 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -73,7 +73,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers // Proposals to order if ($action == 'PROPAL_CLOSE_SIGNED') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (isModEnabled('commande') && getDolGlobalString('WORKFLOW_PROPAL_AUTOCREATE_ORDER')) { + if (isModEnabled('order') && getDolGlobalString('WORKFLOW_PROPAL_AUTOCREATE_ORDER')) { $object->fetchObjectLinked(); if (!empty($object->linkedObjectsIds['commande'])) { if (empty($object->context['closedfromonlinesignature'])) { @@ -104,7 +104,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers // Order to invoice if ($action == 'ORDER_CLOSE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (isModEnabled('facture') && getDolGlobalString('WORKFLOW_ORDER_AUTOCREATE_INVOICE')) { + if (isModEnabled('invoice') && getDolGlobalString('WORKFLOW_ORDER_AUTOCREATE_INVOICE')) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $newobject = new Facture($this->db); @@ -151,7 +151,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // First classify billed the order to allow the proposal classify process - if (isModEnabled('commande') && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER')) { + if (isModEnabled('order') && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER')) { $object->fetchObjectLinked('', 'commande', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; @@ -189,7 +189,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers } // Set shipment to "Closed" if WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE is set (deprecated, has been replaced with WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE instead)) - if (isModEnabled("expedition") && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE')) { + if (isModEnabled("delivery_note") && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE')) { $object->fetchObjectLinked('', 'shipping', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; @@ -210,7 +210,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } - if (isModEnabled("expedition") && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE')) { + if (isModEnabled("delivery_note") && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE')) { $object->fetchObjectLinked('', 'shipping', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; @@ -336,7 +336,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if ($action == 'BILL_PAYED') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (isModEnabled('commande') && getDolGlobalString('WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER')) { + if (isModEnabled('order') && getDolGlobalString('WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER')) { $object->fetchObjectLinked('', 'commande', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; @@ -360,7 +360,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if (($action == 'SHIPPING_VALIDATE') || ($action == 'SHIPPING_CLOSED')) { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (isModEnabled('commande') && isModEnabled("expedition") && !empty($conf->workflow->enabled) && + if (isModEnabled('order') && isModEnabled("delivery_note") && !empty($conf->workflow->enabled) && ( (getDolGlobalString('WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING') && ($action == 'SHIPPING_VALIDATE')) || (getDolGlobalString('WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED') && ($action == 'SHIPPING_CLOSED')) @@ -516,7 +516,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if ($action == 'TICKET_CREATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // Auto link contract - if (!empty($conf->contract->enabled) && isModEnabled('ticket') && isModEnabled('ficheinter') && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_TICKET_LINK_CONTRACT') && getDolGlobalString('TICKET_PRODUCT_CATEGORY') && !empty($object->fk_soc)) { + if (!empty($conf->contract->enabled) && isModEnabled('ticket') && isModEnabled('intervention') && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_TICKET_LINK_CONTRACT') && getDolGlobalString('TICKET_PRODUCT_CATEGORY') && !empty($object->fk_soc)) { $societe = new Societe($this->db); $company_ids = (!getDolGlobalString('WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS')) ? [$object->fk_soc] : $societe->getParentsForCompany($object->fk_soc, [$object->fk_soc]); @@ -550,7 +550,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } // Automatically create intervention - if (isModEnabled('ficheinter') && isModEnabled('ticket') && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_TICKET_CREATE_INTERVENTION')) { + if (isModEnabled('intervention') && isModEnabled('ticket') && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_TICKET_CREATE_INTERVENTION')) { $fichinter = new Fichinter($this->db); $fichinter->socid = (int) $object->fk_soc; $fichinter->fk_project = (int) $object->fk_project; diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index d3441ebec91..a056d47b48d 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -155,9 +155,9 @@ class InterfaceNotification extends DolibarrTriggers $qualified = 0; } elseif ($element == 'withdraw' && !isModEnabled('prelevement')) { $qualified = 0; - } elseif ($element == 'shipping' && !isModEnabled('expedition')) { + } elseif ($element == 'shipping' && !isModEnabled('delivery_note')) { $qualified = 0; - } elseif ($element == 'member' && !isModEnabled('adherent')) { + } elseif ($element == 'member' && !isModEnabled('member')) { $qualified = 0; } elseif (($element == 'expense_report' || $element == 'expensereport') && !isModEnabled('expensereport')) { $qualified = 0; diff --git a/htdocs/datapolicy/admin/setup.php b/htdocs/datapolicy/admin/setup.php index 5bbfe34f6a1..de7ec5c5b50 100644 --- a/htdocs/datapolicy/admin/setup.php +++ b/htdocs/datapolicy/admin/setup.php @@ -51,7 +51,7 @@ if (getDolGlobalString('DATAPOLICY_USE_SPECIFIC_DELAY_FOR_CONTACT')) { 'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')), ); } -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { $arrayofparameters['Member'] = array( 'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'member', 'class="pictofixedwidth"')), ); diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 218ef5ec4a3..7dccbfbdd44 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (isModEnabled("product") || isModEnabled("service")) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; } -if (isModEnabled('expedition')) { +if (isModEnabled('delivery_note')) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; } if (isModEnabled('stock')) { @@ -311,7 +311,7 @@ if ($action == 'create') { * Delivery */ - if ($typeobject == 'commande' && $expedition->origin_id > 0 && isModEnabled('commande')) { + if ($typeobject == 'commande' && $expedition->origin_id > 0 && isModEnabled('order')) { $objectsrc = new Commande($db); $objectsrc->fetch($expedition->origin_id); } @@ -391,7 +391,7 @@ if ($action == 'create') { */ // Document origine - if ($typeobject == 'commande' && $expedition->origin_id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $expedition->origin_id && isModEnabled('order')) { print '
'.$langs->trans("RefOrder").'
'.$langs->trans('Amount').''.price($object->amount, 0, $ print '
'.$langs->trans('Note').''.dol_string_onlythesehtmltags(dol_htmlcleanlastbr($object->note_public)).'
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($project->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'; - if ($origin == 'commande' && isModEnabled('commande')) { + if ($origin == 'commande' && isModEnabled('order')) { print $langs->trans("RefOrder"); } if ($origin == 'propal' && isModEnabled("propal")) { @@ -1869,7 +1869,7 @@ if ($action == 'create') { $totalWeight = $tmparray['weight']; $totalVolume = $tmparray['volume']; - if (!empty($typeobject) && $typeobject === 'commande' && is_object($object->$typeobject) && $object->$typeobject->id && isModEnabled('commande')) { + if (!empty($typeobject) && $typeobject === 'commande' && is_object($object->$typeobject) && $object->$typeobject->id && isModEnabled('order')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } @@ -1920,7 +1920,7 @@ if ($action == 'create') { print ''; // Linked documents - if (!empty($typeobject) && $typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if (!empty($typeobject) && $typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { print ''; print ''; // MenuId Parent - print ''; + print ''; if ($parent_rowid) { print ''; } else { @@ -361,7 +362,7 @@ if ($action == 'create') { print ''; // Picto - print ''; + print ''; print ''; // URL From 7e31aedf94d3b71ca7b76635a99a49f98945416c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Mar 2024 23:46:38 +0100 Subject: [PATCH 0768/1862] FIX Picto in top menu --- htdocs/core/menus/standard/auguria.lib.php | 2 ++ htdocs/core/menus/standard/eldy.lib.php | 2 ++ htdocs/core/menus/standard/empty.php | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 2b0fa54f453..9648194fccf 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -240,6 +240,8 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla if (!empty($menuval['prefix']) && strpos($menuval['prefix'], ''; } else { print ''; } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index c8561fd1f11..10da59b56d7 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -654,6 +654,8 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, print '
'; if (!empty($menuval['prefix']) && strpos($menuval['prefix'], ''; } else { print ''; } diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 9f74d1aad15..4b189b165cc 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -521,7 +521,13 @@ function print_text_menu_entry_empty($text, $showmode, $url, $id, $idsel, $class if ($showmode == 1) { print ''; print '
'; - print ''; + if (!empty($menuval['prefix']) && strpos($menuval['prefix'], ''; + } else { + print ''; + } print '
'; print '
'; if (!getDolGlobalString('THEME_TOPMENU_DISABLE_TEXT')) { From cecd3bc1b61d7c065faae45cbe88dbfb8cd861ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Mar 2024 23:46:38 +0100 Subject: [PATCH 0769/1862] FIX Picto in top menu --- htdocs/core/menus/standard/auguria.lib.php | 2 ++ htdocs/core/menus/standard/eldy.lib.php | 2 ++ htdocs/core/menus/standard/empty.php | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 60480d6c9cb..dbed17b95d5 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -242,6 +242,8 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla if (!empty($menuval['prefix']) && strpos($menuval['prefix'], ''; } else { print ''; } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 1cf504a30fd..141e0e02c65 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -656,6 +656,8 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, print '
'; if (!empty($menuval['prefix']) && strpos($menuval['prefix'], ''; } else { print ''; } diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 542cb1a493a..01282aff09f 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -523,7 +523,13 @@ function print_text_menu_entry_empty($text, $showmode, $url, $id, $idsel, $class if ($showmode == 1) { print ''; print '
'; - print ''; + if (!empty($menuval['prefix']) && strpos($menuval['prefix'], ''; + } else { + print ''; + } print '
'; print '
'; if (!getDolGlobalString('THEME_TOPMENU_DISABLE_TEXT')) { From 8ef22dc461487bd9942cf8d2613f53056eb2f6eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Mar 2024 00:47:00 +0100 Subject: [PATCH 0770/1862] Fix css --- htdocs/bookmarks/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 7bebdcb2af7..8dd22d694ca 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -228,6 +228,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { print '
'; print '
'; print $langs->trans("RefOrder").''; @@ -2677,7 +2677,7 @@ if ($action == 'create') { } // Create bill - if (isModEnabled('facture') && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) { + if (isModEnabled('invoice') && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) { if ($user->hasRight('facture', 'creer')) { if (getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0') { print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index e4d0918ea1f..70a7b3a6a2d 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionlinebatch.class.php'; diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 86b3c547e5a..13403d14a3a 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -55,7 +55,7 @@ if ($id > 0 || !empty($ref)) { } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } @@ -191,7 +191,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { print ''; */ $reshook_onCreate_onAfterShowFields = $hookmanager->executeHooks('onCreate_onAfterShowFields', $parameters, $object, $action); - + print '
'; $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php index 2a72c02ead0..8334b30bdef 100644 --- a/htdocs/expedition/dispatch.php +++ b/htdocs/expedition/dispatch.php @@ -423,7 +423,7 @@ if ($object->id > 0 || !empty($object->ref)) { // Print form confirm print $formconfirm; - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } @@ -474,7 +474,7 @@ if ($object->id > 0 || !empty($object->ref)) { print ''; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { print ''; print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -1973,7 +1973,7 @@ if ($action == 'create') { $labeltype = $langs->trans("PaymentType".$objp->payment_code) != "PaymentType".$objp->payment_code ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_type; print "\n"; // Bank account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; @@ -2782,7 +2782,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'editline') { } // If bank module is used - if ($user->hasRight('expensereport', 'to_paid') && isModEnabled("banque") && $object->status == ExpenseReport::STATUS_APPROVED) { + if ($user->hasRight('expensereport', 'to_paid') && isModEnabled("bank") && $object->status == ExpenseReport::STATUS_APPROVED) { // Pay if ($remaintopay == 0) { print '
'.$langs->trans('DoPayment').'
'; @@ -2792,7 +2792,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'editline') { } // If bank module is not used - if (($user->hasRight('expensereport', 'to_paid') || empty(isModEnabled("banque"))) && $object->status == ExpenseReport::STATUS_APPROVED) { + if (($user->hasRight('expensereport', 'to_paid') || empty(isModEnabled("bank"))) && $object->status == ExpenseReport::STATUS_APPROVED) { //if ((round($remaintopay) == 0 || !isModEnabled("banque")) && $object->paid == 0) if ($object->paid == 0) { print '"; diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php index d8e650fb88d..464ca7edf60 100644 --- a/htdocs/expensereport/class/api_expensereports.class.php +++ b/htdocs/expensereport/class/api_expensereports.class.php @@ -634,7 +634,7 @@ class ExpenseReports extends DolibarrApi if ($paymentExpenseReport->create(DolibarrApiAccess::$user) < 0) { throw new RestException(500, 'Error creating paymentExpenseReport', array_merge(array($paymentExpenseReport->error), $paymentExpenseReport->errors)); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $paymentExpenseReport->addPaymentToBank( DolibarrApiAccess::$user, 'payment_expensereport', diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 0bcb616ba36..ca7da95f824 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -533,7 +533,7 @@ class PaymentExpenseReport extends CommonObject $error = 0; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index caccb13d9d6..8edcfe60ca0 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/expensereport/modules_expensereport.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php'; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; } @@ -121,7 +121,7 @@ print '\n"; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; print ''; print '"; // Contract - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $langs->load('contracts'); print ''; print ''; print_liste_field_titre("Ref", $_SERVER['PHP_SELF'], "f.titre", "", "", 'width="200px"', $sortfield, $sortorder, 'left '); print_liste_field_titre("Company", $_SERVER['PHP_SELF'], "s.nom", "", "", 'width="200px"', $sortfield, $sortorder, 'left '); - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { print_liste_field_titre("Contract", $_SERVER['PHP_SELF'], "f.fk_contrat", "", "", 'width="100px"', $sortfield, $sortorder, 'left '); } if (isModEnabled('project')) { @@ -861,7 +861,7 @@ if ($action == 'create') { print ''; } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { print ''; // Contract - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $langs->load('contracts'); print ''; print '"; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Default bank account for payments print ''; print ''; */ - $reshook_onCreate_onAfterShowFields = $hookmanager->executeHooks('onCreate_onAfterShowFields', $parameters, $object, $action); //***HOOK Note that $action and $object may have been modified by some hooks + $reshook_onCreate_onAfterShowFields = $hookmanager->executeHooks('onCreate_onAfterShowFields', $parameters, $object, $action); print '
'; print $langs->trans("RefOrder").''; diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index 50cbd1f0380..1f1f33c6151 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -77,7 +77,7 @@ if ($id > 0 || !empty($ref)) { } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index b1d33238f15..de32d3fc972 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -652,7 +652,7 @@ if ($user->hasRight('user', 'user', 'lire')) { $moreforfilter .= ''; } // If the user can view prospects other than his' -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -663,7 +663,7 @@ if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user- $moreforfilter .= '
'; } -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index bec93d8c8dc..d05220c1eda 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -52,7 +52,7 @@ if ($id > 0 || !empty($ref)) { } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index b8bae69f698..d5bdbdb3fb6 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1919,7 +1919,7 @@ if ($action == 'create') { // List of payments already done $nbcols = 3; $nbrows = 0; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $nbrows++; $nbcols++; } @@ -1930,7 +1930,7 @@ if ($action == 'create') { print '
'.$langs->trans('Payments').''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('Amount').'".$labeltype.' '.$objp->num_payment."
'.$langs->trans('Note').'
'.$langs->trans('AccountToDebit').''; diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 1ac2095ad1f..8d4303b9e8d 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -43,7 +43,7 @@ if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php'; } @@ -267,7 +267,7 @@ llxHeader('', $langs->trans("RepeatableIntervention"), $help_url); $form = new Form($db); $companystatic = new Societe($db); -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $contratstatic = new Contrat($db); } if (isModEnabled('project')) { @@ -302,7 +302,7 @@ if ($action == 'create') { if (isModEnabled('project') && $object->fk_project > 0) { $rowspan++; } - if (isModEnabled('contrat') && $object->fk_contrat > 0) { + if (isModEnabled('contract') && $object->fk_contrat > 0) { $rowspan++; } @@ -355,7 +355,7 @@ if ($action == 'create') { } // Contrat - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $formcontract = new FormContract($db); print "
".$langs->trans("Contract").""; $contractid = GETPOST('contractid') ? GETPOST('contractid') : (!empty($object->fk_contrat) ? $object->fk_contrat : 0) ; @@ -566,7 +566,7 @@ if ($action == 'create') { print '
'.$langs->trans("Description").''.nl2br($object->description)."
'; @@ -827,7 +827,7 @@ if ($action == 'create') { print '
'.$langs->trans("None").''; if ($objp->fk_contrat > 0) { $contratstatic->fetch($objp->fk_contrat); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 91926349cd9..c5d1ad93933 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -43,7 +43,7 @@ if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT."/core/class/html.formcontract.class.php"; require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"; } @@ -813,7 +813,7 @@ if (empty($reshook)) { $form = new Form($db); $formfile = new FormFile($db); -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $formcontract = new FormContract($db); } if (isModEnabled('project')) { @@ -959,7 +959,7 @@ if ($action == 'create') { } // Contract - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $langs->load("contracts"); print '
'.$langs->trans("Contract").''; $numcontrat = $formcontract->select_contract($soc->id, GETPOSTINT('contratid'), 'contratid', 0, 1, 1); @@ -1272,7 +1272,7 @@ if ($action == 'create') { print '
'; @@ -1701,7 +1701,7 @@ if ($action == 'create') { } // Invoicing - if (isModEnabled('facture') && $object->statut > Fichinter::STATUS_DRAFT) { + if (isModEnabled('invoice') && $object->statut > Fichinter::STATUS_DRAFT) { $langs->load("bills"); if ($object->statut < Fichinter::STATUS_BILLED) { if ($user->hasRight('facture', 'creer')) { diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 05d125f0d0a..335d5608727 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -172,7 +172,7 @@ if ($resql) { /* * Draft orders */ -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; @@ -295,7 +295,7 @@ if ($resql) { * interventions to process */ -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $sql = "SELECT f.rowid, f.ref, f.fk_statut, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 64da4f12882..ddc8d0c332b 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } @@ -48,7 +48,7 @@ $langs->loadLangs(array('companies', 'bills', 'interventions')); if (isModEnabled('project')) { $langs->load("projects"); } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $langs->load("contracts"); } @@ -226,7 +226,7 @@ $companystatic = new Societe($db); if (isModEnabled('project')) { $projetstatic = new Project($db); } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $contratstatic = new Contrat($db); } @@ -258,7 +258,7 @@ $sql .= " s.nom as name, s.rowid as socid, s.client, s.fournisseur, s.email, s.s if (isModEnabled('project')) { $sql .= ", pr.rowid as projet_id, pr.ref as projet_ref, pr.title as projet_title"; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $sql .= ", c.rowid as contrat_id, c.ref as contrat_ref, c.ref_customer as contrat_ref_customer, c.ref_supplier as contrat_ref_supplier"; } // Add fields from extrafields @@ -278,7 +278,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; if (isModEnabled('project')) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr on f.fk_projet = pr.rowid"; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contrat as c on f.fk_contrat = c.rowid"; } if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 818b1e5c0cd..56954e78e16 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -37,10 +37,10 @@ require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } if (!empty($conf->accounting->enabled)) { @@ -330,7 +330,7 @@ if ($object->id > 0) { print "
'; print ''; print ''; diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index c9c674d2c76..00ba4fa8532 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -435,7 +435,7 @@ class SupplierInvoices extends DolibarrApi throw new RestException(404, 'Invoice not found'); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if (empty($accountid)) { throw new RestException(400, 'Bank account ID is mandatory'); } @@ -484,7 +484,7 @@ class SupplierInvoices extends DolibarrApi throw new RestException(400, 'Payment error : ' . $paiement->error); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $result = $paiement->addPaymentToBank(DolibarrApiAccess::$user, 'payment_supplier', '(SupplierInvoicePayment)', $accountid, $chqemetteur, $chqbank); if ($result < 0) { $this->db->rollback(); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 74438fdcc70..059e04db6b7 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1775,7 +1775,7 @@ if ($action == 'create') { print ''; // Bank Account - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') && isModEnabled("bank")) { $langs->load("bank"); print ''; + print '   '; + print ''.$langs->trans("Cancel").''; + + print ""; } - print "\n"; } - $total_debit = price2num($total_debit, 'MT'); - $total_credit = price2num($total_credit, 'MT'); - - if ($total_debit != $total_credit) { - setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings'); - } - - print '
'; @@ -397,7 +397,7 @@ if ($object->id > 0) { } // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); print '
'.$langs->trans("SuppliersCategoriesShort").''; @@ -410,7 +410,7 @@ if ($object->id > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Module Adherent - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $langs->load("members"); $langs->load("users"); print '
'.$langs->trans("LinkedToDolibarrMember").'
'.$langs->trans('BankAccount').''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); @@ -2248,7 +2248,7 @@ if ($action == 'create') { } // Bank Account - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') && isModEnabled("bank")) { print '
'; print ''; // Bank Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Date cloture + if (!empty($arrayfields['p.date_cloture']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Note public + if (!empty($arrayfields['p.note_public']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Note private + if (!empty($arrayfields['p.note_private']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Status + if (!empty($arrayfields['p.fk_statut']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Action column + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; - $formfile = new FormFile($db); - // Show list of available documents - $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource .= str_replace('&', '&', $param); - - $filedir = $diroutputmassaction; - $genallowed = $permissiontoread; - $delallowed = $permissiontoadd; - - print $formfile->showdocuments('massfilesarea_proposals', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); + print ''."\n"; } - // End of page - llxFooter(); - $db->close(); + $i++; +} + +// Show total line +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + +// If no record found +if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''; +} + +$db->free($resql); + +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print '
'; print $langs->trans('BankAccount'); @@ -2642,7 +2642,7 @@ if ($action == 'create') { // Classify billed manually (need one invoice if module invoice is on, no condition on invoice if not) if ($usercancreate && $object->statut >= 2 && $object->statut != 7 && $object->billed != 1) { // statut 2 means approved - if (!isModEnabled('facture')) { + if (!isModEnabled('invoice')) { print ''.$langs->trans("ClassifyBilled").''; } else { if (!empty($object->linkedObjectsIds['invoice_supplier'])) { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 9630614fd9d..ab1f551519e 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1308,7 +1308,7 @@ if ($resql) { $moreforfilter .= ''; } // If the user can view prospects other than his' - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2cab1b323d6..2210f2c1493 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2667,7 +2667,7 @@ if ($action == 'create') { print '
'.$langs->trans('BankAccount').''; // when bank account is empty (means not override by payment mode form a other object, like third-party), try to use default value print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); @@ -3431,7 +3431,7 @@ if ($action == 'create') { } // Bank Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print '
'; print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -3680,7 +3680,7 @@ if ($action == 'create') { print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 59f7d3d7916..5fa0373d095 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1030,7 +1030,7 @@ if ($user->hasRight("user", "user", "lire")) { $moreforfilter .= ''; } // If the user can view prospects other than his' -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -1039,7 +1039,7 @@ if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user- $moreforfilter .= '
'; } -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('SuppliersCategoriesShort'); diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 730442f4935..92ac2fa8987 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -226,7 +226,7 @@ if (empty($reshook)) { $error++; } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // If bank module is on, account is required to enter a payment if (GETPOST('accountid') <= 0) { setEventMessages($langs->transnoentities('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors'); @@ -514,7 +514,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
'; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print '"; diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index a2e0fa51aef..c20ccb99e2c 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -491,7 +491,7 @@ $moreforfilter.= '';*/ // Filter on categories $moreforfilter = ''; -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_KNOWLEDGEMANAGEMENT, $searchCategoryKnowledgemanagementList, 'minwidth300', $searchCategoryKnowledgemanagementList ? $searchCategoryKnowledgemanagementList : 0); /* diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 34f035e9d37..fc41bac9d6b 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -290,7 +290,7 @@ if ($action == 'create') { print ''; // Bank account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index ec0a8dcbe29..b0064f2a62c 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -504,7 +504,7 @@ class PaymentLoan extends CommonObject $error = 0; $this->db->begin(); - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 1ec4aacd72d..ec20266337e 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -25,7 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/paymentloan.class.php'; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; } @@ -130,7 +130,7 @@ print ''; // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { if ($payment->bank_account) { $bankline = new AccountLine($db); $bankline->fetch($payment->bank_line); diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 9e6cda0866d..508d37fcf55 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -106,7 +106,7 @@ if ($action == 'add_payment') { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors'); $error++; } - if (isModEnabled("banque") && !GETPOSTINT('accountid') > 0) { + if (isModEnabled("bank") && !GETPOSTINT('accountid') > 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors'); $error++; } diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index b7ef7d99eb9..462e553847e 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -306,7 +306,7 @@ class MailmanSpip return -1; } - if (isModEnabled('adherent')) { // Synchro for members + if (isModEnabled('member')) { // Synchro for members if (getDolGlobalString('ADHERENT_MAILMAN_URL')) { if ($listes == '' && getDolGlobalString('ADHERENT_MAILMAN_LISTS')) { $lists = explode(',', getDolGlobalString('ADHERENT_MAILMAN_LISTS')); @@ -376,7 +376,7 @@ class MailmanSpip return -1; } - if (isModEnabled('adherent')) { // Synchro for members + if (isModEnabled('member')) { // Synchro for members if (getDolGlobalString('ADHERENT_MAILMAN_UNSUB_URL')) { if ($listes == '' && getDolGlobalString('ADHERENT_MAILMAN_LISTS')) { $lists = explode(',', getDolGlobalString('ADHERENT_MAILMAN_LISTS')); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4e1867a4f4c..7e41e0b4d40 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2738,7 +2738,7 @@ function printDropdownQuickadd() "title" => "MenuNewMember@members", "name" => "Adherent@members", "picto" => "object_member", - "activation" => isModEnabled('adherent') && $user->hasRight("adherent", "write"), // vs hooking + "activation" => isModEnabled('member') && $user->hasRight("adherent", "write"), // vs hooking "position" => 5, ), array( @@ -2771,7 +2771,7 @@ function printDropdownQuickadd() "title" => "NewOrder@orders", "name" => "Order@orders", "picto" => "object_order", - "activation" => isModEnabled('commande') && $user->hasRight("commande", "write"), // vs hooking + "activation" => isModEnabled('order') && $user->hasRight("commande", "write"), // vs hooking "position" => 40, ), array( @@ -2779,7 +2779,7 @@ function printDropdownQuickadd() "title" => "NewBill@bills", "name" => "Bill@bills", "picto" => "object_bill", - "activation" => isModEnabled('facture') && $user->hasRight("facture", "write"), // vs hooking + "activation" => isModEnabled('invoice') && $user->hasRight("facture", "write"), // vs hooking "position" => 50, ), array( @@ -2787,7 +2787,7 @@ function printDropdownQuickadd() "title" => "NewContractSubscription@contracts", "name" => "Contract@contracts", "picto" => "object_contract", - "activation" => isModEnabled('contrat') && $user->hasRight("contrat", "write"), // vs hooking + "activation" => isModEnabled('contract') && $user->hasRight("contrat", "write"), // vs hooking "position" => 60, ), array( @@ -2827,7 +2827,7 @@ function printDropdownQuickadd() "title" => "NewIntervention@interventions", "name" => "Intervention@interventions", "picto" => "intervention", - "activation" => isModEnabled('ficheinter') && $user->hasRight("ficheinter", "creer"), // vs hooking + "activation" => isModEnabled('intervention') && $user->hasRight("ficheinter", "creer"), // vs hooking "position" => 110, ), array( diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index 820c29bc2c1..6f82bac1e10 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -227,7 +227,7 @@ print '
'.$langs->trans("Example").': '.$mysoc->n print ''; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print ''; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print '"; //} - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { // Categories print '"; @@ -2988,7 +2988,7 @@ if (getDolGlobalString('PRODUCT_ADD_FORM_ADD_TO') && $object->id && ($action == } // Commande - if (isModEnabled('commande') && $user->hasRight('commande', 'creer')) { + if (isModEnabled('order') && $user->hasRight('commande', 'creer')) { $commande = new Commande($db); $langs->load("orders"); @@ -3008,7 +3008,7 @@ if (getDolGlobalString('PRODUCT_ADD_FORM_ADD_TO') && $object->id && ($action == } // Factures - if (isModEnabled('facture') && $user->hasRight('facture', 'creer')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'creer')) { $invoice = new Facture($db); $langs->load("bills"); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5b69e98fdd7..e097e270fb3 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5365,7 +5365,7 @@ class Product extends CommonObject } } // show categories for this record only in ajax to not overload lists - if (isModEnabled('categorie') && !$nofetch) { + if (isModEnabled('category') && !$nofetch) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories'] = '
' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); @@ -5865,14 +5865,14 @@ class Product extends CommonObject //dol_syslog("load_virtual_stock"); - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $result = $this->load_stats_commande(0, '1,2', 1); if ($result < 0) { dol_print_error($this->db, $this->error); } $stock_commande_client = $this->stats_commande['qty']; } - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; $filterShipmentStatus = ''; if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')) { diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index f8d5f38a59c..54310e0d759 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -197,7 +197,7 @@ if ($action == 'search') { } $sql .= natural_search($params, $key); } - if (isModEnabled('categorie') && !empty($parent) && $parent != -1) { + if (isModEnabled('category') && !empty($parent) && $parent != -1) { $sql .= " AND cp.fk_categorie ='".$db->escape($parent)."'"; } $sql .= " ORDER BY p.ref ASC"; @@ -625,7 +625,7 @@ if ($id > 0 || !empty($ref)) { print '
'; $rowspan = 1; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $rowspan++; } @@ -638,7 +638,7 @@ if ($id > 0 || !empty($ref)) { print $langs->trans("KeywordFilter").': '; print '   '; print ''; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; print '
'.$langs->trans("CategoryFilter").': '; print $form->select_all_categories(Categorie::TYPE_PRODUCT, $parent, 'parent').'  
'; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 397b1660505..28af89a6246 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -215,7 +215,7 @@ if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight("pr } -if (isModEnabled('categorie') && getDolGlobalString('CATEGORY_GRAPHSTATS_ON_PRODUCTS')) { +if (isModEnabled('category') && getDolGlobalString('CATEGORY_GRAPHSTATS_ON_PRODUCTS')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; print '
'; print '
'; diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 119a1be77f3..38e51960c08 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -474,7 +474,7 @@ $moreforfilter.= $langs->trans('MyFilter') . ': '; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1); diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index c09fe7a6cbf..008ee43e68a 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -560,14 +560,14 @@ if ($search_categ > 0) { // Filter on categories $moreforfilter = ''; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('ProductsCategoriesShort'), 'category', 'class="pictofixedwidth"'); $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1, $langs->trans("ProductsCategoryShort"), 'maxwidth400'); $moreforfilter .= '
'; } // Filter on warehouse categories -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('StockCategoriesShort'), 'category', 'class="pictofixedwidth"'); $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_WAREHOUSE, $search_warehouse_categ, 'search_warehouse_categ', 1, $langs->trans("StockCategoriesShort"), 'maxwidth400'); diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 7021413e3b8..b9413e921bc 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -214,7 +214,7 @@ if ($result || !($id > 0)) { print ''; // Tag - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
"; @@ -961,7 +961,7 @@ if ($action == 'create') { } // Tags-Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 672ca04fcba..07ff350b921 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -780,7 +780,7 @@ if ($id > 0 || $ref) { $found = 0; $helpondiff = ''.$langs->trans("StockDiffPhysicTeoric").':
'; // Number of sales orders running - if (isModEnabled('commande')) { + if (isModEnabled('order')) { if ($found) { $helpondiff .= '
'; } else { @@ -795,7 +795,7 @@ if ($id > 0 || $ref) { } // Number of product from sales order already sent (partial shipping) - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; $filterShipmentStatus = ''; if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')) { diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 14b8a9b7c45..1adc5d07f47 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -415,7 +415,7 @@ if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrep $sql .= ', s.fk_product'; if ($usevirtualstock) { - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd1.qty) IS NULL", "0", "SUM(cd1.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL $sqlCommandesCli .= " FROM ".MAIN_DB_PREFIX."commandedet as cd1, ".MAIN_DB_PREFIX."commande as c1"; $sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity(getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'commande').")"; @@ -425,7 +425,7 @@ if ($usevirtualstock) { $sqlCommandesCli = '0'; } - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { $sqlExpeditionsCli = "(SELECT ".$db->ifsql("SUM(ed2.qty) IS NULL", "0", "SUM(ed2.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL $sqlExpeditionsCli .= " FROM ".MAIN_DB_PREFIX."expedition as e2,"; $sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."expeditiondet as ed2,"; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 3b6a798fe3a..84cd7ade199 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -878,7 +878,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { $doleditor->Create(); print ''; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { // Categories print ''; // Tags-Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $arrayselected = array(); print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; @@ -1645,13 +1645,13 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { if (!getDolGlobalString('PROJECT_HIDE_CREATE_OBJECT_BUTTON')) { $arrayforbutaction = array( 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("commande"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("facture"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("order"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("invoice"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 40 => array('lang'=>'supplier_proposal', 'enabled'=>isModEnabled("supplier_proposal"), 'perm'=>$user->hasRight('supplier_proposal', 'creer'), 'label' => 'AddSupplierProposal', 'url'=>'/supplier_proposal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 50 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_order"), 'perm'=>$user->hasRight('fournisseur', 'commande', 'creer'), 'label' => 'AddSupplierOrder', 'url'=>'/fourn/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 60 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_invoice"), 'perm'=>$user->hasRight('fournisseur', 'facture', 'creer'), 'label' => 'AddSupplierInvoice', 'url'=>'/fourn/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 70 => array('lang'=>'interventions', 'enabled'=>isModEnabled("ficheinter"), 'perm'=>$user->hasRight('fichinter', 'creer'), 'label' => 'AddIntervention', 'url'=>'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 80 => array('lang'=>'contracts', 'enabled'=>isModEnabled("contrat"), 'perm'=>$user->hasRight('contrat', 'creer'), 'label' => 'AddContract', 'url'=>'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 70 => array('lang'=>'interventions', 'enabled'=>isModEnabled("intervention"), 'perm'=>$user->hasRight('fichinter', 'creer'), 'label' => 'AddIntervention', 'url'=>'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 80 => array('lang'=>'contracts', 'enabled'=>isModEnabled("contract"), 'perm'=>$user->hasRight('contrat', 'creer'), 'label' => 'AddContract', 'url'=>'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 90 => array('lang'=>'trips', 'enabled'=>isModEnabled("expensereport"), 'perm'=>$user->hasRight('expensereport', 'creer'), 'label' => 'AddTrip', 'url'=>'/expensereport/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 100 => array('lang'=>'donations', 'enabled'=>isModEnabled("don"), 'perm'=>$user->hasRight('don', 'creer'), 'label' => 'AddDonation', 'url'=>'/don/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), ); diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index b8201e7c6e7..48803930572 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -174,7 +174,7 @@ print nl2br($object->description); print ''; // Categories -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 0b76bd6b620..c9c32359711 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -483,7 +483,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 6f519a921e3..dd053b04549 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -41,16 +41,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; if (isModEnabled('agenda')) { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; } -if (isModEnabled('banque')) { +if (isModEnabled('bank')) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; } -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } if (isModEnabled('deplacement')) { @@ -59,17 +59,17 @@ if (isModEnabled('deplacement')) { if (isModEnabled('don')) { require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; } -if (isModEnabled('expedition')) { +if (isModEnabled('delivery_note')) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; } if (isModEnabled('expensereport')) { require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } if (isModEnabled('loan')) { @@ -110,16 +110,16 @@ if (isModEnabled('stocktransfer')) { // Load translation files required by the page $langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta')); -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { $langs->load("bills"); } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $langs->load("orders"); } if (isModEnabled("propal")) { $langs->load("propal"); } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $langs->load("interventions"); } if (isModEnabled('deplacement')) { @@ -358,7 +358,7 @@ print dol_htmlentitiesbr($object->description); print ''; // Categories -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { print '"; @@ -415,7 +415,7 @@ $listofreferent = array( 'lang'=>'orders', 'buttonnew'=>'CreateOrder', 'testnew'=>$user->hasRight('commande', 'creer'), - 'test'=>isModEnabled('commande') && $user->hasRight('commande', 'lire') + 'test'=>isModEnabled('order') && $user->hasRight('commande', 'lire') ), 'invoice'=>array( 'name'=>"CustomersInvoices", @@ -428,7 +428,7 @@ $listofreferent = array( 'lang'=>'bills', 'buttonnew'=>'CreateBill', 'testnew'=>$user->hasRight('facture', 'creer'), - 'test'=>isModEnabled('facture') && $user->hasRight('facture', 'lire') + 'test'=>isModEnabled('invoice') && $user->hasRight('facture', 'lire') ), 'invoice_predefined'=>array( 'name'=>"PredefinedInvoices", @@ -440,7 +440,7 @@ $listofreferent = array( 'lang'=>'bills', 'buttonnew'=>'CreateBill', 'testnew'=>$user->hasRight('facture', 'creer'), - 'test'=>isModEnabled('facture') && $user->hasRight('facture', 'lire') + 'test'=>isModEnabled('invoice') && $user->hasRight('facture', 'lire') ), 'proposal_supplier'=>array( 'name'=>"SupplierProposals", @@ -489,7 +489,7 @@ $listofreferent = array( 'lang'=>'contracts', 'buttonnew'=>'AddContract', 'testnew'=>$user->hasRight('contrat', 'creer'), - 'test'=>isModEnabled('contrat') && $user->hasRight('contrat', 'lire') + 'test'=>isModEnabled('contract') && $user->hasRight('contrat', 'lire') ), 'intervention'=>array( 'name'=>"Interventions", @@ -503,7 +503,7 @@ $listofreferent = array( 'lang'=>'interventions', 'buttonnew'=>'AddIntervention', 'testnew'=>$user->hasRight('ficheinter', 'creer'), - 'test'=>isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire') + 'test'=>isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire') ), 'shipping'=>array( 'name'=>"Shippings", @@ -515,7 +515,7 @@ $listofreferent = array( 'lang'=>'sendings', 'buttonnew'=>'CreateShipment', 'testnew'=>0, - 'test'=>isModEnabled('expedition') && $user->hasRight('expedition', 'lire') + 'test'=>isModEnabled('delivery_note') && $user->hasRight('expedition', 'lire') ), 'mrp'=>array( 'name'=>"MO", @@ -651,7 +651,7 @@ $listofreferent = array( 'lang'=>'banks', 'buttonnew'=>'AddVariousPayment', 'testnew'=>$user->hasRight('banque', 'modifier'), - 'test'=>isModEnabled("banque") && $user->hasRight('banque', 'lire') && !getDolGlobalString('BANK_USE_OLD_VARIOUS_PAYMENT') + 'test'=>isModEnabled("bank") && $user->hasRight('banque', 'lire') && !getDolGlobalString('BANK_USE_OLD_VARIOUS_PAYMENT') ), /* No need for this, available on dedicated tab "Agenda/Events" 'agenda'=>array( diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index b1f74cc5cbc..63bbbc3ff6e 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -222,7 +222,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index e1fd9a43b35..ddeb182586f 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -178,7 +178,7 @@ $search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $se $search_category_array = array(); -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $search_category_array = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array"); } @@ -1123,13 +1123,13 @@ if ($user->hasRight('user', 'user', 'lire')) { } // Filter on categories -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array, 'minwidth300imp minwidth300 widthcentpercentminusx'); } // Filter on customer categories -if (getDolGlobalString('MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST') && isModEnabled("categorie") && $user->hasRight('categorie', 'lire')) { +if (getDolGlobalString('MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST') && isModEnabled("category") && $user->hasRight('categorie', 'lire')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_CUSTOMER, $searchCategoryCustomerList, 'minwidth300', $searchCategoryCustomerList ? $searchCategoryCustomerList : 0); /*$moreforfilter .= '
'; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 98ed8f1b357..d8c6ca3b391 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -672,7 +672,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
"; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index c36cd2e6d30..8363c284ba2 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -258,7 +258,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index abb5653d4e7..3ae0f6d39e5 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -294,7 +294,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 2d0632eea77..33d0ec29877 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -251,7 +251,7 @@ if ($object->id > 0) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 8cfe753056a..8524b0ccb1e 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -781,7 +781,7 @@ if ($search_all) { $moreforfilter = ''; // Filter on categories -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('ProjectCategories'); @@ -810,7 +810,7 @@ $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form- $moreforfilter .= '
'; // Filter on customer categories -if (getDolGlobalString('MAIN_SEARCH_CATEGORY_CUSTOMER_ON_TASK_LIST') && isModEnabled("categorie") && $user->hasRight('categorie', 'lire')) { +if (getDolGlobalString('MAIN_SEARCH_CATEGORY_CUSTOMER_ON_TASK_LIST') && isModEnabled("category") && $user->hasRight('categorie', 'lire')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_CUSTOMER, $searchCategoryCustomerList, 'minwidth300', $searchCategoryCustomerList ? $searchCategoryCustomerList : 0); /* diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 1f54ef3f26d..5ef996d2ae5 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -241,7 +241,7 @@ if ($object->id > 0) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index ca98bc5330b..d9face5c16a 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -367,7 +367,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 6065cda5c24..e55a8f4fd3d 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1049,7 +1049,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; @@ -1110,7 +1110,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser //'builddoc'=>$langs->trans("PDFMerge"), ); } - if (isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'creer')) { + if (isModEnabled('intervention') && $user->hasRight('ficheinter', 'creer')) { $langs->load("interventions"); $arrayofmassactions['generateinter'] = $langs->trans("GenerateInter"); } diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 5fb856036fe..9d2c29f6068 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -81,7 +81,7 @@ $error = 0; $langs->loadLangs(array("main", "members", "companies", "install", "other", "errors")); // Security check -if (!isModEnabled('adherent')) { +if (!isModEnabled('member')) { httponly_accessforbidden('Module Membership not enabled'); } diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index 65b6065a698..ead24c23bd1 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -53,7 +53,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Security check -if (!isModEnabled('adherent')) { +if (!isModEnabled('member')) { httponly_accessforbidden('Module Membership not enabled'); } diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index b9b388a718b..a39d3670b03 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -49,7 +49,7 @@ if (is_numeric($entity)) { require '../../main.inc.php'; // Security check -if (!isModEnabled('adherent')) { +if (!isModEnabled('member')) { httponly_accessforbidden('Module Membership not enabled'); } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index fc9d9acd0d4..d31715b03ca 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -591,11 +591,11 @@ if ($ispaymentok) { $emetteur_banque = ''; // Define default choice for complementary actions $option = ''; - if (getDolGlobalString('ADHERENT_BANK_USE') == 'bankviainvoice' && isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) { + if (getDolGlobalString('ADHERENT_BANK_USE') == 'bankviainvoice' && isModEnabled("bank") && isModEnabled("societe") && isModEnabled('invoice')) { $option = 'bankviainvoice'; - } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'bankdirect' && isModEnabled("banque")) { + } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'bankdirect' && isModEnabled("bank")) { $option = 'bankdirect'; - } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'invoiceonly' && isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) { + } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'invoiceonly' && isModEnabled("bank") && isModEnabled("societe") && isModEnabled('invoice')) { $option = 'invoiceonly'; } if (empty($option)) { @@ -905,7 +905,7 @@ if ($ispaymentok) { } } - if (!$error && isModEnabled("banque")) { + if (!$error && isModEnabled("bank")) { $bankaccountid = 0; if ($paymentmethod == 'paybox') { $bankaccountid = getDolGlobalString('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS'); @@ -994,7 +994,7 @@ if ($ispaymentok) { } // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $invoice = new Facture($db); @@ -1033,7 +1033,7 @@ if ($ispaymentok) { } } - if (!$error && isModEnabled("banque")) { + if (!$error && isModEnabled("bank")) { $bankaccountid = 0; if ($paymentmethod == 'paybox') { $bankaccountid = getDolGlobalString('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS'); @@ -1170,7 +1170,7 @@ if ($ispaymentok) { } } - if (!$error && isModEnabled("banque")) { + if (!$error && isModEnabled("bank")) { $bankaccountid = 0; if ($paymentmethod == 'paybox') { $bankaccountid = getDolGlobalString('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS'); @@ -1300,7 +1300,7 @@ if ($ispaymentok) { } } - if (!$error && isModEnabled("banque")) { + if (!$error && isModEnabled("bank")) { $bankaccountid = 0; if ($paymentmethod == 'paybox') { $bankaccountid = getDolGlobalString('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS'); @@ -1530,7 +1530,7 @@ if ($ispaymentok) { } } - if (!$error && isModEnabled("banque")) { + if (!$error && isModEnabled("bank")) { $bankaccountid = 0; if ($paymentmethod == 'paybox') { $bankaccountid = getDolGlobalString('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS'); @@ -1702,7 +1702,7 @@ if ($ispaymentok) { $contract_lines = (array_key_exists('COL', $tmptag) && $tmptag['COL'] > 0) ? $tmptag['COL'] : null; // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $invoice = new Facture($db); @@ -1741,7 +1741,7 @@ if ($ispaymentok) { } } - if (!$error && isModEnabled("banque")) { + if (!$error && isModEnabled("bank")) { $bankaccountid = 0; if ($paymentmethod == 'paybox') { $bankaccountid = getDolGlobalString('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS'); diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 93825adf77a..3888b247006 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -466,7 +466,7 @@ if ($event->type == 'payout.created') { } } - if (!$error && isModEnabled('banque')) { + if (!$error && isModEnabled('bank')) { // Search again the payment to see if it is already linked to a bank payment record (We should always find the payment that was created before). $ispaymentdone = 0; $sql = "SELECT p.rowid, p.fk_bank FROM llx_paiement as p"; diff --git a/htdocs/public/webportal/tpl/home.tpl.php b/htdocs/public/webportal/tpl/home.tpl.php index a0c201ca6dc..e1c83c75f3a 100644 --- a/htdocs/public/webportal/tpl/home.tpl.php +++ b/htdocs/public/webportal/tpl/home.tpl.php @@ -18,13 +18,13 @@ global $conf, $langs; getControllerUrl('propallist') . '" title="' . $langs->trans('WebPortalPropalListDesc') . '">' . $langs->trans('WebPortalPropalListTitle') . ''; ?> - + - +
'; print $langs->trans('BankAccount'); @@ -3609,7 +3609,7 @@ if ($action == 'create') { if (isModEnabled('project')) { $nbrows++; } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $nbrows++; $nbcols++; } @@ -3651,7 +3651,7 @@ if ($action == 'create') { print ''.($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('Amount').''; print $s; print '
'.$langs->trans('PaymentMode').''; $form->select_types_paiements(!GETPOST('paiementid') ? $obj->fk_mode_reglement : GETPOST('paiementid'), 'paiementid'); print '
'.$langs->trans('Account').''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); print $form->select_comptes(empty($accountid) ? $obj->fk_account : $accountid, 'accountid', 0, '', 2, '', 0, 'widthcentpercentminusx maxwidth500', 1); diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 19f94afdd9b..d4ad615ee18 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -231,7 +231,7 @@ if ($result > 0) { $allow_delete = 1; // Bank account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if ($object->fk_account) { $bankline = new AccountLine($db); $bankline->fetch($object->bank_line); diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index 6bdecf49b37..540ef560f3c 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -130,7 +130,7 @@ if ($object->id > 0) { $allow_delete = 1; // Bank account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if ($object->fk_account) { $bankline = new AccountLine($db); $bankline->fetch($object->bank_line); diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 835025ebd38..49c9a20a1c4 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -102,7 +102,7 @@ $arrayfields = array( 's.nom' =>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), 'c.libelle' =>array('label'=>"Type", 'checked'=>1, 'position'=>40), 'p.num_paiement' =>array('label'=>"Numero", 'checked'=>1, 'position'=>50, 'tooltip'=>"ChequeOrTransferNumber"), - 'ba.label' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>60, 'enable'=>(isModEnabled("banque"))), + 'ba.label' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>60, 'enable'=>(isModEnabled("bank"))), 'p.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>70), ); $arrayfields = dol_sort_array($arrayfields, 'position'); diff --git a/htdocs/index.php b/htdocs/index.php index 516afe06f43..0cb2d4a260c 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -206,7 +206,7 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD')) { } // Number of sales orders - if (isModEnabled('commande') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('commande', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $board = new Commande($db); // Number of customer orders to be shipped (validated and in progress) @@ -228,7 +228,7 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD')) { } // Number of contract / services enabled (delayed) - if (isModEnabled('contrat') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CONTRACT') && $user->hasRight('contrat', 'lire')) { + if (isModEnabled('contract') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CONTRACT') && $user->hasRight('contrat', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $board = new Contrat($db); $dashboardlines[$board->element.'_inactive'] = $board->load_board($user, "inactive"); @@ -246,7 +246,7 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD')) { } // Number of invoices customers (paid) - if (isModEnabled('facture') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('facture', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $board = new Facture($db); $dashboardlines[$board->element] = $board->load_board($user); @@ -260,7 +260,7 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD')) { } // Number of transactions to conciliate - if (isModEnabled('banque') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) { + if (isModEnabled('bank') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) { include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $board = new Account($db); $nb = $board->countAccountToReconcile(); // Get nb of account to reconciliate @@ -271,7 +271,7 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD')) { // Number of cheque to send - if (isModEnabled('banque') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) { + if (isModEnabled('bank') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) { if (!getDolGlobalString('BANK_DISABLE_CHECK_DEPOSIT')) { include_once DOL_DOCUMENT_ROOT . '/compta/paiement/cheque/class/remisecheque.class.php'; $board = new RemiseCheque($db); @@ -290,7 +290,7 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD')) { } // Number of foundation members - if (isModEnabled('adherent') && !getDolGlobalString('MAIN_DISABLE_BLOCK_ADHERENT') && $user->hasRight('adherent', 'lire') && !$user->socid) { + if (isModEnabled('member') && !getDolGlobalString('MAIN_DISABLE_BLOCK_ADHERENT') && $user->hasRight('adherent', 'lire') && !$user->socid) { include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $board = new Adherent($db); $dashboardlines[$board->element.'_shift'] = $board->load_board($user, 'shift'); diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 9941d21ce26..f7d513d4e3f 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -2040,7 +2040,7 @@ function migrate_modeles($db, $langs, $conf) dolibarr_install_syslog("upgrade2::migrate_modeles"); - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { include_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; $modellist = ModelePDFFactures::liste_modeles($db); if (count($modellist) == 0) { @@ -2053,7 +2053,7 @@ function migrate_modeles($db, $langs, $conf) } } - if (isModEnabled('commande')) { + if (isModEnabled('order')) { include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; $modellist = ModelePDFCommandes::liste_modeles($db); if (count($modellist) == 0) { @@ -2066,7 +2066,7 @@ function migrate_modeles($db, $langs, $conf) } } - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { include_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; $modellist = ModelePdfExpedition::liste_modeles($db); if (count($modellist) == 0) { diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 6ed03ae11f5..b8148c97f43 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -746,7 +746,7 @@ class KnowledgeRecord extends CommonObject $labellang = ($this->lang ? $langs->trans('Language_'.$this->lang) : ''); $datas['lang'] = '
'.$langs->trans('Language').': ' . picto_from_langcode($this->lang, 'class="paddingrightonly saturatemedium opacitylow"') . $labellang; // show categories for this record only in ajax to not overload lists - if (isModEnabled('categorie') && !$nofetch) { + if (isModEnabled('category') && !$nofetch) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories'] = '
' . $form->showCategories($this->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1); diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index b44d5c3e5c5..1fa1a8a20f1 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -191,7 +191,7 @@ if ($action == 'create') { include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; $object->fields['answer']['enabled'] = 1; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1); if (count($cate_arbo)) { @@ -248,7 +248,7 @@ if (($id || $ref) && $action == 'edit') { include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; $object->fields['answer']['enabled'] = 1; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1); if (count($cate_arbo)) { @@ -433,7 +433,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $object->fields['answer']['enabled'] = 1; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1); print "
'.$langs->trans("Label").'
'.$langs->trans("BankAccount").''; $form->select_comptes(GETPOST("accountid"), "accountid", 0, "courant=1", 1); // Show list of bank account with courant print '
'.$langs->trans('NotePrivate').''.nl2br($payment->note_p print '
'.$langs->trans('NotePublic').''.nl2br($payment->note_public).'
'; print $langs->trans("BankAccount").''; $form->select_comptes($conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 83fa2eecf3b..305a9960abf 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -245,7 +245,7 @@ print ''.$langs->trans("Example").': '.$mysoc->name.''; print '
'; print $langs->trans("BankAccount").''; print img_picto('', 'bank_account').' '; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index cae180fd850..d9a95678e81 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -60,10 +60,10 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; if (isModEnabled('propal')) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (isModEnabled('accounting')) { @@ -83,7 +83,7 @@ $langs->loadLangs(array('products', 'other')); if (isModEnabled('stock')) { $langs->load("stocks"); } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { $langs->load("bills"); } if (isModEnabled('productbatch')) { @@ -1685,7 +1685,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print "
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1); @@ -2295,7 +2295,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Tags-Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1); $c = new Categorie($db); @@ -2825,7 +2825,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PRODUCT, 1); print "
'.$langs->trans("Categories").''; $moreforfilter .= img_picto($langs->trans("Categories"), 'category', 'class="pictofixedwidth"'); $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1, 1, 'widthcentpercentminusx maxwidth400'); @@ -368,7 +368,7 @@ if ($result || !($id > 0)) { 'label' => $langs->transnoentitiesnoconv($arrayforlabel[$mode], $langs->transnoentitiesnoconv("SuppliersOrders"))); } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $graphfiles['invoices'] = array('modulepart'=>'productstats_invoices', 'file' => $object->id.'/invoices12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png', 'label' => $langs->transnoentitiesnoconv($arrayforlabel[$mode], $langs->transnoentitiesnoconv("Invoices"))); @@ -380,7 +380,7 @@ if ($result || !($id > 0)) { 'label' => $langs->transnoentitiesnoconv($arrayforlabel[$mode], $langs->transnoentitiesnoconv("SupplierInvoices"))); } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $graphfiles['contracts'] = array('modulepart'=>'productstats_contracts', 'file' => $object->id.'/contracts12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png', 'label' => $langs->transnoentitiesnoconv($arrayforlabel[$mode], $langs->transnoentitiesnoconv("Contracts"))); diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 9225e9aebd8..1a4aedaefa6 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -382,7 +382,7 @@ if ($action == 'create') { // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { // Categories print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_WAREHOUSE, '', 'parent', 64, 0, 1); @@ -555,7 +555,7 @@ if ($action == 'create') { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_WAREHOUSE, 1); print "
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_WAREHOUSE, '', 'parent', 64, 0, 1); $c = new Categorie($db); diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 5e7bb9e8c6d..010d657cb93 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -737,7 +737,7 @@ class Entrepot extends CommonObject $datas['locationsummary'] = '
'.$langs->trans('LocationSummary').': '.$this->lieu; } // show categories for this record only in ajax to not overload lists - if (!$nofetch && isModEnabled('categorie')) { + if (!$nofetch && isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories_warehouse'] = '
' . $form->showCategories($this->id, Categorie::TYPE_WAREHOUSE, 1, 1); diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 931da124450..5eab969d4ce 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -29,7 +29,7 @@ // Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -55,7 +55,7 @@ $search_label = GETPOST("snom", "alpha") ? GETPOST("snom", "alpha") : GETPOST("s $search_status = GETPOSTINT("search_status"); $search_category_list = array(); -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $search_category_list = GETPOST("search_category_".Categorie::TYPE_WAREHOUSE."_list", "array"); } @@ -496,7 +496,7 @@ if ($search_all) { $moreforfilter = ''; -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_WAREHOUSE, $search_category_list); } diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 9eff95f02b0..234271ac2fb 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -939,7 +939,7 @@ if ($warehouse->id > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($warehouse->id, Categorie::TYPE_WAREHOUSE, 1); print "
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); @@ -1270,7 +1270,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); @@ -1442,7 +1442,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
' . $langs->trans("Categories") . ''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { print ''; print ''; print ''; @@ -513,7 +513,7 @@ if ($action == 'create') { print ''; print ''; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index b74904f0a9f..774cb173364 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -262,7 +262,7 @@ if ($result) { if ($user->admin) { print ''; diff --git a/htdocs/asset/class/assetdepreciationoptions.class.php b/htdocs/asset/class/assetdepreciationoptions.class.php index 99497d1b23a..e6aa273060c 100644 --- a/htdocs/asset/class/assetdepreciationoptions.class.php +++ b/htdocs/asset/class/assetdepreciationoptions.class.php @@ -268,7 +268,7 @@ class AssetDepreciationOptions extends CommonObject if ($field_info['notnull'] > 0 && $field_value == '' && !is_null($field_info['default']) && $field_info['default'] == '(PROV)') { $field_value = '(PROV)'; } elseif ((!empty($field_info['required']) || $field_info['notnull'] > 0) && $field_value == '' && !empty($field_info['default'])) { - $field_value = dol_eval($field_info['default'], 1); + $field_value = $field_info['default']; } if ($field_info['notnull'] > 0 && $field_value == '' && is_null($field_info['default'])) { $error++; diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index c8c105ab5c8..c35fe380279 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -109,7 +109,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index f5c987e15f7..cb61803017c 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -109,7 +109,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/asset/tpl/depreciation_options_edit.tpl.php b/htdocs/asset/tpl/depreciation_options_edit.tpl.php index 8031d3576f1..ea55ab5999a 100644 --- a/htdocs/asset/tpl/depreciation_options_edit.tpl.php +++ b/htdocs/asset/tpl/depreciation_options_edit.tpl.php @@ -136,7 +136,7 @@ if (empty($reshook)) { } $value = GETPOSTISSET($html_name) ? GETPOST($html_name, $check) : $assetdepreciationoptions->$field_key; } elseif ($field_info['type'] == 'price') { - $value = GETPOSTISSET($html_name) ? price2num(GETPOST($html_name)) : ($assetdepreciationoptions->$field_key ? price2num($assetdepreciationoptions->$field_key) : (!empty($field_info['default']) ? dol_eval($field_info['default'], 1) : 0)); + $value = GETPOSTISSET($html_name) ? price2num(GETPOST($html_name)) : ($assetdepreciationoptions->$field_key ? price2num($assetdepreciationoptions->$field_key) : (!empty($field_info['default']) ? $field_info['default'] : 0)); } elseif ($field_key == 'lang') { $value = GETPOSTISSET($html_name) ? GETPOST($html_name, 'aZ09') : $assetdepreciationoptions->lang; } else { diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index cbf1f8cccf5..b7b6be62f2e 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -111,7 +111,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index 83df6105c77..d27b46dd02c 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -122,7 +122,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php index a513aab7d31..781cad7732e 100644 --- a/htdocs/bookcal/calendar_list.php +++ b/htdocs/bookcal/calendar_list.php @@ -120,7 +120,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index d38984a2b79..d1bde067b1e 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -480,7 +480,7 @@ if ($object->fetch($id) >= 0) { $obj = new $classname($db); // Check if qualified - $qualified = (is_null($obj->enabled) ? 1 : dol_eval($obj->enabled, 1)); + $qualified = (is_null($obj->enabled) ? 1 : (int) dol_eval($obj->enabled, 1)); // Check dependencies foreach ($obj->require_module as $key) { diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 8618b1049fd..88cec014878 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -268,7 +268,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index a6c9cf5a361..c3cd5cd37a1 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -110,7 +110,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 1a82e95d19d..7c2f594906a 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -282,7 +282,7 @@ foreach ($object->fields as $key => $val) { $arrayfields[$newkey] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), 'position'=>$val['position'], 'help' => empty($val['help']) ? '' : $val['help'], ); diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 0a38507ccb6..72bb5428b75 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -351,10 +351,7 @@ if ($modecompta == 'CREANCES-DETTES') { } else { //var_dump($result); //$r = $AccCat->calculate($result); - $r = dol_eval($result, 1, 1, '1'); - if (is_nan($r)) { - $r = 0; - } + $r = (float) dol_eval($result, 1, 1, '1'); print ''; } @@ -378,10 +375,7 @@ if ($modecompta == 'CREANCES-DETTES') { $result = str_replace('--', '+', $result); //$r = $AccCat->calculate($result); - $r = dol_eval($result, 1, 1, '1'); - if (is_nan($r)) { - $r = 0; - } + $r = (float) dol_eval($result, 1, 1, '1'); print ''; if (empty($sommes[$code]['N'])) { @@ -400,10 +394,7 @@ if ($modecompta == 'CREANCES-DETTES') { $result = str_replace('--', '+', $result); //$r = $AccCat->calculate($result); - $r = dol_eval($result, 1, 1, '1'); - if (is_nan($r)) { - $r = 0; - } + $r = (float) dol_eval($result, 1, 1, '1'); print ''; if (empty($sommes[$code]['M'][$k])) { @@ -423,10 +414,7 @@ if ($modecompta == 'CREANCES-DETTES') { $result = str_replace('--', '+', $result); //$r = $AccCat->calculate($result); - $r = dol_eval($result, 1, 1, '1'); - if (is_nan($r)) { - $r = 0; - } + $r = (float) dol_eval($result, 1, 1, '1'); print ''; if (empty($sommes[$code]['M'][$k])) { diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 6ae0192bfe1..96e58140742 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -227,7 +227,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['p.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/core/boxes/box_scheduled_jobs.php b/htdocs/core/boxes/box_scheduled_jobs.php index 6bcb71d5311..539781c0da9 100644 --- a/htdocs/core/boxes/box_scheduled_jobs.php +++ b/htdocs/core/boxes/box_scheduled_jobs.php @@ -89,7 +89,7 @@ class box_scheduled_jobs extends ModeleBoxes while ($i < $num) { $objp = $this->db->fetch_object($result); - if (dol_eval($objp->test, 1, 1, '2')) { + if ((int) dol_eval($objp->test, 1, 1, '2')) { $nextrun = $this->db->jdate($objp->datenextrun); if (empty($nextrun)) { $nextrun = $this->db->jdate($objp->datestart); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 564f7d84493..c947e4e7c53 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -921,14 +921,14 @@ abstract class CommonObject } $enabled = 1; if ($enabled && isset($extrafields->attributes[$this->table_element]['enabled'][$key])) { - $enabled = dol_eval($extrafields->attributes[$this->table_element]['enabled'][$key], 1, 1, '2'); + $enabled = (int) dol_eval($extrafields->attributes[$this->table_element]['enabled'][$key], 1, 1, '2'); } if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key])) { - $enabled = dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '2'); + $enabled = (int) dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '2'); } $perms = 1; if ($perms && isset($extrafields->attributes[$this->table_element]['perms'][$key])) { - $perms = dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '2'); + $perms = (int) dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '2'); } if (empty($enabled)) { continue; // 0 = Never visible field @@ -6180,12 +6180,12 @@ abstract class CommonObject $enabled = 1; if (isset($this->fields[$key]['enabled'])) { - $enabled = dol_eval($this->fields[$key]['enabled'], 1, 1, '1'); + $enabled = (int) dol_eval($this->fields[$key]['enabled'], 1, 1, '1'); } /*$perms = 1; if (isset($this->fields[$key]['perms'])) { - $perms = dol_eval($this->fields[$key]['perms'], 1, 1, '1'); + $perms = (int) dol_eval($this->fields[$key]['perms'], 1, 1, '1'); }*/ if (empty($enabled)) { continue; @@ -8596,7 +8596,7 @@ abstract class CommonObject // Test on 'enabled' ('enabled' is different than 'list' = 'visibility') $enabled = 1; if ($enabled && isset($extrafields->attributes[$this->table_element]['enabled'][$key])) { - $enabled = dol_eval($extrafields->attributes[$this->table_element]['enabled'][$key], 1, 1, '2'); + $enabled = (int) dol_eval($extrafields->attributes[$this->table_element]['enabled'][$key], 1, 1, '2'); } if (empty($enabled)) { continue; @@ -8604,12 +8604,12 @@ abstract class CommonObject $visibility = 1; if ($visibility && isset($extrafields->attributes[$this->table_element]['list'][$key])) { - $visibility = dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '2'); + $visibility = (int) dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '2'); } $perms = 1; if ($perms && isset($extrafields->attributes[$this->table_element]['perms'][$key])) { - $perms = dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '2'); + $perms = (int) dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '2'); } if (($mode == 'create') && abs($visibility) != 1 && abs($visibility) != 3) { diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 7bcdab198e0..a7b6cc9ac22 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -966,9 +966,9 @@ class ExtraFields $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; $required = $this->attributes[$extrafieldsobjectkey]['required'][$key]; $param = $this->attributes[$extrafieldsobjectkey]['param'][$key]; - $perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '2'); + $perms = (int) dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '2'); $langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key]; - $list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '2'); + $list = (string) dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '2'); $totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key]; $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; $hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) @@ -1649,9 +1649,9 @@ class ExtraFields $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; $required = $this->attributes[$extrafieldsobjectkey]['required'][$key]; $param = $this->attributes[$extrafieldsobjectkey]['param'][$key]; - $perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '2'); + $perms = (int) dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '2'); $langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key]; - $list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '2'); + $list = (string) dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '2'); $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; $hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) @@ -2154,17 +2154,17 @@ class ExtraFields $enabled = 1; if (isset($this->attributes[$object->table_element]['enabled'][$key])) { // 'enabled' is often a condition on module enabled or not - $enabled = dol_eval($this->attributes[$object->table_element]['enabled'][$key], 1, 1, '2'); + $enabled = (int) dol_eval($this->attributes[$object->table_element]['enabled'][$key], 1, 1, '2'); } $visibility = 1; if (isset($this->attributes[$object->table_element]['list'][$key])) { // 'list' is option for visibility - $visibility = intval(dol_eval($this->attributes[$object->table_element]['list'][$key], 1, 1, '2')); + $visibility = (int) dol_eval($this->attributes[$object->table_element]['list'][$key], 1, 1, '2'); } $perms = 1; if (isset($this->attributes[$object->table_element]['perms'][$key])) { - $perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1, 1, '2'); + $perms = (int) dol_eval($this->attributes[$object->table_element]['perms'][$key], 1, 1, '2'); } if (empty($enabled) || ( diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cc55f91e448..21e33db578e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8235,7 +8235,7 @@ class Form if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) $tmpfieldstoshow = ''; foreach ($objecttmp->fields as $key => $val) { - if (!dol_eval($val['enabled'], 1, 1, '1')) { + if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { continue; } if (!empty($val['showoncombobox'])) { diff --git a/htdocs/core/class/menu.class.php b/htdocs/core/class/menu.class.php index 0b908997d15..6b93331127e 100644 --- a/htdocs/core/class/menu.class.php +++ b/htdocs/core/class/menu.class.php @@ -119,7 +119,6 @@ class Menu { $nb = 0; foreach ($this->liste as $val) { - //if (dol_eval($val['enabled'], 1, 1, '1')) $nb++; if (!empty($val['enabled'])) { $nb++; // $val['enabled'] is already evaluated to 0 or 1, no need for dol_eval() } diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index ebda232e331..25dc836be3c 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -434,7 +434,7 @@ class Menubase $this->title = $obj->title; $this->prefix = $obj->prefix; $this->langs = $obj->langs; - $this->perms = $obj->perms; + $this->perms = str_replace("\"", "'", $obj->perms); $this->enabled = str_replace("\"", "'", $obj->enabled); $this->user = $obj->user; $this->tms = $this->db->jdate($obj->tms); @@ -665,7 +665,7 @@ class Menubase if (isset($menu['perms'])) { $tmpcond = $menu['perms']; if ($leftmenu == 'all') { - $tmpcond = preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z_]+/', '1==1', $tmpcond); // Force part of condition to true + $tmpcond = preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z_]+/', '1==1', $tmpcond); // Force the part of condition on leftmenu to true } $perms = verifCond($tmpcond); //print "verifCond rowid=".$menu['rowid']." ".$tmpcond.":".$perms."
\n"; @@ -676,7 +676,7 @@ class Menubase if (isset($menu['enabled'])) { $tmpcond = $menu['enabled']; if ($leftmenu == 'all') { - $tmpcond = preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z_]+/', '1==1', $tmpcond); // Force part of condition to true + $tmpcond = preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z_]+/', '1==1', $tmpcond); // Force the part of condition on leftmenu to true } $enabled = verifCond($tmpcond); //var_dump($menu['type'].' - '.$menu['titre'].' - '.$menu['enabled'].' => '.$enabled); diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 5cd303acaa0..96daa0479f8 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -727,7 +727,6 @@ class Translate return $str; } else { // Translation is not available - //if ($key[0] == '$') { return dol_eval($key, 1, 1, '1'); } return $this->getTradFromKey($key); } } @@ -796,9 +795,6 @@ class Translate return $str; } else { - /*if ($key[0] == '$') { - return dol_eval($key, 1, 1, '1'); - }*/ return $this->getTradFromKey($key); } } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index c5209a3790d..d18aa3c8fd2 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1089,9 +1089,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl if (!empty($extrafields->attributes[$contactstatic->table_element]['list'][$key])) { $arrayfields["ef.".$key] = array( 'label'=>$extrafields->attributes[$contactstatic->table_element]['label'][$key], - 'checked'=>((dol_eval($extrafields->attributes[$contactstatic->table_element]['list'][$key], 1, 1, '1') < 0) ? 0 : 1), + 'checked'=>(((int) dol_eval($extrafields->attributes[$contactstatic->table_element]['list'][$key], 1, 1, '1') < 0) ? 0 : 1), 'position'=>1000 + $extrafields->attributes[$contactstatic->table_element]['pos'][$key], - 'enabled' => (abs((int) dol_eval($extrafields->attributes[$contactstatic->table_element]['list'][$key], 1)) != 3 && dol_eval($extrafields->attributes[$contactstatic->table_element]['perms'][$key], 1, 1, '1')) + 'enabled' => (abs((int) dol_eval($extrafields->attributes[$contactstatic->table_element]['list'][$key], 1)) != 3 && (int) dol_eval($extrafields->attributes[$contactstatic->table_element]['perms'][$key], 1, 1, '1')) ); } } diff --git a/htdocs/core/lib/customreports.lib.php b/htdocs/core/lib/customreports.lib.php index 496b5a605ac..1359fae99a1 100644 --- a/htdocs/core/lib/customreports.lib.php +++ b/htdocs/core/lib/customreports.lib.php @@ -65,7 +65,7 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu // Add main fields of object foreach ($object->fields as $key => $val) { - if (!empty($val['isameasure']) && (!isset($val['enabled']) || dol_eval($val['enabled'], 1, 1, '1'))) { + if (!empty($val['isameasure']) && (!isset($val['enabled']) || (int) dol_eval($val['enabled'], 1, 1, '1'))) { $position = (empty($val['position']) ? 0 : intval($val['position'])); $arrayofmesures[$tablealias.'.'.$key.'-sum'] = array( 'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($val['label']).' ('.$langs->trans("Sum").')', @@ -100,7 +100,7 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu // Add extrafields to Measures if (!empty($object->isextrafieldmanaged) && isset($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { + if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || (int) dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { $position = (!empty($val['position']) ? $val['position'] : 0); $arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-sum'] = array( 'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Sum").')', @@ -206,10 +206,10 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis, 'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) { continue; } - if (isset($val['enabled']) && !dol_eval($val['enabled'], 1, 1, '1')) { + if (isset($val['enabled']) && ! (int) dol_eval($val['enabled'], 1, 1, '1')) { continue; } - if (isset($val['visible']) && !dol_eval($val['visible'], 1, 1, '1')) { + if (isset($val['visible']) && ! (int) dol_eval($val['visible'], 1, 1, '1')) { continue; } if (preg_match('/^fk_/', $key) && !preg_match('/^fk_statu/', $key)) { @@ -371,10 +371,10 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup 'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) { continue; } - if (isset($val['enabled']) && !dol_eval($val['enabled'], 1, 1, '1')) { + if (isset($val['enabled']) && ! (int) dol_eval($val['enabled'], 1, 1, '1')) { continue; } - if (isset($val['visible']) && !dol_eval($val['visible'], 1, 1, '1')) { + if (isset($val['visible']) && ! (int) dol_eval($val['visible'], 1, 1, '1')) { continue; } if (preg_match('/^fk_/', $key) && !preg_match('/^fk_statu/', $key)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c6795f8c777..25cc81e664c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9786,9 +9786,9 @@ function isStringVarMatching($var, $regextext, $matchrule = 1) * Verify if condition in string is ok or not * * @param string $strToEvaluate String with condition to check - * @param string $onlysimplestring '0' (deprecated, used for computed property of extrafields)=Accept all chars, + * @param string $onlysimplestring '0' (deprecated, do not use it anymore)=Accept all chars, * '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';', - * '2' (rarely used)=Accept also '[]' + * '2' (used for example for the compute property of extrafields)=Accept also '[]' * @return boolean True or False. Note: It returns also True if $strToEvaluate is ''. False if error */ function verifCond($strToEvaluate, $onlysimplestring = '1') @@ -9798,7 +9798,7 @@ function verifCond($strToEvaluate, $onlysimplestring = '1') if (isset($strToEvaluate) && $strToEvaluate !== '') { //var_dump($strToEvaluate); //$rep = dol_eval($strToEvaluate, 1, 0, '1'); // to show the error - $rep = dol_eval($strToEvaluate, 1, 1, $onlysimplestring); // The dol_eval() must contains all the "global $xxx;" for all variables $xxx found into the string condition + $rep = (int) dol_eval($strToEvaluate, 1, 1, $onlysimplestring); // The dol_eval() must contains all the "global $xxx;" for all variables $xxx found into the string condition $rights = $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false); //var_dump($rights); } @@ -9810,15 +9810,15 @@ function verifCond($strToEvaluate, $onlysimplestring = '1') * This function is called by verifCond() or trans() and transnoentitiesnoconv(). * * @param string $s String to evaluate - * @param int $returnvalue 0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)). + * @param int $returnvalue 0=No return (deprecated, used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)). * @param int $hideerrors 1=Hide errors - * @param string $onlysimplestring '0' (deprecated, used for computed property of extrafields)=Accept all chars, + * @param string $onlysimplestring '0' (deprecated, do not use it anymore)=Accept all chars, * '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';', - * '2' (rarely used)=Accept also '[]' + * '2' (used for example for the compute property of extrafields)=Accept also '[]' * @return mixed Nothing or return result of eval * @see verifCond() */ -function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1') +function dol_eval($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1') { // Only this global variables can be read by eval function and returned to caller global $conf; // Read of const is done with getDolGlobalString() but we need $conf->currency for example @@ -9837,10 +9837,14 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' try { // Test on dangerous char (used for RCE), we allow only characters to make PHP variable testing - if ($onlysimplestring == '1') { - // We must accept: '1 && getDolGlobalInt("doesnotexist1") && getDolGlobalString("MAIN_FEATURES_LEVEL")' - // We must accept: '$user->hasRight("cabinetmed", "read") && !$object->canvas=="patient@cabinetmed"' + if ($onlysimplestring == '1' || $onlysimplestring == '2') { + // We must accept with 1: '1 && getDolGlobalInt("doesnotexist1") && getDolGlobalString("MAIN_FEATURES_LEVEL")' + // We must accept with 1: '$user->hasRight("cabinetmed", "read") && !$object->canvas=="patient@cabinetmed"' + // We must accept with 2: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found" $specialcharsallowed = '^$_+-.*>&|=!?():"\',/@'; + if ($onlysimplestring == '2') { + $specialcharsallowed .= '[]'; + } if (getDolGlobalString('MAIN_ALLOW_UNSECURED_SPECIAL_CHARS_IN_DOL_EVAL')) { $specialcharsallowed .= getDolGlobalString('MAIN_ALLOW_UNSECURED_SPECIAL_CHARS_IN_DOL_EVAL'); } @@ -9866,50 +9870,15 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' //print 'scheck='.$scheck." : ".strpos($scheck, '(')."
\n"; if (strpos($scheck, '(') !== false) { if ($returnvalue) { - return 'Bad string syntax to evaluate (mode 1, found call of a function or method without using the direct name of the function): '.$s; + return 'Bad string syntax to evaluate (mode '.$onlysimplestring.', found call of a function or method without using the direct name of the function): '.$s; } else { - dol_syslog('Bad string syntax to evaluate (mode 1, found call of a function or method without using the direct name of the function): '.$s); + dol_syslog('Bad string syntax to evaluate (mode '.$onlysimplestring.', found call of a function or method without using the direct name of the function): '.$s); return ''; } } // TODO - // We can exclude $ char that are not: $db, $langs, $leftmenu, $topmenu, $user, $langs, $objectoffield, $object..., - } elseif ($onlysimplestring == '2') { - // We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found" - $specialcharsallowed = '^$_+-.*>&|=!?():"\',/@[]'; - if (getDolGlobalString('MAIN_ALLOW_UNSECURED_SPECIAL_CHARS_IN_DOL_EVAL')) { - $specialcharsallowed .= getDolGlobalString('MAIN_ALLOW_UNSECURED_SPECIAL_CHARS_IN_DOL_EVAL'); - } - if (preg_match('/[^a-z0-9\s'.preg_quote($specialcharsallowed, '/').']/i', $s)) { - if ($returnvalue) { - return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s; - } else { - dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s); - return ''; - } - } - $savescheck = ''; - $scheck = $s; - while ($scheck && $savescheck != $scheck) { - $savescheck = $scheck; - $scheck = preg_replace('/->[a-zA-Z0-9_]+\(/', '->__METHOD__', $scheck); // accept parenthesis in '...->method(...' - $scheck = preg_replace('/^\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '(...'. Must replace with __PARENTHESIS__ with a space after to allow following substitutions - $scheck = preg_replace('/\s\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '... ('. Must replace with __PARENTHESIS__ with a space after to allow following substitutions - $scheck = preg_replace('/^!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in 'function(' and '!function(' - $scheck = preg_replace('/\s!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in '... function(' and '... !function(' - $scheck = preg_replace('/(\^|\')\(/', '__REGEXSTART__', $scheck); // To allow preg_match('/^(aaa|bbb)/'... or isStringVarMatching('leftmenu', '(aaa|bbb)') - } - //print 'scheck='.$scheck." : ".strpos($scheck, '(')."
\n"; - if (strpos($scheck, '(') !== false) { - if ($returnvalue) { - return 'Bad string syntax to evaluate (mode 2, found call of a function or method without using the direct name of the function): '.$s; - } else { - dol_syslog('Bad string syntax to evaluate (mode 2, found call of a function or method without using the direct name of the function): '.$s); - return ''; - } - } - // TODO - // We can exclude $ char that are not: $db, $leftmenu, $topmenu, $user, $langs, $object..., + // We can exclude $ char that are not: + // $db, $langs, $leftmenu, $topmenu, $user, $langs, $objectoffield, $object..., } if (is_array($s) || $s === 'Array') { return 'Bad string syntax to evaluate (value is Array) '.var_export($s, true); @@ -9949,7 +9918,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("get_defined_functions", "get_defined_vars", "get_defined_constants", "get_declared_classes")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func")); - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once")); + //$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities $forbiddenphpmethods = array('invoke', 'invokeArgs'); // Method of ReflectionFunction to execute a function @@ -9979,11 +9948,26 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' //print $s."
\n"; if ($returnvalue) { if ($hideerrors) { - return @eval('return '.$s.';'); + ob_start(); // An evaluation has no reason to output data + $tmps = @eval('return '.$s.';'); + $tmpo = ob_get_contents(); + ob_clean(); // End of interception of data + if ($tmpo) { + print 'Bad string syntax to evaluate. Some data were output when it should not when evaluating: '.$s; + } + return $tmps; } else { - return eval('return '.$s.';'); + ob_start(); // An evaluation has no reason to output data + $tmps = eval('return '.$s.';'); + $tmpo = ob_get_contents(); + ob_clean(); // End of interception of data + if ($tmpo) { + print 'Bad string syntax to evaluate. Some data were output when it should not when evaluating: '.$s; + } + return $tmps; } } else { + dol_syslog('Do not use anymore dol_eval with param returnvalue=0', LOG_WARNING); if ($hideerrors) { @eval($s); } else { diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 7c1f4a94a15..04d75f0e844 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -99,7 +99,7 @@ print "\n"; if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafields->attributes[$elementtype]['type']) && count($extrafields->attributes[$elementtype]['type'])) { foreach ($extrafields->attributes[$elementtype]['type'] as $key => $value) { - /*if (! dol_eval($extrafields->attributes[$elementtype]['enabled'][$key], 1, 1, '1')) { + /*if (! (int) dol_eval($extrafields->attributes[$elementtype]['enabled'][$key], 1, 1, '1')) { // TODO Uncomment this to exclude extrafields of modules not enabled. Add a link to "Show extrafields disabled" // continue; }*/ diff --git a/htdocs/core/tpl/extrafields_list_array_fields.tpl.php b/htdocs/core/tpl/extrafields_list_array_fields.tpl.php index 46ad5391035..e7f745cedf7 100644 --- a/htdocs/core/tpl/extrafields_list_array_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_array_fields.tpl.php @@ -24,9 +24,9 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table $arrayfields[$extrafieldsobjectprefix.$key] = array( 'label' => $extrafields->attributes[$extrafieldsobjectkey]['label'][$key], 'type' => $extrafields->attributes[$extrafieldsobjectkey]['type'][$key], - 'checked' => ((dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1') <= 0) ? 0 : 1), + 'checked' => (((int) dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1') <= 0) ? 0 : 1), 'position' => $extrafields->attributes[$extrafieldsobjectkey]['pos'][$key], - 'enabled' => (abs((int) dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1)) != 3 && dol_eval($extrafields->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1')), + 'enabled' => (abs((int) dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1)) != 3 && (int) dol_eval($extrafields->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1')), 'langfile' => $extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key], 'help' => $extrafields->attributes[$extrafieldsobjectkey]['help'][$key], ); diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 679a420df8c..b44df727362 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -35,7 +35,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield // If field is a computed field, we make computation to get value if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) { $objectoffield = $object; //For compatibility with the computed formula - $value = dol_eval($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1, 1, '2'); + $value = dol_eval((int) $extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1, 1, '2'); if (is_numeric(price2num($value)) && $extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key]) { $obj->$tmpkey = price2num($value); } diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 2867f2ec15e..347e611b8bf 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -74,15 +74,15 @@ if (empty($reshook) && !empty($object->table_element) && isset($extrafields->att $enabled = 1; if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra])) { - $enabled = dol_eval($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra], 1, 1, '2'); + $enabled = (int) dol_eval($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra], 1, 1, '2'); } if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra])) { - $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra], 1, 1, '2'); + $enabled = (int) dol_eval($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra], 1, 1, '2'); } $perms = 1; if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra])) { - $perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra], 1, 1, '2'); + $perms = (int) dol_eval($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra], 1, 1, '2'); } //print $tmpkeyextra.'-'.$enabled.'-'.$perms.'
'."\n"; diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index b04026109f3..273b560fa27 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -399,11 +399,11 @@ class InterfaceTicketEmail extends DolibarrTriggers foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $value) { $enabled = 1; if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$key])) { - $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1); + $enabled = (int) dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1); } $perms = 1; if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key])) { - $perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1); + $perms = (int) dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1); } $qualified = true; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 41caf186654..a2b370ba6f4 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -122,7 +122,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 94145c852e1..afb8f29d942 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -130,7 +130,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index c49cf2fbf14..c25fd3bff9c 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -764,7 +764,7 @@ class Export // Export of compute field does not work. $obj contains $obj->alias_field and formula may contains $obj->field // Also the formula may contains objects of class that are not loaded. $computestring = $this->array_export_special[$indice][$key]; - //$tmp = dol_eval($computestring, 1, 0, '1'); + //$tmp = (string) dol_eval($computestring, 1, 0, '2'); //$obj->$alias = $tmp; $this->error = "ERROPNOTSUPPORTED. Operation ".$computestring." not supported. Export of 'computed' extrafields is not yet supported, please remove field."; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index d412fa6d6ee..68f6d8f0af2 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -200,7 +200,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['cf.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 861b25a1507..20b8ee4359c 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -121,7 +121,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 24686b42715..9191162e979 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -120,7 +120,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index 69807b143f1..6c227add829 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -127,7 +127,7 @@ foreach ($objectposition->fields as $key => $val) { $arrayfields['t.' . $key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index c72b7d2af20..4b9666e4c79 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -121,7 +121,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index 7ae07c6a26f..d7b8e3d49ea 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -570,7 +570,7 @@ if ($action != "create" && $action != "edit") { $arrayfields['t.' . $key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 344e91be8dd..ea155ac684f 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -128,7 +128,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 9e77ee2e30e..f2ee512c004 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -123,7 +123,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 5fad24be651..013c41e3cce 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -84,7 +84,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 06cd5c81f7a..476a429d972 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -176,7 +176,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 535576c789c..c88168ed1b9 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -116,7 +116,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); @@ -127,7 +127,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible <= 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 452e03be496..c810e09f554 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -138,7 +138,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 8b57061e08e..d9ff6026f0d 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -115,7 +115,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 2d47c9a7e5e..88248cc0d8a 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -279,7 +279,7 @@ $arrayfields = array( $arrayfields['p.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), 'position'=>$val['position'] ); } diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index d41180191b7..ca5bcb5fded 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -124,7 +124,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 0b61dffa99d..bd1733bdf81 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -115,7 +115,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_list.php b/htdocs/product/stock/stocktransfer/stocktransfer_list.php index 864a9957c7f..d798b7556ac 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_list.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_list.php @@ -111,7 +111,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index aa1d3218a22..4477b2ad218 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -229,7 +229,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['p.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index f257972f69c..11a1c5fa5c5 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -267,7 +267,7 @@ if ($action == "view_ticketlist") { if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { if ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate') { - $enabled = abs(dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1, 1, '2')); + $enabled = abs((int) dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1, 1, '2')); $enabled = (($enabled == 0 || $enabled == 3) ? 0 : $enabled); $arrayfields["ef.".$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'checked' => ($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1, 'position' => $extrafields->attributes[$object->table_element]['pos'][$key], 'enabled' => $enabled && $extrafields->attributes[$object->table_element]['perms'][$key]); } diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 53f3ee74511..3284710c7eb 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -119,7 +119,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index b1e24a0fc52..bf62f0beb62 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -108,7 +108,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index aa8e62caf52..80e4dd7baf1 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -130,7 +130,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index a2e98275e2c..db0865ba994 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -142,7 +142,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index e7ba363e045..fdafc97e55b 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -546,7 +546,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index a5ea8eaf13b..1233793cd7d 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -146,7 +146,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 0b4d80bcefb..ea7a4ef554b 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -438,7 +438,7 @@ if ($object->id > 0) { if ($user->admin) { print ''; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 77ad13f1f75..d6372cfb6a6 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -695,7 +695,7 @@ if ($result) { if ($user->admin) { print ''; diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index 3fd8e4b3b4c..0bee01ba154 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -114,7 +114,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index d1c307ba730..cbcca8fbfe8 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -117,7 +117,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/webportal/class/html.formlistwebportal.class.php b/htdocs/webportal/class/html.formlistwebportal.class.php index c850c424377..7bdd0bc4311 100644 --- a/htdocs/webportal/class/html.formlistwebportal.class.php +++ b/htdocs/webportal/class/html.formlistwebportal.class.php @@ -189,7 +189,7 @@ class FormListWebPortal $arrayfields['t.' . $key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/webportal/class/html.formwebportal.class.php b/htdocs/webportal/class/html.formwebportal.class.php index eb1a26ceb70..ea4debb2348 100644 --- a/htdocs/webportal/class/html.formwebportal.class.php +++ b/htdocs/webportal/class/html.formwebportal.class.php @@ -447,7 +447,7 @@ class FormWebPortal extends Form if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) $tmpfieldstoshow = ''; foreach ($objecttmp->fields as $key => $val) { - if (!dol_eval($val['enabled'], 1, 1, '1')) { + if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { continue; } if (!empty($val['showoncombobox'])) { @@ -1021,7 +1021,7 @@ class FormWebPortal extends Form if ($computed) { // Make the eval of compute string //var_dump($computed); - $value = dol_eval($computed, 1, 0, ''); + $value = (string) dol_eval($computed, 1, 0, '2'); } // Format output value differently according to properties of field diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index 3ee747367d9..fb749bd6a4c 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -118,7 +118,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); @@ -128,7 +128,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['wug.fk_usergroup'] = array( 'label'=>$langs->trans('UserGroups'), 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>1000, 'help' => empty($val['help']) ? '' : $val['help'], 'csslist' => 'minwidth100' @@ -138,7 +138,7 @@ $arrayfields['wug.fk_usergroup'] = array( $arrayfields['wr.fk_resource'] = array( 'label'=>$langs->trans('Resources'), 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), 'position'=>1001, 'help' => empty($val['help']) ? '' : $val['help'] ); From c0ee90aa7d8d5094f01e04cc11b6d0ee3f6115b0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 17:13:05 +0100 Subject: [PATCH 0502/1862] Exclude require, include into dol_eval --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 25cc81e664c..8dac5976289 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9918,7 +9918,7 @@ function dol_eval($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1' $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("get_defined_functions", "get_defined_vars", "get_defined_constants", "get_declared_classes")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func")); - //$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities $forbiddenphpmethods = array('invoke', 'invokeArgs'); // Method of ReflectionFunction to execute a function From 8bc7027ced65668b942b18f07972882cb69e932d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 17:17:24 +0100 Subject: [PATCH 0503/1862] Fix help on status of menu condition --- htdocs/admin/menus/edit.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index ac40bfd21d0..42892fbb8b6 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -505,7 +505,7 @@ if ($action == 'create') { print ''; print ''; @@ -513,7 +513,7 @@ if ($action == 'create') { print ''; print ''; From 2d9801ffe33c22ea9d6c65a0b5bdd49e487712be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 15:01:25 +0100 Subject: [PATCH 0504/1862] Fix sec more complete list of forbidden function --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index cbf8fee96e0..181825a689e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9297,6 +9297,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("get_defined_functions", "get_defined_vars", "get_defined_constants", "get_declared_classes")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities $forbiddenphpmethods = array('invoke', 'invokeArgs'); // Method of ReflectionFunction to execute a function From 91b994b89ce6a5263bdedd36dff1c43141f6767a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 17:20:44 +0100 Subject: [PATCH 0505/1862] Prepare 18.0.6 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index cba47566c2b..9e1046d439f 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '18.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '18.0.6'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From 24059b0b8db2dcc64ea7b133f17ff4a5258834af Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 6 Mar 2024 17:24:23 +0100 Subject: [PATCH 0506/1862] get rows security --- htdocs/core/db/DoliDB.class.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 3b1184c7f85..4c0bfcbd0f3 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -385,6 +385,7 @@ abstract class DoliDB implements Database if ($res) { $obj = $this->fetch_object($res); if ($obj) { + $this->free($res); return $obj; } else { return 0; @@ -399,12 +400,17 @@ abstract class DoliDB implements Database * Note : This method executes a given SQL query and retrieves all row of results as an array of objects. It should only be used with SELECT queries * be careful with this method use it only with some limit of results to avoid performances loss. * - * @param string $sql The sql query string - * @return bool|array Result - * @deprecated + * @param string $sql The sql query string + * @param bool $noLimitCheck set it to true to disable sql query check of limit + * @return bool|array Result */ - public function getRows($sql) + public function getRows($sql, $noLimitCheck = false) { + + if (!$noLimitCheck && strpos($sql, 'LIMIT') === false) { + return false; + } + $res = $this->query($sql); if ($res) { $results = array(); @@ -413,6 +419,7 @@ abstract class DoliDB implements Database $results[] = $obj; } } + $this->free($res); return $results; } From 21ef87777230a746face1119830d9b873b483511 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2024 11:07:28 +0100 Subject: [PATCH 0507/1862] Remove not used email layout --- htdocs/core/class/html.formmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 606becf17c2..8c998f0cc50 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1521,7 +1521,7 @@ class FormMail extends Form 'basic' => 'basic', 'news' => 'news', 'commerce' => 'commerce', - 'text' => 'text' + //'text' => 'text' ); foreach ($templates as $template => $templateFunction) { From f00d3ff6ddd9b76b4dfd83076efe044b78c6b816 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2024 14:57:41 +0100 Subject: [PATCH 0508/1862] Fix route not complete --- .../template/class/api_mymodule.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index 1908a2a0b4b..e29e1a08911 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -64,7 +64,7 @@ class MyModuleApi extends DolibarrApi * @param int $id ID of myobject * @return Object Object with cleaned properties * - * @url GET myobjects/{id} + * @url GET mymodule/myobjects/{id} * * @throws RestException 403 Not allowed * @throws RestException 404 Not found @@ -103,7 +103,7 @@ class MyModuleApi extends DolibarrApi * @throws RestException 403 Not allowed * @throws RestException 503 System error * - * @url GET /myobjects/ + * @url GET /mymodule/myobjects/ */ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '') { @@ -191,7 +191,7 @@ class MyModuleApi extends DolibarrApi * @throws RestException 403 Not allowed * @throws RestException 500 System error * - * @url POST myobjects/ + * @url POST mymodule/myobjects/ */ public function post($request_data = null) { @@ -232,7 +232,7 @@ class MyModuleApi extends DolibarrApi * @throws RestException 404 Not found * @throws RestException 500 System error * - * @url PUT myobjects/{id} + * @url PUT mymodule/myobjects/{id} */ public function put($id, $request_data = null) { @@ -282,7 +282,7 @@ class MyModuleApi extends DolibarrApi * @throws RestException 409 Nothing to do * @throws RestException 500 System error * - * @url DELETE myobjects/{id} + * @url DELETE mymodule/myobjects/{id} */ public function delete($id) { From f45f1f6cfd787179c8acb590a7954ad452a1d00d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2024 15:00:08 +0100 Subject: [PATCH 0509/1862] Fix separator block for modulebuilder --- htdocs/modulebuilder/template/class/api_mymodule.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index e29e1a08911..7ff746c21fb 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -54,7 +54,7 @@ class MyModuleApi extends DolibarrApi $this->myobject = new MyObject($this->db); } - /*begin methods CRUD*/ + /* BEGIN MODULEBUILDER API MYOBJECT */ /** * Get properties of a myobject object @@ -336,7 +336,9 @@ class MyModuleApi extends DolibarrApi return $myobject; } - /*end methods CRUD*/ + /* END MODULEBUILDER API MYOBJECT */ + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** From 4dcf98b9f7d5e26dd4c4c62bc4a980e389cc61aa Mon Sep 17 00:00:00 2001 From: ATM-NicolasV <92087862+ATM-NicolasV@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:55:07 +0100 Subject: [PATCH 0510/1862] fix entity in sql from RemoveFromGroup (#28682) --- htdocs/user/class/user.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 1543d579839..0ec4d6fdf5a 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2377,7 +2377,11 @@ class User extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_user"; $sql .= " WHERE fk_user = ".((int) $this->id); $sql .= " AND fk_usergroup = ".((int) $group); - $sql .= " AND entity = ".((int) $entity); + if (empty($entity)) { + $sql .= " AND entity IN (0, 1)"; // group may be in entity 0 (so $entity=0) and link with user into entity 1. + } else { + $sql .= " AND entity = ".((int) $entity); + } $result = $this->db->query($sql); if ($result) { From 7bb55aa22528cf2ac35303a957113170ebc58af0 Mon Sep 17 00:00:00 2001 From: atm-adrien <67913809+atm-adrien@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:56:17 +0100 Subject: [PATCH 0511/1862] FIX : Translation for select (#28677) * FIX : Adding thez dependencies list feature for select fields * FIX : Adding some spaces * FIX : View * FIX : Translating --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 47060b949f4..9ef1f4c94f4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7330,7 +7330,7 @@ abstract class CommonObject $isDependList = 1; } $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); - $out .= '>'.$valb.''; + $out .= '>'.$langs->trans($valb).''; } $out .= ''; } elseif ($type == 'sellist') { @@ -7954,7 +7954,7 @@ abstract class CommonObject } elseif ($type == 'select') { $value = isset($param['options'][$value]) ? $param['options'][$value] : ''; if (strpos($value, "|") !== false) { - $value = explode('|', $value)[0]; + $value = $langs->trans(explode('|', $value)[0]); } } elseif ($type == 'sellist') { $param_list = array_keys($param['options']); From 18cc09fae69936cf194d83a699b2dbb2563bcacd Mon Sep 17 00:00:00 2001 From: thibdrev Date: Thu, 7 Mar 2024 16:02:14 +0100 Subject: [PATCH 0512/1862] qual: phan for htdocs/core/lib/ajax.lib.php (#28672) 29 entries for: Argument 3 ($entity) is null of type null but \ajax_constantonoff() takes int (no real type) defined at htdocs/core/lib/ajax.lib.php:645 --- htdocs/core/lib/ajax.lib.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 91f76b66cdd..81fe78a073c 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -628,19 +628,19 @@ function ajax_event($htmlname, $events) /** * On/off button for constant * - * @param string $code Name of constant - * @param array $input Array of complementary actions to do if success ("disabled"|"enabled'|'set'|'del') => CSS element to switch, 'alert' => message to show, ... Example: array('disabled'=>array(0=>'cssid')) - * @param int $entity Entity. Current entity is used if null. - * @param int $revertonoff 1=Revert on/off - * @param int $strict Use only "disabled" with delConstant and "enabled" with setConstant - * @param int $forcereload Force to reload page if we click/change value (this is supported only when there is no 'alert' option in input) - * @param int $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No left margin. - * @param int $forcenoajax 1 = Force to use a ahref link instead of ajax code. - * @param int $setzeroinsteadofdel 1 = Set constantto '0' instead of deleting it - * @param string $suffix Suffix to use on the name of the switch_on picto. Example: '', '_red' - * @param string $mode Add parameter &mode= to the href link (Used for href link) - * @param string $morecss More CSS - * @return string + * @param string $code Name of constant + * @param array $input Array of complementary actions to do if success ("disabled"|"enabled'|'set'|'del') => CSS element to switch, 'alert' => message to show, ... Example: array('disabled'=>array(0=>'cssid')) + * @param int|null $entity Entity. Current entity is used if null. + * @param int $revertonoff 1=Revert on/off + * @param int $strict Use only "disabled" with delConstant and "enabled" with setConstant + * @param int $forcereload Force to reload page if we click/change value (this is supported only when there is no 'alert' option in input) + * @param int $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No left margin. + * @param int $forcenoajax 1 = Force to use a ahref link instead of ajax code. + * @param int $setzeroinsteadofdel 1 = Set constantto '0' instead of deleting it + * @param string $suffix Suffix to use on the name of the switch_on picto. Example: '', '_red' + * @param string $mode Add parameter &mode= to the href link (Used for href link) + * @param string $morecss More CSS + * @return string */ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2, $forcenoajax = 0, $setzeroinsteadofdel = 0, $suffix = '', $mode = '', $morecss = 'inline-block') { From fcfc70e02a2145caf359b597c46cde6220bd4692 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Thu, 7 Mar 2024 16:02:57 +0100 Subject: [PATCH 0513/1862] qual: phpstan for htdocs/loan/class/loan.class.php (#28673) htdocs/loan/class/loan.class.php 113 PHPDoc type int of property Loan::$totalpaid is not covariant with PHPDoc type float of overridden property CommonObject::$totalpaid. --- htdocs/loan/class/loan.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 3eb5b1bdc45..20f51e90e78 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -108,7 +108,7 @@ class Loan extends CommonObject public $fk_project; /** - * @var int totalpaid + * @var float totalpaid */ public $totalpaid; From 38e69184d1a4943fb787b5502a3ce31adc688e28 Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 7 Mar 2024 16:04:39 +0100 Subject: [PATCH 0514/1862] Fix typing hints (#28676) --- htdocs/core/lib/functions.lib.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8dac5976289..30f5dc3b5b4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6890,7 +6890,7 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric if (($mysoc->country_code == $thirdpartytouse->country_code) || (in_array($mysoc->country_code, array('FR', 'MC')) && in_array($thirdpartytouse->country_code, array('FR', 'MC'))) || (in_array($mysoc->country_code, array('MQ', 'GP')) && in_array($thirdpartytouse->country_code, array('MQ', 'GP'))) - ) { + ) { // If country of thirdparty to consider is ours if ($idprodfournprice > 0) { // We want vat for product for a "supplier" object $result = $product->get_buyprice($idprodfournprice, 0, 0, 0); @@ -9756,13 +9756,13 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = } /** - * Check if a variable with name $var start with $text. + * Check if a variable with name $var startx with $text. * Can be used to forge dol_eval() conditions. * - * @param $var string Variable - * @param $regextext string Text that must be a valid regex string - * @param $matchrule int 1=Test if start with, 0=Test if equal - * @return boolean|string True or False, text if bad use. + * @param string $var Variable + * @param string $regextext Text that must be a valid regex string + * @param int $matchrule 1=Test if start with, 0=Test if equal + * @return boolean|string True or False, text if bad usage. */ function isStringVarMatching($var, $regextext, $matchrule = 1) { @@ -13078,6 +13078,8 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n } $histo = array(); + '@phan-var-force array $histo'; + $numaction = 0; $now = dol_now(); @@ -13157,7 +13159,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n } $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; - if ($force_filter_contact === false) { + if (!$force_filter_contact) { if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) { $sql .= " AND a.fk_soc = ".((int) $filterobj->id); } elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) { @@ -13285,6 +13287,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); + '@phan-var-force array{apicto:string,contact_id:string,dp:string,dp2:string,firstname:string,label:string,message:string,msg_from:string,ref:string,type:string,user_lastname:string} $obj'; if ($obj->type == 'action') { $contactaction = new ActionComm($db); $contactaction->id = $obj->id; From 2d8223eefb5a3e493a71a358626c64e051068034 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2024 16:16:49 +0100 Subject: [PATCH 0515/1862] Doc --- htdocs/admin/system/security.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 6ad04701a52..e19463934af 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -341,12 +341,13 @@ if (!getDolGlobalString('SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF')) { } print '$dolibarr_main_stream_to_disable: '; +// $arrayofstreamtodisable is defined into filefunc.inc.php if (empty($dolibarr_main_stream_to_disable)) { print ''.$langs->trans("Undefined").' = '.join(', ', $arrayofstreamtodisable).''; } else { print join(', ', $dolibarr_main_stream_to_disable); } -print ' -> PHP streams allowed = '; +print ' -> Current PHP streams allowed = '; $arrayofstreams = stream_get_wrappers(); if (!empty($arrayofstreams)) { sort($arrayofstreams); From 5e9dfc80902eeb494fd1399ee3e7a26cc643a0c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2024 16:38:02 +0100 Subject: [PATCH 0516/1862] Fix phan --- htdocs/accountancy/class/bookkeeping.class.php | 2 +- htdocs/hrm/class/job.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 362728c367b..fe307fe8915 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1231,7 +1231,7 @@ class BookKeeping extends CommonObject } elseif ($key == 't.reconciled_option') { $sqlwhere[] = 't.lettering_code IS NULL'; } else { - $sqlwhere[] = $this->db->sanitize($key)." LIKE '%".$this->escape($this->db->escapeforlike($value))."%'"; + $sqlwhere[] = $this->db->sanitize($key)." LIKE '%".$this->db->escape($this->db->escapeforlike($value))."%'"; } } } diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 684bc39b3c3..dbed9cad902 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -365,7 +365,7 @@ class Job extends CommonObject * @param string $filtermode No more used * @return array|int int <0 if KO, array of pages if OK */ - public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND') { dol_syslog(__METHOD__, LOG_DEBUG); From af9704acdcde8a9050b5fdd0cb4825456ec04f72 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Thu, 7 Mar 2024 16:41:39 +0100 Subject: [PATCH 0517/1862] qual: phpdoc for htdocs/core/lib/pdf.lib.php (#28671) --- htdocs/core/lib/pdf.lib.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 4cfac0f4413..7d342e152a3 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -429,7 +429,7 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali * @param Contact|string|null $targetcontact Target contact object * @param int $usecontact Use contact instead of company * @param string $mode Address type ('source', 'target', 'targetwithdetails', 'targetwithdetails_xxx': target but include also phone/fax/email/url) - * @param Object $object Object we want to build document for + * @param Object|null $object Object we want to build document for * @return string|int String with full address or -1 if KO */ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $targetcontact = '', $usecontact = 0, $mode = 'source', $object = null) @@ -718,7 +718,7 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t /** * Show header of page for PDF generation * - * @param TCPDF $pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Translate $outputlangs Object lang for output * @param int $page_height Height of page * @return void @@ -752,11 +752,11 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height) /** * Return array of possible substitutions for PDF content (without external module substitutions). * - * @param Translate $outputlangs Output language - * @param array $exclude Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...) - * @param Object $object Object - * @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip) - * @param array $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...) + * @param Translate $outputlangs Output language + * @param array|null $exclude Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...) + * @param Object|null $object Object + * @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip) + * @param array|null $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...) * @return array Array of substitutions */ function pdf_getSubstitutionArray($outputlangs, $exclude = null, $object = null, $onlykey = 0, $include = null) @@ -2296,11 +2296,11 @@ function pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails = 0) /** * Return line percent * - * @param Object $object Object - * @param int $i Current line number - * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @param HookManager $hookmanager Hook manager instance + * @param Object $object Object + * @param int $i Current line number + * @param Translate $outputlangs Object langs for output + * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @param HookManager|null $hookmanager Hook manager instance * @return string */ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null) From 1aa0f8227f2b5d872fbe9005dc95c90fd23a8c84 Mon Sep 17 00:00:00 2001 From: Rikard Bosnjakovic Date: Thu, 7 Mar 2024 16:43:04 +0100 Subject: [PATCH 0518/1862] Update card.php (#28679) Fix #25130 Co-authored-by: Laurent Destailleur --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index f0e85472b80..4fdefef202b 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2763,7 +2763,7 @@ if ($action == 'create') { // Presend form $modelmail = 'shipping_send'; - $defaulttopic = $langs->trans('SendShippingRef'); + $defaulttopic = 'SendShippingRef'; $diroutput = $conf->expedition->dir_output.'/sending'; $trackid = 'shi'.$object->id; From 8870be3c3d211385f7a7061fb5eef4ee5cb3790d Mon Sep 17 00:00:00 2001 From: Rikard Bosnjakovic Date: Thu, 7 Mar 2024 16:43:04 +0100 Subject: [PATCH 0519/1862] Update card.php (#28679) Fix #25130 Co-authored-by: Laurent Destailleur --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index fd83a09ab0e..45cbba28344 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2762,7 +2762,7 @@ if ($action == 'create') { // Presend form $modelmail = 'shipping_send'; - $defaulttopic = $langs->trans('SendShippingRef'); + $defaulttopic = 'SendShippingRef'; $diroutput = $conf->expedition->dir_output.'/sending'; $trackid = 'shi'.$object->id; From 4fcbdf15ab3acdd163cd854de3c4da330f686723 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Thu, 7 Mar 2024 16:49:41 +0100 Subject: [PATCH 0520/1862] fix: better inner join than comma for hook printFieldListFrom after (#28681) * better inner jion than comme for hook after * better inner jion than comme for hook after --------- Co-authored-by: Laurent Destailleur --- htdocs/comm/propal/list.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 88cec014878..0a03d0cc1cd 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -77,6 +77,7 @@ $mode = GETPOST('mode', 'alpha'); // Search Fields $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_user = GETPOSTINT('search_user'); +if ($search_user==-1) $search_user=0; $search_sale = GETPOSTINT('search_sale'); $search_ref = GETPOST('sf_ref') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_refcustomer = GETPOST('search_refcustomer', 'alpha'); @@ -587,7 +588,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; -$sql .= ', '.MAIN_DB_PREFIX.'propal as p'; +$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'propal as p ON p.fk_soc = s.rowid'; if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)"; } @@ -598,8 +599,10 @@ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON p.fk_user_author = u.rowid'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr ON pr.rowid = p.fk_projet"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_availability as ava on (ava.rowid = p.fk_availability)"; if ($search_user > 0) { - $sql .= ", ".MAIN_DB_PREFIX."element_contact as c"; - $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_contact as c"; + $sql .= " ON c.element_id = p.rowid AND c.fk_socpeople = ".((int) $search_user); + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_type_contact as tc"; + $sql .= " ON c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal'"; } // Add table from hooks @@ -607,8 +610,8 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -$sql .= ' WHERE p.fk_soc = s.rowid'; -$sql .= ' AND p.entity IN ('.getEntity('propal').')'; +$sql .= ' WHERE'; +$sql .= ' p.entity IN ('.getEntity('propal').')'; if ($search_town) { $sql .= natural_search('s.town', $search_town); } @@ -718,9 +721,6 @@ if ($search_date_delivery_start) { if ($search_date_delivery_end) { $sql .= " AND p.date_livraison <= '".$db->idate($search_date_delivery_end)."'"; } -if ($search_user > 0) { - $sql .= " AND c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".((int) $search_user); -} if ($search_date_signature_start) { $sql .= " AND p.date_signature >= '".$db->idate($search_date_signature_start)."'"; } @@ -1147,7 +1147,7 @@ if ($search_date_signature_endyear) { if ($user->hasRight('user', 'user', 'lire')) { $moreforfilter .= '
'; $tmptitle = $langs->trans('LinkedToSpecificUsers'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers((empty($search_user)?-2:0), 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx'); $moreforfilter .= '
'; } // If the user can view products From 5659ba8de35a43715d1a53203a444bcb464f4a2b Mon Sep 17 00:00:00 2001 From: thibdrev Date: Thu, 7 Mar 2024 16:50:42 +0100 Subject: [PATCH 0521/1862] qual: phan for accountingaccount.class.php (#28669) htdocs/accountancy/admin/productaccount.php 196 TypeError PhanTypeMismatchArgumentProbablyReal Argument 2 ($account_number) is null of type null but \AccountingAccount::fetch() takes string (no real type) defined at htdocs/accountancy/class/accountingaccount.class.php:182 (the inferred real argument type has nothing in common with the parameter's phpdoc type) Co-authored-by: Laurent Destailleur --- htdocs/accountancy/class/accountingaccount.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 057c307e1f6..500fd4a7543 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -174,7 +174,7 @@ class AccountingAccount extends CommonObject * Load record in memory * * @param int $rowid Id - * @param string $account_number Account number + * @param string|null $account_number Account number * @param int|boolean $limittocurrentchart 1 or true=Load record only if it is into current active chart of account * @param string $limittoachartaccount 'ABC'=Load record only if it is into chart account with code 'ABC' (better and faster than previous parameter if you have chart of account code). * @return int Return integer <0 if KO, 0 if not found, Id of record if OK and found From b9c843c08687c89631eb0d845ef90b5931396a85 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Thu, 7 Mar 2024 16:55:12 +0100 Subject: [PATCH 0522/1862] qual: phan for functions.lib.php (#28653) * qual: phan for functions.lib.php 54 entries for: TypeError PhanTypeMismatchArgumentProbablyReal Argument 3 ($exclude) is null of type null but \getCommonSubstitutionArray() takes array (no real type) defined at htdocs/core/lib/functions.lib.php:8285 * phpcs --- htdocs/core/lib/functions.lib.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 30f5dc3b5b4..af156d0442f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8274,12 +8274,13 @@ function dol_concatdesc($text1, $text2, $forxml = false, $invert = false) /** * Return array of possible common substitutions. This includes several families like: 'system', 'mycompany', 'object', 'objectamount', 'date', 'user' * - * @param Translate $outputlangs Output language - * @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are trunc and html sanitized (to use for help tooltip) - * @param array $exclude Array of family keys we want to exclude. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...) - * @param Object $object Object for keys on object - * @param array $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...) - * @return array Array of substitutions + * @param Translate $outputlangs Output language + * @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), + * 2=Values are trunc and html sanitized (to use for help tooltip) + * @param array|null $exclude Array of family keys we want to exclude. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...) + * @param Object|null $object Object for keys on object + * @param array|null $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...) + * @return array Array of substitutions * @see setSubstitFromObject() */ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $object = null, $include = null) From 14ffa142aa7d4e7b1b5d6787008a0472e4bd4456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 7 Mar 2024 16:57:29 +0100 Subject: [PATCH 0523/1862] fix precommit and clean code (#28651) * fix precommit * fix precommit * fix missing include * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * clean code * clean code --- htdocs/bookcal/lib/bookcal.lib.php | 7 ++- .../lib/bookcal_availabilities.lib.php | 21 +++---- htdocs/bookcal/lib/bookcal_calendar.lib.php | 23 ++++---- htdocs/comm/card.php | 1 + htdocs/core/class/html.formsms.class.php | 22 ++++++- .../doc/pdf_aurore.modules.php | 2 +- .../doc/pdf_zenith.modules.php | 2 +- .../emailcollector/lib/emailcollector.lib.php | 5 +- ...ventorganization_conferenceorbooth.lib.php | 57 ++++++++++--------- htdocs/loan/class/paymentloan.class.php | 7 ++- htdocs/mrp/ajax/interface.php | 17 ++++++ htdocs/mrp/lib/mrp.lib.php | 11 ++-- htdocs/mrp/lib/mrp_mo.lib.php | 27 ++++----- htdocs/mrp/mo_agenda.php | 6 +- htdocs/mrp/mo_document.php | 7 ++- htdocs/mrp/mo_movements.php | 5 +- htdocs/mrp/mo_note.php | 5 +- htdocs/mrp/mo_production.php | 3 +- htdocs/partnership/lib/partnership.lib.php | 31 +++++----- htdocs/product/class/product.class.php | 13 ++++- htdocs/recruitment/lib/recruitment.lib.php | 18 +++--- ...recruitment_recruitmentcandidature.lib.php | 21 +++---- ...recruitment_recruitmentjobposition.lib.php | 33 +++++------ htdocs/societe/class/client.class.php | 9 ++- htdocs/theme/eldy/flags-sprite.inc.php | 24 +++++++- htdocs/theme/eldy/global.inc.php | 22 +++++++ htdocs/theme/eldy/main_menu_fa_icons.inc.php | 30 +++++++++- htdocs/webhook/lib/webhook.lib.php | 7 ++- htdocs/webhook/lib/webhook_target.lib.php | 7 ++- htdocs/webportal/lib/webportal.lib.php | 6 +- htdocs/website/lib/websiteaccount.lib.php | 6 +- htdocs/zapier/lib/zapier.lib.php | 10 ++-- 32 files changed, 302 insertions(+), 163 deletions(-) diff --git a/htdocs/bookcal/lib/bookcal.lib.php b/htdocs/bookcal/lib/bookcal.lib.php index 3f809da08d8..049de3c6472 100644 --- a/htdocs/bookcal/lib/bookcal.lib.php +++ b/htdocs/bookcal/lib/bookcal.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +17,7 @@ */ /** - * \file bookcal/lib/bookcal.lib.php + * \file htdocs/bookcal/lib/bookcal.lib.php * \ingroup bookcal * \brief Library files with common functions for BookCal */ @@ -35,13 +36,13 @@ function bookcalAdminPrepareHead() $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/bookcal/admin/setup.php", 1); + $head[$h][0] = DOL_URL_ROOT . '/bookcal/admin/setup.php'; $head[$h][1] = $langs->trans("Settings"); $head[$h][2] = 'settings'; $h++; /* - $head[$h][0] = dol_buildpath("/bookcal/admin/myobject_extrafields.php", 1); + $head[$h][0] = DOL_URL_ROOT.'/bookcal/admin/myobject_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); $head[$h][2] = 'myobject_extrafields'; $h++; diff --git a/htdocs/bookcal/lib/bookcal_availabilities.lib.php b/htdocs/bookcal/lib/bookcal_availabilities.lib.php index 1fb93187f94..674c0ea70bb 100644 --- a/htdocs/bookcal/lib/bookcal_availabilities.lib.php +++ b/htdocs/bookcal/lib/bookcal_availabilities.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,13 +42,13 @@ function availabilitiesPrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/bookcal/availabilities_card.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/bookcal/availabilities_card.php?id=' . $object->id; $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h++; if ($showtabofpagecontact) { - $head[$h][0] = dol_buildpath("/bookcal/availabilities_contact.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/bookcal/availabilities_contact.php?id=' . $object->id; $head[$h][1] = $langs->trans("Contacts"); $head[$h][2] = 'contact'; $h++; @@ -62,10 +63,10 @@ function availabilitiesPrepareHead($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = dol_buildpath('/bookcal/availabilities_note.php', 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/bookcal/availabilities_note.php?id=' . $object->id; $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { - $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? ''.$nbNote.'' : ''); + $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '' . $nbNote . '' : ''); } $head[$h][2] = 'note'; $h++; @@ -73,22 +74,22 @@ function availabilitiesPrepareHead($object) } if ($showtabofpagedocument) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->bookcal->dir_output."/availabilities/".dol_sanitizeFileName($object->ref); + require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; + $upload_dir = $conf->bookcal->dir_output . "/availabilities/" . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = dol_buildpath("/bookcal/availabilities_document.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/bookcal/availabilities_document.php?id=' . $object->id; $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) { - $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + $head[$h][1] .= '' . ($nbFiles + $nbLinks) . ''; } $head[$h][2] = 'document'; $h++; } if ($showtabofpageagenda) { - $head[$h][0] = dol_buildpath("/bookcal/availabilities_agenda.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/bookcal/availabilities_agenda.php?id=' . $object->id; $head[$h][1] = $langs->trans("Events"); $head[$h][2] = 'agenda'; $h++; diff --git a/htdocs/bookcal/lib/bookcal_calendar.lib.php b/htdocs/bookcal/lib/bookcal_calendar.lib.php index f586c8845df..d81d0f85d2e 100644 --- a/htdocs/bookcal/lib/bookcal_calendar.lib.php +++ b/htdocs/bookcal/lib/bookcal_calendar.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,13 +42,13 @@ function calendarPrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/bookcal/calendar_card.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/bookcal/calendar_card.php?id=' . $object->id; $head[$h][1] = $langs->trans("Calendar"); $head[$h][2] = 'card'; $h++; if ($object->status == Calendar::STATUS_VALIDATED) { - $head[$h][0] = dol_buildpath("/bookcal/booking_list.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/bookcal/booking_list.php?id=' . $object->id; $head[$h][1] = $langs->trans("Bookings"); $head[$h][2] = 'booking'; $h++; @@ -55,7 +56,7 @@ function calendarPrepareHead($object) if ($showtabofpagecontact) { - $head[$h][0] = dol_buildpath("/bookcal/calendar_contact.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/bookcal/calendar_contact.php?id=' . $object->id; $head[$h][1] = $langs->trans("Contacts"); $head[$h][2] = 'contact'; $h++; @@ -70,10 +71,10 @@ function calendarPrepareHead($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = dol_buildpath('/bookcal/calendar_note.php', 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/bookcal/calendar_note.php?id=' . $object->id; $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { - $head[$h][1] .= (!getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') ? ''.$nbNote.'' : ''); + $head[$h][1] .= (!getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') ? '' . $nbNote . '' : ''); } $head[$h][2] = 'note'; $h++; @@ -81,22 +82,22 @@ function calendarPrepareHead($object) } if ($showtabofpagedocument) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->bookcal->dir_output."/calendar/".dol_sanitizeFileName($object->ref); + require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; + $upload_dir = $conf->bookcal->dir_output . "/calendar/" . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = dol_buildpath("/bookcal/calendar_document.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/bookcal/calendar_document.php?id=' . $object->id; $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) { - $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + $head[$h][1] .= '' . ($nbFiles + $nbLinks) . ''; } $head[$h][2] = 'document'; $h++; } if ($showtabofpageagenda) { - $head[$h][0] = dol_buildpath("/bookcal/calendar_agenda.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/bookcal/calendar_agenda.php?id=' . $object->id; $head[$h][1] = $langs->trans("Events"); $head[$h][2] = 'agenda'; $h++; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 0b07926aad8..4a20bf2dc9e 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -36,6 +36,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index f9cecb96867..4aa0bd0ed61 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,6 +41,10 @@ class FormSms public $fromid; public $fromname; public $fromsms; + + /** + * @var string + */ public $fromtype; public $replytoname; public $replytomail; @@ -48,9 +52,25 @@ class FormSms public $tomail; public $withsubstit; // Show substitution array + + /** + * @var int + */ public $withfrom; + + /** + * @var int + */ public $withto; + + /** + * @var int + */ public $withtopic; + + /** + * @var int + */ public $withbody; /** 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 f53f7eba871..be2c6e38937 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -714,7 +714,7 @@ class pdf_aurore extends ModelePDFSupplierProposal * @param Object $object Object to show * @param int|float $posy Y * @param Translate $outputlangs Langs object - * @return int + * @return int|float */ protected function _tableau_info(&$pdf, $object, $posy, $outputlangs) { diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index 2c10cdefc1c..f42c862bb9e 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -844,7 +844,7 @@ class pdf_zenith extends ModelePDFSupplierProposal * @param SupplierProposal $object Object to show * @param int|float $posy Y * @param Translate $outputlangs Langs object - * @return integer + * @return int|float */ protected function _tableau_info(&$pdf, $object, $posy, $outputlangs) { diff --git a/htdocs/emailcollector/lib/emailcollector.lib.php b/htdocs/emailcollector/lib/emailcollector.lib.php index 8bb69da5f3b..3549f20a5a5 100644 --- a/htdocs/emailcollector/lib/emailcollector.lib.php +++ b/htdocs/emailcollector/lib/emailcollector.lib.php @@ -38,13 +38,12 @@ function emailcollectorPrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/admin/emailcollector_card.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/admin/emailcollector_card.php?id='.$object->id; $head[$h][1] = $langs->trans("EmailCollector"); $head[$h][2] = 'card'; $h++; - /*if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) - { + /*if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { $nbNote = 0; if (!empty($object->note_private)) $nbNote++; if (!empty($object->note_public)) $nbNote++; diff --git a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php index 1f89e43eaba..b0efb0602c5 100644 --- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php +++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php @@ -1,5 +1,6 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +17,7 @@ */ /** - * \file lib/eventorganization_conferenceorbooth.lib.php + * \file htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php * \ingroup eventorganization * \brief Library files with common functions for ConferenceOrBooth */ @@ -37,18 +38,18 @@ function conferenceorboothPrepareHead($object, $with_project = 0) $h = 0; $head = array(); - $withProjectUrl=''; - if ($with_project>0) { + $withProjectUrl = ''; + if ($with_project > 0) { $withProjectUrl = "&withproject=1"; } - $head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?id='.$object->id.$withProjectUrl; + $head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_card.php?id=' . $object->id . $withProjectUrl; $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h++; if (getDolGlobalString('MAIN_FEATURES_LEVEL') && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { - $head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_contact.php?id='.$object->id.$withProjectUrl; + $head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_contact.php?id=' . $object->id . $withProjectUrl; $head[$h][1] = $langs->trans("ContactsAddresses"); $head[$h][2] = 'contact'; $h++; @@ -82,15 +83,15 @@ function conferenceorboothPrepareHead($object, $with_project = 0) $h++; */ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->eventorganization->dir_output."/conferenceorbooth/".dol_sanitizeFileName($object->ref); + require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; + $upload_dir = $conf->eventorganization->dir_output . "/conferenceorbooth/" . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_document.php", 1).'?id='.$object->id.$withProjectUrl; + $head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_document.php?id=' . $object->id . $withProjectUrl; $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) { - $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + $head[$h][1] .= '' . ($nbFiles + $nbLinks) . ''; } $head[$h][2] = 'document'; $h++; @@ -125,22 +126,22 @@ function conferenceorboothProjectPrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_list.php", 1).'?projectid='.$object->id; + $head[$h][0] = DOL_URL_ROOT . 'eventorganization/conferenceorbooth_list.php?projectid=' . $object->id; $head[$h][1] = $langs->trans("ConferenceOrBooth"); $head[$h][2] = 'conferenceorbooth'; // Enable caching of conf or booth count attendees $nbAttendees = 0; - $nbConferenceOrBooth= 0; - require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; - $cachekey = 'count_conferenceorbooth_project_'.$object->id; + $nbConferenceOrBooth = 0; + require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; + $cachekey = 'count_conferenceorbooth_project_' . $object->id; $dataretrieved = dol_getcache($cachekey); if (!is_null($dataretrieved)) { $nbAttendees = $dataretrieved; } else { - require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; - $conforbooth=new ConferenceOrBooth($db); - $result = $conforbooth->fetchAll('', '', 0, 0, '(t.fk_project:=:'.((int) $object->id).')'); - if (!is_array($result) && $result<0) { + require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorbooth.class.php'; + $conforbooth = new ConferenceOrBooth($db); + $result = $conforbooth->fetchAll('', '', 0, 0, '(t.fk_project:=:' . ((int) $object->id) . ')'); + if (!is_array($result) && $result < 0) { setEventMessages($conforbooth->error, $conforbooth->errors, 'errors'); } else { $nbConferenceOrBooth = count($result); @@ -148,25 +149,25 @@ function conferenceorboothProjectPrepareHead($object) dol_setcache($cachekey, $nbConferenceOrBooth, 120); // If setting cache fails, this is not a problem, so we do not test result. } if ($nbConferenceOrBooth > 0) { - $head[$h][1] .= ''.$nbConferenceOrBooth.''; + $head[$h][1] .= '' . $nbConferenceOrBooth . ''; } $h++; - $head[$h][0] = dol_buildpath("/eventorganization/conferenceorboothattendee_list.php", 1).'?fk_project='.$object->id.'&withproject=1'; + $head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorboothattendee_list.php?fk_project=' . $object->id . '&withproject=1'; $head[$h][1] = $langs->trans("Attendees"); $head[$h][2] = 'attendees'; // Enable caching of conf or booth count attendees $nbAttendees = 0; - require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; - $cachekey = 'count_attendees_conferenceorbooth_project_'.$object->id; + require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; + $cachekey = 'count_attendees_conferenceorbooth_project_' . $object->id; $dataretrieved = dol_getcache($cachekey); if (!is_null($dataretrieved)) { $nbAttendees = $dataretrieved; } else { - require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; - $attendees=new ConferenceOrBoothAttendee($db); - $result = $attendees->fetchAll('', '', 0, 0, '(t.fk_project:=:'.((int) $object->id).')'); - if (!is_array($result) && $result<0) { + require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorboothattendee.class.php'; + $attendees = new ConferenceOrBoothAttendee($db); + $result = $attendees->fetchAll('', '', 0, 0, '(t.fk_project:=:' . ((int) $object->id) . ')'); + if (!is_array($result) && $result < 0) { setEventMessages($attendees->error, $attendees->errors, 'errors'); } else { $nbAttendees = count($result); @@ -174,7 +175,7 @@ function conferenceorboothProjectPrepareHead($object) dol_setcache($cachekey, $nbAttendees, 120); // If setting cache fails, this is not a problem, so we do not test result. } if ($nbAttendees > 0) { - $head[$h][1] .= ''.$nbAttendees.''; + $head[$h][1] .= '' . $nbAttendees . ''; } complete_head_from_modules($conf, $langs, $object, $head, $h, 'conferenceorboothproject@eventorganization'); @@ -200,7 +201,7 @@ function conferenceorboothAttendeePrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/eventorganization/conferenceorboothattendee_card.php?id=".((int) $object->id).($object->fk_actioncomm > 0 ? '&conforboothid='.((int) $object->fk_actioncomm) : '').($object->fk_project > 0 ? '&withproject=1&fk_project='.((int) $object->fk_project) : ''); + $head[$h][0] = DOL_URL_ROOT . "/eventorganization/conferenceorboothattendee_card.php?id=" . ((int) $object->id) . ($object->fk_actioncomm > 0 ? '&conforboothid=' . ((int) $object->fk_actioncomm) : '') . ($object->fk_project > 0 ? '&withproject=1&fk_project=' . ((int) $object->fk_project) : ''); $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index b0064f2a62c..3ec3fda1f0e 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015-2023 Frederic France + * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2020 Maxime DEMAREST * * This program is free software; you can redistribute it and/or modify @@ -61,7 +61,10 @@ class PaymentLoan extends CommonObject */ public $datep = ''; - public $amounts = array(); // Array of amounts + /** + * @var array Array of amounts + */ + public $amounts = array(); public $amount_capital; // Total amount of payment diff --git a/htdocs/mrp/ajax/interface.php b/htdocs/mrp/ajax/interface.php index 17000dd0207..afb2a33d7df 100644 --- a/htdocs/mrp/ajax/interface.php +++ b/htdocs/mrp/ajax/interface.php @@ -1,7 +1,24 @@ + * Copyright (C) 2024 Frédéric France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ /** * \file htdocs/mrp/ajax/interface.php + * \brief Ajax search component for Mrp. */ if (!defined('NOREQUIRESOC')) { diff --git a/htdocs/mrp/lib/mrp.lib.php b/htdocs/mrp/lib/mrp.lib.php index c650c4dd02b..20840d40e1b 100644 --- a/htdocs/mrp/lib/mrp.lib.php +++ b/htdocs/mrp/lib/mrp.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +17,7 @@ */ /** - * \file mrp/lib/mrp.lib.php + * \file htdocs/mrp/lib/mrp.lib.php * \ingroup mrp * \brief Library files with common functions for Mrp */ @@ -38,21 +39,21 @@ function mrpAdminPrepareHead() $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/admin/mrp.php", 1); + $head[$h][0] = DOL_URL_ROOT . '/admin/mrp.php'; $head[$h][1] = $langs->trans("Settings"); $head[$h][2] = 'settings'; $h++; - $head[$h][0] = dol_buildpath("/admin/mrp_extrafields.php", 1); + $head[$h][0] = DOL_URL_ROOT . '/admin/mrp_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['mrp_mo']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ''.$nbExtrafields.''; + $head[$h][1] .= '' . $nbExtrafields . ''; } $head[$h][2] = 'mrp_extrafields'; $h++; - $head[$h][0] = dol_buildpath("/admin/mrp_production_extrafields.php", 1); + $head[$h][0] = DOL_URL_ROOT . '/admin/mrp_production_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); $head[$h][2] = 'mrp_production_extrafields'; $h++; diff --git a/htdocs/mrp/lib/mrp_mo.lib.php b/htdocs/mrp/lib/mrp_mo.lib.php index f78f5da9166..63f39445e91 100644 --- a/htdocs/mrp/lib/mrp_mo.lib.php +++ b/htdocs/mrp/lib/mrp_mo.lib.php @@ -1,5 +1,6 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,26 +37,26 @@ function moPrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/mrp/mo_card.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/mrp/mo_card.php?id=' . $object->id; $head[$h][1] = $langs->trans("ManufacturingOrder"); $head[$h][2] = 'card'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/mrp/mo_production.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/mrp/mo_production.php?id=' . $object->id; $head[$h][1] = $langs->trans("Production"); $arrayproduced = $object->fetchLinesLinked('produced', 0); $nbProduced = 0; foreach ($arrayproduced as $lineproduced) { $nbProduced += $lineproduced['qty']; } - $head[$h][1] .= ''.$nbProduced.' / '.$object->qty.''; + $head[$h][1] .= '' . $nbProduced . ' / ' . $object->qty . ''; $head[$h][2] = 'production'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/mrp/mo_movements.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/mrp/mo_movements.php?id=' . $object->id; $head[$h][1] = $langs->trans("StockMovements"); $nbMove = $object->countMovements(); - $head[$h][1] .= ''.$nbMove.''; + $head[$h][1] .= '' . $nbMove . ''; $head[$h][2] = 'stockmovement'; $h++; @@ -67,29 +68,29 @@ function moPrepareHead($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = dol_buildpath('/mrp/mo_note.php', 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/mrp/mo_note.php?id=' . $object->id; $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { - $head[$h][1] .= ''.$nbNote.''; + $head[$h][1] .= '' . $nbNote . ''; } $head[$h][2] = 'note'; $h++; } - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->mrp->dir_output."/".dol_sanitizeFileName($object->ref); + require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; + $upload_dir = $conf->mrp->dir_output . "/" . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = dol_buildpath("/mrp/mo_document.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/mrp/mo_document.php?id=' . $object->id; $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) { - $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + $head[$h][1] .= '' . ($nbFiles + $nbLinks) . ''; } $head[$h][2] = 'document'; $h++; - $head[$h][0] = dol_buildpath("/mrp/mo_agenda.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/mrp/mo_agenda.php?id=' . $object->id; $head[$h][1] = $langs->trans("Events"); $head[$h][2] = 'agenda'; $h++; diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 86f8778e799..d4c87b7015e 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,8 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/mrp/class/mo.class.php'); -dol_include_once('/mrp/lib/mrp_mo.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; +require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php'; // Load translation files required by the page diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index c8f09b37a9b..6afe0f35686 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +17,7 @@ */ /** - * \file mo_document.php + * \file htdocs/mrp/mo_document.php * \ingroup mrp * \brief Tab for documents linked to Mo */ @@ -30,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -dol_include_once('/mrp/class/mo.class.php'); -dol_include_once('/mrp/lib/mrp_mo.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; +require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php'; // Load translation files required by the page $langs->loadLangs(array("mrp", "companies", "other", "mails")); diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index deb9d39a97a..b5395b9b04b 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -1,6 +1,7 @@ * Copyright (C) 2022 Ferran Marcet + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,8 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; -dol_include_once('/mrp/class/mo.class.php'); -dol_include_once('/mrp/lib/mrp_mo.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; +require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php'; // Load translation files required by the page $langs->loadLangs(array("mrp", "stocks", "other")); diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php index 19b630aaf53..9d24201da2e 100644 --- a/htdocs/mrp/mo_note.php +++ b/htdocs/mrp/mo_note.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,8 +27,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -dol_include_once('/mrp/class/mo.class.php'); -dol_include_once('/mrp/lib/mrp_mo.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; +require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php'; // Load translation files required by the page $langs->loadLangs(array("mrp", "companies")); diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 11e6ce992ce..c13813c342f 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -2,6 +2,7 @@ /* Copyright (C) 2019-2020 Laurent Destailleur * Copyright (C) 2023 Christian Humpel * Copyright (C) 2023 Vincent de Grandpré + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -96,7 +97,7 @@ $result = restrictedArea($user, 'mrp', $object->id, 'mrp_mo', '', 'fk_soc', 'row $permissionnote = $user->hasRight('mrp', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('mrp', 'write'); // Used by the include of actions_dellink.inc.php $permissiontoadd = $user->hasRight('mrp', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->mrp->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('mrp', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissiontoproduce = $permissiontoadd; $permissiontoupdatecost = $user->hasRight('bom', 'read'); // User who can define cost must have knowledge of pricing diff --git a/htdocs/partnership/lib/partnership.lib.php b/htdocs/partnership/lib/partnership.lib.php index ec8f7b80987..f5822e20a16 100644 --- a/htdocs/partnership/lib/partnership.lib.php +++ b/htdocs/partnership/lib/partnership.lib.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2021 Dorian Laurent + * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +17,7 @@ */ /** - * \file partnership/lib/partnership.lib.php + * \file htdocs/partnership/lib/partnership.lib.php * \ingroup partnership * \brief Library files with common functions for Partnership */ @@ -38,22 +39,22 @@ function partnershipAdminPrepareHead() $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/partnership/admin/setup.php", 1); + $head[$h][0] = DOL_URL_ROOT . '/partnership/admin/setup.php'; $head[$h][1] = $langs->trans("Settings"); $head[$h][2] = 'settings'; $h++; - $head[$h][0] = dol_buildpath("/partnership/admin/partnership_extrafields.php", 1); + $head[$h][0] = DOL_URL_ROOT . '/partnership/admin/partnership_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['partnership']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ''.$nbExtrafields.''; + $head[$h][1] .= '' . $nbExtrafields . ''; } $head[$h][2] = 'partnership_extrafields'; $h++; - $head[$h][0] = dol_buildpath("/partnership/admin/website.php", 1); + $head[$h][0] = DOL_URL_ROOT . '/partnership/admin/website.php'; $head[$h][1] = $langs->trans("BlankSubscriptionForm"); $head[$h][2] = 'website'; $h++; @@ -88,7 +89,7 @@ function partnershipPrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/partnership/partnership_card.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/partnership/partnership_card.php?id=' . $object->id; $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h++; @@ -101,29 +102,29 @@ function partnershipPrepareHead($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = dol_buildpath('/partnership/partnership_note.php', 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/partnership/partnership_note.php?id=' . $object->id; $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { - $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? ''.$nbNote.'' : ''); + $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '' . $nbNote . '' : ''); } $head[$h][2] = 'note'; $h++; } - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->partnership->dir_output."/partnership/".dol_sanitizeFileName($object->ref); + require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; + $upload_dir = $conf->partnership->dir_output . "/partnership/" . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = dol_buildpath("/partnership/partnership_document.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/partnership/partnership_document.php?id=' . $object->id; $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) { - $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + $head[$h][1] .= '' . ($nbFiles + $nbLinks) . ''; } $head[$h][2] = 'document'; $h++; - $head[$h][0] = dol_buildpath("/partnership/partnership_agenda.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/partnership/partnership_agenda.php?id=' . $object->id; $head[$h][1] = $langs->trans("Events"); $head[$h][2] = 'agenda'; $h++; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 722af2e74b2..2d664de7376 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -70,6 +70,11 @@ class Product extends CommonObject */ public $fk_element = 'fk_product'; + /** + * @var Product + */ + public $oldcopy; + /** * @var array List of child tables. To test if we can delete object. */ @@ -290,7 +295,7 @@ class Product extends CommonObject public $duration; /** - * Service Workstation + * @var int Service Workstation */ public $fk_default_workstation; @@ -487,6 +492,10 @@ class Product extends CommonObject public $fourn_qty; public $fourn_pu; public $fourn_price_base_type; + + /** + * @var int ID + */ public $fourn_socid; /** @@ -529,7 +538,7 @@ class Product extends CommonObject public $sousprods; /** - * Path of subproducts. Build from ->sousprods with get_arbo_each_prod() + * @var array Path of subproducts. Build from ->sousprods with get_arbo_each_prod() */ public $res; diff --git a/htdocs/recruitment/lib/recruitment.lib.php b/htdocs/recruitment/lib/recruitment.lib.php index 911c6abdb03..97690d73ea7 100644 --- a/htdocs/recruitment/lib/recruitment.lib.php +++ b/htdocs/recruitment/lib/recruitment.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2022 Frédéric France + * Copyright (C) 2022-2024 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ */ /** - * \file recruitment/lib/recruitment.lib.php + * \file htdocs/recruitment/lib/recruitment.lib.php * \ingroup recruitment * \brief Library files with common functions for Recruitment */ @@ -40,35 +40,35 @@ function recruitmentAdminPrepareHead() $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/recruitment/admin/setup.php", 1); + $head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/setup.php'; $head[$h][1] = $langs->trans("JobPositions"); $head[$h][2] = 'settings'; $h++; - $head[$h][0] = dol_buildpath("/recruitment/admin/setup_candidatures.php", 1); + $head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/setup_candidatures.php'; $head[$h][1] = $langs->trans("RecruitmentCandidatures"); $head[$h][2] = 'settings_candidatures'; $h++; - $head[$h][0] = dol_buildpath("/recruitment/admin/public_interface.php", 1); + $head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/public_interface.php'; $head[$h][1] = $langs->trans("PublicUrl"); $head[$h][2] = 'publicurl'; $h++; - $head[$h][0] = dol_buildpath("/recruitment/admin/jobposition_extrafields.php", 1); + $head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/jobposition_extrafields.php'; $head[$h][1] = $langs->trans("ExtrafieldsJobPosition"); $nbExtrafields = $extrafields->attributes['recruitment_recruitmentjobposition']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ''.$nbExtrafields.''; + $head[$h][1] .= '' . $nbExtrafields . ''; } $head[$h][2] = 'jobposition_extrafields'; $h++; - $head[$h][0] = dol_buildpath("/recruitment/admin/candidature_extrafields.php", 1); + $head[$h][0] = DOL_URL_ROOT . '/recruitment/admin/candidature_extrafields.php'; $head[$h][1] = $langs->trans("ExtrafieldsApplication"); $nbExtrafields = $extrafields->attributes['recruitment_recruitmentcandidature']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ''.$nbExtrafields.''; + $head[$h][1] .= '' . $nbExtrafields . ''; } $head[$h][2] = 'candidature_extrafields'; $h++; diff --git a/htdocs/recruitment/lib/recruitment_recruitmentcandidature.lib.php b/htdocs/recruitment/lib/recruitment_recruitmentcandidature.lib.php index c4ad141bca6..d6a0de449dc 100644 --- a/htdocs/recruitment/lib/recruitment_recruitmentcandidature.lib.php +++ b/htdocs/recruitment/lib/recruitment_recruitmentcandidature.lib.php @@ -1,5 +1,6 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,13 +37,13 @@ function recruitmentCandidaturePrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/recruitment/recruitmentcandidature_card.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentcandidature_card.php?id=' . $object->id; $head[$h][1] = $langs->trans("RecruitmentCandidature"); $head[$h][2] = 'card'; $h++; // if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - // $head[$h][0] = dol_buildpath("/recruitment/recruitmentrating_card.php", 1).'?id='.$object->id; + // $head[$h][0] = DOL_URL_ROOT.'/recruitment/recruitmentrating_card.php?id='.$object->id; // $head[$h][1] = $langs->trans("Rating"); // $head[$h][2] = 'rating'; // $h++; @@ -56,29 +57,29 @@ function recruitmentCandidaturePrepareHead($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = dol_buildpath('/recruitment/recruitmentcandidature_note.php', 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentcandidature_note.php?id=' . $object->id; $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { - $head[$h][1] .= ''.$nbNote.''; + $head[$h][1] .= '' . $nbNote . ''; } $head[$h][2] = 'note'; $h++; } - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->recruitment->dir_output."/recruitmentcandidature/".dol_sanitizeFileName($object->ref); + require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; + $upload_dir = $conf->recruitment->dir_output . "/recruitmentcandidature/" . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = dol_buildpath("/recruitment/recruitmentcandidature_document.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentcandidature_document.php?id=' . $object->id; $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) { - $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + $head[$h][1] .= '' . ($nbFiles + $nbLinks) . ''; } $head[$h][2] = 'document'; $h++; - $head[$h][0] = dol_buildpath("/recruitment/recruitmentcandidature_agenda.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentcandidature_agenda.php?id=' . $object->id; $head[$h][1] = $langs->trans("Events"); $head[$h][2] = 'agenda'; $h++; diff --git a/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php b/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php index a269bc61683..8fafb1c3fdc 100644 --- a/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php +++ b/htdocs/recruitment/lib/recruitment_recruitmentjobposition.lib.php @@ -1,5 +1,6 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,21 +37,21 @@ function recruitmentjobpositionPrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/recruitment/recruitmentjobposition_card.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentjobposition_card.php?id=' . $object->id; $head[$h][1] = $langs->trans("PositionToBeFilled"); $head[$h][2] = 'card'; $h++; - $head[$h][0] = dol_buildpath("/recruitment/recruitmentcandidature_list.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentcandidature_list.php?id=' . $object->id; $head[$h][1] = $langs->trans("RecruitmentCandidatures"); - $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature WHERE fk_recruitmentjobposition = ".((int) $object->id); + $sql = "SELECT COUNT(rowid) as nb FROM " . MAIN_DB_PREFIX . "recruitment_recruitmentcandidature WHERE fk_recruitmentjobposition = " . ((int) $object->id); $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); if ($obj) { $nCandidature = $obj->nb; if ($nCandidature > 0) { - $head[$h][1] .= ''.$nCandidature.''; + $head[$h][1] .= '' . $nCandidature . ''; } } } else { @@ -67,29 +68,29 @@ function recruitmentjobpositionPrepareHead($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = dol_buildpath('/recruitment/recruitmentjobposition_note.php', 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentjobposition_note.php?id=' . $object->id; $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { - $head[$h][1] .= ''.$nbNote.''; + $head[$h][1] .= '' . $nbNote . ''; } $head[$h][2] = 'note'; $h++; } - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->recruitment->dir_output."/recruitmentjobposition/".dol_sanitizeFileName($object->ref); + require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; + $upload_dir = $conf->recruitment->dir_output . "/recruitmentjobposition/" . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = dol_buildpath("/recruitment/recruitmentjobposition_document.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentjobposition_document.php?id=' . $object->id; $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) { - $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + $head[$h][1] .= '' . ($nbFiles + $nbLinks) . ''; } $head[$h][2] = 'document'; $h++; - $head[$h][0] = dol_buildpath("/recruitment/recruitmentjobposition_agenda.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT . '/recruitment/recruitmentjobposition_agenda.php?id=' . $object->id; $head[$h][1] = $langs->trans("Events"); $head[$h][2] = 'agenda'; $h++; @@ -126,8 +127,8 @@ function getPublicJobPositionUrl($mode, $ref = '', $localorexternal = 0) $out = ''; // Define $urlwithroot - $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); - $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + $urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot . DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current $urltouse = DOL_MAIN_URL_ROOT; @@ -135,7 +136,7 @@ function getPublicJobPositionUrl($mode, $ref = '', $localorexternal = 0) $urltouse = $urlwithroot; } - $out = $urltouse.'/public/recruitment/view.php?ref='.($mode ? '' : '').$ref.($mode ? '' : ''); + $out = $urltouse . '/public/recruitment/view.php?ref=' . ($mode ? '' : '') . $ref . ($mode ? '' : ''); /*if (!empty($conf->global->RECRUITMENT_SECURITY_TOKEN)) { if (empty($conf->global->RECRUITMENT_SECURITY_TOKEN)) $out .= '&securekey='.urlencode($conf->global->RECRUITMENT_SECURITY_TOKEN); @@ -144,7 +145,7 @@ function getPublicJobPositionUrl($mode, $ref = '', $localorexternal = 0) // For multicompany if (!empty($out) && isModEnabled('multicompany')) { - $out .= "&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities + $out .= "&entity=" . $conf->entity; // Check the entity because we may have the same reference in several entities } return $out; diff --git a/htdocs/societe/class/client.class.php b/htdocs/societe/class/client.class.php index b1fad2a4be8..9c858eb6da2 100644 --- a/htdocs/societe/class/client.class.php +++ b/htdocs/societe/class/client.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2020 Open-Dsi + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,8 +31,14 @@ include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; */ class Client extends Societe { - public $next_prev_filter = "te.client in (1,2,3)"; // Used to add a filter in Form::showrefnav method + /** + * @var string Used to add a filter in Form::showrefnav method + */ + public $next_prev_filter = "te.client in (1,2,3)"; + /** + * @var array + */ public $cacheprospectstatus = array(); diff --git a/htdocs/theme/eldy/flags-sprite.inc.php b/htdocs/theme/eldy/flags-sprite.inc.php index 56300e37e3f..274235f844a 100644 --- a/htdocs/theme/eldy/flags-sprite.inc.php +++ b/htdocs/theme/eldy/flags-sprite.inc.php @@ -1,6 +1,28 @@ + * Copyright (C) 2024 Frédéric France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/theme/eldy/flag-sprite.inc.php + * \brief File for CSS style sheet Eldy + */ if (!defined('ISLOADEDBYSTEELSHEET')) { - die('Must be call by steelsheet'); + die('Must be call by stylesheet'); } ?> /* '; if (empty($hidelabel)) { From c7b1a924c2a033fa1e25a75beda5028c234d5cd5 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:50:32 +0100 Subject: [PATCH 0670/1862] Fix: Ensure string type for urlencode() --- htdocs/core/lib/company.lib.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 7caa6533194..a4cd09de402 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -229,7 +229,7 @@ function societe_prepare_head(Societe $object) //if (isModEnabled('stripe') && $nbBankAccount > 0) $nbBankAccount = '...'; // No way to know exact number - $head[$h][0] = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.urlencode($object->id); + $head[$h][0] = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.urlencode((string) ($object->id)); $head[$h][1] = $title; if ($foundonexternalonlinesystem) { $head[$h][1] .= '...'; @@ -249,7 +249,7 @@ function societe_prepare_head(Societe $object) $site_filter_list[] = 'dolibarr_portal'; } - $head[$h][0] = DOL_URL_ROOT.'/societe/website.php?id='.urlencode($object->id); + $head[$h][0] = DOL_URL_ROOT.'/societe/website.php?id='.urlencode((string) ($object->id)); $head[$h][1] = $langs->trans("WebSiteAccounts"); $nbNote = 0; $sql = "SELECT COUNT(n.rowid) as nb"; @@ -333,7 +333,7 @@ function societe_prepare_head(Societe $object) dol_setcache($cachekey, $nbNotif, 120); // If setting cache fails, this is not a problem, so we do not test result. } - $head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.urlencode($object->id); + $head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.urlencode((string) ($object->id)); $head[$h][1] = $langs->trans("Notifications"); if ($nbNotif > 0) { $head[$h][1] .= ''.$nbNotif.''; @@ -350,7 +350,7 @@ function societe_prepare_head(Societe $object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = DOL_URL_ROOT.'/societe/note.php?id='.urlencode($object->id); + $head[$h][0] = DOL_URL_ROOT.'/societe/note.php?id='.urlencode((string) ($object->id)); $head[$h][1] = $langs->trans("Notes"); if ($nbNote > 0) { $head[$h][1] .= ''.$nbNote.''; @@ -1155,12 +1155,12 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print "\n".'
'; print $langs->trans("RefOrder").''; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index ee2587cc04e..2ab50c297f4 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } diff --git a/htdocs/reception/dispatch.php b/htdocs/reception/dispatch.php index a212ad31953..ab5e4dc9972 100644 --- a/htdocs/reception/dispatch.php +++ b/htdocs/reception/dispatch.php @@ -389,7 +389,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { print ''; print ''."\n"; // Date payment // Bank - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; // Number - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Number print ''; // Default Bank Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; - $out .= '
'; print $langs->trans("RefOrder").''; diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index ebe929ffc6c..a44e82e6eb9 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -282,7 +282,7 @@ if ($action == 'add' && empty($cancel)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $error++; } - if (isModEnabled("banque") && !empty($auto_create_paiement) && !$object->accountid > 0) { + if (isModEnabled("bank") && !empty($auto_create_paiement) && !$object->accountid > 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors'); $error++; } @@ -622,7 +622,7 @@ if ($action == 'create' && $permissiontoadd) { print '
'; print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; print img_picto('', 'bank_account', 'class="paddingrighonly"'); @@ -650,7 +650,7 @@ if ($action == 'create' && $permissiontoadd) { print '
'; print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -1032,7 +1032,7 @@ if ($id > 0) { print '\n"; $labeltype = $langs->trans("PaymentType".$objp->type_code) != "PaymentType".$objp->type_code ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "\n"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; diff --git a/htdocs/salaries/class/api_salaries.class.php b/htdocs/salaries/class/api_salaries.class.php index 693c1978b31..fad592803c4 100644 --- a/htdocs/salaries/class/api_salaries.class.php +++ b/htdocs/salaries/class/api_salaries.class.php @@ -330,7 +330,7 @@ class Salaries extends DolibarrApi if ($paymentsalary->create(DolibarrApiAccess::$user, 1) < 0) { throw new RestException(500, 'Error creating paymentsalary', array_merge(array($paymentsalary->error), $paymentsalary->errors)); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $paymentsalary->addPaymentToBank( DolibarrApiAccess::$user, 'payment_salary', @@ -444,7 +444,7 @@ class Salaries extends DolibarrApi { $paymentsalary = array(); $fields = Salaries::$FIELDSPAYMENT; - if (isModEnabled("banque")) array_push($fields, "accountid"); + if (isModEnabled("bank")) array_push($fields, "accountid"); foreach ($fields as $field) { if (!isset($data[$field])) { throw new RestException(400, "$field field missing"); diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 7c27aa44b28..ef54b12b43a 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -596,7 +596,7 @@ class PaymentSalary extends CommonObject $error = 0; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index d8569747e30..91f57d2d880 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -527,7 +527,7 @@ print $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, print ''; // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print ''; @@ -581,7 +581,7 @@ print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.lastname", "", $par $totalarray['nbfield']++; print_liste_field_titre("DefaultPaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, 'class="left"', $sortfield, $sortorder); $totalarray['nbfield']++; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print_liste_field_titre("DefaultBankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); $totalarray['nbfield']++; } @@ -731,7 +731,7 @@ while ($i < $imaxinloop) { } // Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 2fda40dddc6..6e5b19c857e 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -78,7 +78,7 @@ if (($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == ' $error++; $action = 'create'; } - if (isModEnabled("banque") && !(GETPOSTINT("accountid") > 0)) { + if (isModEnabled("bank") && !(GETPOSTINT("accountid") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToDebit")), null, 'errors'); $error++; $action = 'create'; diff --git a/htdocs/salaries/payment_salary/card.php b/htdocs/salaries/payment_salary/card.php index 2d84cace617..16dc023c176 100644 --- a/htdocs/salaries/payment_salary/card.php +++ b/htdocs/salaries/payment_salary/card.php @@ -172,7 +172,7 @@ print ''; // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { if ($object->bank_account) { $bankline = new AccountLine($db); $bankline->fetch($object->bank_line); diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index a00707b039b..2b77863cb04 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -482,7 +482,7 @@ print ''; // Chq number print ''; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { // Bank transaction print ''; // Default Bank Account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print ''; print ''; + print ''; print ''; print ''; print ''; @@ -2225,6 +2270,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { print ''; print ''; + print ''; // User $userstatic = new User($db); @@ -2297,6 +2343,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { } print ''; print ''; + print ''; print ''; print ''; print ''; @@ -2356,6 +2403,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { print ''; print ''; + print ''; print ''; if ($user->hasRight('produit', 'supprimer') || $user->hasRight('service', 'supprimer')) { @@ -2434,6 +2482,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { print ''; print ''; + print ''; // User $userstatic = new User($db); From 2d936bf1c9f1ccba28596645854228e30e54fc61 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 1 Mar 2024 12:38:06 +0100 Subject: [PATCH 0338/1862] FIX postgresql error (#28542) * FIX postgresql error * FIX better index name --- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 5 ++++- htdocs/install/mysql/tables/llx_expensereport.key.sql | 7 +++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index f528d39bdc6..70bf4fe7628 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -204,7 +204,10 @@ ALTER TABLE llx_salary ADD COLUMN note_public text; ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN element_type varchar(50) DEFAULT 'supplier_order' NOT NULL; -ALTER TABLE llx_expensereport DROP INDEX idx_expensereport_fk_refuse, ADD INDEX idx_expensereport_fk_refuse(fk_user_refuse); +-- VMYSQL4.1 DROP INDEX idx_expensereport_fk_refuse ON llx_expensereport; +-- VPGSQL8.2 DROP INDEX idx_expensereport_fk_refuse; + +ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_refuse(fk_user_refuse); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (1,'66','Société publique locale'); diff --git a/htdocs/install/mysql/tables/llx_expensereport.key.sql b/htdocs/install/mysql/tables/llx_expensereport.key.sql index 329bb9089ff..8557fcee666 100644 --- a/htdocs/install/mysql/tables/llx_expensereport.key.sql +++ b/htdocs/install/mysql/tables/llx_expensereport.key.sql @@ -1,6 +1,6 @@ -- =================================================================== -- Copyright (C) 2005 Laurent Destailleur --- Copyright (C) 2008-2010 Regis Houssin +-- Copyright (C) 2008-2024 Regis Houssin -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -31,6 +31,5 @@ ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_refuse (fk_user_ref --ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); --ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid); ---ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_approve FOREIGN KEY (fk_user_approve) REFERENCES llx_user (rowid); ---ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_refuse FOREIGN KEY (fk_user_refuse) REFERENCES llx_user (rowid); - +--ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_approve FOREIGN KEY (fk_user_approve) REFERENCES llx_user (rowid); +--ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_refuse FOREIGN KEY (fk_user_refuse) REFERENCES llx_user (rowid); From 73359442d4044a7e881c7f09a48ac83a60cba5bc Mon Sep 17 00:00:00 2001 From: PsyCrow <93346975+PsyCrow-code@users.noreply.github.com> Date: Fri, 1 Mar 2024 05:38:56 -0600 Subject: [PATCH 0339/1862] Update paiement.php (#28539) Fix #28485 --- htdocs/fourn/facture/paiement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 007dd70dea0..0e4245d9b23 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -834,7 +834,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $text .= '
'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed"); print ''; } - print $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type, $langs->trans('PayedSuppliersPayments'), $text, 'confirm_paiement', $formquestion, $preselectedchoice); + print $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id.'&socid='.$object->socid.'&type='.$object->type, $langs->trans('PayedSuppliersPayments'), $text, 'confirm_paiement', $formquestion, $preselectedchoice); } print ''; From 016de3ef66ce56e89d438ab4dcc9bf8993096b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Mar 2024 12:39:23 +0100 Subject: [PATCH 0340/1862] fix codespell (#28536) * fix codespell * fix phpstan * fix phpstan * fix phpstan * fix phpstan --- dev/setup/pre-commit/README.md | 6 +++--- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/core/lib/files.lib.php | 4 ++-- htdocs/core/modules/member/doc/pdf_standard.class.php | 3 ++- htdocs/projet/class/project.class.php | 4 +++- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dev/setup/pre-commit/README.md b/dev/setup/pre-commit/README.md index f6e82b6dcb5..1f3740144c2 100644 --- a/dev/setup/pre-commit/README.md +++ b/dev/setup/pre-commit/README.md @@ -38,8 +38,8 @@ the project: `pre-commit-config.yaml`. ### Tips After installing `pre-commit` onto your local git clone, pre-commit will run -on every commit. The first time, all tools required by pre-commit will be installed -into ~/.cache/pre-commit +on every commit. The first time, all tools required by pre-commit will be installed +into ~/.cache/pre-commit When it finds some issue, the git commit will be aborted, so you can fix it, or verify it. @@ -89,5 +89,5 @@ on github.\ CI also runs pre-commit to help maintain code quality. Note: -Code for precommits are saved into: +Code for precommits are saved into: .cache/pre-commit/repoyXXXXX/py_env-python3/lib/pythonX.Y/site-packages/pre_commit_hooks/no_commit_to_branch.py diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 14fa0eb3565..12ca9e77c2b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2017 ATM Consulting * Copyright (C) 2017-2019 Nicolas ZABOURI * Copyright (C) 2017 Rui Strecht - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Josep Lluís Amador * Copyright (C) 2023 Gauthier VERDOL * Copyright (C) 2021 Grégory Blémand @@ -590,7 +590,7 @@ abstract class CommonObject public $lines; /** - * @var string Action code to use to record auto event in agenda. For exemple 'AC_OTH_AUTO' + * @var string Action code to use to record auto event in agenda. By example 'AC_OTH_AUTO' */ public $actiontypecode; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 963ac582189..a518ec79f9d 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -4,7 +4,7 @@ * Copyright (C) 2012-2016 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Raphaël Doursenaud - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2023 Lenin Rivas * Copyright (C) 2024 MDW * @@ -2620,7 +2620,7 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only * @return array Array with properties (full path, date, ...) of to most recent file */ -function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('(\.meta|_preview.*\.png)$', '^\.'), $nohook = false, $mode = '') +function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('(\.meta|_preview.*\.png)$', '^\.'), $nohook = 0, $mode = '') { $tmparray = dol_dir_list($dir, 'files', 0, $regexfilter, $excludefilter, 'date', SORT_DESC, $mode, $nohook); return isset($tmparray[0]) ? $tmparray[0] : null; diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 5b2e2ed5703..15e58685878 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2015 Francis Appels + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -119,7 +120,7 @@ class pdf_standard extends CommonStickerGenerator $member = new Adherent($db); $member->id = $idmember; - $member->ref = $idmember; + $member->ref = (string) $idmember; // Define photo $dir = $conf->adherent->dir_output; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index dee6d2bcef5..893ced6f27c 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2019 Juanjo Menent * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Gauthier VERDOL + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1495,7 +1496,8 @@ class Project extends CommonObject $this->date_start = $now; $this->date_end = $now + (3600 * 24 * 365); $this->note_public = 'SPECIMEN'; - $this->fk_element = 20000; + $this->note_private = 'Private Note'; + $this->fk_project = 0; $this->opp_amount = 20000; $this->budget_amount = 10000; From 4b7d25975f41ae722cc929c918c89b04af9ef1ec Mon Sep 17 00:00:00 2001 From: PsyCrow <93346975+PsyCrow-code@users.noreply.github.com> Date: Fri, 1 Mar 2024 05:45:08 -0600 Subject: [PATCH 0341/1862] Update html.form.class.php (#28540) * Update html.form.class.php Fix PHP Warning: Undefined array key "labeladddateof" * Update html.form.class.php * Update html.form.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8be98a09173..29cb68f171d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7171,8 +7171,8 @@ class Form $arrayofdateof = $adddateof; } foreach ($arrayofdateof as $valuedateof) { - $tmpadddateof = $valuedateof['adddateof'] != '' ? $valuedateof['adddateof'] : 0; - $tmplabeladddateof = $valuedateof['labeladddateof']; + $tmpadddateof = empty($valuedateof['adddateof']) ? 0 : $valuedateof['adddateof']; + $tmplabeladddateof = empty($valuedateof['labeladddateof']) ? '' : $valuedateof['labeladddateof']; $tmparray = dol_getdate($tmpadddateof); if (empty($tmplabeladddateof)) { $tmplabeladddateof = $langs->trans("DateInvoice"); From 449d31a424f57b48815c78f18e9ac32f9b6265c8 Mon Sep 17 00:00:00 2001 From: smselver <50632715+smselver@users.noreply.github.com> Date: Fri, 1 Mar 2024 03:46:18 -0800 Subject: [PATCH 0342/1862] make some small grammatical upgrade to README (#28537) * make some small grammatical upgrade to README * fixed exemple in htdocs/common/core --------- Co-authored-by: steve Co-authored-by: Laurent Destailleur --- README.md | 10 +++++----- htdocs/core/class/commonobject.class.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f4087ec5a93..52b74a1fcdf 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,13 @@ [![GitHub release](https://img.shields.io/github/v/release/Dolibarr/dolibarr)](https://github.com/Dolibarr/dolibarr) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5521/badge)](https://bestpractices.coreinfrastructure.org/projects/5521) -Dolibarr ERP & CRM is a modern software package that helps 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 activities (contacts, suppliers, invoices, orders, stocks, agenda…). -It's an Open Source Software suite (written in PHP with optional JavaScript enhancements) designed for small, medium or large companies, foundations and freelancers. +It's an Open-Source Software suite (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 license. -You can use it as a standalone application or as a web application 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 from a LAN. Dolibarr has a large community ready to help you, free forums and [preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org) @@ -19,7 +19,7 @@ Dolibarr has a large community ready to help you, free forums and [preferred par ## LICENSE -Dolibarr is released under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version (GPL-3+). +Dolibarr is released under the terms of the GNU General Public License as published by the Free Software Foundation; either Version 3 of the License, or (at your option) any later version (GPL-3+). See the [COPYING](https://github.com/Dolibarr/dolibarr/blob/develop/COPYING) file for a full copy of the license. @@ -29,7 +29,7 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git ### Simple setup -If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions: +If you have low technical skills and you're looking to install Dolibarr ERP/CRM with just a few clicks, you can use one of the packaged versions: - [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp)) - [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 12ca9e77c2b..a42df1a6755 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -590,7 +590,7 @@ abstract class CommonObject public $lines; /** - * @var string Action code to use to record auto event in agenda. By example 'AC_OTH_AUTO' + * @var string Action code to use to record auto event in agenda. For example 'AC_OTH_AUTO' */ public $actiontypecode; From c069f3f161afe7dd811b836a244566ecdb46cd65 Mon Sep 17 00:00:00 2001 From: Christian Humpel <78662388+Humml87@users.noreply.github.com> Date: Fri, 1 Mar 2024 12:47:37 +0100 Subject: [PATCH 0343/1862] FIX #28533 Mo::deleteLine removes the "main" MoLine if consumed line is delete (#28535) * fix #28533 * qual for github actions * fix use $this->db in classes --------- Co-authored-by: christian.humpel --- htdocs/mrp/class/mo.class.php | 168 +++++++++++++++++++++------------- htdocs/mrp/mo_production.php | 2 +- 2 files changed, 103 insertions(+), 67 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 2341f1fd406..090bdc067c8 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -891,78 +891,58 @@ class Mo extends CommonObject */ public function deleteLine(User $user, $idline, $notrigger = false) { - global $langs; - $langs->loadLangs(array('stocks', 'mrp')); + $error = 0; if ($this->status < 0) { $this->error = 'ErrorDeleteLineNotAllowedByObjectStatus'; return -2; } - $productstatic = new Product($this->db); - $fk_movement = GETPOST('fk_movement', 'int'); - $arrayoflines = $this->fetchLinesLinked('consumed', $idline); - if (!empty($arrayoflines)) { - $this->db->begin(); + $moline = new MoLine($this->db); + $moline->fetch($idline); - $stockmove = new MouvementStock($this->db); - $stockmove->setOrigin($this->element, $this->id); - - if (!empty($fk_movement)) { - $moline = new MoLine($this->db); - $TArrayMoLine = $moline->fetchAll('', '', 1, 0, array('customsql' => 'fk_stock_movement ='.$fk_movement)); - $moline = array_shift($TArrayMoLine); - - $movement = new MouvementStock($this->db); - $movement->fetch($fk_movement); - $productstatic->fetch($movement->product_id); - $qtytoprocess = $movement->qty; - - // Reverse stock movement - $labelmovementCancel = $langs->trans("CancelProductionForRef", $productstatic->ref); - $codemovementCancel = $langs->trans("StockIncrease"); - - if (($qtytoprocess >= 0)) { - $idstockmove = $stockmove->reception($user, $movement->product_id, $movement->warehouse_id, $qtytoprocess, 0, $labelmovementCancel, '', '', $movement->batch, dol_now(), 0, $codemovementCancel); - } else { - $idstockmove = $stockmove->livraison($user, $movement->product_id, $movement->warehouse_id, $qtytoprocess, 0, $labelmovementCancel, dol_now(), '', '', $movement->batch, 0, $codemovementCancel); - } - if ($idstockmove < 0) { - $this->error++; - $this->db->rollback(); - setEventMessages($stockmove->error, $stockmove->errors, 'errors'); - } else { - $this->db->commit(); - } - return $moline->delete($user, $notrigger); - } else { - foreach ($arrayoflines as $key => $arrayofline) { - $lineDetails = $arrayoflines[$key]; - $productstatic->fetch($lineDetails['fk_product']); - $qtytoprocess = $lineDetails['qty']; - - // Reverse stock movement - $labelmovementCancel = $langs->trans("CancelProductionForRef", $productstatic->ref); - $codemovementCancel = $langs->trans("StockIncrease"); - - if ($qtytoprocess >= 0) { - $idstockmove = $stockmove->reception($user, $lineDetails['fk_product'], $lineDetails['fk_warehouse'], $qtytoprocess, 0, $labelmovementCancel, '', '', $lineDetails['batch'], dol_now(), 0, $codemovementCancel); - } else { - $idstockmove = $stockmove->livraison($user, $lineDetails['fk_product'], $lineDetails['fk_warehouse'], $qtytoprocess, 0, $labelmovementCancel, dol_now(), '', '', $lineDetails['batch'], 0, $codemovementCancel); - } - if ($idstockmove < 0) { - $this->error++; - $this->db->rollback(); - setEventMessages($stockmove->error, $stockmove->errors, 'errors'); - } else { - $this->db->commit(); - } - } - return $this->deleteLineCommon($user, $idline, $notrigger); - } - } else { - return $this->deleteLineCommon($user, $idline, $notrigger); + $affectedLinkedMoLines; + // Check if it's linked or a main line + if (empty($moline->fk_mrp_production)) { + // Check if the main line has linked lines + $affectedLinkedMoLines = $this->fetchLinesLinked('consumed', $moline->id); } + + $this->db->begin(); + + // undo stockmovements and remove linked lines + if (!empty($affectedLinkedMoLines)) { + foreach ($affectedLinkedMoLines as $linkedLine) { + if (!$error) { + $linkedMoline = new MoLine($this->db); + $linkedMoline->fetch($linkedLine['rowid']); + $result = $linkedMoline->delete($user, $notrigger); + + if ($result < 0) { + $error++; + setEventMessages($linkedMoline->error, $linkedMoline->errors, 'errors'); + } + } + } + } + + if (!$error) { + $result = $moline->delete($user, $notrigger); + + if ($result < 0) { + $error++; + setEventMessages($moline->error, $moline->errors, 'errors'); + } + } + + if (!$error) { + $this->db->commit(); + $result = 1; + } else { + $this->db->rollback(); + $result = -1; + } + return $result; } @@ -2222,7 +2202,63 @@ class MoLine extends CommonObjectLine */ public function delete(User $user, $notrigger = false) { - return $this->deleteCommon($user, $notrigger); - //return $this->deleteCommon($user, $notrigger, 1); + global $langs; + + $error = 0; + $result = -1; + + // the stockmovements it was created for this line revise + if (!empty($this->fk_warehouse)) { + $langs->loadLangs(array('stocks', 'mrp')); + + // load the mo for this line + $tmpmo = new Mo($this->db); + $tmpmo->fetch($this->fk_mo); + + // load the (old) linked stockmovement and the associated product + $linkedMovement = new MouvementStock($this->db); + $linkedMovement->fetch($this->fk_stock_movement); + $productForLinkedMovement = new Product($this->db); + $productForLinkedMovement->fetch($linkedMovement->product_id); + + // create new stockmovement to revise the linked stockmovement + $stockmove = new MouvementStock($this->db); + $stockmove->setOrigin($tmpmo->element, $tmpmo->id); + + // Reverse stock movement + $labelmovementCancel = $langs->trans("CancelProductionForRef", $productForLinkedMovement->ref); + $codemovementCancel = dol_print_date(dol_now(), 'dayhourlog'); + + $idstockmove = -1; + if (($linkedMovement->qty < 0)) { + $qtytoprocess = $linkedMovement->qty * -1; + $idstockmove = $stockmove->reception($user, $linkedMovement->product_id, $linkedMovement->warehouse_id, $qtytoprocess, 0, $labelmovementCancel, '', '', $linkedMovement->batch, dol_now(), 0, $codemovementCancel); + } else { + $idstockmove = $stockmove->livraison($user, $linkedMovement->product_id, $linkedMovement->warehouse_id, $linkedMovement->qty, 0, $labelmovementCancel, dol_now(), '', '', $linkedMovement->batch, 0, $codemovementCancel); + } + + if ($idstockmove < 0) { + $this->error++; + setEventMessages($stockmove->error, $stockmove->errors, 'errors'); + } + } + + if (!$error) { + $result = $this->deleteCommon($user, $notrigger); + if ($result < 0) { + $this->error++; + setEventMessages($stockmove->error, $stockmove->errors, 'errors'); + } + } + + if (!$error) { + $this->db->commit(); + $result = 1; + } else { + $this->db->rollback(); + $result = -1; + } + + return $result; } } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 0caba7cb777..1dafabc87a7 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -1288,7 +1288,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Action delete line if ($permissiontodelete) { - $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line->id).'&fk_movement='.((int) $line2['fk_stock_movement']); + $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line2['rowid']); print '
'; @@ -1492,6 +1492,7 @@ while ($i < $imaxinloop) { $userstatic->firstname = $obj->firstname; $userstatic->email = $obj->user_email; $userstatic->statut = $obj->user_statut; + $userstatic->status = $obj->user_statut; $userstatic->entity = $obj->entity; $userstatic->photo = $obj->photo; $userstatic->office_phone = $obj->office_phone; From f875201b4687c9e860c80333a95c3b7409dbd2e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Mar 2024 18:59:57 +0100 Subject: [PATCH 0395/1862] Fix #19404 FIX #22721 --- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 65a00f8affc..94db1f445ac 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2691,7 +2691,7 @@ class FactureFournisseur extends CommonInvoice $sql .= " JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ff.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= ' WHERE ff.paye = 0'; - $sql .= ' AND ff.fk_statut > 0'; + $sql .= " AND ff.fk_statut IN (".self::STATUS_VALIDATED.")"; $sql .= " AND ff.entity = ".$conf->entity; if ($user->socid) { $sql .= ' AND ff.fk_soc = '.((int) $user->socid); From cc1199664cd077187a83c160c8f14f884786478a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 2 Mar 2024 19:19:18 +0100 Subject: [PATCH 0396/1862] fix default value is incompatible with type string (#28584) --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ef6205953e4..0fd4bc4acc1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4516,7 +4516,7 @@ function getPictoForType($key) * @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip. * @param string $alt Force alt for bind people * @param string $morecss Add more class css on img tag (For example 'myclascss'). - * @param string $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No margin left. Works for fontawesome picto only. + * @param int $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No margin left. Works for fontawesome picto only. * @return string Return img tag * @see img_object(), img_picto_common() */ From eb1f6be1e21a112092ca5258f9fdf04ee18a506e Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 2 Mar 2024 19:57:59 +0100 Subject: [PATCH 0397/1862] Qual: Add information from backtrace when mysql request fails. (#28583) # Qual: Add information from backtrace when mysql request fails. This helps locate the line that was responsible for the SQL request --- htdocs/core/db/mysqli.class.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 53ccf8e19bf..f3c0c3cce62 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -358,7 +358,7 @@ class DoliDBMysqli extends DoliDB if (getDolGlobalInt('SYSLOG_LEVEL') < LOG_DEBUG) { dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR); // Log of request was not yet done previously } - dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR); + dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror.self::getCallerInfoString(), LOG_ERR); //var_dump(debug_print_backtrace()); } $this->lastquery = $query; @@ -368,6 +368,24 @@ class DoliDBMysqli extends DoliDB return $ret; } + /** + * Get caller info + * + * @return string + */ + final protected static function getCallerInfoString() + { + $backtrace = debug_backtrace(); + $msg = ""; + if (count($backtrace) >= 1) { + $trace = $backtrace[1]; + if (isset($trace['file'], $trace['line'])) { + $msg = " From {$trace['file']}:{$trace['line']}."; + } + } + return $msg; + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Returns the current line (as an object) for the resultset cursor From 21feee3bc8b2ebe8a87b8fa56f023faa5835ba44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Mar 2024 13:11:54 +0100 Subject: [PATCH 0398/1862] FIX Better test on validity of compute field syntax with parenthesis --- htdocs/core/lib/functions.lib.php | 42 +++++++++++++++++++------------ test/phpunit/SecurityTest.php | 15 +++++++++-- 2 files changed, 39 insertions(+), 18 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1fe4661236e..c0ecd6acefc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9641,18 +9641,23 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' return ''; } } - $scheck = preg_replace('/->[a-zA-Z0-9_]+\(/', '->__METHOD__', $s); // accept parenthesis in '...->method(...' - $scheck = preg_replace('/^\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '(...'. Must replace with __PARENTHESIS__ with a space after to allow following substitutions - $scheck = preg_replace('/\s\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '... ('. Must replace with __PARENTHESIS__ with a space after to allow following substitutions - $scheck = preg_replace('/^!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in 'function(' and '!function(' - $scheck = preg_replace('/\s!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in '... function(' and '... !function(' - $scheck = preg_replace('/(\^|\')\(/', '__REGEXSTART__', $scheck); // To allow preg_match('/^(aaa|bbb)/'... or isStringVarMatching('leftmenu', '(aaa|bbb)') + $savescheck = ''; + $scheck = $s; + while ($scheck && $savescheck != $scheck) { + $savescheck = $scheck; + $scheck = preg_replace('/->[a-zA-Z0-9_]+\(/', '->__METHOD__', $scheck); // accept parenthesis in '...->method(...' + $scheck = preg_replace('/^\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '(...'. Must replace with __PARENTHESIS__ with a space after to allow following substitutions + $scheck = preg_replace('/\s\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '... ('. Must replace with __PARENTHESIS__ with a space after to allow following substitutions + $scheck = preg_replace('/^!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in 'function(' and '!function(' + $scheck = preg_replace('/\s!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in '... function(' and '... !function(' + $scheck = preg_replace('/(\^|\')\(/', '__REGEXSTART__', $scheck); // To allow preg_match('/^(aaa|bbb)/'... or isStringVarMatching('leftmenu', '(aaa|bbb)') + } //print 'scheck='.$scheck." : ".strpos($scheck, '(')."
\n"; if (strpos($scheck, '(') !== false) { if ($returnvalue) { - return 'Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s; + return 'Bad string syntax to evaluate (mode 1, found call of a function or method without using the direct name of the function): '.$s; } else { - dol_syslog('Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s); + dol_syslog('Bad string syntax to evaluate (mode 1, found call of a function or method without using the direct name of the function): '.$s); return ''; } } @@ -9672,18 +9677,23 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' return ''; } } - $scheck = preg_replace('/->[a-zA-Z0-9_]+\(/', '->__METHOD__', $s); // accept parenthesis in '...->method(...' - $scheck = preg_replace('/^\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '(...'. Must replace with __PARENTHESIS__ with a space after to allow following substitutions - $scheck = preg_replace('/\s\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '... ('. Must replace with __PARENTHESIS__ with a space after to allow following substitutions - $scheck = preg_replace('/^!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in 'function(' and '!function(' - $scheck = preg_replace('/\s!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in '... function(' and '... !function(' - $scheck = preg_replace('/(\^|\')\(/', '__REGEXSTART__', $scheck); // To allow preg_match('/^(aaa|bbb)/'... or isStringVarMatching('leftmenu', '(aaa|bbb)') + $savescheck = ''; + $scheck = $s; + while ($scheck && $savescheck != $scheck) { + $savescheck = $scheck; + $scheck = preg_replace('/->[a-zA-Z0-9_]+\(/', '->__METHOD__', $scheck); // accept parenthesis in '...->method(...' + $scheck = preg_replace('/^\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '(...'. Must replace with __PARENTHESIS__ with a space after to allow following substitutions + $scheck = preg_replace('/\s\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '... ('. Must replace with __PARENTHESIS__ with a space after to allow following substitutions + $scheck = preg_replace('/^!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in 'function(' and '!function(' + $scheck = preg_replace('/\s!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in '... function(' and '... !function(' + $scheck = preg_replace('/(\^|\')\(/', '__REGEXSTART__', $scheck); // To allow preg_match('/^(aaa|bbb)/'... or isStringVarMatching('leftmenu', '(aaa|bbb)') + } //print 'scheck='.$scheck." : ".strpos($scheck, '(')."
\n"; if (strpos($scheck, '(') !== false) { if ($returnvalue) { - return 'Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s; + return 'Bad string syntax to evaluate (mode 2, found call of a function or method without using the direct name of the function): '.$s; } else { - dol_syslog('Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s); + dol_syslog('Bad string syntax to evaluate (mode 2, found call of a function or method without using the direct name of the function): '.$s); return ''; } } diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 4615efe8c22..66a40206bb3 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -1061,6 +1061,10 @@ class SecurityTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; + // Declare classes found into string to evaluate + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $result=dol_eval('1==1', 1, 0); print "result1 = ".$result."\n"; $this->assertTrue($result); @@ -1069,8 +1073,15 @@ class SecurityTest extends PHPUnit\Framework\TestCase print "result2 = ".$result."\n"; $this->assertFalse($result); - include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $s = '((($reloadedobj = new ClassThatDoesNotExists($db)) && ($reloadedobj->fetchNoCompute($objectoffield->fk_product) > 0)) ? \'1\' : \'0\')'; + $result3a = dol_eval($s, 1, 1, '2'); + print "result3a = ".$result."\n"; + $this->assertTrue(is_null($result3a)); + + $s = '((($reloadedobj = new Project($db)) && ($reloadedobj->fetchNoCompute($objectoffield->fk_product) > 0)) ? \'1\' : \'0\')'; + $result3b = dol_eval($s, 1, 1, '2'); + print "result3b = ".$result."\n"; + $this->assertEquals('0', $result3b); $s = '(($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"'; $result=dol_eval($s, 1, 1, '2'); From 16319e5103baf93a142eb12ec7b2bffdb5466b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Mar 2024 15:48:36 +0100 Subject: [PATCH 0399/1862] fix codespell (#28594) --- htdocs/mrp/class/mo.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index e3438cad7e0..b8e2ec9e940 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -900,7 +900,7 @@ class Mo extends CommonObject } $productstatic = new Product($this->db); $fk_movement = GETPOST('fk_movement', 'int'); - $arrayoflines = $this->fetchLinesLinked('consumed', $idline); // Get lines consummed under the one to delete + $arrayoflines = $this->fetchLinesLinked('consumed', $idline); // Get lines consumed under the one to delete $result = 0; From a26d81ad39fcff7e4c039aa130f88a6e133b44ff Mon Sep 17 00:00:00 2001 From: PsyCrow <93346975+PsyCrow-code@users.noreply.github.com> Date: Sun, 3 Mar 2024 08:49:18 -0600 Subject: [PATCH 0400/1862] Patch 6 (#28593) * css * Fix #19404 FIX #22721 * Update facture.class.php FIX #22948 * Update facture.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/compta/facture/class/facture.class.php | 4 ++-- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/fourn/facture/list.php | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 3f12e4e045f..c37501e3377 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4164,8 +4164,8 @@ class Facture extends CommonInvoice $price = $pu; $remise = 0; if ($remise_percent > 0) { - $remise = round(($pu * $remise_percent / 100), 2); - $price = ($pu - $remise); + $remise = round(((float) $pu * (float) $remise_percent / 100), 2); + $price = ((float) $pu - $remise); } $price = price2num($price); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 87af56e106c..b63a17aa5a3 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2687,7 +2687,7 @@ class FactureFournisseur extends CommonInvoice $sql .= " JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ff.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= ' WHERE ff.paye = 0'; - $sql .= ' AND ff.fk_statut > 0'; + $sql .= " AND ff.fk_statut IN (".self::STATUS_VALIDATED.")"; $sql .= " AND ff.entity = ".$conf->entity; if ($user->socid) { $sql .= ' AND ff.fk_soc = '.((int) $user->socid); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 3426dd33313..bfdd8fdbdad 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1306,7 +1306,7 @@ if (!empty($arrayfields['f.tms']['checked'])) { } // Status if (!empty($arrayfields['f.fk_statut']['checked'])) { - print '
'; @@ -1525,6 +1525,7 @@ while ($i < $imaxinloop) { $userstatic->firstname = $obj->firstname; $userstatic->email = $obj->user_email; $userstatic->statut = $obj->user_statut; + $userstatic->status = $obj->user_statut; $userstatic->entity = $obj->entity; $userstatic->photo = $obj->photo; $userstatic->office_phone = $obj->office_phone; From da3a24c3f3fa5f24a95276e2bedc3c1f6950740f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Mar 2024 15:53:31 +0100 Subject: [PATCH 0401/1862] fix phpstan (#28597) * fix phpstan * fix phpstan --- .../supplier_proposal/doc/pdf_aurore.modules.php | 3 ++- .../supplier_proposal/doc/pdf_zenith.modules.php | 10 +++++----- 2 files changed, 7 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 deffaf0e905..f53f7eba871 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -5,6 +5,7 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -711,7 +712,7 @@ class pdf_aurore extends ModelePDFSupplierProposal * * @param TCPDF $pdf Object PDF * @param Object $object Object to show - * @param int $posy Y + * @param int|float $posy Y * @param Translate $outputlangs Langs object * @return int */ diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index 82b1dbaabf3..2c10cdefc1c 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -5,7 +5,7 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018-2022 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -840,10 +840,10 @@ class pdf_zenith extends ModelePDFSupplierProposal /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param TCPDF $pdf Object PDF - * @param SupplierProposal $object Object to show - * @param int $posy Y - * @param Translate $outputlangs Langs object + * @param TCPDF $pdf Object PDF + * @param SupplierProposal $object Object to show + * @param int|float $posy Y + * @param Translate $outputlangs Langs object * @return integer */ protected function _tableau_info(&$pdf, $object, $posy, $outputlangs) From 51f6111519f098852d5e38588da467356aa370cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Mar 2024 15:56:09 +0100 Subject: [PATCH 0402/1862] Comment --- htdocs/categories/class/categorie.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 1f901d7381e..74310aea526 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1853,9 +1853,9 @@ class Categorie extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Return tableau de toutes les photos de la categorie + * Return an array with all photos inside the directory * - * @param string $dir Repertoire a scanner + * @param string $dir Dir to scan * @param int $nbmax Nombre maximum de photos (0=pas de max) * @return array Tableau de photos */ From 71bb3a1275d9d04953dd7b44bc9465982e4e4292 Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 3 Mar 2024 15:59:08 +0100 Subject: [PATCH 0403/1862] Fix: Use accessible path for CategorieTest (#28600) * Fix: Use accessible path for CategorieTest # Fix: Use accessible path for CategorieTest The test was using '/' (root of the filesystem) which was outside the open_basedir paths. Modified the path to the medias directory to allow the test to pass with open_basedir restriction in effect. * Update CategorieTest.php --------- Co-authored-by: Laurent Destailleur --- test/phpunit/CategorieTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php index b57932bebde..cef67a66b70 100644 --- a/test/phpunit/CategorieTest.php +++ b/test/phpunit/CategorieTest.php @@ -214,7 +214,7 @@ class CategorieTest extends CommonClassTest $this->assertLessThan($result, 0); */ - $retarray = $localobject->liste_photos('/'); + $retarray = $localobject->liste_photos(DOL_DATA_ROOT."/categorie"); print __METHOD__." retarray size=".count($retarray)."\n"; $this->assertTrue(is_array($retarray)); From a094cf73c29d5a76198990f607717d73f6ffbad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Mar 2024 16:00:13 +0100 Subject: [PATCH 0404/1862] fix phpstan and phpdoc (#28596) * fix phpstan * fix phpstan * fix phpstan --- .../product/class/html.formproduct.class.php | 12 ++--- htdocs/webportal/class/context.class.php | 51 +++++++++++++++++-- htdocs/webportal/class/controller.class.php | 22 ++++++++ 3 files changed, 75 insertions(+), 10 deletions(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index d272bc6e95a..660ed67acba 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -261,7 +261,7 @@ class FormProduct /** * Return list of warehouses * - * @param string|int|array $selected Id of preselected warehouse ('' or '-1' for no value, 'ifone' and 'ifonenodefault' = select value if one value otherwise no value, '-2' to use the default value from setup) + * @param string|int|array $selected Id of preselected warehouse ('' or '-1' for no value, 'ifone' and 'ifonenodefault' = select value if one value otherwise no value, '-2' to use the default value from setup) * @param string $htmlname Name of html select html * @param string $filterstatus warehouse status filter, following comma separated filter options can be used * 'warehouseopen' = select products from open warehouses, @@ -491,10 +491,10 @@ class FormProduct /** * Display form to select warehouse * - * @param string $page Page - * @param int $selected Id of warehouse - * @param string $htmlname Name of select html field - * @param int $addempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @param string $page Page + * @param string|int $selected Id of warehouse + * @param string $htmlname Name of select html field + * @param int $addempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. * @return void */ public function formSelectWarehouses($page, $selected = '', $htmlname = 'warehouse_id', $addempty = 0) @@ -692,7 +692,7 @@ class FormProduct /** * Return list of lot numbers (stock from product_batch) with stock location and stock qty * - * @param int $selected Id of preselected lot stock id ('' for no value, 'ifone'=select value if one value otherwise no value) + * @param string|int $selected Id of preselected lot stock id ('' for no value, 'ifone'=select value if one value otherwise no value) * @param string $htmlname Name of html select html * @param string $filterstatus lot status filter, following comma separated filter options can be used * @param int $empty 1=Can be empty, 0 if not diff --git a/htdocs/webportal/class/context.class.php b/htdocs/webportal/class/context.class.php index d590c4fcf6d..d14efdc2d98 100644 --- a/htdocs/webportal/class/context.class.php +++ b/htdocs/webportal/class/context.class.php @@ -1,4 +1,26 @@ + * Copyright (C) 2024 Frédéric France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + /** + * \file htdocs/webportal/class/context.class.php + * \ingroup webportal + * \brief File of context class for WebPortal + */ require_once __DIR__ . '/controller.class.php'; require_once __DIR__ . '/webPortalTheme.class.php'; @@ -20,10 +42,24 @@ class Context */ public $db; + /** + * @var string + */ public $title; + + /** + * @var string + */ public $desc; + /** + * @var string + */ public $meta_title; + + /** + * @var string + */ public $meta_desc; /** @@ -32,7 +68,14 @@ class Context */ public $appliName; + /** + * @var string + */ public $controller; + + /** + * @var boolean + */ public $controller_found = false; /** @@ -264,7 +307,7 @@ class Context * @return string * @deprecated see getControllerUrl() */ - public function getRootUrl($controller = false, $moreParams = '', $addToken = true) + public function getRootUrl($controller = '', $moreParams = '', $addToken = true) { return self::getControllerUrl($controller, $moreParams, $addToken); } @@ -277,7 +320,7 @@ class Context * @param bool $addToken Add token hash only if controller is set * @return string */ - public function getControllerUrl($controller = false, $moreParams = '', $addToken = true) + public function getControllerUrl($controller = '', $moreParams = '', $addToken = true) { // TODO : addToken parameter on auto to detect (create or edit) action and add token on url $url = $this->rootUrl; @@ -303,12 +346,12 @@ class Context * Used for external link (like email or web page) * so remove token and contextual behavior associate with current user * - * @param bool $controller Controller + * @param string $controller Controller * @param string|array $moreParams More parameters * @param array $Tparams Parameters * @return string */ - static public function getPublicControllerUrl($controller = false, $moreParams = '', $Tparams = array()) + static public function getPublicControllerUrl($controller = '', $moreParams = '', $Tparams = array()) { $url = self::getRootConfigUrl(); diff --git a/htdocs/webportal/class/controller.class.php b/htdocs/webportal/class/controller.class.php index 0904b664847..ddc3ae103df 100644 --- a/htdocs/webportal/class/controller.class.php +++ b/htdocs/webportal/class/controller.class.php @@ -1,4 +1,26 @@ + * Copyright (C) 2024 Frédéric France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + /** + * \file htdocs/webportal/class/controller.class.php + * \ingroup webportal + * \brief File of controller class for WebPortal + */ /** * Class to manage pages From 5714ff8b161aba66a5805fdfcff9f3fd30a2ab6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Mar 2024 16:31:22 +0100 Subject: [PATCH 0405/1862] Fix regression in dol_dir_list() --- htdocs/admin/translation.php | 1 + htdocs/core/lib/files.lib.php | 31 ++++++++++++++++--------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index c8f47d241c6..2c71f7592c4 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -290,6 +290,7 @@ foreach ($modulesdir as $keydir => $tmpsearchdir) { $dir_lang_osencoded = dol_osencode($dir_lang); $filearray = dol_dir_list($dir_lang_osencoded, 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ? SORT_ASC : SORT_DESC), 1); + foreach ($filearray as $file) { $tmpfile = preg_replace('/.lang/i', '', basename($file['name'])); $moduledirname = (basename(dirname(dirname($dir_lang)))); diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index f82a0fccd6e..9d7b2222040 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -44,19 +44,19 @@ function dol_basename($pathfile) * Scan a directory and return a list of files/directories. * Content for string is UTF8 and dir separator is "/". * - * @param string $utf8_path Starting path from which to search. This is a full path. - * @param string $types Can be "directories", "files", or "all" - * @param int $recursive Determines whether subdirectories are searched - * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function, - * but must not contains the start and end '/'. Filter is checked into basename only. - * @param string[] $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked both into fullpath and into basename (So '^xxx' may exclude 'xxx/dirscanned/...' and dirscanned/xxx'). - * @param string $sortcriteria Sort criteria ('','fullname','relativename','name','date','size') - * @param int $sortorder Sort order (SORT_ASC, SORT_DESC) - * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only, 4=Force load of perm - * @param int $nohook Disable all hooks - * @param string $relativename For recursive purpose only. Must be "" at first call. - * @param int $donotfollowsymlinks Do not follow symbolic links - * @param int $nbsecondsold Only files older than $nbsecondsold + * @param string $utf8_path Starting path from which to search. This is a full path. + * @param string $types Can be "directories", "files", or "all" + * @param int $recursive Determines whether subdirectories are searched + * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function, + * but must not contains the start and end '/'. Filter is checked into basename only. + * @param string|string[] $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked both into fullpath and into basename (So '^xxx' may exclude 'xxx/dirscanned/...' and dirscanned/xxx'). + * @param string $sortcriteria Sort criteria ('','fullname','relativename','name','date','size') + * @param int $sortorder Sort order (SORT_ASC, SORT_DESC) + * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only, 4=Force load of perm + * @param int $nohook Disable all hooks + * @param string $relativename For recursive purpose only. Must be "" at first call. + * @param int $donotfollowsymlinks Do not follow symbolic links + * @param int $nbsecondsold Only files older than $nbsecondsold * @return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file',...) * @see dol_dir_list_in_database() */ @@ -70,7 +70,7 @@ function dol_dir_list($utf8_path, $types = "all", $recursive = 0, $filter = "", $filters_ok = true; $error_info = ""; // Ensure we have an array for the exclusions - $exclude_array = $excludefilter === null ? array() : (is_array($excludefilter) ? $excludefilter : array($excludefilter)); + $exclude_array = ($excludefilter === null || $excludefilter === '') ? array() : (is_array($excludefilter) ? $excludefilter : array($excludefilter)); foreach ((array($filter) + $exclude_array) as $f) { // Check that all '/' are escaped. if ((int) preg_match('/(?:^|[^\\\\])\//', $f) > 0) { @@ -87,8 +87,9 @@ function dol_dir_list($utf8_path, $types = "all", $recursive = 0, $filter = "", } } else { // Already computed before - $exclude_array = $excludefilter; + $exclude_array = ($excludefilter === null || $excludefilter === '') ? array() : (is_array($excludefilter) ? $excludefilter : array($excludefilter)); } + // Define excludefilterarray (before while, for speed) $excludefilterarray = array_merge(array('^\.'), $exclude_array); From b518bb0c9af8451fe529c05924d71c0f991dd207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Mar 2024 16:51:16 +0100 Subject: [PATCH 0406/1862] fix phpstan (#28604) --- htdocs/core/class/html.formcompany.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index b3be55a633f..5c6154a4605 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2017 Rui Strecht * Copyright (C) 2020 Open-Dsi + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -635,7 +636,7 @@ class FormCompany extends Form * * @param object $object Object we try to find contacts * @param string $var_id Name of id field - * @param string $selected Pre-selected third party + * @param int $selected Pre-selected third party * @param string $htmlname Name of HTML form * @param array $limitto Disable answers that are not id in this array list * @param int $forceid This is to force another object id than object->id @@ -643,7 +644,7 @@ class FormCompany extends Form * @param string $morecss More CSS on select component * @return int The selected third party ID */ - public function selectCompaniesForNewContact($object, $var_id, $selected = 0, $htmlname = 'newcompany', $limitto = '', $forceid = 0, $moreparam = '', $morecss = '') + public function selectCompaniesForNewContact($object, $var_id, $selected = 0, $htmlname = 'newcompany', $limitto = [], $forceid = 0, $moreparam = '', $morecss = '') { global $conf, $hookmanager; From 8b756678191d6ef24ab5b3c3ae75169e0f29dac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Mar 2024 16:52:02 +0100 Subject: [PATCH 0407/1862] fix phpstan $amounts (array) does not accept array (#28603) * fix phpstan $amounts (array) does not accept array * fix phpstan $amounts (array) does not accept array --- htdocs/compta/paiement.php | 8 ++++---- htdocs/compta/paiement/class/paiement.class.php | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 4d24a875fb1..63938b6742c 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -8,8 +8,8 @@ * Copyright (C) 2014 Raphaël Doursenaud * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2018-2021 Frédéric France - * Copyright (C) 2023 Lenin Rivas + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2023 Lenin Rivas * Copyright (C) 2023 Sylvain Legrand * Copyright (C) 2023 William Mead * @@ -261,8 +261,8 @@ if (empty($reshook)) { // Creation of payment line $paiement = new Paiement($db); - $paiement->datepaye = $datepaye; - $paiement->amounts = $amounts; // Array with all payments dispatching with invoice id + $paiement->datepaye = $datepaye; + $paiement->amounts = $amounts; // Array with all payments dispatching with invoice id $paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching $paiement->multicurrency_code = $multicurrency_code; // Array with all currency of payments dispatching $paiement->multicurrency_tx = $multicurrency_tx; // Array with all currency tx of payments dispatching diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 013c0fcebad..54768afbba2 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -7,9 +7,9 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2018 Ferran Marcet - * Copyright (C) 2018 Thibault FOUCART + * Copyright (C) 2018 Thibault FOUCART * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2020 Andreu Bisquerra Gaya + * Copyright (C) 2020 Andreu Bisquerra Gaya * Copyright (C) 2021 OpenDsi * Copyright (C) 2023 Joachim Kueter * Copyright (C) 2023 Sylvain Legrand @@ -100,22 +100,22 @@ class Paiement extends CommonObject public $multicurrency_amount; /** - * @var array array: invoice ID => amount for that invoice (in the main currency) + * @var float[] array: invoice ID => amount for that invoice (in the main currency) */ public $amounts = array(); /** - * @var array array: invoice ID => amount for that invoice (in the invoice's currency) + * @var float[] array: invoice ID => amount for that invoice (in the invoice's currency) */ public $multicurrency_amounts = array(); /** - * @var array Multicurrency rate (array: invoice ID => currency rate ("taux" in French) for that invoice) + * @var float[] Multicurrency rate (array: invoice ID => currency rate ("taux" in French) for that invoice) */ public $multicurrency_tx = array(); /** - * @var array Multicurrency code (array: invoice ID => currency code for that invoice) + * @var string[] Multicurrency code (array: invoice ID => currency code for that invoice) */ public $multicurrency_code = array(); From 9c3a3758396f2b1e5f0bf8fdc5a211b9c3689f49 Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 3 Mar 2024 16:56:12 +0100 Subject: [PATCH 0408/1862] Fix: Use accessible temporarypath for CMailFileTest (#28599) # Fix: Use accessible temporarypath for CMailFileTest '/tmp' does not exist on all systems and is subject to open_basedir restrictions. Selected another temporary path for the test. --- test/phpunit/CMailFileTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/phpunit/CMailFileTest.php b/test/phpunit/CMailFileTest.php index d0b5d480a82..0cf5aa83216 100644 --- a/test/phpunit/CMailFileTest.php +++ b/test/phpunit/CMailFileTest.php @@ -155,8 +155,8 @@ class CMailFileTest extends CommonClassTest $msg .= '

From wikipedia

Red dot'; $msg .= ''; - - $localobject = new CMailFile('Test', 'test@test.com', 'from@from.com', $msg, array(), array(), array(), '', '', 0, -1, '', '', '', '', 'standard', '', '/tmp'); + $tmp_dir = $conf->admin->dir_temp.'/'.__FUNCTION__.getmypid().'_tmp'; + $localobject = new CMailFile('Test', 'test@test.com', 'from@from.com', $msg, array(), array(), array(), '', '', 0, -1, '', '', '', '', 'standard', '', $tmp_dir); $result = count($localobject->html_images); print __METHOD__ . " result count image detected in the mail=" . $result . "\n"; From 40f98d529ed7228d84d93bfb1772bde2bf185b77 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Mar 2024 16:58:03 +0100 Subject: [PATCH 0409/1862] Fix phpcs --- test/phpunit/CMailFileTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/CMailFileTest.php b/test/phpunit/CMailFileTest.php index 0cf5aa83216..1898a9fba34 100644 --- a/test/phpunit/CMailFileTest.php +++ b/test/phpunit/CMailFileTest.php @@ -155,7 +155,7 @@ class CMailFileTest extends CommonClassTest $msg .= '

From wikipedia

Red dot'; $msg .= ''; - $tmp_dir = $conf->admin->dir_temp.'/'.__FUNCTION__.getmypid().'_tmp'; + $tmp_dir = $conf->admin->dir_temp.'/'.__FUNCTION__.getmypid().'_tmp'; $localobject = new CMailFile('Test', 'test@test.com', 'from@from.com', $msg, array(), array(), array(), '', '', 0, -1, '', '', '', '', 'standard', '', $tmp_dir); $result = count($localobject->html_images); From 41bdcff4da175afe13d4bb1e8d51bb38eb139723 Mon Sep 17 00:00:00 2001 From: PsyCrow <93346975+PsyCrow-code@users.noreply.github.com> Date: Sun, 3 Mar 2024 09:58:52 -0600 Subject: [PATCH 0410/1862] Update facture.class.php (#28591) * Update facture.class.php FIX #22948 * Update facture.class.php --- htdocs/compta/facture/class/facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 41daf8bd39c..73a184c96c0 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4167,8 +4167,8 @@ class Facture extends CommonInvoice $price = $pu; $remise = 0; if ($remise_percent > 0) { - $remise = round(($pu * $remise_percent / 100), 2); - $price = ($pu - $remise); + $remise = round(((float) $pu * (float) $remise_percent / 100), 2); + $price = ((float) $pu - $remise); } $price = price2num($price); From 3663b9b305040247fe1902502361a69405562cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Mar 2024 17:00:06 +0100 Subject: [PATCH 0411/1862] fix phpstan (#28589) * fix phpstan * Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 6 +++--- htdocs/salaries/class/paymentsalary.class.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0fd4bc4acc1..4dde6a63754 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5104,7 +5104,7 @@ function img_delete($titlealt = 'default', $other = 'class="pictodelete"', $more $titlealt = $langs->trans('Delete'); } - return img_picto($titlealt, 'delete.png', $other, false, 0, 0, '', $morecss); + return img_picto($titlealt, 'delete.png', $other, 0, 0, 0, '', $morecss); } /** @@ -5425,7 +5425,7 @@ function img_search($titlealt = 'default', $other = '') $titlealt = $langs->trans('Search'); } - $img = img_picto($titlealt, 'search.png', $other, false, 1); + $img = img_picto($titlealt, 'search.png', $other, 0, 1); $input = ''; @@ -5448,7 +5448,7 @@ function img_searchclear($titlealt = 'default', $other = '') $titlealt = $langs->trans('Search'); } - $img = img_picto($titlealt, 'searchclear.png', $other, false, 1); + $img = img_picto($titlealt, 'searchclear.png', $other, 0, 1); $input = ''; diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 18f3d1263e1..0de7eaaf457 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -62,7 +62,7 @@ class PaymentSalary extends CommonObject public $fk_salary; /** - * @var int Payment creation date + * @var int|string Payment creation date */ public $datec = ''; From faf00c35e36e82fa48c0170821138772a42cb99d Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 3 Mar 2024 17:01:17 +0100 Subject: [PATCH 0412/1862] Fix: Skip UtilsTest on windows where ls is not available (#28601) # Fix: Skip UtilsTest on windows where ls is not available The test in question uses 'ls' which is not available on windows. This change limits the execution to non windows systems. --- test/phpunit/CommonClassTest.class.php | 18 ++++++++++++++++++ test/phpunit/UtilsTest.php | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/test/phpunit/CommonClassTest.class.php b/test/phpunit/CommonClassTest.class.php index 262dc2ad002..eae67cb1dda 100644 --- a/test/phpunit/CommonClassTest.class.php +++ b/test/phpunit/CommonClassTest.class.php @@ -418,4 +418,22 @@ abstract class CommonClassTest extends TestCase $this->assertFileDoesNotExist($file, $message); } } + + + /** + * Skip test if test is not running on "Unix" + * + * @param string $message Message to indicate which test requires "Unix" + * + * @return bool True if this is not *nix, and fake assert generated + */ + protected function fakeAssertIfNotUnix($message) + { + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + $this->assertTrue(true, "Dummy test to not mark the test as risky"); + // $this->markTestSkipped("PHPUNIT is running on windows. $message"); + return true; + } + return false; + } } diff --git a/test/phpunit/UtilsTest.php b/test/phpunit/UtilsTest.php index ddb87e0f83e..354a325b8cc 100644 --- a/test/phpunit/UtilsTest.php +++ b/test/phpunit/UtilsTest.php @@ -55,6 +55,11 @@ class UtilsTest extends CommonClassTest */ public function testExecuteCLI() { + // Needs ls. Skip test if not running on *nix system. + if ($this->fakeAssertIfNotUnix(__METHOD__." only works on *nix")) { + return; + } + global $conf,$user,$langs,$db; $conf = $this->savconf; $user = $this->savuser; From 9e1cfb7c52f8c2ec67562b60fbfc359a20eb069a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20A?= <35066297+c3do@users.noreply.github.com> Date: Sun, 3 Mar 2024 17:07:58 +0100 Subject: [PATCH 0413/1862] FIX issue #23022 (#28590) * FIX issue #23022 * no longer necessary * no longer necessary * no longer necessary * no longer necessary * no longer necessary * no longer necessary * no longer necessary --- htdocs/core/lib/company.lib.php | 1 + htdocs/partnership/partnership_list.php | 4 ---- htdocs/societe/agenda.php | 3 --- htdocs/societe/document.php | 3 --- htdocs/societe/messaging.php | 3 --- htdocs/societe/note.php | 3 --- htdocs/societe/price.php | 3 --- htdocs/societe/project.php | 3 --- 8 files changed, 1 insertion(+), 22 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index c71fe088869..487782f7f39 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -314,6 +314,7 @@ function societe_prepare_head(Societe $object) if ($user->socid == 0) { // Notifications if (isModEnabled('notification')) { + $langs->load('mails'); $nbNotif = 0; // Enable caching of thirdparty count notifications require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index ba50933b9ec..452e03be496 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -489,10 +489,6 @@ if ($managedfor == "member") { $adht = new AdherentType($db); $result = $adhstat->fetch($memberid); - if (isModEnabled('notification')) { - $langs->load("mails"); - } - $adht->fetch($adhstat->typeid); $head = member_prepare_head($adhstat); diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 5acb9e4f050..cffa65d43f1 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -129,9 +129,6 @@ if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/thirdpartynameonly/', $help_url = ''; llxHeader('', $title, $help_url); -if (isModEnabled('notification')) { - $langs->load("mails"); -} $head = societe_prepare_head($object); diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 3b7c7081551..aab773fa19a 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -118,9 +118,6 @@ $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('', $title, $help_url); // Show tabs -if (isModEnabled('notification')) { - $langs->load("mails"); -} $head = societe_prepare_head($object); print dol_get_fiche_head($head, 'document', $langs->trans("ThirdParty"), -1, 'company'); diff --git a/htdocs/societe/messaging.php b/htdocs/societe/messaging.php index 50ff1d6b7d7..01791b4a188 100644 --- a/htdocs/societe/messaging.php +++ b/htdocs/societe/messaging.php @@ -128,9 +128,6 @@ if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/thirdpartynameonly/', } llxHeader('', $title); -if (isModEnabled('notification')) { - $langs->load("mails"); -} $head = societe_prepare_head($object); print dol_get_fiche_head($head, 'agenda', $langs->trans("ThirdParty"), -1, $object->picto); diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index a80e7031c2a..7213426011e 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -93,9 +93,6 @@ if ($object->id > 0) { /* * Affichage onglets */ - if (isModEnabled('notification')) { - $langs->load("mails"); - } $head = societe_prepare_head($object); diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 31d8f9cec31..e7ba363e045 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -204,9 +204,6 @@ $object = new Societe($db); $result = $object->fetch($socid); llxHeader("", $langs->trans("ThirdParty").'-'.$langs->trans('PriceByCustomer')); -if (isModEnabled('notification')) { - $langs->load("mails"); -} $head = societe_prepare_head($object); print dol_get_fiche_head($head, 'price', $langs->trans("ThirdParty"), -1, 'company'); diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index a4f490b031d..3ab7e0d712e 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -124,9 +124,6 @@ if ($socid) { } llxHeader('', $title); - if (isModEnabled('notification')) { - $langs->load("mails"); - } $head = societe_prepare_head($object); print dol_get_fiche_head($head, 'project', $langs->trans("ThirdParty"), -1, 'company'); From e2fba5d03f84c714e2f4180f1c29ad7bc66194dd Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 3 Mar 2024 17:08:57 +0100 Subject: [PATCH 0414/1862] Qual: FactureTest - use assertions rather than dying in the setup. (#28585) # Qual: FactureTest - use assertions rather than dying in the setup. The 'die()' instructions have been replaced - not all tests should fail because the preconditions for a test case are not met. --- test/phpunit/FactureTest.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 28c4ad210dc..a7d26438352 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -56,20 +56,9 @@ class FactureTest extends CommonClassTest */ public static function setUpBeforeClass(): void { - global $conf,$user,$langs,$db; - - if (!isModEnabled('facture')) { - print __METHOD__." module customer invoice must be enabled.\n"; - die(1); - } - if (isModEnabled('ecotaxdeee')) { - print __METHOD__." ecotaxdeee module must not be enabled.\n"; - die(1); - } - - $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. - - print __METHOD__."\n"; + self::assertTrue(isModEnabled('facture'), " module customer invoice must be enabled"); + self::assertFalse(isModEnabled('ecotaxdeee'), " module customer invoice must be enabled"); + parent::setUpBeforeClass(); } From e1b3a639c4832d0a3a11bba715a745ffccb3e808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Mar 2024 17:09:24 +0100 Subject: [PATCH 0415/1862] fix phpstan default value is incompatible with type string (#28592) --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4dde6a63754..762ce407775 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5699,7 +5699,7 @@ function dol_print_error_email($prefixcode, $errormessage = '', $errormessages = * @param string $sortorder Current sort order * @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag, for example 'mycss '. * @param string $tooltip Tooltip - * @param string $forcenowrapcolumntitle No need for use 'wrapcolumntitle' css style + * @param int $forcenowrapcolumntitle No need for use 'wrapcolumntitle' css style * @return void */ function print_liste_field_titre($name, $file = "", $field = "", $begin = "", $moreparam = "", $moreattrib = "", $sortfield = "", $sortorder = "", $prefix = "", $tooltip = "", $forcenowrapcolumntitle = 0) @@ -5722,7 +5722,7 @@ function print_liste_field_titre($name, $file = "", $field = "", $begin = "", $m * @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag, for example 'mycss '. * @param string $disablesortlink 1=Disable sort link * @param string $tooltip Tooltip - * @param string $forcenowrapcolumntitle No need for use 'wrapcolumntitle' css style + * @param int $forcenowrapcolumntitle No need for use 'wrapcolumntitle' css style * @return string */ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin = "", $moreparam = "", $moreattrib = "", $sortfield = "", $sortorder = "", $prefix = "", $disablesortlink = 0, $tooltip = '', $forcenowrapcolumntitle = 0) From f5c0cfcf6bb17dd33744ec17af8b283f2bc6008a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Mar 2024 17:09:55 +0100 Subject: [PATCH 0416/1862] fix phpstan (#28588) --- htdocs/core/lib/functions.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 762ce407775..77bfb98042f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4511,7 +4511,7 @@ function getPictoForType($key) * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) * Example: fontawesome_envelope-open-text_fas_red_1em if you want to use fontaweseome icons: fontawesome__'; $out .= ''; } else { // Immediate load of table record. - $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); + $out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); } return $out; From 8d9e9f13cfead5ff6ddb8acf72d4bbbc6a3398ef Mon Sep 17 00:00:00 2001 From: thomas-Ngr Date: Tue, 5 Mar 2024 17:18:36 +0100 Subject: [PATCH 0486/1862] fix #28374 : tosell is not used anymore on products, use status (#28647) --- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/compta/facture/card.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 9c30198f3e7..7a3b3c13cba 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -233,7 +233,7 @@ if (empty($reshook)) { $line->fetch_product(); } if (is_object($line->product) && $line->product->id > 0) { - if (empty($line->product->tosell)) { + if (empty($line->product->status)) { $warningMsgLineList[$line->id] = $langs->trans('WarningLineProductNotToSell', $line->product->ref); } } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 3b40b864f5a..92621cdfcac 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -203,7 +203,7 @@ if (empty($reshook)) { $line->fetch_product(); } if (is_object($line->product) && $line->product->id > 0) { - if (empty($line->product->tosell)) { + if (empty($line->product->status)) { $warningMsgLineList[$line->id] = $langs->trans('WarningLineProductNotToSell', $line->product->ref); } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index dd784b53419..ca53310fb71 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -234,7 +234,7 @@ if (empty($reshook)) { $line->fetch_product(); } if (is_object($line->product) && $line->product->id > 0) { - if (empty($line->product->tosell)) { + if (empty($line->product->status)) { $warningMsgLineList[$line->id] = $langs->trans('WarningLineProductNotToSell', $line->product->ref); } } From dffa96768077df862e6f5debfc3fede131158601 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Mar 2024 17:23:33 +0100 Subject: [PATCH 0487/1862] Sanitize table name --- htdocs/accountancy/class/bookkeeping.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index a49570fccbf..362728c367b 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1211,17 +1211,17 @@ class BookKeeping extends CommonObject if (count($filter) > 0) { foreach ($filter as $key => $value) { if ($key == 't.doc_date') { - $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; + $sqlwhere[] = $this->db->sanitize($key)." = '".$this->db->idate($value)."'"; } elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=' || $key == 't.doc_date>' || $key == 't.doc_date<') { - $sqlwhere[] = $key."'".$this->db->idate($value)."'"; + $sqlwhere[] = $this->db->sanitize($key)."'".$this->db->idate($value)."'"; } elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=' || $key == 't.subledger_account>=' || $key == 't.subledger_account<=') { - $sqlwhere[] = $key."'".$this->db->escape($value)."'"; + $sqlwhere[] = $this->db->sanitize($key)."'".$this->db->escape($value)."'"; } elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') { - $sqlwhere[] = $key." = ".((int) $value); + $sqlwhere[] = $this->db->sanitize($key)." = ".((int) $value); } elseif ($key == 't.subledger_account' || $key == 't.numero_compte') { - $sqlwhere[] = $key." LIKE '".$this->db->escape($value)."%'"; + $sqlwhere[] = $this->db->sanitize($key)." LIKE '".$this->db->escape($value)."%'"; } elseif ($key == 't.subledger_label') { - $sqlwhere[] = $key." LIKE '".$this->db->escape($value)."%'"; + $sqlwhere[] = $this->db->sanitize($key)." LIKE '".$this->db->escape($value)."%'"; } elseif ($key == 't.code_journal' && !empty($value)) { if (is_array($value)) { $sqlwhere[] = natural_search("t.code_journal", implode(',', $value), 3, 1); @@ -1231,7 +1231,7 @@ class BookKeeping extends CommonObject } elseif ($key == 't.reconciled_option') { $sqlwhere[] = 't.lettering_code IS NULL'; } else { - $sqlwhere[] = $key." LIKE '%".$this->escape($this->db->escapeforlike($value))."%'"; + $sqlwhere[] = $this->db->sanitize($key)." LIKE '%".$this->escape($this->db->escapeforlike($value))."%'"; } } } From de139de23dde3c688b655da2930e6d0140208891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 5 Mar 2024 17:24:18 +0100 Subject: [PATCH 0488/1862] clean some files (#28649) * clean some files * clean some files --- .../webportal/css/themes/custom.css.php | 23 ++++++++++ htdocs/public/webportal/index.php | 29 +++++++++++-- htdocs/public/webportal/logout.php | 8 ++-- .../public/webportal/webportal.main.inc.php | 42 +++++++++++++------ htdocs/webportal/lib/webportal.lib.php | 3 +- 5 files changed, 83 insertions(+), 22 deletions(-) diff --git a/htdocs/public/webportal/css/themes/custom.css.php b/htdocs/public/webportal/css/themes/custom.css.php index e6bbf6d48ae..bdb1de8d7bb 100644 --- a/htdocs/public/webportal/css/themes/custom.css.php +++ b/htdocs/public/webportal/css/themes/custom.css.php @@ -1,4 +1,27 @@ + * Copyright (C) 2023-2024 Lionel Vessiller + * Copyright (C) 2024 Frédéric France + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/webportal/css/themes/custom.css.php + * \ingroup webportal + * \brief Custom css files for WebPortal + */ if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); diff --git a/htdocs/public/webportal/index.php b/htdocs/public/webportal/index.php index fecaecd29ed..9e293d5a04f 100644 --- a/htdocs/public/webportal/index.php +++ b/htdocs/public/webportal/index.php @@ -1,9 +1,30 @@ + * Copyright (C) 2023-2024 Lionel Vessiller + * Copyright (C) 2024 Frédéric France + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/webportal/index.php + * \ingroup webportal + * \brief index files for WebPortal + */ + +include 'webportal.main.inc.php'; -// Change this following line to use the correct relative path (../, ../../, etc) -$res = 0; -if (!$res && file_exists('./webportal.main.inc.php')) $res = @include './webportal.main.inc.php'; // to work if your module directory is into dolibarr root htdocs directory -if (!$res) die('Include of WebPortal main fails'); /** @var Context $context */ diff --git a/htdocs/public/webportal/logout.php b/htdocs/public/webportal/logout.php index 5cc4b00de7e..ec8a4c5f136 100644 --- a/htdocs/public/webportal/logout.php +++ b/htdocs/public/webportal/logout.php @@ -1,6 +1,7 @@ * Copyright (C) 2023-2024 Lionel Vessiller + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +18,7 @@ */ /** - * \file htdocs/user/logout.php + * \file htdocs/public/webportal/logout.php * \ingroup webportal * \brief Page called to disconnect a user */ @@ -33,10 +34,7 @@ if (!defined('NOREQUIREAJAX')) { define('NOREQUIREAJAX', '1'); } -// Change this following line to use the correct relative path (../, ../../, etc) -$res = 0; -if (!$res && file_exists('./webportal.main.inc.php')) $res = @include './webportal.main.inc.php'; // to work if your module directory is into dolibarr root htdocs directory -if (!$res) die('Include of WebPortal main fails'); +include 'webportal.main.inc.php'; global $db; diff --git a/htdocs/public/webportal/webportal.main.inc.php b/htdocs/public/webportal/webportal.main.inc.php index f72337314c1..c56e7d9bfba 100644 --- a/htdocs/public/webportal/webportal.main.inc.php +++ b/htdocs/public/webportal/webportal.main.inc.php @@ -1,4 +1,28 @@ + * Copyright (C) 2023-2024 Lionel Vessiller + * Copyright (C) 2024 Frédéric France + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/webportal/webportal.main.inc.php + * \ingroup webportal + * \brief Main include file for WebPortal + */ + if (!defined('WEBPORTAL')) { define('WEBPORTAL', 1); } if (!defined('NOLOGIN')) { define('NOLOGIN', 1); } if (!defined('NOREQUIREUSER')) { define('NOREQUIREUSER', 1); } @@ -38,20 +62,14 @@ if (!function_exists('dol_getprefix')) { } -// Change this following line to use the correct relative path (../, ../../, etc) -$res = 0; -if (!$res && file_exists('../../main.inc.php')) $res = @include '../../main.inc.php'; // to work if your module directory is into dolibarr root htdocs directory -if (!$res && file_exists('../../../main.inc.php')) $res = @include '../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory -if (!$res && file_exists('../../../../main.inc.php')) $res = @include '../../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory -if (!$res && file_exists('../../../../../main.inc.php')) $res = @include '../../../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory -if (!$res && file_exists('../../../../../../main.inc.php')) $res = @include '../../../../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory -if (!$res) die('Include of main fails'); +include '../../main.inc.php'; + require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/societeaccount.class.php'; -dol_include_once('/public/webportal/lib/webportal.lib.php'); -dol_include_once('/webportal/class/context.class.php'); -dol_include_once('/webportal/class/webportalmember.class.php'); -dol_include_once('/webportal/class/webportalpartnership.class.php'); +require_once DOL_DOCUMENT_ROOT . '/public/webportal/lib/webportal.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/webportal/class/context.class.php'; +require_once DOL_DOCUMENT_ROOT . '/webportal/class/webportalmember.class.php'; +require_once DOL_DOCUMENT_ROOT . '/webportal/class/webportalpartnership.class.php'; // Init session. Name of session is specific to WEBPORTAL instance. // Must be done after the include of filefunc.inc.php so global variables of conf file are defined (like $dolibarr_main_instance_unique_id or $dolibarr_main_force_https). diff --git a/htdocs/webportal/lib/webportal.lib.php b/htdocs/webportal/lib/webportal.lib.php index 16d3ecc9876..ca95ad67bbe 100644 --- a/htdocs/webportal/lib/webportal.lib.php +++ b/htdocs/webportal/lib/webportal.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2023-2024 Lionel Vessiller + * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +18,7 @@ */ /** - * \file lib/webportal.lib.php + * \file htdocs/webportal/lib/webportal.lib.php * \ingroup webportal * \brief Library files with common functions for WebPortal */ From 75f1de8f8f5140235b45f80633f65192ab14b847 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Tue, 5 Mar 2024 18:07:05 +0100 Subject: [PATCH 0489/1862] Fix: Deposit lines are not created correctly (#28646) * FIX: The minimum price in proposals is not checked correctly * Fix: Deposit lines are not created correctly * Fix: Volver a dejar como estaba * Fix: Deposit lines are not created correctly --- htdocs/compta/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0dd1b661b33..bb96c2c2f81 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2013 Jean-Francois FERRY * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2014-2019 Ferran Marcet + * Copyright (C) 2014-2024 Ferran Marcet * Copyright (C) 2015-2016 Marcos García * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2022 Gauthier VERDOL @@ -1596,7 +1596,7 @@ if (empty($reshook)) { null, 0, '', - 1 + (!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA)?0:1) ); } From cb20a1d0335561c8c5eb1d1d35bd1c3ec88c10d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Mar 2024 21:18:14 +0100 Subject: [PATCH 0490/1862] Fix css --- htdocs/theme/eldy/global.inc.php | 6 +++--- htdocs/theme/md/style.css.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index d1799aae1c3..7b3cd0697cb 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -8155,11 +8155,11 @@ table.jPicker { + ?> select[multiple] { - height: 42px; + height: 42px; } - + ?> select[multiple] { - height: 42px; + height: 42px; } - Date: Tue, 5 Mar 2024 21:19:42 +0100 Subject: [PATCH 0491/1862] Fix phpcs --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 28d9e7a1ce8..80e85cf7341 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3563,7 +3563,7 @@ class Product extends CommonObject } if (!$serviceStockIsEnabled) { $sql .= "AND EXISTS (SELECT p.rowid FROM ".$this->db->prefix()."product AS p WHERE p.rowid = ".((int) $this->id)." AND p.fk_product_type IN (0))"; - } + } if (!empty($warehouseid)) { $sql.= " AND m.fk_warehouse = ".((int) $warehouseid); } From fd2352645de445716eeaa5a72c8415f9da45d1a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Mar 2024 22:59:55 +0100 Subject: [PATCH 0492/1862] Fix warning --- htdocs/accountancy/class/accountingaccount.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index b31f39c366d..057c307e1f6 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -173,13 +173,13 @@ class AccountingAccount extends CommonObject /** * Load record in memory * - * @param int $rowid Id - * @param string $account_number Account number - * @param int|boolean $limittocurrentchart 1 or true=Load record only if it is into current active chart of account - * @param string $limittoachartaccount 'ABC'=Load record only if it is into chart account with code 'ABC' (better and faster than previous parameter if you have chart of account code). - * @return int Return integer <0 if KO, 0 if not found, Id of record if OK and found + * @param int $rowid Id + * @param string $account_number Account number + * @param int|boolean $limittocurrentchart 1 or true=Load record only if it is into current active chart of account + * @param string $limittoachartaccount 'ABC'=Load record only if it is into chart account with code 'ABC' (better and faster than previous parameter if you have chart of account code). + * @return int Return integer <0 if KO, 0 if not found, Id of record if OK and found */ - public function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0, $limittoachartaccount = '') + public function fetch($rowid = 0, $account_number = null, $limittocurrentchart = 0, $limittoachartaccount = '') { global $conf; From 64093cc3786d2439b90833cf0155d0c3809b9437 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Mar 2024 23:00:51 +0100 Subject: [PATCH 0493/1862] Fix warning --- htdocs/accountancy/admin/productaccount.php | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index a0556a5753a..e93164b01be 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -267,18 +267,18 @@ $form = new FormAccounting($db); // so we need to get those the rowid of those default value first $accounting = new AccountingAccount($db); // TODO: we should need to check if result is already exists accountaccount rowid..... -$aarowid_servbuy = $accounting->fetch('', getDolGlobalString('ACCOUNTING_SERVICE_BUY_ACCOUNT'), 1); -$aarowid_servbuy_intra = $accounting->fetch('', getDolGlobalString('ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT'), 1); -$aarowid_servbuy_export = $accounting->fetch('', getDolGlobalString('ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT'), 1); -$aarowid_prodbuy = $accounting->fetch('', getDolGlobalString('ACCOUNTING_PRODUCT_BUY_ACCOUNT'), 1); -$aarowid_prodbuy_intra = $accounting->fetch('', getDolGlobalString('ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT'), 1); -$aarowid_prodbuy_export = $accounting->fetch('', getDolGlobalString('ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT'), 1); -$aarowid_servsell = $accounting->fetch('', getDolGlobalString('ACCOUNTING_SERVICE_SOLD_ACCOUNT'), 1); -$aarowid_servsell_intra = $accounting->fetch('', getDolGlobalString('ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT'), 1); -$aarowid_servsell_export = $accounting->fetch('', getDolGlobalString('ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT'), 1); -$aarowid_prodsell = $accounting->fetch('', getDolGlobalString('ACCOUNTING_PRODUCT_SOLD_ACCOUNT'), 1); -$aarowid_prodsell_intra = $accounting->fetch('', getDolGlobalString('ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT'), 1); -$aarowid_prodsell_export = $accounting->fetch('', getDolGlobalString('ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT'), 1); +$aarowid_servbuy = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_SERVICE_BUY_ACCOUNT'), 1); +$aarowid_servbuy_intra = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT'), 1); +$aarowid_servbuy_export = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT'), 1); +$aarowid_prodbuy = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_PRODUCT_BUY_ACCOUNT'), 1); +$aarowid_prodbuy_intra = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT'), 1); +$aarowid_prodbuy_export = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT'), 1); +$aarowid_servsell = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_SERVICE_SOLD_ACCOUNT'), 1); +$aarowid_servsell_intra = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT'), 1); +$aarowid_servsell_export = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT'), 1); +$aarowid_prodsell = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_PRODUCT_SOLD_ACCOUNT'), 1); +$aarowid_prodsell_intra = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT'), 1); +$aarowid_prodsell_export = $accounting->fetch(0, getDolGlobalString('ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT'), 1); $aacompta_servbuy = getDolGlobalString('ACCOUNTING_SERVICE_BUY_ACCOUNT', $langs->trans("CodeNotDef")); $aacompta_servbuy_intra = getDolGlobalString('ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT', $langs->trans("CodeNotDef")); From c27551cbb7673c2136f21ca91df256d26d682d93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Mar 2024 23:29:41 +0100 Subject: [PATCH 0494/1862] Add a more complete message --- htdocs/public/payment/paymentok.php | 10 +++++----- htdocs/public/stripe/ipn.php | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index d31715b03ca..f5950f629d7 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -882,7 +882,7 @@ if ($ispaymentok) { } else { $paiement->multicurrency_amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching - $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; + $postactionmessages[] = 'Payment was done in a currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')'; $ispostactionok = -1; $error++; // Not yet supported } @@ -1011,7 +1011,7 @@ if ($ispaymentok) { } else { $paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching - $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; + $postactionmessages[] = 'Payment was done in a currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')'; $ispostactionok = -1; $error++; } @@ -1278,7 +1278,7 @@ if ($ispaymentok) { } else { $paiement->multicurrency_amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching - $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; + $postactionmessages[] = 'Payment was done in a currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')'; $ispostactionok = -1; $error++; // Not yet supported } @@ -1508,7 +1508,7 @@ if ($ispaymentok) { } else { $paiement->multicurrency_amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching - $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; + $postactionmessages[] = 'Payment was done in a currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')'; $ispostactionok = -1; $error++; // Not yet supported } @@ -1719,7 +1719,7 @@ if ($ispaymentok) { } else { $paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching - $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; + $postactionmessages[] = 'Payment was done in a currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')'; $ispostactionok = -1; $error++; } diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 3888b247006..1cbedcc9342 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -404,6 +404,8 @@ if ($event->type == 'payout.created') { $payment_amount = $payment_amountInDolibarr; // TODO Check payment_amount in Stripe (received) is same than the one in Dolibarr + $postactionmessages = array(); + if ($paymentTypeId == "CB" && ($paymentTypeIdInDolibarr == 'card' || empty($paymentTypeIdInDolibarr))) { // Case payment type in Stripe and into prelevement_demande are both CARD. // For this case, payment should already have been recorded so we just update flag of payment request if not yet 1 @@ -422,7 +424,7 @@ if ($event->type == 'payout.created') { } else { $paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching - $postactionmessages[] = 'Payment was done in a different currency than currency expected of company'; + $postactionmessages[] = 'Payment was done in a currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')'; $ispostactionok = -1; // Not yet supported, so error $error++; From 5c4c39da2ac62db2e2188bc9526f8dfbbe6e0380 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 00:46:04 +0100 Subject: [PATCH 0495/1862] Debug module AI --- htdocs/ai/admin/custom_prompt.php | 98 ++++++++++++---------- htdocs/ai/admin/setup.php | 9 +- htdocs/ai/ajax/generate_content.php | 10 ++- htdocs/ai/class/ai.class.php | 62 ++++++++++---- htdocs/core/class/html.formsetup.class.php | 4 + htdocs/langs/en_US/admin.lang | 8 +- 6 files changed, 125 insertions(+), 66 deletions(-) diff --git a/htdocs/ai/admin/custom_prompt.php b/htdocs/ai/admin/custom_prompt.php index 56c29fa0e5e..c784e9ae3b8 100644 --- a/htdocs/ai/admin/custom_prompt.php +++ b/htdocs/ai/admin/custom_prompt.php @@ -38,11 +38,6 @@ if (empty($action)) { $action = 'edit'; } -$value = GETPOST('value', 'alpha'); -$label = GETPOST('label', 'alpha'); -$scandir = GETPOST('scan_dir', 'alpha'); -$type = 'myobject'; - $error = 0; $setupnotempty = 0; @@ -71,8 +66,12 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); // List of AI features $arrayofaifeatures = array( - 'emailing' => 'Emailing', - 'imagegeneration' => 'ImageGeneration' + 'textgeneration' => array('label' => 'TextGeneration', 'picto'=>'', 'status'=>'development'), + 'imagegeneration' => array('label' => 'ImageGeneration', 'picto'=>'', 'status'=>'notused'), + 'videogeneration' => array('label' => 'VideoGeneration', 'picto'=>'', 'status'=>'notused'), + 'transcription' => array('label' => 'Transcription', 'picto'=>'', 'status'=>'notused'), + 'translation' => array('label' => 'Translation', 'picto'=>'', 'status'=>'notused'), + 'audiotext' => array('label' => 'AudioText', 'picto'=>'', 'status'=>'notused') ); @@ -80,12 +79,12 @@ $arrayofaifeatures = array( * Actions */ -$modulename = GETPOST('module_name'); +$functioncode = GETPOST('functioncode', 'alpha'); $pre_prompt = GETPOST('prePrompt', 'alpha'); $post_prompt = GETPOST('postPrompt', 'alpha'); // get all configs in const AI -$currentConfigurationsJson = dolibarr_get_const($db, 'AI_CONFIGURATIONS_PROMPT', $conf->entity); +$currentConfigurationsJson = getDolGlobalString('AI_CONFIGURATIONS_PROMPT'); $currentConfigurations = json_decode($currentConfigurationsJson, true); if ($action == 'update' && GETPOST('cancel')) { @@ -93,7 +92,7 @@ if ($action == 'update' && GETPOST('cancel')) { } if ($action == 'update' && !GETPOST('cancel')) { $error = 0; - if (empty($modulename)) { + if (empty($functioncode)) { $error++; setEventMessages($langs->trans('ErrorInputRequired'), null, 'errors'); } @@ -101,12 +100,12 @@ if ($action == 'update' && !GETPOST('cancel')) { $currentConfigurations = []; } - if (empty($modulename) || (empty($pre_prompt) && empty($post_prompt))) { - if (isset($currentConfigurations[$modulename])) { - unset($currentConfigurations[$modulename]); + if (empty($functioncode) || (empty($pre_prompt) && empty($post_prompt))) { + if (isset($currentConfigurations[$functioncode])) { + unset($currentConfigurations[$functioncode]); } } else { - $currentConfigurations[$modulename] = [ + $currentConfigurations[$functioncode] = [ 'prePrompt' => $pre_prompt, 'postPrompt' => $post_prompt, ]; @@ -172,10 +171,12 @@ if ($action == 'edit') { $out .= ''; $out .= '
'; $out .= ''; @@ -223,37 +224,42 @@ if ($action == 'edit') { if ($action == 'edit' || $action == 'create') { - $out = '
'; print $langs->trans('DefaultBankAccount'); @@ -974,7 +974,7 @@ if ($id > 0) { print '
'; $nbcols = 3; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $nbcols++; } @@ -1008,7 +1008,7 @@ if ($id > 0) { print '
'.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans('BankAccount').''.$langs->trans("Amount").''.dol_print_date($db->jdate($objp->dp), 'dayhour', 'tzuserrel')."".$labeltype.' '.$objp->num_payment."'; print $form->select_comptes($search_account, 'search_account', 0, '', 1, '', 0, 'maxwidth125', 1); print ''; if ($obj->fk_account > 0) { //$accountstatic->fetch($obj->fk_bank); @@ -820,7 +820,7 @@ if ($num == 0) { } }*/ $colspan = 9; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $colspan++; } print '
'.$langs->trans("NoRecordFound").'
'.$langs->trans('Amount').''.price($object->amount, 0, $ print '
'.$langs->trans('Note').''.dol_string_onlythesehtmltags(dol_htmlcleanlastbr($object->note_private)).'
'; print ''; @@ -539,7 +539,7 @@ print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pst.code", "", $pa $totalarray['nbfield']++; print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "s.num_payment", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber'); $totalarray['nbfield']++; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "s.fk_bank", "", $param, '', $sortfield, $sortorder); $totalarray['nbfield']++; print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); @@ -702,7 +702,7 @@ while ($i < $imaxinloop) { } // Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Bank transaction print ''; $accountlinestatic->id = $obj->fk_bank; diff --git a/htdocs/salaries/virement_request.php b/htdocs/salaries/virement_request.php index b640d1f3c58..2c9b444655e 100644 --- a/htdocs/salaries/virement_request.php +++ b/htdocs/salaries/virement_request.php @@ -313,7 +313,7 @@ if ($action == 'editmode') { print '
'; print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -391,7 +391,7 @@ if ($resql) { print '\n"; $labeltype = $langs->trans("PaymentType".$objp->type_code) != "PaymentType".$objp->type_code ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "\n"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index b432cd98235..1000eaf142a 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -874,7 +874,7 @@ if (getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { print ''; print ''; -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { if (getDolGlobalInt('MAIN_FEATURES_LEVEL') > 0) { // Visible on experimental only because seems to not be implemented everywhere (only on proposal) print ''; print ''; diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index a98680cfeb9..5125bfdc389 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -345,7 +345,7 @@ abstract class ActionsCardCommon } // Linked member - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $langs->load("members"); $adh = new Adherent($this->db); $result = $adh->fetch('', '', $this->object->id); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ef713898c70..facb6cc3d9c 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -50,7 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } if (isModEnabled('accounting')) { @@ -77,10 +77,10 @@ if ($mysoc->country_code == 'GR') { $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { $langs->load("members"); } -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $langs->load("categories"); } if (isModEnabled('incoterm')) { @@ -1692,7 +1692,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $langs->load('categories'); // Customer @@ -2446,7 +2446,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { // Customer print ''; print ''; // Bank Account - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) { print ''; } // Shipping Method - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { print ''; }*/ - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) { // Bank Account print ''; // Timing (Duration sum of linked fichinter) - if (isModEnabled('ficheinter')) { + if (isModEnabled('intervention')) { $object->fetchObjectLinked(); $num = count($object->linkedObjects); $timing = 0; @@ -1197,7 +1197,7 @@ if ($action == 'create' || $action == 'presend') { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'; print '
'; print $langs->trans('DefaultBankAccount'); @@ -375,7 +375,7 @@ if ($resql) { print ''.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans('BankAccount').''.$langs->trans("Amount").''.dol_print_date($db->jdate($objp->dp), 'dayhour', 'tzuserrel')."".$labeltype.' '.$objp->num_payment."
'.$langs->trans("AskForPreferredShippingMethod").'
'.$form->editfieldkey('CustomersCategoriesShort', 'custcats', '', $object, 0).''; @@ -2902,7 +2902,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print ''; // Tags / categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { // Customer if ($object->prospect || $object->client || getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT')) { print ''; @@ -3069,7 +3069,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; // Module Adherent - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $langs->load("members"); print ''; print '
'.$langs->trans("CustomersCategoriesShort").'
'.$langs->trans("LinkedToDolibarrMember").''; @@ -3145,7 +3145,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $adh = new Adherent($db); $result = $adh->fetch('', '', $object->id); if ($result == 0 && ($object->client == 1 || $object->client == 3) && getDolGlobalString('MEMBER_CAN_CONVERT_CUSTOMERS_TO_MEMBERS')) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 3405b222938..118dca102bf 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1664,7 +1664,7 @@ class Societe extends CommonObject if (!$error && $nbrowsaffected) { // Update information on linked member if it is an update - if (!$nosyncmember && isModEnabled('adherent')) { + if (!$nosyncmember && isModEnabled('member')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; dol_syslog(get_class($this)."::update update linked member"); @@ -2835,7 +2835,7 @@ class Societe extends CommonObject $datas['accountancycustomercode'] = '
'.$langs->trans('CustomerAccountancyCode').': '.($this->code_compta ? $this->code_compta : $this->code_compta_client); } // show categories for this record only in ajax to not overload lists - if (!$nofetch && isModEnabled('categorie') && $this->client) { + if (!$nofetch && isModEnabled('category') && $this->client) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories_customer'] = '
' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1); @@ -2848,7 +2848,7 @@ class Societe extends CommonObject $datas['accountancysuppliercode'] = '
'.$langs->trans('SupplierAccountancyCode').': '.$this->code_compta_fournisseur; } // show categories for this record only in ajax to not overload lists - if (!$nofetch && isModEnabled('categorie') && $this->fournisseur) { + if (!$nofetch && isModEnabled('category') && $this->fournisseur) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories_supplier'] = '
' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1); diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 6da2a9aa73c..8a828fb6c39 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -172,18 +172,18 @@ if ($object->client) { if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { + if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } } -if (isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire')) { +if (isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire')) { $elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions'); } diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 3f121f52749..1fd810a9793 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -43,14 +43,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } // Load translation files required by the page $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $langs->load("categories"); } if (isModEnabled('incoterm')) { diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index d9dd58c3887..3f008867bd3 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -203,7 +203,7 @@ $thirdpartygraph .= '
'; $thirdpartygraph .= ''; $thirdpartycateggraph = ''; -if (isModEnabled('categorie') && getDolGlobalString('CATEGORY_GRAPHSTATS_ON_THIRDPARTIES')) { +if (isModEnabled('category') && getDolGlobalString('CATEGORY_GRAPHSTATS_ON_THIRDPARTIES')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $elementtype = 'societe'; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 2ef9b22fe40..1864043e62b 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; } @@ -1214,14 +1214,14 @@ if ($search_all) { // Filter on categories $moreforfilter = ''; if (empty($type) || $type == 'c' || $type == 'p') { - if (isModEnabled('categorie') && $user->hasRight('categorie', 'read')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'read')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_CUSTOMER, $searchCategoryCustomerList, 'minwidth300', $searchCategoryCustomerOperator ? $searchCategoryCustomerOperator : 0); } } if (empty($type) || $type == 'f') { - if (isModEnabled("fournisseur") && isModEnabled('categorie') && $user->hasRight('categorie', 'read')) { + if (isModEnabled("fournisseur") && isModEnabled('category') && $user->hasRight('categorie', 'read')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_SUPPLIER, $searchCategorySupplierList, 'minwidth300', $searchCategorySupplierOperator ? $searchCategorySupplierOperator : 0); } diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 6af4a946941..665a76d03da 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -972,13 +972,13 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { + if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } @@ -1068,13 +1068,13 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if (isModEnabled('propal') && $user->hasRight('propal', 'lire')) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { + if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } } diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 70db93aebc8..3dc6e26dee1 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -205,7 +205,7 @@ if ($id > 0 || !empty($ref)) { } // additional list with adherents of company - if (isModEnabled('adherent') && $user->hasRight('adherent', 'lire')) { + if (isModEnabled('member') && $user->hasRight('adherent', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 2500d9d00e1..e8fc5bf25d1 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1321,14 +1321,14 @@ if ($action == 'create') { print '
'.$langs->trans('BankAccount').''; $form->select_comptes(GETPOST('fk_account') > 0 ? GETPOSTINT('fk_account') : $fk_account, 'fk_account', 0, '', 1); print '
'.$langs->trans('SendingMethod').''; print img_picto('', 'dolly', 'class="pictofixedwidth"'); $form->selectShippingMethod(GETPOST('shipping_method_id') > 0 ? GETPOSTINT('shipping_method_id') : "", 'shipping_method_id', '', 1); @@ -1791,7 +1791,7 @@ if ($action == 'create') { print '
'; print ''; $atleastonefound = 0; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print ''; print ''; print '
'; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 3916568fcd1..3fb07664ffa 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -696,7 +696,7 @@ if ($resql) { $moreforfilter .= ''; } // If the user can view products - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 469c96e90da..f417c2a9988 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -216,7 +216,7 @@ print ajax_constantonoff("TAKEPOS_FORBID_SALES_TO_DEFAULT_CUSTOMER", array(), $c print '
'.$langs->trans("CashDeskBankAccountForSell").''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); @@ -527,7 +527,7 @@ print '
'; print ''; -if ($atleastonefound == 0 && isModEnabled("banque")) { +if ($atleastonefound == 0 && isModEnabled("bank")) { print info_admin($langs->trans("AtLeastOneDefaultBankAccountMandatory"), 0, 0, 'error'); } diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index f3dda5ffb83..c3a1f934e2d 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -1310,7 +1310,7 @@ if (isset($_SESSION["takeposterminal"]) && $_SESSION["takeposterminal"]) { } } - if (empty($paiementsModes) && isModEnabled("banque")) { + if (empty($paiementsModes) && isModEnabled("bank")) { $langs->load('errors'); setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors'); setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors'); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 1e0faeb2b44..6e6e7739411 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -195,7 +195,7 @@ if (empty($reshook)) { } } - if ($bankaccount <= 0 && $pay != "delayed" && isModEnabled("banque")) { + if ($bankaccount <= 0 && $pay != "delayed" && isModEnabled("bank")) { $errormsg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")); $error++; } @@ -1438,7 +1438,7 @@ $( document ).ready(function() { // Module Adherent $s = ''; - if (isModEnabled('adherent') && $invoice->socid > 0 && $invoice->socid != getDolGlobalInt($constforcompanyid)) { + if (isModEnabled('member') && $invoice->socid > 0 && $invoice->socid != getDolGlobalInt($constforcompanyid)) { $s = ''; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $langs->load("members"); diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index cb39394006c..e0858b6b45c 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -246,7 +246,7 @@ if ($resql) { $arrayOfValidBankAccount[getDolGlobalInt($accountname)] = getDolGlobalInt($accountname); $arrayOfValidPaymentModes[] = $obj; } - if (!isModEnabled('banque')) { + if (!isModEnabled('bank')) { if ($paycode == 'CASH' || $paycode == 'CB') { $arrayOfValidPaymentModes[] = $obj; } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 5ab6dfa2363..f595ae566cf 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -44,7 +44,7 @@ if (isModEnabled('project')) { include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; @@ -1010,7 +1010,7 @@ if ($action == 'create' || $action == 'presend') { // Contract if (getDolGlobalString('TICKET_LINK_TO_CONTRACT_WITH_HARDLINK')) { // Deprecated. Duplicate feature. Ticket can already be linked to contract with the generic "Link to" feature. - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $langs->load('contracts'); $morehtmlref .= '
'; if ($permissiontoedit) { @@ -1158,7 +1158,7 @@ if ($action == 'create' || $action == 'presend') { print '
'; print ''; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 001d4b55bb7..4b0ba6f813d 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1559,7 +1559,7 @@ class Ticket extends CommonObject $datas['date_modification'] = '
'.$langs->trans('DateModification').': '.dol_print_date($this->date_modification, 'dayhour'); } // show categories for this record only in ajax to not overload lists - if (isModEnabled('categorie') && !$nofetch) { + if (isModEnabled('category') && !$nofetch) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories'] = '
' . $form->showCategories($this->id, Categorie::TYPE_TICKET, 1); @@ -1927,7 +1927,7 @@ class Ticket extends CommonObject $error = 0; // Valid and close fichinter linked - if (isModEnabled('ficheinter') && getDolGlobalString('WORKFLOW_TICKET_CLOSE_INTERVENTION')) { + if (isModEnabled('intervention') && getDolGlobalString('WORKFLOW_TICKET_CLOSE_INTERVENTION')) { dol_syslog("We have closed the ticket, so we close all linked interventions"); $this->fetchObjectLinked($this->id, $this->element, null, 'fichinter'); if ($this->linkedObjectsIds) { diff --git a/htdocs/user/card.php b/htdocs/user/card.php index afe86b1760d..8f8cf80e2aa 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -53,10 +53,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; if (isModEnabled('ldap')) { require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; } -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } if (isModEnabled('stock')) { @@ -357,7 +357,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; // Go back to create page } else { - if (isModEnabled("categorie")) { + if (isModEnabled("category")) { // Categories association $usercats = GETPOST('usercats', 'array'); $object->setCategories($usercats); @@ -1265,7 +1265,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Categories - if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { + if (isModEnabled('category') && $user->hasRight("categorie", "read")) { print ''; print ''; print ''; // Categories - if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { + if (isModEnabled('category') && $user->hasRight("categorie", "read")) { print ''; print ''; print ''; // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $langs->load('categories'); if (!GETPOSTISSET('categories')) { @@ -4704,7 +4704,7 @@ if ($mode == 'replacesite' || $massaction == 'replace') { print ''; // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print '
'; print '
'; print $langs->trans("Category"); @@ -4841,7 +4841,7 @@ if ($mode == 'replacesite' || $massaction == 'replace') { // Categories - Tags print '
'; + + + // Price Label + print ''; + print ''; + print '
'.$form->editfieldkey('Categories', 'usercats', '', $object, 0).''; $cate_arbo = $form->select_all_categories('user', null, 'parent', null, null, 1); print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('usercats', $cate_arbo, GETPOST('usercats', 'array'), 0, 0, 'maxwdith300 widthcentpercentminusx', 0, '90%'); @@ -1734,7 +1734,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Categories - if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { + if (isModEnabled('category') && $user->hasRight("categorie", "read")) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_USER, 1); @@ -1814,7 +1814,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Module Adherent - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $langs->load("members"); print '
'.$langs->trans("LinkedToDolibarrMember").''; @@ -2693,7 +2693,7 @@ if ($action == 'create' || $action == 'adduserldap') { print '
'.$form->editfieldkey('Categories', 'usercats', '', $object, 0).''; print img_picto('', 'category', 'class="pictofixedwidth"'); @@ -2748,7 +2748,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Module Adherent - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $langs->load("members"); print '
'.$langs->trans("LinkedToDolibarrMember").''; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 0d924c142cf..cb40dba7c17 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -28,7 +28,7 @@ // Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -701,7 +701,7 @@ $moreforfilter = ''; $moreforfilter.= '';*/ // Filter on categories -if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { +if (isModEnabled('category') && $user->hasRight("categorie", "read")) { $moreforfilter .= '
'; $tmptitle = $langs->trans('Category'); $moreforfilter .= img_picto($langs->trans("Category"), 'category', 'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_USER, $search_categ, 'search_categ', 1, $tmptitle); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 6ec1f7e3a2d..c59313ec708 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -209,16 +209,16 @@ if (isModEnabled('holiday') || isModEnabled('expensereport')) { if (isModEnabled("product") || isModEnabled("service")) { $tmparray['product/index.php?mainmenu=products&leftmenu='] = array('label'=>'ProductsAndServicesArea', 'picto'=>'product'); } -if (isModEnabled("propal") || isModEnabled('commande') || isModEnabled('ficheinter') || isModEnabled('contrat')) { +if (isModEnabled("propal") || isModEnabled('order') || isModEnabled('intervention') || isModEnabled('contract')) { $tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = array('label'=>'CommercialArea', 'picto'=>'commercial'); } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { $tmparray['compta/index.php?mainmenu=billing&leftmenu='] = array('label'=>'InvoicesArea', 'picto'=>'bill'); } if (isModEnabled('comptabilite') || isModEnabled('accounting')) { $tmparray['compta/index.php?mainmenu=accountancy&leftmenu='] = array('label'=>'AccountancyTreasuryArea', 'picto'=>'bill'); } -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { $tmparray['adherents/index.php?mainmenu=members&leftmenu='] = array('label'=>'MembersArea', 'picto'=>'member'); } if (isModEnabled('agenda')) { diff --git a/htdocs/webportal/class/html.formcardwebportal.class.php b/htdocs/webportal/class/html.formcardwebportal.class.php index d0d9531436e..702d4dfb3cb 100644 --- a/htdocs/webportal/class/html.formcardwebportal.class.php +++ b/htdocs/webportal/class/html.formcardwebportal.class.php @@ -382,7 +382,7 @@ class FormCardWebPortal } } - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $categories = GETPOST('categories', 'array'); if (method_exists($object, 'setCategories')) { $object->setCategories($categories); diff --git a/htdocs/webportal/controllers/invoicelist.controller.class.php b/htdocs/webportal/controllers/invoicelist.controller.class.php index a58b5be7cb4..3f8fa6ff31b 100644 --- a/htdocs/webportal/controllers/invoicelist.controller.class.php +++ b/htdocs/webportal/controllers/invoicelist.controller.class.php @@ -40,7 +40,7 @@ class InvoiceListController extends Controller */ public function checkAccess() { - $this->accessRight = isModEnabled('facture') && getDolGlobalInt('WEBPORTAL_INVOICE_LIST_ACCESS'); + $this->accessRight = isModEnabled('invoice') && getDolGlobalInt('WEBPORTAL_INVOICE_LIST_ACCESS'); return parent::checkAccess(); } diff --git a/htdocs/webportal/controllers/membercard.controller.class.php b/htdocs/webportal/controllers/membercard.controller.class.php index a984d66f1bb..d3415f04086 100644 --- a/htdocs/webportal/controllers/membercard.controller.class.php +++ b/htdocs/webportal/controllers/membercard.controller.class.php @@ -43,7 +43,7 @@ class MemberCardController extends Controller { $context = Context::getInstance(); $cardAccess = getDolGlobalString('WEBPORTAL_MEMBER_CARD_ACCESS'); - $this->accessRight = isModEnabled('adherent') && in_array($cardAccess, array('visible', 'edit')) && $context->logged_member && $context->logged_member->id > 0; + $this->accessRight = isModEnabled('member') && in_array($cardAccess, array('visible', 'edit')) && $context->logged_member && $context->logged_member->id > 0; return parent::checkAccess(); } @@ -72,8 +72,8 @@ class MemberCardController extends Controller // set form card $cardAccess = getDolGlobalString('WEBPORTAL_MEMBER_CARD_ACCESS'); - $permissiontoread = (int) isModEnabled('adherent') && in_array($cardAccess, array('visible', 'edit')); - $permissiontoadd = (int) isModEnabled('adherent') && in_array($cardAccess, array('edit')); + $permissiontoread = (int) isModEnabled('member') && in_array($cardAccess, array('visible', 'edit')); + $permissiontoadd = (int) isModEnabled('member') && in_array($cardAccess, array('edit')); $permissiontodelete = 0; $permissionnote = 0; $permissiondellink = 0; diff --git a/htdocs/webportal/controllers/orderlist.controller.class.php b/htdocs/webportal/controllers/orderlist.controller.class.php index 204f00db2ba..5d104cb344c 100644 --- a/htdocs/webportal/controllers/orderlist.controller.class.php +++ b/htdocs/webportal/controllers/orderlist.controller.class.php @@ -42,7 +42,7 @@ class OrderListController extends Controller */ public function checkAccess() { - $this->accessRight = isModEnabled('commande') && getDolGlobalInt('WEBPORTAL_ORDER_LIST_ACCESS'); + $this->accessRight = isModEnabled('order') && getDolGlobalInt('WEBPORTAL_ORDER_LIST_ACCESS'); return parent::checkAccess(); } diff --git a/htdocs/webportal/controllers/propallist.controller.class.php b/htdocs/webportal/controllers/propallist.controller.class.php index 533327a42b6..5c6ca9668db 100644 --- a/htdocs/webportal/controllers/propallist.controller.class.php +++ b/htdocs/webportal/controllers/propallist.controller.class.php @@ -64,7 +64,7 @@ class PropalListController extends Controller // Load translation files required by the page $langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'categories')); - if (isModEnabled('expedition')) { + if (isModEnabled('delivery_note')) { $langs->loadLangs(array('sendings')); } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index d55b81d1151..25fe96f7efe 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3074,7 +3074,7 @@ if (!GETPOST('hide_websitemenu')) { print dolButtonToOpenUrlInDialogPopup('file_manager', $langs->transnoentitiesnoconv("MediaFiles"), '', '/website/index.php?action=file_manager&website='.urlencode($website->ref).'§ion_dir='.urlencode('image/'.$website->ref.'/'), $disabled); - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { //print ''; print dolButtonToOpenUrlInDialogPopup('categories', $langs->transnoentitiesnoconv("Categories"), '', '/categories/index.php?leftmenu=website&nosearch=1&type=website_page&website='.urlencode($website->ref), $disabled); } @@ -4376,7 +4376,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties print '
'; - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { // Get current categories $existing = $c->containing($answerrecord->id, Categorie::TYPE_WEBSITE_PAGE, 'object'); if (is_array($existing)) { From 049eaa18201953c91859be4a820edb5cd74cc5ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2024 15:33:48 +0100 Subject: [PATCH 0257/1862] Compact code --- htdocs/accountancy/admin/account.php | 4 ++-- htdocs/modulebuilder/template/myobject_list.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index f02c1e9f555..85f230168c3 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -66,10 +66,10 @@ if (!$user->hasRight('accounting', 'chartofaccount')) { } // Load variable for pagination -$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; +$limit = GETPOSTINT('limit', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 0086243bff2..41264b0a467 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -106,7 +106,7 @@ $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page'); From 8af8fc98daeeacb56b6a0dc07fade33e00f04d21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 16:42:09 +0100 Subject: [PATCH 0258/1862] fix phpstan (#28461) --- htdocs/core/class/html.formbarcode.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 6d58b9a6198..ff8fb505202 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2008-2012 Laurent Destailleur - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -57,7 +57,7 @@ class FormBarCode * @param int $selected Id code pre-selected * @param array $barcodelist Array of barcodes generators * @param int $code_id Id du code barre - * @param int $idForm Id du formulaire + * @param string $idForm Id of html form, ex id="idform" * @return string HTML select string */ public function setBarcodeEncoder($selected, $barcodelist, $code_id, $idForm = 'formbarcode') @@ -118,7 +118,7 @@ class FormBarCode * @return void * @deprecated */ - public function select_barcode_type($selected = '', $htmlname = 'barcodetype_id', $useempty = 0) + public function select_barcode_type($selected = 0, $htmlname = 'barcodetype_id', $useempty = 0) { // phpcs:enable print $this->selectBarcodeType($selected, $htmlname, $useempty); @@ -132,7 +132,7 @@ class FormBarCode * @param int $useempty Display empty value in select * @return string */ - public function selectBarcodeType($selected = '', $htmlname = 'barcodetype_id', $useempty = 0) + public function selectBarcodeType($selected = 0, $htmlname = 'barcodetype_id', $useempty = 0) { global $langs, $conf; @@ -187,7 +187,7 @@ class FormBarCode * @return void * @deprecated */ - public function form_barcode_type($page, $selected = '', $htmlname = 'barcodetype_id') + public function form_barcode_type($page, $selected = 0, $htmlname = 'barcodetype_id') { // phpcs:enable print $this->formBarcodeType($page, $selected, $htmlname); @@ -201,7 +201,7 @@ class FormBarCode * @param string $htmlname Nom du formulaire select * @return string */ - public function formBarcodeType($page, $selected = '', $htmlname = 'barcodetype_id') + public function formBarcodeType($page, $selected = 0, $htmlname = 'barcodetype_id') { global $langs, $conf; $out = ''; From 92e790effe7586ef8b57fe09d8070ad89f41c653 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 27 Feb 2024 16:43:04 +0100 Subject: [PATCH 0259/1862] Fix: GETPOST -> GETPOSTINT (#28460) --- htdocs/core/customreports.php | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 49cecafe544..1ada4100484 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -55,10 +55,10 @@ if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) { $search_graph = GETPOST('search_graph', 'restricthtml'); // Load variable for pagination - $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; + $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); - $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); + $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action @@ -118,24 +118,24 @@ $head = array(); $ObjectClassName = ''; // Objects available by default $arrayoftype = array( - 'thirdparty' => array('langs'=>'companies', 'label' => 'ThirdParties', 'picto'=>'company', 'ObjectClassName' => 'Societe', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/societe/class/societe.class.php"), - 'contact' => array('label' => 'Contacts', 'picto'=>'contact', 'ObjectClassName' => 'Contact', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/contact/class/contact.class.php"), - 'proposal' => array('label' => 'Proposals', 'picto'=>'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php"), - 'order' => array('label' => 'Orders', 'picto'=>'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/commande.class.php"), - 'invoice' => array('langs'=>'facture', 'label' => 'Invoices', 'picto'=>'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture.class.php"), - 'invoice_template'=>array('label' => 'PredefinedInvoices', 'picto'=>'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/class/facturerec.class.php", 'langs'=>'bills'), - 'contract' => array('label' => 'Contracts', 'picto'=>'contract', 'ObjectClassName' => 'Contrat', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'), - 'contractdet' => array('label' => 'ContractLines', 'picto'=>'contract', 'ObjectClassName' => 'ContratLigne', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'), - 'bom' => array('label' => 'BOM', 'picto'=>'bom', 'ObjectClassName' => 'Bom', 'enabled' => isModEnabled('bom')), - 'mrp' => array('label' => 'MO', 'picto'=>'mrp', 'ObjectClassName' => 'Mo', 'enabled' => isModEnabled('mrp'), 'ClassPath' => "/mrp/class/mo.class.php"), - 'ticket' => array('label' => 'Ticket', 'picto'=>'ticket', 'ObjectClassName' => 'Ticket', 'enabled' => isModEnabled('ticket')), - 'member' => array('label' => 'Adherent', 'picto'=>'member', 'ObjectClassName' => 'Adherent', 'enabled' => isModEnabled('member'), 'ClassPath' => "/adherents/class/adherent.class.php", 'langs'=>'members'), - 'cotisation' => array('label' => 'Subscriptions', 'picto'=>'member', 'ObjectClassName' => 'Subscription', 'enabled' => isModEnabled('member'), 'ClassPath' => "/adherents/class/subscription.class.php", 'langs'=>'members'), + 'thirdparty' => array('langs' => 'companies', 'label' => 'ThirdParties', 'picto' => 'company', 'ObjectClassName' => 'Societe', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/societe/class/societe.class.php"), + 'contact' => array('label' => 'Contacts', 'picto' => 'contact', 'ObjectClassName' => 'Contact', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/contact/class/contact.class.php"), + 'proposal' => array('label' => 'Proposals', 'picto' => 'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php"), + 'order' => array('label' => 'Orders', 'picto' => 'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/commande.class.php"), + 'invoice' => array('langs' => 'facture', 'label' => 'Invoices', 'picto' => 'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture.class.php"), + 'invoice_template' => array('label' => 'PredefinedInvoices', 'picto' => 'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/class/facturerec.class.php", 'langs' => 'bills'), + 'contract' => array('label' => 'Contracts', 'picto' => 'contract', 'ObjectClassName' => 'Contrat', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs' => 'contracts'), + 'contractdet' => array('label' => 'ContractLines', 'picto' => 'contract', 'ObjectClassName' => 'ContratLigne', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs' => 'contracts'), + 'bom' => array('label' => 'BOM', 'picto' => 'bom', 'ObjectClassName' => 'Bom', 'enabled' => isModEnabled('bom')), + 'mrp' => array('label' => 'MO', 'picto' => 'mrp', 'ObjectClassName' => 'Mo', 'enabled' => isModEnabled('mrp'), 'ClassPath' => "/mrp/class/mo.class.php"), + 'ticket' => array('label' => 'Ticket', 'picto' => 'ticket', 'ObjectClassName' => 'Ticket', 'enabled' => isModEnabled('ticket')), + 'member' => array('label' => 'Adherent', 'picto' => 'member', 'ObjectClassName' => 'Adherent', 'enabled' => isModEnabled('member'), 'ClassPath' => "/adherents/class/adherent.class.php", 'langs' => 'members'), + 'cotisation' => array('label' => 'Subscriptions', 'picto' => 'member', 'ObjectClassName' => 'Subscription', 'enabled' => isModEnabled('member'), 'ClassPath' => "/adherents/class/subscription.class.php", 'langs' => 'members'), ); // Complete $arrayoftype by external modules -$parameters = array('objecttype'=>$objecttype, 'tabfamily'=>$tabfamily); +$parameters = array('objecttype' => $objecttype, 'tabfamily' => $tabfamily); $reshook = $hookmanager->executeHooks('loadDataForCustomReports', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -586,7 +586,7 @@ if (!defined('MAIN_CUSTOM_REPORT_KEEP_GRAPH_ONLY')) { jQuery(document).ready(function() { jQuery("#objecttype").change(function() { console.log("Reload for "+jQuery("#objecttype").val()); - location.href = "'.$_SERVER["PHP_SELF"].'?objecttype="+jQuery("#objecttype").val()+"'.($tabfamily ? '&tabfamily='.urlencode($tabfamily) : '').(GETPOST('show_search_component_params_hidden', 'int') ? '&show_search_component_params_hidden='.((int) GETPOST('show_search_component_params_hidden', 'int')) : '').'"; + location.href = "'.$_SERVER["PHP_SELF"].'?objecttype="+jQuery("#objecttype").val()+"'.($tabfamily ? '&tabfamily='.urlencode($tabfamily) : '').(GETPOSTINT('show_search_component_params_hidden') ? '&show_search_component_params_hidden='.((int) GETPOSTINT('show_search_component_params_hidden')) : '').'"; }); }); '; @@ -1225,28 +1225,28 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu $arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-sum'] = array( 'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Sum").')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val), - 'position' => ($position+($count * 100000)).'.1', + 'position' => ($position + ($count * 100000)).'.1', 'table' => $object->table_element, 'tablefromt' => $tablepath ); $arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-average'] = array( 'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Average").')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val), - 'position' => ($position+($count * 100000)).'.2', + 'position' => ($position + ($count * 100000)).'.2', 'table' => $object->table_element, 'tablefromt' => $tablepath ); $arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-min'] = array( 'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Minimum").')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val), - 'position' => ($position+($count * 100000)).'.3', + 'position' => ($position + ($count * 100000)).'.3', 'table' => $object->table_element, 'tablefromt' => $tablepath ); $arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-max'] = array( 'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Maximum").')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val), - 'position' => ($position+($count * 100000)).'.4', + 'position' => ($position + ($count * 100000)).'.4', 'table' => $object->table_element, 'tablefromt' => $tablepath ); From a6db30f1dfb9c5eba2e711f40f3008cafbb8f9eb Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Tue, 27 Feb 2024 16:53:59 +0100 Subject: [PATCH 0260/1862] fix ref and verify date and time --- htdocs/bookcal/availabilities_card.php | 31 +++++++++++++++++-- htdocs/bookcal/class/availabilities.class.php | 2 +- htdocs/langs/en_US/errors.lang | 2 ++ 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/htdocs/bookcal/availabilities_card.php b/htdocs/bookcal/availabilities_card.php index ae32bbe7b33..6289b476ae8 100644 --- a/htdocs/bookcal/availabilities_card.php +++ b/htdocs/bookcal/availabilities_card.php @@ -105,6 +105,10 @@ if (!$permissiontoread) { } + + + + /* * Actions */ @@ -132,9 +136,30 @@ if (empty($reshook)) { $triggermodname = 'BOOKCAL_AVAILABILITIES_MODIFY'; // Name of trigger action code to execute when we modify record - // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen - include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; + $dateStartTimestamp = dol_stringtotime(GETPOST('start')); + $dateEndTimestamp = dol_stringtotime(GETPOST('end')); + $startHour = intval(GETPOST('startHour')); + $endHour = intval(GETPOST('endHour')); + + // check hours + if ($startHour > $endHour) { + if ($dateStartTimestamp === $dateEndTimestamp) { + $error++; + setEventMessages($langs->trans("ErrorEndTimeMustBeGreaterThanStartTime"), null, 'errors'); + } + } + + // check date + if ($dateStartTimestamp > $dateEndTimestamp) { + $error++; + setEventMessages($langs->trans("ErrorIncoherentDates"), null, 'errors'); + } + + if (!$error) { + // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; + } // Actions when linking object each other include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; @@ -203,7 +228,7 @@ if ($action == 'create') { print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Availabilities")), '', 'object_'.$object->picto); - print '
'; + print ''; print ''; print ''; if ($backtopage) { diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 5e9ffe56f5c..013f4ce453a 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -539,7 +539,7 @@ class Availabilities extends CommonObject if (!empty($num)) { // Validate $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; - $sql .= " SET ref = '".$this->db->escape($num)."',"; + $sql .= " SET label = '".$this->db->escape($num)."',"; $sql .= " status = ".self::STATUS_VALIDATED; if (!empty($this->fields['date_validation'])) { $sql .= ", date_validation = '".$this->db->idate($now)."'"; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index cf721af6915..5013eb85361 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -332,6 +332,8 @@ ErrorDictionaryNotFound=Dictionary %s not found ErrorFailedToCreateSymLinkToMedias=Failed to create the symbolic link %s to point to %s ErrorCheckTheCommandInsideTheAdvancedOptions=Check the command used for the export into the Advanced options of the export +ErrorEndTimeMustBeGreaterThanStartTime=End time must be greater than start time +ErrorIncoherentDates=Date start must be less than date end # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. From 4f0dc0f0cf2a383ae27f8f380aa6fddcaf611ca4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2024 17:06:17 +0100 Subject: [PATCH 0261/1862] Test index hint --- htdocs/compta/index.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 3d8d6c10e1d..d64a02b762d 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -139,6 +139,9 @@ if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { $sql .= ", cc.rowid as country_id, cc.code as country_code"; $sql .= ", sum(pf.amount) as am"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays, ".MAIN_DB_PREFIX."facture as f"; + if (getDolGlobalString("INVOICE_LAST_MODIFIED_INVOICE_FORCE_INDEX_TMS")) { + $sql .= " USE INDEX (idx_facture_tms)"; + } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; From 0ca145bfd062dd18e16bda6fd3d04dfcb06acecd Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Tue, 27 Feb 2024 17:27:49 +0100 Subject: [PATCH 0262/1862] fix ref and verify date and time --- htdocs/bookcal/availabilities_card.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/bookcal/availabilities_card.php b/htdocs/bookcal/availabilities_card.php index 6289b476ae8..9cbd48253e6 100644 --- a/htdocs/bookcal/availabilities_card.php +++ b/htdocs/bookcal/availabilities_card.php @@ -156,10 +156,10 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorIncoherentDates"), null, 'errors'); } - if (!$error) { + // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; - } + // Actions when linking object each other include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; @@ -227,8 +227,7 @@ if ($action == 'create') { } print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Availabilities")), '', 'object_'.$object->picto); - - print ''; + print ''; print ''; print ''; if ($backtopage) { From fd8ad1f7c06aecb58747d2e6e1078e90ec40b9f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 28 Feb 2024 15:27:16 +0100 Subject: [PATCH 0263/1862] add css in list cron (#28487) --- htdocs/cron/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index c00296a02eb..f3a87e0ad60 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr * Copyright (C) 2013 Florian Henry * Copyright (C) 2013-2021 Laurent Destailleur - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -444,7 +444,7 @@ $selectedfields = ''; $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; -print ''; +print '
'; print ''; // Action column From abbec034c6dc40f8523564fc23d4ae8c1491f329 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 28 Feb 2024 15:36:29 +0100 Subject: [PATCH 0264/1862] Qual: Several typing hints/some fixes. (#28483) * Update documentation to improve static tool messages * Suppress PhanPluginSuspiciousParamOrder * Fix typing hint * Fix typing hint (number->int) * Fix typing hint (PDF->TCPDF) * Fix typing hint (PDF->TCPDF) * Modify code to hint typing check * Correct Noop statement (createfromclone) * Remove useless if/else with same result * Suppress PhanRedefineFunctionInternal * Suppress PhanParamSuspiciousOrder * Suppress PhanPluginDuplicateArrayKey * Suppress multiple phan messages * Ignore PhanPluginSuspiciousParamOrder * Add phan typing * Remove useless if statement * Remove useless if/else condition * Remove useless if * Remove useless if * Join duplicate if/else statements * Fix useless if * Fix useless if * Fix phan notice by optimizing 2**$i to 1<<$i --- htdocs/accountancy/admin/account.php | 28 +++--- .../accountancy/class/bookkeeping.class.php | 7 +- htdocs/accountancy/journal/bankjournal.php | 50 ++++++---- .../cashcontrol/class/cashcontrol.class.php | 45 ++++----- htdocs/core/lib/functions2.lib.php | 9 +- .../contract/doc/pdf_strato.modules.php | 9 +- .../expedition/doc/pdf_espadon.modules.php | 15 +-- .../stocktransfer/doc/pdf_eagle.modules.php | 2 +- .../core/modules/syslog/mod_syslog_file.php | 4 +- .../class/DataCollector/DolPhpCollector.php | 3 +- htdocs/fourn/commande/card.php | 35 ++++--- htdocs/imports/import.php | 63 ++++++------- htdocs/install/fileconf.php | 15 +-- htdocs/master.inc.php | 2 + .../stock/class/mouvementstock.class.php | 53 +++++------ htdocs/product/stock/movement_list.php | 54 ++++++----- htdocs/projet/list.php | 53 +++++------ htdocs/projet/tasks/time.php | 29 +++--- htdocs/reception/list.php | 57 ++++++------ htdocs/societe/class/societe.class.php | 21 +++-- htdocs/ticket/list.php | 35 +++---- htdocs/user/list.php | 91 +++++++++---------- htdocs/website/class/website.class.php | 2 +- 23 files changed, 348 insertions(+), 334 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 85f230168c3..7532b8fc9f4 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -2,6 +2,7 @@ /* Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2024 Alexandre Spangaro * Copyright (C) 2016-2018 Laurent Destailleur + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -84,15 +85,15 @@ if (!$sortorder) { } $arrayfields = array( - 'aa.account_number'=>array('label'=>"AccountNumber", 'checked'=>1), - 'aa.label'=>array('label'=>"Label", 'checked'=>1), - 'aa.labelshort'=>array('label'=>"LabelToShow", 'checked'=>1), - 'aa.account_parent'=>array('label'=>"Accountparent", 'checked'=>1), - 'aa.pcg_type'=>array('label'=>"Pcgtype", 'checked'=>1, 'help'=>'PcgtypeDesc'), - 'categories'=>array('label'=>"AccountingCategories", 'checked'=>-1, 'help'=>'AccountingCategoriesDesc'), - 'aa.reconcilable'=>array('label'=>"Reconcilable", 'checked'=>1), - 'aa.import_key'=>array('label'=>"ImportId", 'checked'=>-1, 'help'=>''), - 'aa.active'=>array('label'=>"Activated", 'checked'=>1) + 'aa.account_number' => array('label' => "AccountNumber", 'checked' => 1), + 'aa.label' => array('label' => "Label", 'checked' => 1), + 'aa.labelshort' => array('label' => "LabelToShow", 'checked' => 1), + 'aa.account_parent' => array('label' => "Accountparent", 'checked' => 1), + 'aa.pcg_type' => array('label' => "Pcgtype", 'checked' => 1, 'help' => 'PcgtypeDesc'), + 'categories' => array('label' => "AccountingCategories", 'checked' => -1, 'help' => 'AccountingCategoriesDesc'), + 'aa.reconcilable' => array('label' => "Reconcilable", 'checked' => 1), + 'aa.import_key' => array('label' => "ImportId", 'checked' => -1, 'help' => ''), + 'aa.active' => array('label' => "Activated", 'checked' => 1) ); if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { @@ -410,6 +411,7 @@ if ($resql) { print ''; print ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'accounting_account', 0, $newcardbutton, '', $limit, 0, 0, 1); include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; @@ -506,7 +508,7 @@ if ($resql) { } // Fields from hook - $parameters = array('arrayfields'=>$arrayfields); + $parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -568,7 +570,7 @@ if ($resql) { } // Hook fields - $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); + $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -709,7 +711,7 @@ if ($resql) { } // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -803,7 +805,7 @@ if ($resql) { $db->free($resql); - $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); + $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 588b21ed668..a7d946f5ec7 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2015-2022 Alexandre Spangaro * Copyright (C) 2015-2020 Florian Henry * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -555,7 +556,7 @@ class BookKeeping extends CommonObject global $action; $hookmanager->initHooks(array($this->element . 'dao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; @@ -1971,7 +1972,7 @@ class BookKeeping extends CommonObject /** * Transform transaction * - * @param number $direction If 0: tmp => real, if 1: real => tmp + * @param int $direction If 0: tmp => real, if 1: real => tmp * @param string $piece_num Piece num = Transaction ref * @return int int Return integer <0 if KO, >0 if OK */ @@ -2197,7 +2198,7 @@ class BookKeeping extends CommonObject $obj = $this->db->fetch_object($resql); } - $result = array('id'=>$obj->rowid, 'account_number'=>$obj->account_number, 'label'=>$obj->label); + $result = array('id' => $obj->rowid, 'account_number' => $obj->account_number, 'label' => $obj->label); return $result; } else { $this->error = "Error ".$this->db->lasterror(); diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index c091abb5b48..9e6b39a9b00 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -12,6 +12,7 @@ * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Eric Seigne * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -194,6 +195,21 @@ $accountingjournalstatic->fetch($id_journal); $journal = $accountingjournalstatic->code; $journal_label = $accountingjournalstatic->label; +$tabcompany = array(); +$tabuser = array(); +$tabpay = array(); +$tabbq = array(); +$tabtp = array(); +$tabtype = array(); +$tabmoreinfo = array(); + +' +@phan-var-force array $tabcompany +@phan-var-force array $tabuser +@phan-var-force array $tabpay +@phan-var-force array $tabtp +'; + //print $sql; dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG); $result = $db->query($sql); @@ -210,14 +226,6 @@ if ($result) { $account_pay_subscription = getDolGlobalString('ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT', 'NotDefined'); // NotDefined is a reserved word $account_transfer = getDolGlobalString('ACCOUNTING_ACCOUNT_TRANSFER_CASH', 'NotDefined'); // NotDefined is a reserved word - $tabcompany = array(); - $tabuser = array(); - $tabpay = array(); - $tabbq = array(); - $tabtp = array(); - $tabtype = array(); - $tabmoreinfo = array(); - // Loop on each line into llx_bank table. For each line, we should get: // one line tabpay = line into bank // one line for bank record = tabbq @@ -342,11 +350,13 @@ if ($result) { // We save tabtype for a future use, to remember what kind of payment it is $tabpay[$obj->rowid]['type'] = $links[$key]['type']; $tabtype[$obj->rowid] = $links[$key]['type']; - } elseif (in_array($links[$key]['type'], array('company', 'user'))) { - if ($tabpay[$obj->rowid]['type'] == 'unknown') { - // We can guess here it is a bank record for a thirdparty company or a user. - // But we won't be able to record somewhere else than into a waiting account, because there is no other journal to record the contreparty. - } + /* phpcs:disable -- Code does nothing at this moment -> commented + } elseif (in_array($links[$key]['type'], array('company', 'user'))) { + if ($tabpay[$obj->rowid]['type'] == 'unknown') { + // We can guess here it is a bank record for a thirdparty company or a user. + // But we won't be able to record somewhere else than into a waiting account, because there is no other journal to record the contreparty. + } + */ // phpcs::enable } // Special case to ask later to add more request to get information for old links without company link. @@ -467,7 +477,7 @@ if ($result) { $userstatic->email = $tmpsalary->user->email; $userstatic->firstname = $tmpsalary->user->firstname; $userstatic->lastname = $tmpsalary->user->lastname; - $userstatic->statut = $tmpsalary->user->statut; + $userstatic->statut = $tmpsalary->user->status; $userstatic->accountancy_code = $tmpsalary->user->accountancy_code; if ($userstatic->id > 0) { @@ -487,7 +497,7 @@ if ($result) { 'firstname' => $userstatic->firstname, 'email' => $userstatic->email, 'accountancy_code' => $compta_user, - 'status' => $userstatic->statut + 'status' => $userstatic->status ); } } @@ -554,8 +564,8 @@ if ($result) { foreach ($arrayofamounts as $invoiceid => $amount) { $tmpinvoice->fetch($invoiceid); $tmpinvoice->fetch_thirdparty(); - if ($tmpinvoice->thirdparty->code_compta) { - $tabtp[$obj->rowid][$tmpinvoice->thirdparty->code_compta] += $amount; + if ($tmpinvoice->thirdparty->code_compta_client) { + $tabtp[$obj->rowid][$tmpinvoice->thirdparty->code_compta_client] += $amount; } } } @@ -1072,8 +1082,8 @@ if (empty($action) || $action == 'view') { $description = $langs->trans("DescJournalOnlyBindedVisible").'
'; $listofchoices = array( - 'notyet'=>$langs->trans("NotYetInGeneralLedger"), - 'already'=>$langs->trans("AlreadyInGeneralLedger") + 'notyet' => $langs->trans("NotYetInGeneralLedger"), + 'already' => $langs->trans("AlreadyInGeneralLedger") ); $period = $form->selectDate($date_start ? $date_start : -1, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end ? $date_end : -1, 'date_end', 0, 0, 0, '', 1, 0); $period .= ' - '.$langs->trans("JournalizationInLedgerStatus").' '.$form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1); @@ -1432,7 +1442,7 @@ $db->close(); /** * Return source for doc_ref of a bank transaction * - * @param string $val Array of val + * @param array $val Array of val * @param string $typerecord Type of record ('payment', 'payment_supplier', 'payment_expensereport', 'payment_vat', ...) * @return string A string label to describe a record into llx_bank_url */ diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index f66106d5ddd..15959866819 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2009 Regis Houssin * Copyright (C) 2016 Marcos García * Copyright (C) 2018 Andreu Bisquerra + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -80,26 +81,26 @@ class CashControl extends CommonObject * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>10), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>15), - 'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>18), - 'posmodule' =>array('type'=>'varchar(30)', 'label'=>'Module', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>19), - 'posnumber' =>array('type'=>'varchar(30)', 'label'=>'Terminal', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>20, 'css'=>'center'), - 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>0, 'position'=>24), - 'opening' =>array('type'=>'price', 'label'=>'Opening', 'enabled'=>1, 'visible'=>1, 'position'=>25, 'csslist'=>'amount'), - 'cash' =>array('type'=>'price', 'label'=>'Cash', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'csslist'=>'amount'), - 'cheque' =>array('type'=>'price', 'label'=>'Cheque', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'csslist'=>'amount'), - 'card' =>array('type'=>'price', 'label'=>'CreditCard', 'enabled'=>1, 'visible'=>1, 'position'=>36, 'csslist'=>'amount'), - 'year_close' =>array('type'=>'integer', 'label'=>'Year close', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>50, 'css'=>'center'), - 'month_close' =>array('type'=>'integer', 'label'=>'Month close', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'css'=>'center'), - 'day_close' =>array('type'=>'integer', 'label'=>'Day close', 'enabled'=>1, 'visible'=>1, 'position'=>60, 'css'=>'center'), - 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), - 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>502), - 'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>505), - 'fk_user_creat' =>array('type'=>'integer:User', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>600), - 'fk_user_valid' =>array('type'=>'integer:User', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>602), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'Import key', 'enabled'=>1, 'visible'=>0, 'position'=>700), - 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated')), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 10), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 15), + 'ref' => array('type' => 'varchar(64)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 18), + 'posmodule' => array('type' => 'varchar(30)', 'label' => 'Module', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 19), + 'posnumber' => array('type' => 'varchar(30)', 'label' => 'Terminal', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 20, 'css' => 'center'), + 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'visible' => 0, 'position' => 24), + 'opening' => array('type' => 'price', 'label' => 'Opening', 'enabled' => 1, 'visible' => 1, 'position' => 25, 'csslist' => 'amount'), + 'cash' => array('type' => 'price', 'label' => 'Cash', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'csslist' => 'amount'), + 'cheque' => array('type' => 'price', 'label' => 'Cheque', 'enabled' => 1, 'visible' => 1, 'position' => 33, 'csslist' => 'amount'), + 'card' => array('type' => 'price', 'label' => 'CreditCard', 'enabled' => 1, 'visible' => 1, 'position' => 36, 'csslist' => 'amount'), + 'year_close' => array('type' => 'integer', 'label' => 'Year close', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 50, 'css' => 'center'), + 'month_close' => array('type' => 'integer', 'label' => 'Month close', 'enabled' => 1, 'visible' => 1, 'position' => 55, 'css' => 'center'), + 'day_close' => array('type' => 'integer', 'label' => 'Day close', 'enabled' => 1, 'visible' => 1, 'position' => 60, 'css' => 'center'), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 500), + 'date_valid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 502), + 'tms' => array('type' => 'timestamp', 'label' => 'Tms', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 505), + 'fk_user_creat' => array('type' => 'integer:User', 'label' => 'UserCreation', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 600), + 'fk_user_valid' => array('type' => 'integer:User', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 602), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'Import key', 'enabled' => 1, 'visible' => 0, 'position' => 700), + 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'position' => 1000, 'notnull' => 1, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated')), ); /** @@ -241,7 +242,7 @@ class CashControl extends CommonObject * Validate cash fence * * @param User $user User - * @param number $notrigger No trigger + * @param int $notrigger No trigger * @return int Return integer <0 if KO, >0 if OK */ public function valid(User $user, $notrigger = 0) @@ -450,7 +451,7 @@ class CashControl extends CommonObject global $action; $hookmanager->initHooks(array('cashfencedao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 27b78638c33..1335da5649a 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1006,6 +1006,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $regKey = array(); while (preg_match('/\{([A-Z]+)\-([1-9])\}/', $tmpmask, $regKey)) { $maskperso[$regKey[1]] = '{'.$regKey[1].'-'.$regKey[2].'}'; + // @phan-suppress-next-line PhanParamSuspiciousOrder $maskpersonew[$regKey[1]] = str_pad('', $regKey[2], '_', STR_PAD_RIGHT); $tmpmask = preg_replace('/\{'.$regKey[1].'\-'.$regKey[2].'\}/i', $maskpersonew[$regKey[1]], $tmpmask); } @@ -1194,8 +1195,10 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $maskLike = preg_replace('/\{y\}/i', '_', $maskLike); $maskLike = preg_replace('/\{mm\}/i', '__', $maskLike); $maskLike = preg_replace('/\{dd\}/i', '__', $maskLike); + // @phan-suppress-next-line PhanParamSuspiciousOrder $maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'), str_pad("", dol_strlen($maskcounter), "_"), $maskLike); if ($maskrefclient) { + // @phan-suppress-next-line PhanParamSuspiciousOrder $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'), str_pad("", dol_strlen($maskrefclient), "_"), $maskLike); } if ($masktype) { @@ -1268,6 +1271,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $maskLike = preg_replace('/\{dd\}/i', '__', $maskLike); $maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'), $counterpadded, $maskLike); if ($maskrefclient) { + // @phan-suppress-next-line PhanParamSuspiciousOrder $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'), str_pad("", dol_strlen($maskrefclient), "_"), $maskLike); } if ($masktype) { @@ -1335,7 +1339,9 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $maskrefclient_maskLike = str_replace(dol_string_nospecial('{y}'), '_', $maskrefclient_maskLike); $maskrefclient_maskLike = str_replace(dol_string_nospecial('{mm}'), '__', $maskrefclient_maskLike); $maskrefclient_maskLike = str_replace(dol_string_nospecial('{dd}'), '__', $maskrefclient_maskLike); + // @phan-suppress-next-line PhanParamSuspiciousOrder $maskrefclient_maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'), str_pad("", dol_strlen($maskcounter), "_"), $maskrefclient_maskLike); + // @phan-suppress-next-line PhanParamSuspiciousOrder $maskrefclient_maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'), $maskrefclient_clientcode.str_pad("", dol_strlen($maskrefclient_maskcounter), "_"), $maskrefclient_maskLike); // Get counter in database @@ -1657,7 +1663,7 @@ function numero_semaine($time) // Definition du numero de semaine: nb de jours entre "premier Jeudi de l'annee" et "Jeudi de la semaine"; $numeroSemaine = ( ( - date("z", mktime(12, 0, 0, date("m", $jeudiSemaine), date("d", $jeudiSemaine), date("Y", $jeudiSemaine))) + date("z", mktime(12, 0, 0, date("m", $jeudiSemaine), date("d", $jeudiSemaine), date("Y", $jeudiSemaine))) - date("z", mktime(12, 0, 0, date("m", $premierJeudiAnnee), date("d", $premierJeudiAnnee), date("Y", $premierJeudiAnnee))) ) / 7 @@ -2840,6 +2846,7 @@ function phpSyntaxError($code) ob_start(); $code = substr($code, strlen(' * Copyright (C) 2015 Marcos García * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -195,7 +196,7 @@ class pdf_strato extends ModelePDFContract $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -467,7 +468,7 @@ class pdf_strato extends ModelePDFContract // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -477,7 +478,7 @@ class pdf_strato extends ModelePDFContract dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { @@ -794,7 +795,7 @@ class pdf_strato extends ModelePDFContract /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF $pdf PDF * @param Contrat $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index a79335a4899..885b61da806 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -5,6 +5,7 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2018-2020 Frédéric France * Copyright (C) 2023 Charlene Benke + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -229,7 +230,7 @@ class pdf_espadon extends ModelePdfExpedition $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -274,6 +275,7 @@ class pdf_espadon extends ModelePdfExpedition $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page @@ -442,7 +444,7 @@ class pdf_espadon extends ModelePdfExpedition if (empty($height_trackingnumber)) { $height_note = $this->page_hauteur - ($tab_top + $heightforfooter); } else { - $height_note = $this->page_hauteur - ($tab_top + $heightforfooter)+ $height_trackingnumber + 1; + $height_note = $this->page_hauteur - ($tab_top + $heightforfooter) + $height_trackingnumber + 1; $tab_top = $tab_topbeforetrackingnumber; } $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2); @@ -675,10 +677,10 @@ class pdf_espadon extends ModelePdfExpedition // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } // Detect if some page were added automatically and output _tableau for past pages @@ -743,7 +745,7 @@ class pdf_espadon extends ModelePdfExpedition // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -753,7 +755,7 @@ class pdf_espadon extends ModelePdfExpedition dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { @@ -1381,6 +1383,7 @@ class pdf_espadon extends ModelePdfExpedition if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } elseif (empty($reshook)) { + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } else { $this->cols = $hookmanager->resArray; diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index b5b967487c4..725abb6a34b 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -1222,7 +1222,7 @@ class pdf_eagle extends ModelePDFStockTransfer /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF $pdf PDF * @param StockTransfer $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index 60e43dc16c1..a6df4ed82a5 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -1,4 +1,6 @@ + */ require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php'; @@ -133,6 +135,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface * @param array $content Array containing the info about the message * @param string $suffixinfilename When output is a file, append this suffix into default log filename. * @return void + * @phan-suppress PhanPluginDuplicateArrayKey */ public function export($content, $suffixinfilename = '') { @@ -158,7 +161,6 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface print 'Failed to open log file '.($dolibarr_main_prod ? basename($logfile) : $logfile); } } else { - // @phan-suppress PhanPluginDuplicateArrayKey $logLevels = array( LOG_EMERG => 'EMERG', LOG_ALERT => 'ALERT', diff --git a/htdocs/debugbar/class/DataCollector/DolPhpCollector.php b/htdocs/debugbar/class/DataCollector/DolPhpCollector.php index bca2b2a7071..c4ff10dbc61 100644 --- a/htdocs/debugbar/class/DataCollector/DolPhpCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolPhpCollector.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -137,7 +138,7 @@ class PhpCollector extends DataCollector implements Renderable public function errorHandler($severity, $message, $fileName, $line) { for ($i = 0; $i < 15; $i++) { - if ($type = $severity & (2 ** $i)) { + if ($type = $severity & (1 << $i)) { $label = $this->friendlyErrorType($type); $this->messages[] = [ 'message' => $message . ' (' . $fileName . ':' . $line . ')', diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 059e04db6b7..adc56f49324 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -12,6 +12,7 @@ * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Joachim Kueter + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -173,7 +174,7 @@ $error = 0; * Actions */ -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -553,7 +554,7 @@ if (empty($reshook)) { //If text set in desc is the same as product descpription (as now it's preloaded) we add it only one time if (trim($product_desc) == trim($desc) && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) { - $product_desc=''; + $product_desc = ''; } if (!empty($product_desc) && getDolGlobalString('MAIN_NO_CONCAT_DESCRIPTION')) { @@ -1146,10 +1147,8 @@ if (empty($reshook)) { $langs->load("deliveries"); setEventMessages($langs->trans("DeliveryStateSaved"), null); $action = ''; - } elseif ($result == -3) { - $error++; - setEventMessages($object->error, $object->errors, 'errors'); } else { + //if ($result == -3) {} $error++; setEventMessages($object->error, $object->errors, 'errors'); } @@ -1442,11 +1441,11 @@ if (empty($reshook)) { // NS and Authentication parameters $ws_ns = 'http://www.dolibarr.org/ns/'; $ws_authentication = array( - 'dolibarrkey'=>$ws_key, - 'sourceapplication'=>'DolibarrWebServiceClient', - 'login'=>$ws_user, - 'password'=>$ws_password, - 'entity'=>$ws_entity + 'dolibarrkey' => $ws_key, + 'sourceapplication' => 'DolibarrWebServiceClient', + 'login' => $ws_user, + 'password' => $ws_password, + 'entity' => $ws_entity ); //Is sync supplier web services module activated? and everything filled? @@ -1501,7 +1500,7 @@ if (empty($reshook)) { 'lines' => $order_lines ); - $ws_parameters = array('authentication'=>$ws_authentication, 'order' => $order); + $ws_parameters = array('authentication' => $ws_authentication, 'order' => $order); $result_order = $soapclient_order->call("createOrder", $ws_parameters, $ws_ns, ''); if (empty($result_order["result"]["result_code"])) { //No result, check error str @@ -2036,7 +2035,7 @@ if ($action == 'create') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1); } - $parameters = array('formConfirm' => $formconfirm, 'lineid'=>$lineid); + $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $formconfirm .= $hookmanager->resPrint; @@ -2805,11 +2804,11 @@ if ($action == 'create') { // NS and Authentication parameters $ws_ns = 'http://www.dolibarr.org/ns/'; $ws_authentication = array( - 'dolibarrkey'=>$ws_key, - 'sourceapplication'=>'DolibarrWebServiceClient', - 'login'=>$ws_user, - 'password'=>$ws_password, - 'entity'=>'' + 'dolibarrkey' => $ws_key, + 'sourceapplication' => 'DolibarrWebServiceClient', + 'login' => $ws_user, + 'password' => $ws_password, + 'entity' => '' ); print load_fiche_titre($langs->trans('CreateRemoteOrder'), ''); @@ -2865,7 +2864,7 @@ if ($action == 'create') { $soapclient_user->decodeUTF8(false); //Get the thirdparty associated to user - $ws_parameters = array('authentication'=>$ws_authentication, 'id' => '', 'ref'=>$ws_user); + $ws_parameters = array('authentication' => $ws_authentication, 'id' => '', 'ref' => $ws_user); $result_user = $soapclient_user->call("getUser", $ws_parameters, $ws_ns, ''); $user_status_code = $result_user["result"]["result_code"]; diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index ef68400738d..43dd1645035 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2022 Charlene Benke + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -58,7 +59,7 @@ $entitytoicon = array( 'other' => 'generic', 'account' => 'account', 'product' => 'product', - 'virtualproduct'=>'product', + 'virtualproduct' => 'product', 'subproduct' => 'product', 'product_supplier_ref' => 'product', 'stock' => 'stock', @@ -67,11 +68,11 @@ $entitytoicon = array( 'stockbatch' => 'stock', 'category' => 'category', 'shipment' => 'sending', - 'shipment_line'=> 'sending', - 'reception'=> 'sending', - 'reception_line'=> 'sending', - 'expensereport'=> 'trip', - 'expensereport_line'=> 'trip', + 'shipment_line' => 'sending', + 'reception' => 'sending', + 'reception_line' => 'sending', + 'expensereport' => 'trip', + 'expensereport_line' => 'trip', 'holiday' => 'holiday', 'contract_line' => 'contract', 'translation' => 'generic', @@ -113,16 +114,16 @@ $entitytolang = array( 'other' => 'Other', 'trip' => 'TripsAndExpenses', 'shipment' => 'Shipments', - 'shipment_line'=> 'ShipmentLine', + 'shipment_line' => 'ShipmentLine', 'project' => 'Projects', 'projecttask' => 'Tasks', 'task_time' => 'TaskTimeSpent', 'action' => 'Event', - 'expensereport'=> 'ExpenseReport', - 'expensereport_line'=> 'ExpenseReportLine', + 'expensereport' => 'ExpenseReport', + 'expensereport_line' => 'ExpenseReportLine', 'holiday' => 'TitreRequestCP', 'contract' => 'Contract', - 'contract_line'=> 'ContractLine', + 'contract_line' => 'ContractLine', 'translation' => 'Translation', 'bom' => 'BOM', 'bomline' => 'BOMLine' @@ -895,21 +896,21 @@ if ($step == 4 && $datatoimport) { $isrequired = preg_match('/\*$/', $label); if (!empty($isrequired)) { $newlabel = substr($label, 0, -1); - $fieldstarget_tmp[$key] = array("label"=>$newlabel, "required"=>true); + $fieldstarget_tmp[$key] = array("label" => $newlabel, "required" => true); } else { - $fieldstarget_tmp[$key] = array("label"=>$label, "required"=>false); + $fieldstarget_tmp[$key] = array("label" => $label, "required" => false); } if (!empty($array_match_database_to_file[$key])) { $fieldstarget_tmp[$key]["imported"] = true; - $fieldstarget_tmp[$key]["position"] = $array_match_database_to_file[$key]-1; + $fieldstarget_tmp[$key]["position"] = $array_match_database_to_file[$key] - 1; $keytoswap = $key; while (!empty($array_match_database_to_file[$keytoswap])) { - if ($position+1 > $array_match_database_to_file[$keytoswap]) { - $keytoswapwith = $array_match_database_to_file[$keytoswap]-1; - $tmp = [$keytoswap=>$fieldstarget_tmp[$keytoswap]]; + if ($position + 1 > $array_match_database_to_file[$keytoswap]) { + $keytoswapwith = $array_match_database_to_file[$keytoswap] - 1; + $tmp = [$keytoswap => $fieldstarget_tmp[$keytoswap]]; unset($fieldstarget_tmp[$keytoswap]); $fieldstarget_tmp = arrayInsert($fieldstarget_tmp, $keytoswapwith, $tmp); - $keytoswapwith = $arraykeysfieldtarget[$array_match_database_to_file[$keytoswap]-1]; + $keytoswapwith = $arraykeysfieldtarget[$array_match_database_to_file[$keytoswap] - 1]; $tmp = $fieldstarget_tmp[$keytoswapwith]; unset($fieldstarget_tmp[$keytoswapwith]); $fieldstarget_tmp[$keytoswapwith] = $tmp; @@ -1115,7 +1116,7 @@ if ($step == 4 && $datatoimport) { foreach ($tmparray as $tmpkey => $tmpval) { $labeltoshow .= ($labeltoshow ? ' '.$langs->trans('or').' ' : '').$langs->transnoentities($tmpval); } - $optionsall[$code] = array('labelkey'=>$line['label'], 'labelkeyarray'=>$tmparray, 'label'=>$labeltoshow, 'required'=>(empty($line["required"]) ? 0 : 1), 'position'=>!empty($line['position']) ? $line['position'] : 0); + $optionsall[$code] = array('labelkey' => $line['label'], 'labelkeyarray' => $tmparray, 'label' => $labeltoshow, 'required' => (empty($line["required"]) ? 0 : 1), 'position' => !empty($line['position']) ? $line['position'] : 0); // TODO Get type from a new array into module descriptor. //$picto = 'email'; $picto = ''; @@ -1164,7 +1165,7 @@ if ($step == 4 && $datatoimport) { //var_dump($_SESSION['dol_array_match_file_to_database']); $selectforline = ''; - $selectforline .= ''; if (!empty($line["imported"])) { $selectforline .= ''; } else { @@ -1268,10 +1269,10 @@ if ($step == 4 && $datatoimport) { } elseif ($modetoautofillmapping == 'session' && !empty($_SESSION['dol_array_match_file_to_database_select'])) { $tmpselectioninsession = dolExplodeIntoArray($_SESSION['dol_array_match_file_to_database_select'], ',', '='); //var_dump($code); - if (!empty($tmpselectioninsession[($i+1)]) && $tmpselectioninsession[($i+1)] == $tmpcode) { + if (!empty($tmpselectioninsession[($i + 1)]) && $tmpselectioninsession[($i + 1)] == $tmpcode) { $selectforline .= ' selected'; } - $selectforline .= ' data-debug="'.$tmpcode.'-'.$code.'-'.$j.'-'.(!empty($tmpselectioninsession[($i+1)]) ? $tmpselectioninsession[($i+1)] : "").'"'; + $selectforline .= ' data-debug="'.$tmpcode.'-'.$code.'-'.$j.'-'.(!empty($tmpselectioninsession[($i + 1)]) ? $tmpselectioninsession[($i + 1)] : "").'"'; } $selectforline .= ' data-html="'.dol_escape_htmltag($labelhtml).'"'; $selectforline .= '>'; @@ -1280,7 +1281,7 @@ if ($step == 4 && $datatoimport) { $j++; } $selectforline .= ''; - $selectforline .= ajax_combobox('selectorderimport_'.($i+1)); + $selectforline .= ajax_combobox('selectorderimport_'.($i + 1)); print $selectforline; @@ -1496,7 +1497,7 @@ if ($step == 4 && $datatoimport) { print '
'; print ''; print ''; print ''; diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 7d211faae21..64b360472bb 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -6,6 +6,7 @@ * Copyright (C) 2004 Sebastien DiCintio * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2016 Raphaël Doursenaud + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -188,7 +189,7 @@ if (!empty($force_install_noedit)) { name="main_data_dir" value="" > @@ -220,7 +221,7 @@ if (!empty($force_install_noedit)) { name="main_url" value=" " > @@ -493,6 +494,7 @@ if (!empty($force_install_noedit)) { name="db_pass" value="" > @@ -576,14 +578,15 @@ if (!empty($force_install_noedit)) { class="needroot text-security" value="" 0 && !empty($force_install_databaserootpass)) { - print ' disabled'; /* May be removed by javascript*/ + print ' disabled'; /* May be removed by javascript*/ } ?> > diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 0eb37c28936..2539d9748c1 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -10,6 +10,7 @@ * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2011 Philippe Grand * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,6 +45,7 @@ if (!function_exists('is_countable')) { * function is_countable (to remove when php version supported will be >= 7.3) * @param mixed $c data to check if countable * @return bool + * @phan-suppress PhanRedefineFunctionInternal */ function is_countable($c) { diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index cd5eae2e6d8..6b310bdac1a 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2015 Laurent Destailleur * Copyright (C) 2011 Jean Heimburger * Copyright (C) 2014 Cedric GROSS + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -122,25 +123,25 @@ class MouvementStock extends CommonObject public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10, 'showoncombobox'=>1), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15), - 'datem' =>array('type'=>'datetime', 'label'=>'Datem', 'enabled'=>1, 'visible'=>-1, 'position'=>20), - 'fk_product' =>array('type'=>'integer:Product:product/class/product.class.php:1', 'label'=>'Product', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), - 'fk_entrepot' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>30), - 'value' =>array('type'=>'double', 'label'=>'Value', 'enabled'=>1, 'visible'=>-1, 'position'=>35), - 'price' =>array('type'=>'double(24,8)', 'label'=>'Price', 'enabled'=>1, 'visible'=>-1, 'position'=>40), - 'type_mouvement' =>array('type'=>'smallint(6)', 'label'=>'Type mouvement', 'enabled'=>1, 'visible'=>-1, 'position'=>45), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>50), - 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'fk_origin' =>array('type'=>'integer', 'label'=>'Fk origin', 'enabled'=>1, 'visible'=>-1, 'position'=>60), - 'origintype' =>array('type'=>'varchar(32)', 'label'=>'Origintype', 'enabled'=>1, 'visible'=>-1, 'position'=>65), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>70), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>75), - 'inventorycode' =>array('type'=>'varchar(128)', 'label'=>'InventoryCode', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'batch' =>array('type'=>'varchar(30)', 'label'=>'Batch', 'enabled'=>1, 'visible'=>-1, 'position'=>85), - 'eatby' =>array('type'=>'date', 'label'=>'Eatby', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'sellby' =>array('type'=>'date', 'label'=>'Sellby', 'enabled'=>1, 'visible'=>-1, 'position'=>95), - 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label'=>'Fk project', 'enabled'=>1, 'visible'=>-1, 'position'=>100), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10, 'showoncombobox' => 1), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 15), + 'datem' => array('type' => 'datetime', 'label' => 'Datem', 'enabled' => 1, 'visible' => -1, 'position' => 20), + 'fk_product' => array('type' => 'integer:Product:product/class/product.class.php:1', 'label' => 'Product', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 25), + 'fk_entrepot' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php', 'label' => 'Warehouse', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 30), + 'value' => array('type' => 'double', 'label' => 'Value', 'enabled' => 1, 'visible' => -1, 'position' => 35), + 'price' => array('type' => 'double(24,8)', 'label' => 'Price', 'enabled' => 1, 'visible' => -1, 'position' => 40), + 'type_mouvement' => array('type' => 'smallint(6)', 'label' => 'Type mouvement', 'enabled' => 1, 'visible' => -1, 'position' => 45), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'position' => 50), + 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'visible' => -1, 'position' => 55), + 'fk_origin' => array('type' => 'integer', 'label' => 'Fk origin', 'enabled' => 1, 'visible' => -1, 'position' => 60), + 'origintype' => array('type' => 'varchar(32)', 'label' => 'Origintype', 'enabled' => 1, 'visible' => -1, 'position' => 65), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 70), + 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Project', 'enabled' => '$conf->project->enabled', 'visible' => -1, 'notnull' => 1, 'position' => 75), + 'inventorycode' => array('type' => 'varchar(128)', 'label' => 'InventoryCode', 'enabled' => 1, 'visible' => -1, 'position' => 80), + 'batch' => array('type' => 'varchar(30)', 'label' => 'Batch', 'enabled' => 1, 'visible' => -1, 'position' => 85), + 'eatby' => array('type' => 'date', 'label' => 'Eatby', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'sellby' => array('type' => 'date', 'label' => 'Sellby', 'enabled' => 1, 'visible' => -1, 'position' => 95), + 'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Fk project', 'enabled' => 1, 'visible' => -1, 'position' => 100), ); @@ -545,11 +546,11 @@ class MouvementStock extends CommonObject } else { $newpmp = $oldpmp; } - } elseif ($type == 1 || $type == 2) { - // After a stock decrease, we don't change value of the AWP/PMP of a product. - $newpmp = $oldpmp; } else { - // Type of movement unknown + // ($type == 1 || $type == 2) + // -> After a stock decrease, we don't change value of the AWP/PMP of a product. + // else + // Type of movement unknown $newpmp = $oldpmp; } } @@ -579,11 +580,11 @@ class MouvementStock extends CommonObject if ($id_product_batch > 0) { $result = $this->createBatch($id_product_batch, $qty); if ($result == -2 && $fk_product_stock > 0) { // The entry for this product batch does not exists anymore, bu we already have a llx_product_stock, so we recreate the batch entry in product_batch - $param_batch = array('fk_product_stock' =>$fk_product_stock, 'batchnumber'=>$batch); + $param_batch = array('fk_product_stock' => $fk_product_stock, 'batchnumber' => $batch); $result = $this->createBatch($param_batch, $qty); } } else { - $param_batch = array('fk_product_stock' =>$fk_product_stock, 'batchnumber'=>$batch); + $param_batch = array('fk_product_stock' => $fk_product_stock, 'batchnumber' => $batch); $result = $this->createBatch($param_batch, $qty); } if ($result < 0) { @@ -1139,7 +1140,7 @@ class MouvementStock extends CommonObject $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->id; $label .= '
'.$langs->trans('Label').': '.$this->label; - $qtylabel = (($this->qty > 0) ? '+' : '') . $this->qty . ''; + $qtylabel = (($this->qty > 0) ? '+' : '') . $this->qty . ''; $label .= '
'.$langs->trans('Qty').': ' . $qtylabel; if ($this->batch) { $label .= '
'.$langs->trans('Batch').': '.$this->batch; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 234271ac2fb..18d40cdcc82 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -5,6 +5,7 @@ * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2018-2022 Ferran Marcet * Copyright (C) 2019 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -86,7 +87,7 @@ $search_user = trim(GETPOST("search_user")); $search_batch = trim(GETPOST("search_batch")); $search_qty = trim(GETPOST("search_qty")); $search_type_mouvement = GETPOSTINT('search_type_mouvement'); -$search_fk_project=GETPOSTINT("search_fk_project"); +$search_fk_project = GETPOSTINT("search_fk_project"); $type = GETPOSTINT("type"); @@ -126,22 +127,22 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); $arrayfields = array( - 'm.rowid'=>array('label'=>"Ref", 'checked'=>1, 'position'=>1), - 'm.datem'=>array('label'=>"Date", 'checked'=>1, 'position'=>2), - 'p.ref'=>array('label'=>"ProductRef", 'checked'=>1, 'css'=>'maxwidth100', 'position'=>3), - 'p.label'=>array('label'=>"ProductLabel", 'checked'=>0, 'position'=>5), - 'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(isModEnabled('productbatch'))), - 'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(isModEnabled('productbatch'))), - 'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))), - 'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it - 'm.fk_user_author'=>array('label'=>"Author", 'checked'=>0, 'position'=>120), - 'm.inventorycode'=>array('label'=>"InventoryCodeShort", 'checked'=>1, 'position'=>130), - 'm.label'=>array('label'=>"MovementLabel", 'checked'=>1, 'position'=>140), - 'm.type_mouvement'=>array('label'=>"TypeMovement", 'checked'=>0, 'position'=>150), - 'origin'=>array('label'=>"Origin", 'checked'=>1, 'position'=>155), - 'm.fk_projet'=>array('label'=>'Project', 'checked'=>0, 'position'=>180), - 'm.value'=>array('label'=>"Qty", 'checked'=>1, 'position'=>200), - 'm.price'=>array('label'=>"UnitPurchaseValue", 'checked'=>0, 'position'=>210, 'enabled'=>(!getDolGlobalInt('STOCK_MOVEMENT_LIST_HIDE_UNIT_PRICE'))) + 'm.rowid' => array('label' => "Ref", 'checked' => 1, 'position' => 1), + 'm.datem' => array('label' => "Date", 'checked' => 1, 'position' => 2), + 'p.ref' => array('label' => "ProductRef", 'checked' => 1, 'css' => 'maxwidth100', 'position' => 3), + 'p.label' => array('label' => "ProductLabel", 'checked' => 0, 'position' => 5), + 'm.batch' => array('label' => "BatchNumberShort", 'checked' => 1, 'position' => 8, 'enabled' => (isModEnabled('productbatch'))), + 'pl.eatby' => array('label' => "EatByDate", 'checked' => 0, 'position' => 9, 'enabled' => (isModEnabled('productbatch'))), + 'pl.sellby' => array('label' => "SellByDate", 'checked' => 0, 'position' => 10, 'enabled' => (isModEnabled('productbatch'))), + 'e.ref' => array('label' => "Warehouse", 'checked' => 1, 'position' => 100, 'enabled' => (!($id > 0))), // If we are on specific warehouse, we hide it + 'm.fk_user_author' => array('label' => "Author", 'checked' => 0, 'position' => 120), + 'm.inventorycode' => array('label' => "InventoryCodeShort", 'checked' => 1, 'position' => 130), + 'm.label' => array('label' => "MovementLabel", 'checked' => 1, 'position' => 140), + 'm.type_mouvement' => array('label' => "TypeMovement", 'checked' => 0, 'position' => 150), + 'origin' => array('label' => "Origin", 'checked' => 1, 'position' => 155), + 'm.fk_projet' => array('label' => 'Project', 'checked' => 0, 'position' => 180), + 'm.value' => array('label' => "Qty", 'checked' => 1, 'position' => 200), + 'm.price' => array('label' => "UnitPurchaseValue", 'checked' => 0, 'position' => 210, 'enabled' => (!getDolGlobalInt('STOCK_MOVEMENT_LIST_HIDE_UNIT_PRICE'))) //'m.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), //'m.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500) ); @@ -1101,11 +1102,7 @@ if ($id > 0) { $newcardbutton = ''; -if ($id > 0) { - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'movement', 0, '', '', $limit, 0, 0, 1); -} else { - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'movement', 0, '', '', $limit, 0, 0, 1); -} +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'movement', 0, '', '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendStockMovement"; @@ -1130,7 +1127,7 @@ if ($search_all) { $moreforfilter = ''; -$parameters = array('arrayfields'=>&$arrayfields); +$parameters = array('arrayfields' => &$arrayfields); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $warehouse, $action); // Note that $action and $warehouse may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; @@ -1272,7 +1269,7 @@ if (!empty($arrayfields['m.price']['checked'])) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $warehouse, $action); // Note that $action and $warehouse may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1359,7 +1356,7 @@ if (!empty($arrayfields['m.price']['checked'])) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $warehouse, $action); // Note that $action and $warehouse may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['m.datec']['checked'])) { @@ -1494,7 +1491,8 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['m.rowid']['checked'])) { print '
'; // This is primary not movement id } if (!empty($arrayfields['m.datem']['checked'])) { @@ -1593,7 +1591,7 @@ while ($i < $imaxinloop) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -1632,7 +1630,7 @@ if ($num == 0) { $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index ddeb182586f..1b030ac72f7 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -8,6 +8,7 @@ * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2019 Juanjo Menent * Copyright (C) 2020 Tobias Sean + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -226,11 +227,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = dol_eval($val['visible'], 1, 1, '1'); $arrayfields['p.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } @@ -238,12 +239,12 @@ foreach ($object->fields as $key => $val) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; // Add non object fields to fields for list -$arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>21, 'enabled'=>(!isModEnabled('societe') ? 0 : 1)); -$arrayfields['s.name_alias'] = array('label'=>"AliasNameShort", 'checked'=>0, 'position'=>22); -$arrayfields['commercial'] = array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0, 'position'=>23); -$arrayfields['c.assigned'] = array('label'=>$langs->trans("AssignedTo"), 'checked'=>1, 'position'=>120); -$arrayfields['opp_weighted_amount'] = array('label'=>$langs->trans('OpportunityWeightedAmountShort'), 'checked'=>0, 'enabled'=>(!getDolGlobalString('PROJECT_USE_OPPORTUNITIES') ? 0 : 1), 'position'=>106); -$arrayfields['u.login'] = array('label'=>"Author", 'checked'=>-1, 'position'=>165); +$arrayfields['s.nom'] = array('label' => $langs->trans("ThirdParty"), 'checked' => 1, 'position' => 21, 'enabled' => (!isModEnabled('societe') ? 0 : 1)); +$arrayfields['s.name_alias'] = array('label' => "AliasNameShort", 'checked' => 0, 'position' => 22); +$arrayfields['commercial'] = array('label' => $langs->trans("SaleRepresentativesOfThirdParty"), 'checked' => 0, 'position' => 23); +$arrayfields['c.assigned'] = array('label' => $langs->trans("AssignedTo"), 'checked' => 1, 'position' => 120); +$arrayfields['opp_weighted_amount'] = array('label' => $langs->trans('OpportunityWeightedAmountShort'), 'checked' => 0, 'enabled' => (!getDolGlobalString('PROJECT_USE_OPPORTUNITIES') ? 0 : 1), 'position' => 106); +$arrayfields['u.login'] = array('label' => "Author", 'checked' => -1, 'position' => 165); // Force some fields according to search_usage filter... if (GETPOST('search_usage_opportunity')) { //$arrayfields['p.usage_opportunity']['visible'] = 1; // Not require, filter on search_opp_status is enough @@ -274,7 +275,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -395,11 +396,7 @@ if (empty($reshook)) { } if (!$error) { - if ($nbok > 1) { - setEventMessages($langs->trans("RecordsClosed", $nbok), null, 'mesgs'); - } else { - setEventMessages($langs->trans("RecordsClosed", $nbok), null, 'mesgs'); - } + setEventMessages($langs->trans("RecordsClosed", $nbok), null, 'mesgs'); $db->commit(); } else { $db->rollback(); @@ -495,7 +492,7 @@ $sql = preg_replace('/,\s*$/', '', $sql); $sqlfields = $sql; // $sql fields to remove for count total $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as p"; -if (!empty($extrafields->attributes[$object->table_element]['label']) &&is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)"; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; @@ -1015,8 +1012,8 @@ $param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( - 'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), - 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + 'validate' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + 'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); @@ -1049,8 +1046,8 @@ if ($search_usage_event_organization == 1) { } $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewProject'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('projet', 'creer')); @@ -1250,7 +1247,7 @@ if (!empty($arrayfields['p.datee']['checked'])) { // Visibility if (!empty($arrayfields['p.public']['checked'])) { print ''; } @@ -1334,7 +1331,7 @@ if (!empty($arrayfields['u.login']['checked'])) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Creation date @@ -1489,7 +1486,7 @@ if (!empty($arrayfields['u.login']['checked'])) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['p.datec']['checked'])) { @@ -1618,7 +1615,7 @@ while ($i < $imaxinloop) { } $selected = in_array($object->id, $arrayofselected); - $arrayofdata = array('assignedusers' => $stringassignedusers, 'thirdparty'=>$companystatic, 'selected' => $selected); + $arrayofdata = array('assignedusers' => $stringassignedusers, 'thirdparty' => $companystatic, 'selected' => $selected); print $object->getKanbanView('', $arrayofdata); @@ -1982,7 +1979,7 @@ while ($i < $imaxinloop) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -2065,7 +2062,7 @@ if ($num == 0) { $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql' => $sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index e55a8f4fd3d..4ddc831827a 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -7,6 +7,7 @@ * Copyright (C) 2018 Frédéric France * Copyright (C) 2019-2021 Christophe Battarel * Copyright (C) 2023 Gauthier VERDOL + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -262,11 +263,7 @@ if ($action == 'addtimespent' && $user->hasRight('projet', 'time')) { } } } else { - if (empty($id)) { - $action = 'createtime'; - } else { - $action = 'createtime'; - } + $action = 'createtime'; } } @@ -1268,25 +1265,25 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Definition of fields for list $arrayfields = array(); - $arrayfields['t.element_date'] = array('label'=>$langs->trans("Date"), 'checked'=>1); - $arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1','checked'=>1); - $arrayfields['s.name_alias'] = array('label'=>$langs->trans("AliasNameShort"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1'); + $arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => 1); + $arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => 1); + $arrayfields['s.name_alias'] = array('label' => $langs->trans("AliasNameShort"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1'); if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task if (! empty($allprojectforuser)) { $arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1]; $arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1]; } - $arrayfields['t.element_ref'] = array('label'=>$langs->trans("RefTask"), 'checked'=>1); - $arrayfields['t.element_label'] = array('label'=>$langs->trans("LabelTask"), 'checked'=>1); + $arrayfields['t.element_ref'] = array('label' => $langs->trans("RefTask"), 'checked' => 1); + $arrayfields['t.element_label'] = array('label' => $langs->trans("LabelTask"), 'checked' => 1); } $arrayfields['author'] = array('label' => $langs->trans("By"), 'checked' => 1); $arrayfields['t.note'] = array('label' => $langs->trans("Note"), 'checked' => 1); if (isModEnabled('service') && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) { $arrayfields['t.fk_product'] = array('label' => $langs->trans("Product"), 'checked' => 1); } - $arrayfields['t.element_duration'] = array('label'=>$langs->trans("Duration"), 'checked'=>1); - $arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>isModEnabled("salaries")); - $arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time)); + $arrayfields['t.element_duration'] = array('label' => $langs->trans("Duration"), 'checked' => 1); + $arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => 1, 'enabled' => isModEnabled("salaries")); + $arrayfields['valuebilled'] = array('label' => $langs->trans("Billed"), 'checked' => 1, 'enabled' => (((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time)); // Extra fields include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -1835,7 +1832,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if (isModEnabled("service") && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) { print ''; } } @@ -2397,8 +2394,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if ($task_time->invoice_id) { $result = $tmpinvoice->fetch($task_time->invoice_id); if ($result > 0) { - if ($action=='editline' && $_GET['lineid'] == $task_time->rowid) { - print $formproject->selectInvoiceAndLine($task_time->invoice_id, $task_time->invoice_line_id, 'invoiceid', 'invoicelineid', 'maxwidth500', array('p.rowid'=>$projectstatic->id)); + if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { + print $formproject->selectInvoiceAndLine($task_time->invoice_id, $task_time->invoice_line_id, 'invoiceid', 'invoicelineid', 'maxwidth500', array('p.rowid' => $projectstatic->id)); } else { print $tmpinvoice->getNomUrl(1); if (!empty($task_time->invoice_line_id)) { diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 4ed9d014e0d..6551eb35d36 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2023 Alexandre Spangaro + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -109,9 +110,9 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'e.ref'=>"Ref", - 's.nom'=>"ThirdParty", - 'e.note_public'=>'NotePublic', + 'e.ref' => "Ref", + 's.nom' => "ThirdParty", + 'e.note_public' => 'NotePublic', ); if (empty($user->socid)) { $fieldstosearchall["e.note_private"] = "NotePrivate"; @@ -119,19 +120,19 @@ if (empty($user->socid)) { $checkedtypetiers = 0; $arrayfields = array( - 'e.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), - 'e.ref_supplier'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1), - 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1), - 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1), - 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1), - 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0), - 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0), - 'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers), - 'e.date_delivery'=>array('label'=>$langs->trans("DateDeliveryPlanned"), 'checked'=>1), - 'e.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - 'e.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), - 'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>'getDolGlobalString("WORKFLOW_BILL_ON_RECEPTION") !== "0"') + 'e.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1), + 'e.ref_supplier' => array('label' => $langs->trans("RefSupplier"), 'checked' => 1), + 's.nom' => array('label' => $langs->trans("ThirdParty"), 'checked' => 1), + 's.town' => array('label' => $langs->trans("Town"), 'checked' => 1), + 's.zip' => array('label' => $langs->trans("Zip"), 'checked' => 1), + 'state.nom' => array('label' => $langs->trans("StateShort"), 'checked' => 0), + 'country.code_iso' => array('label' => $langs->trans("Country"), 'checked' => 0), + 'typent.code' => array('label' => $langs->trans("ThirdPartyType"), 'checked' => $checkedtypetiers), + 'e.date_delivery' => array('label' => $langs->trans("DateDeliveryPlanned"), 'checked' => 1), + 'e.datec' => array('label' => $langs->trans("DateCreation"), 'checked' => 0, 'position' => 500), + 'e.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => 0, 'position' => 500), + 'e.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => 1, 'position' => 1000), + 'e.billed' => array('label' => $langs->trans("Billed"), 'checked' => 1, 'position' => 1000, 'enabled' => 'getDolGlobalString("WORKFLOW_BILL_ON_RECEPTION") !== "0"') ); // Extra fields @@ -162,7 +163,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -225,7 +226,7 @@ if (empty($reshook)) { $TFactThirdNbLines = array(); $nb_bills_created = 0; - $lastid= 0; + $lastid = 0; $lastref = ''; $db->begin(); @@ -459,7 +460,7 @@ if (empty($reshook)) { $array_options = $lines[$i]->array_options; } - $objecttmp->context['createfromclone']; + $objecttmp->context['createfromclone'] = 'createfromclone'; $rang = $i; //there may already be rows from previous receptions @@ -537,7 +538,7 @@ if (empty($reshook)) { $id = $objecttmp->id; // For builddoc action $lastref = $objecttmp->ref; // generated ref - $object =$objecttmp; + $object = $objecttmp; // Fac builddoc $donotredirect = 1; @@ -868,8 +869,8 @@ $massactionbutton = $form->selectMassAction('', $arrayofmassactions); // if (!empty($socid)) $url .= '&socid='.$socid; // $newcardbutton = dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', $url, '', $user->rights->expedition->creer); $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewReception'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/reception/card.php?action=create2', '', $user->hasRight('reception', 'creer')); @@ -943,7 +944,7 @@ $moreforfilter = ''; if (!empty($moreforfilter)) { print '
'; print $moreforfilter; - $parameters = array('type'=>$type); + $parameters = array('type' => $type); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
'; @@ -1037,7 +1038,7 @@ if (!empty($arrayfields['l.date_delivery']['checked'])) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1059,7 +1060,7 @@ if (!empty($arrayfields['e.tms']['checked'])) { // Status if (!empty($arrayfields['e.fk_statut']['checked'])) { print '
'; } // Status billed @@ -1135,7 +1136,7 @@ if (!empty($arrayfields['l.date_delivery']['checked'])) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, '$totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, '$totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['e.datec']['checked'])) { @@ -1351,7 +1352,7 @@ while ($i < $imaxinloop) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1423,7 +1424,7 @@ if ($num == 0) { // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; -$parameters = array('arrayfields'=>$arrayfields, 'totalarray' => $totalarray, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'totalarray' => $totalarray, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 118dca102bf..2885555b01a 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -20,6 +20,7 @@ * Copyright (C) 2022 ButterflyOfFire * Copyright (C) 2023 Alexandre Janniaux * Copyright (C) 2024 William Mead + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -328,21 +329,21 @@ class Societe extends CommonObject /** * @var string State code - * @deprecated Use state_code instead + * @deprecated Use $state_code instead * @see $state_code */ public $departement_code; /** * @var string - * @deprecated Use state instead + * @deprecated Use $state instead * @see $state */ public $departement; /** * @var string - * @deprecated Use country instead + * @deprecated Use $country instead * @see $country */ public $pays; @@ -425,7 +426,7 @@ class Societe extends CommonObject /** * @var string Professional ID 1 - * @deprecated + * @deprecated Use $idprof1 instead * @see $idprof1 */ public $siren; @@ -439,7 +440,7 @@ class Societe extends CommonObject /** * @var string Professional ID 2 - * @deprecated + * @deprecated Use $idprof2 instead * @see $idprof2 */ public $siret; @@ -452,7 +453,7 @@ class Societe extends CommonObject /** * @var string Professional ID 3 - * @deprecated + * @deprecated Use $idprof3 instead * @see $idprof3 */ public $ape; @@ -638,7 +639,7 @@ class Societe extends CommonObject /** * Duplicate of code_compta_client (for backward compatibility) * @var string - * @deprecated + * @deprecated Use $code_compta_client * @see $code_compta_client */ public $code_compta; @@ -662,14 +663,14 @@ class Societe extends CommonObject public $accountancy_code_supplier; /** - * Accounting code for product (for level 3 of suggestion of prouct accounting account) + * Accounting code for product (for level 3 of suggestion of product accounting account) * @var string */ public $code_compta_product; /** * @var string - * @deprecated Note is split in public and private notes + * @deprecated Use $note_public, $note_private - Note is split in public and private notes * @see $note_public, $note_private */ public $note; @@ -2247,7 +2248,7 @@ class Societe extends CommonObject * Define third party as a customer * * @return int Return integer <0 if KO, >0 if OK - * @deprecated + * @deprecated Use setAsCustomer() instead * @see setAsCustomer() */ public function set_as_client() diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 16597f8cf8c..5370e41ef85 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -5,6 +5,7 @@ * Copyright (C) 2019-2021 Juanjo Menent * Copyright (C) 2019-2020 Laurent Destailleur * Copyright (C) 2023 Charlene Benke + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -143,11 +144,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } @@ -267,11 +268,7 @@ if (empty($reshook)) { } if (!$error) { - if ($nbok > 1) { - setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); - } else { - setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); - } + setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); $db->commit(); } else { $db->rollback(); @@ -313,11 +310,7 @@ if (empty($reshook)) { } if (!$error) { - if ($nbok > 1) { - setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); - } else { - setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); - } + setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); $db->commit(); } else { $db->rollback(); @@ -763,8 +756,8 @@ if (!empty($socid)) { $url .= '&socid='.$socid; } $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewTicket'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('ticket', 'write')); @@ -942,7 +935,7 @@ foreach ($object->fields as $key => $val) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -984,7 +977,7 @@ foreach ($object->fields as $key => $val) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { @@ -1200,7 +1193,7 @@ while ($i < $imaxinloop) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -1243,7 +1236,7 @@ if ($num == 0) { $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index cb40dba7c17..a5d146dc282 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Marcos García + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -102,15 +103,15 @@ $form = new Form($db); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'u.login'=>"Login", - 'u.lastname'=>"Lastname", - 'u.firstname'=>"Firstname", - 'u.accountancy_code'=>"AccountancyCode", - 'u.office_phone'=>"PhonePro", - 'u.user_mobile'=>"PhoneMobile", - 'u.email'=>"EMail", - 'u.note_public'=>"NotePublic", - 'u.note_private'=>"NotePrivate" + 'u.login' => "Login", + 'u.lastname' => "Lastname", + 'u.firstname' => "Firstname", + 'u.accountancy_code' => "AccountancyCode", + 'u.office_phone' => "PhonePro", + 'u.user_mobile' => "PhoneMobile", + 'u.email' => "EMail", + 'u.note_public' => "NotePublic", + 'u.note_private' => "NotePrivate" ); if (isModEnabled('api')) { $fieldstosearchall['u.api_key'] = "ApiKey"; @@ -121,29 +122,29 @@ $permissiontowritehr = $user->hasRight('hrm', 'write_personal_information', 'wri // Definition of fields for list $arrayfields = array( - 'u.rowid'=>array('label'=>"TechnicalID", 'checked'=>-1, 'position'=>5), - 'u.login'=>array('label'=>"Login", 'checked'=>1, 'position'=>10), - 'u.lastname'=>array('label'=>"Lastname", 'checked'=>1, 'position'=>15), - 'u.firstname'=>array('label'=>"Firstname", 'checked'=>1, 'position'=>20), - 'u.entity'=>array('label'=>"Entity", 'checked'=>1, 'position'=>50, 'enabled'=>(isModEnabled('multicompany') && !getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE'))), - 'u.gender'=>array('label'=>"Gender", 'checked'=>0, 'position'=>22), - 'u.employee'=>array('label'=>"Employee", 'checked'=>($contextpage == 'employeelist' ? 1 : 0), 'position'=>25), - 'u.fk_user'=>array('label'=>"HierarchicalResponsible", 'checked'=>1, 'position'=>27, 'csslist'=>'maxwidth150'), - 'u.accountancy_code'=>array('label'=>"AccountancyCode", 'checked'=>0, 'position'=>30), - 'u.office_phone'=>array('label'=>"PhonePro", 'checked'=>1, 'position'=>31), - 'u.user_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1, 'position'=>32), - 'u.email'=>array('label'=>"EMail", 'checked'=>1, 'position'=>35), - 'u.api_key'=>array('label'=>"ApiKey", 'checked'=>0, 'position'=>40, "enabled"=>(isModEnabled('api') && $user->admin)), - 'u.fk_soc'=>array('label'=>"Company", 'checked'=>($contextpage == 'employeelist' ? 0 : 1), 'position'=>45), - 'u.ref_employee'=>array('label'=>"RefEmployee", 'checked'=>-1, 'position'=>60, 'enabled'=>(isModEnabled('hrm') && $permissiontoreadhr)), - 'u.national_registration_number'=>array('label'=>"NationalRegistrationNumber", 'checked'=>-1, 'position'=>61, 'enabled'=>(isModEnabled('hrm') && $permissiontoreadhr)), - 'u.job'=>array('label'=>"PostOrFunction", 'checked'=>-1, 'position'=>50), - 'u.salary'=>array('label'=>"Salary", 'checked'=>-1, 'position'=>80, 'enabled'=>(isModEnabled('salaries') && $user->hasRight("salaries", "readall")), 'isameasure'=>1), - 'u.datelastlogin'=>array('label'=>"LastConnexion", 'checked'=>1, 'position'=>100), - 'u.datepreviouslogin'=>array('label'=>"PreviousConnexion", 'checked'=>0, 'position'=>110), - 'u.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), - 'u.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), - 'u.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), + 'u.rowid' => array('label' => "TechnicalID", 'checked' => -1, 'position' => 5), + 'u.login' => array('label' => "Login", 'checked' => 1, 'position' => 10), + 'u.lastname' => array('label' => "Lastname", 'checked' => 1, 'position' => 15), + 'u.firstname' => array('label' => "Firstname", 'checked' => 1, 'position' => 20), + 'u.entity' => array('label' => "Entity", 'checked' => 1, 'position' => 50, 'enabled' => (isModEnabled('multicompany') && !getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE'))), + 'u.gender' => array('label' => "Gender", 'checked' => 0, 'position' => 22), + 'u.employee' => array('label' => "Employee", 'checked' => ($contextpage == 'employeelist' ? 1 : 0), 'position' => 25), + 'u.fk_user' => array('label' => "HierarchicalResponsible", 'checked' => 1, 'position' => 27, 'csslist' => 'maxwidth150'), + 'u.accountancy_code' => array('label' => "AccountancyCode", 'checked' => 0, 'position' => 30), + 'u.office_phone' => array('label' => "PhonePro", 'checked' => 1, 'position' => 31), + 'u.user_mobile' => array('label' => "PhoneMobile", 'checked' => 1, 'position' => 32), + 'u.email' => array('label' => "EMail", 'checked' => 1, 'position' => 35), + 'u.api_key' => array('label' => "ApiKey", 'checked' => 0, 'position' => 40, "enabled" => (isModEnabled('api') && $user->admin)), + 'u.fk_soc' => array('label' => "Company", 'checked' => ($contextpage == 'employeelist' ? 0 : 1), 'position' => 45), + 'u.ref_employee' => array('label' => "RefEmployee", 'checked' => -1, 'position' => 60, 'enabled' => (isModEnabled('hrm') && $permissiontoreadhr)), + 'u.national_registration_number' => array('label' => "NationalRegistrationNumber", 'checked' => -1, 'position' => 61, 'enabled' => (isModEnabled('hrm') && $permissiontoreadhr)), + 'u.job' => array('label' => "PostOrFunction", 'checked' => -1, 'position' => 50), + 'u.salary' => array('label' => "Salary", 'checked' => -1, 'position' => 80, 'enabled' => (isModEnabled('salaries') && $user->hasRight("salaries", "readall")), 'isameasure' => 1), + 'u.datelastlogin' => array('label' => "LastConnexion", 'checked' => 1, 'position' => 100), + 'u.datepreviouslogin' => array('label' => "PreviousConnexion", 'checked' => 0, 'position' => 110), + 'u.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500), + 'u.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 500), + 'u.statut' => array('label' => "Status", 'checked' => 1, 'position' => 1000), ); // Extra fields include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -332,11 +333,7 @@ if (empty($reshook)) { } if (!$error) { - if ($nbok > 1) { - setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); - } else { - setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); - } + setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); $db->commit(); } else { $db->rollback(); @@ -657,9 +654,9 @@ if (!empty($socid)) { } $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars paddingleft imgforviewmode', DOL_URL_ROOT.'/user/list.php?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('HierarchicView'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/user/hierarchy.php?mode=hierarchy'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', (($mode == 'hierarchy') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars paddingleft imgforviewmode', DOL_URL_ROOT.'/user/list.php?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('HierarchicView'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/user/hierarchy.php?mode=hierarchy'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', (($mode == 'hierarchy') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd); @@ -762,7 +759,7 @@ if (!empty($arrayfields['u.firstname']['checked'])) { } if (!empty($arrayfields['u.gender']['checked'])) { print ''; } @@ -819,7 +816,7 @@ if (!empty($arrayfields['u.datepreviouslogin']['checked'])) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['u.datec']['checked'])) { @@ -835,7 +832,7 @@ if (!empty($arrayfields['u.tms']['checked'])) { if (!empty($arrayfields['u.statut']['checked'])) { // Status print ''; } // Action column @@ -940,7 +937,7 @@ if (!empty($arrayfields['u.datepreviouslogin']['checked'])) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['u.datec']['checked'])) { @@ -978,7 +975,7 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar // -------------------------------------------------------------------- $i = 0; $savnbfield = $totalarray['nbfield']; -$totalarray = array('val'=>array('u.salary'=>0)); +$totalarray = array('val' => array('u.salary' => 0)); $totalarray['nbfield'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { @@ -1309,7 +1306,7 @@ while ($i < $imaxinloop) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1376,7 +1373,7 @@ if ($num == 0) { $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index d7d47bde917..b7fb7ec2c6b 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -2059,7 +2059,7 @@ class Website extends CommonObject $linefound[$i]['output'] = '/dolWebsiteOutput\(\$tmp, "html", ' . preg_quote($exceptNumPge[$i], '/') . '\);/'; } - if ($countNumPage >= 2) { + if (isset($linefound[1])) { $maxLines = max(count($lines1), count($lines2)); for ($lineNum = 0; $lineNum < $maxLines; $lineNum++) { $lineContent1 = $lines1[$lineNum] ?? ''; From 01b2e4a62c16bf55de9d58ee9bf7f96e9e7efd6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 28 Feb 2024 16:07:02 +0100 Subject: [PATCH 0265/1862] fix phpstan (#28480) --- htdocs/core/class/html.formother.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index adda77c0fad..5008cfc093b 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -834,7 +834,7 @@ class FormOther * @deprecated Use instead selectColor * @see selectColor() */ - public function select_color($set_color = '', $prefix = 'f_color', $form_name = '', $showcolorbox = 1, $arrayofcolors = '') + public function select_color($set_color = '', $prefix = 'f_color', $form_name = '', $showcolorbox = 1, $arrayofcolors = []) { // phpcs:enable print $this->selectColor($set_color, $prefix, $form_name, $showcolorbox, $arrayofcolors); @@ -854,7 +854,7 @@ class FormOther * @return string * @see showColor() */ - public static function selectColor($set_color = '', $prefix = 'f_color', $form_name = '', $showcolorbox = 1, $arrayofcolors = array(), $morecss = '', $setpropertyonselect = '', $default = '') + public static function selectColor($set_color = '', $prefix = 'f_color', $form_name = '', $showcolorbox = 1, $arrayofcolors = [], $morecss = '', $setpropertyonselect = '', $default = '') { // Deprecation warning if ($form_name) { From 0b2ce5c2aeee8a04d36ce01866d63441b966fe25 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 28 Feb 2024 16:07:46 +0100 Subject: [PATCH 0266/1862] Fix: author email (#28479) --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 216472484e0..1619f147c3b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -22,7 +22,7 @@ * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Joachim Kueter * Copyright (C) 2024 MDW - * Copyright (C) 2024 Lenin Rivas + * Copyright (C) 2024 Lenin Rivas * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 1738347d2003531b55666b2ee38ea74f52375ab8 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 28 Feb 2024 16:09:19 +0100 Subject: [PATCH 0267/1862] FIX type of paiementCode by casting with string (#28477) --- htdocs/compta/facture/class/api_invoices.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index ee34766b45c..74221f0e178 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1496,7 +1496,7 @@ class Invoices extends DolibarrApi $paymentobj->amounts = $amounts; // Array with all payments dispatching with invoice id $paymentobj->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching $paymentobj->paiementid = $paymentid; - $paymentobj->paiementcode = dol_getIdFromCode($this->db, $paymentid, 'c_paiement', 'id', 'code', 1); + $paymentobj->paiementcode = (string) dol_getIdFromCode($this->db, $paymentid, 'c_paiement', 'id', 'code', 1); $paymentobj->num_payment = $num_payment; $paymentobj->note_private = $comment; From 00385af6f0a1d5215dcc50b84dd0747a658eae2c Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 28 Feb 2024 16:12:47 +0100 Subject: [PATCH 0268/1862] FIX type of multicurrency_amount (#28476) --- htdocs/compta/facture/class/api_invoices.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 74221f0e178..61258a62655 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1494,7 +1494,11 @@ class Invoices extends DolibarrApi $paymentobj = new Paiement($this->db); $paymentobj->datepaye = $datepaye; $paymentobj->amounts = $amounts; // Array with all payments dispatching with invoice id - $paymentobj->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching + $multicurrencyAmountsConverted = []; + foreach ($multicurrency_amounts as $key => $value) { + $multicurrencyAmountsConverted[$key] = (float) $value; + } + $paymentobj->multicurrency_amounts = $multicurrencyAmountsConverted; // Array with all payments dispatching $paymentobj->paiementid = $paymentid; $paymentobj->paiementcode = (string) dol_getIdFromCode($this->db, $paymentid, 'c_paiement', 'id', 'code', 1); $paymentobj->num_payment = $num_payment; From d4ced85527c138b6c935cc97f75d2ae0b6655c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 28 Feb 2024 16:19:38 +0100 Subject: [PATCH 0269/1862] fix phpstan (#28473) --- htdocs/core/class/html.formprojet.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 0c58136a322..020d01fd626 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -75,7 +75,7 @@ class FormProjets extends Form * @param int $nooutput No print output. Return it only. * @param int $forceaddid Force to add project id in list, event if not qualified * @param string $morecss More css - * @param int $htmlid Html id to use instead of htmlname + * @param string $htmlid Html id to use instead of htmlname, by example id="htmlid" * @param string $morefilter More filters (Must be a sql sanitized string) * @return string Return html content */ From 0f3009d8214d127d99dad037e81c7e0efaebb66f Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 28 Feb 2024 16:20:06 +0100 Subject: [PATCH 0270/1862] Fix type of variable in Deplacement class (#28472) --- htdocs/compta/deplacement/class/deplacement.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index e101aab8317..8a91ee9b50a 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -88,7 +88,7 @@ class Deplacement extends CommonObject public $fk_user; /** - * @var string km value formatted + * @var float km value formatted */ public $km; From c0cd4e1aaafaee77dc71483d273a4407d013417c Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 28 Feb 2024 16:52:30 +0100 Subject: [PATCH 0271/1862] Fix return method by adding type int (#28493) --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index ab1fa81adc1..e782e83f662 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1688,7 +1688,7 @@ class CMailFile * @param array $mimetype_list Tableau * @param array $mimefilename_list Tableau * @param array $cidlist Array of CID if file must be completed with CID code - * @return string String with files encoded + * @return string|int String with files encoded */ private function write_files($filename_list, $mimetype_list, $mimefilename_list, $cidlist) { From 0033429991930e20adf5a6d882f8ae7defc531d4 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 28 Feb 2024 16:54:03 +0100 Subject: [PATCH 0272/1862] Fix type of ref in tva card (#28492) --- htdocs/compta/tva/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index a77c5979c9d..47669898244 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -330,7 +330,7 @@ if (empty($reshook)) { if ($object->id > 0) { $object->id = 0; - $object->ref = null; + $object->ref = ''; $object->paye = 0; if (GETPOST('amount', 'alphanohtml')) { From ccb562cc0b406dc3e3ae5d90ce0e0707753081a4 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 28 Feb 2024 16:55:11 +0100 Subject: [PATCH 0273/1862] FIX type of variable does not accept null (#28490) --- htdocs/compta/sociales/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index c3fdb7f1296..1c503429393 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -259,7 +259,8 @@ if (empty($reshook)) { $originalId = $object->id; if ($object->id > 0) { - $object->id = $object->ref = null; + $object->id = 0; + $object->ref = ''; $object->paye = 0; if (GETPOST('amount', 'alphanohtml')) { $object->amount = price2num(GETPOST('amount', 'alphanohtml'), 'MT', 2); From cec3a6c8e88c2d724a85c9bfc82b3e9fa0628421 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 28 Feb 2024 17:03:53 +0100 Subject: [PATCH 0274/1862] Qual: Add AbstractRestApiTest class, refactor RestApiUserTest, add RestApiMosTest (#28484) * New: AbstractRestAPITest class * Qual: Create RestAPIMosTest --- dev/setup/phpunit/PHPUNIT.BAT | 13 +- test/phpunit/AbstractRestAPITest.php | 107 +++++++++++++++++ test/phpunit/RestAPIMosTest.php | 173 +++++++++++++++++++++++++++ test/phpunit/RestAPIUserTest.php | 74 +----------- 4 files changed, 287 insertions(+), 80 deletions(-) create mode 100644 test/phpunit/AbstractRestAPITest.php create mode 100644 test/phpunit/RestAPIMosTest.php diff --git a/dev/setup/phpunit/PHPUNIT.BAT b/dev/setup/phpunit/PHPUNIT.BAT index b931a081528..cd36711f8b0 100644 --- a/dev/setup/phpunit/PHPUNIT.BAT +++ b/dev/setup/phpunit/PHPUNIT.BAT @@ -1,9 +1,4 @@ -@ECHO OFF -REM SAMPLE WINDOWS SCRIPT TO START TESTS -REM -REM CURRENTLY THIS SCRIPT MUST BE LOCATED AT THE ROOT OF THE PROJECT. -REM A copy of phpunit-9.5.phar is required - +REM @ECHO OFF SET OPEN_BASEDIR=%~dp0 SET DD_TRACE_CLI_ENABLED=1 @@ -17,8 +12,10 @@ REM REM The DOMAIN/Port value should be the same as in htdocs/conf/conf.php REM (This is only needed if did not set up another server locally REM for your test installation database). -SET PHPSERVER_DOMAIN_PORT=127.0.0.1:80 +SET PHPSERVER_DOMAIN_PORT=127.0.0.1:8080 SET PHPSERVER_LOG=%~dp0/php_serv.log + +echo if (class_exists('PHPUnit\Framework\TestSuite')) { $dolibarr_main_url_root='http://%PHPSERVER_DOMAIN_PORT%'; } >> %~dp0\htdocs\conf\conf.php GOTO :START REM The error handler @@ -37,7 +34,7 @@ for /F "tokens=2 delims=," %%i in ('tasklist /FI "IMAGENAME eq php.exe" /FO CSV :FOUND_PID echo "Server PID: %php_pid%" -curl "http://%PHPSERVER_DOMAIN_PORT%" +REM curl "http://%PHPSERVER_DOMAIN_PORT%" SET MEMOPT=-d memory-limit=-1 diff --git a/test/phpunit/AbstractRestAPITest.php b/test/phpunit/AbstractRestAPITest.php new file mode 100644 index 00000000000..fa1cb867283 --- /dev/null +++ b/test/phpunit/AbstractRestAPITest.php @@ -0,0 +1,107 @@ + + * Copyright (C) 2023 Alexandre Janniaux + * Copyright (C) 2024 MDW + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see https://www.gnu.org/ + */ + +/** + * \file test/phpunit/AbstractRestAPITest.php + * \ingroup test + * \brief Abstract Class for Rest API Tests + */ + +global $conf,$user,$langs,$db; +//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver +//require_once 'PHPUnit/Autoload.php'; +require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; +require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; +require_once dirname(__FILE__).'/../../htdocs/core/lib/geturl.lib.php'; +require_once dirname(__FILE__).'/CommonClassTest.class.php'; + +if (empty($user->id)) { + print "Load permissions for admin user nb 1\n"; + $user->fetch(1); + $user->getrights(); +} +$conf->global->MAIN_DISABLE_ALL_MAILS = 1; +$conf->global->MAIN_UMASK = '0666'; + + +/** + * Class for PHPUnit tests + * + * @backupGlobals disabled + * @backupStaticAttributes enabled + * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. + */ +abstract class AbstractRestAPITest extends CommonClassTest +{ + protected $api_url; + protected $api_key; + + /** + * setUpBeforeClass + * + * @return void + */ + public static function setUpBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::assertTrue(isModEnabled('api'), " module api must be enabled."); + } + + /** + * Init phpunit tests + * + * @return void + */ + protected function setUp(): void + { + parent::setUp(); + + global $conf,$user,$langs,$db; + $conf = $this->savconf; + $user = $this->savuser; + $langs = $this->savlangs; + $db = $this->savdb; + + $this->api_url = DOL_MAIN_URL_ROOT.'/api/index.php'; + $addheaders = array('Content-Type: application/json', 'Accept: application/json'); + + $method = get_called_class()."::".__FUNCTION__; + $test = "API Test Setup - "; + $login = 'admin'; + $password = 'admin'; + $url = $this->api_url.'/login?login='.$login.'&password='.$password; + // Call the API login method to save api_key for this test class. + // At first call, if token is not defined a random value is generated and returned. + $result = getURLContent($url, 'GET', '', 1, $addheaders, array('http', 'https'), 2); + print "$method result = ".var_export($result, true)."\n"; + print "$method curl_error_no: ".$result['curl_error_no']."\n"; + $this->assertEquals('', $result['curl_error_no'], "$test Should not have a curl error"); + $object = json_decode($result['content'], true); // If success content is just an id, if not an array + + $this->assertNotNull($object, "$test Parsing of JSON result must not be null"); + $this->assertNotEquals(500, (empty($object['error']['code']) ? 0 : $object['error']['code']), "$test Error".(empty($object['error']['message']) ? '' : ' '.$object['error']['message'])); + $this->assertEquals('200', $object['success']['code']); + + $this->api_key = $object['success']['token']; + + print "$method api_key: $this->api_key \n"; + } +} diff --git a/test/phpunit/RestAPIMosTest.php b/test/phpunit/RestAPIMosTest.php new file mode 100644 index 00000000000..d16640fffd3 --- /dev/null +++ b/test/phpunit/RestAPIMosTest.php @@ -0,0 +1,173 @@ + + * Copyright (C) 2023 Alexandre Janniaux + * Copyright (C) 2024 MDW + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see https://www.gnu.org/ + */ + +/** + * \file test/phpunit/RestAPIUserTest.php + * \ingroup test + * \brief PHPUnit test + * \remarks To run this script as CLI: phpunit filename.php + */ + +//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver +//require_once 'PHPUnit/Autoload.php'; +require_once __DIR__."/AbstractRestAPITest.php"; + +/** + * Class for PHPUnit tests + * + * @backupGlobals disabled + * @backupStaticAttributes enabled + * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. + */ +class RestAPIMosTest extends AbstractRestAPITest +{ + /** + * + * @param string $endpoint Endpoint - "user/id" + * @param string $test_title Text to be added to output + * @param 'POST'|'GET' $method Call Method + * @param mixed $data Data that will be JSON encoded + * @param int $expected_error Expected error code + * + * @return mixed Decodes JSON value returned by the service + * + */ + private function getUrl($endpoint, $test_title = "", $method = "GET", $data = null, $expected_error = 0) + { + + // Encode parameters in JSON body when POST, as URL query key/values otherwise. + $params = ''; + $body = null; + if ($method === 'POST') { + $body = json_encode($data); + } elseif (!empty($data)) { + $params = '?'.http_build_query($data); + } + + + $addheaders = array( + 'Content-Type: application/json','Accept: application/json', "DOLAPIKEY: {$this->api_key}"); + + // $url = $this->api_url.'/'.$endpoint.'?'.http_build_query(['api_key'=>$this->api_key]); + // + $url = $this->api_url.'/'.$endpoint.$params; + + // getURLContent($url, $postorget, $param, $followlocation, $addheaders, $allowedschemes, $localurl, $ssl_verifypeer) + + $result = getURLContent($url, $method, $body, 1, $addheaders, array('http', 'https'), 2); + + $this->assertEquals('', $result['curl_error_no'], "{$test_title}Should not have a curl error"); + + $object = json_decode($result['content'], true); + + $dbg_info = PHP_EOL.json_encode($result, JSON_PRETTY_PRINT); + + $this->assertNotNull($object, "{$test_title}Parsing of JSON result must not be null$dbg_info"); + + $result['content'] = $object; + $dbg_info = PHP_EOL.json_encode($result, JSON_PRETTY_PRINT); + + $this->assertEquals($expected_error, (empty($object['error']['code']) ? 0 : $object['error']['code']), "{$test_title}Error code is not $expected_error$dbg_info"); + + return $result; + } + + /** + * testRestMoCreate + * + * @return int + */ + public function testRestMoCreate() + { + + $test = "Create MO "; + $data = [ + 'ref' => 'Try1', + 'mrptype' => 0, + 'fk_product' => 1, + 'qty' => 1, + 'status' => 1, // 0=Draft,1=Validated,2=InProgress,3=Produced,9=Canceled + ]; + $result = $this->getUrl('mos', $test, 'POST', $data); + + print json_encode($result, JSON_PRETTY_PRINT); + $this->assertTrue(is_int($result['content']), "$test Result data is expected to be integer"); + + /// return $object['id']; + return $result['content']; + } + + + /** + * testRestMoProduceAndConsumete + * + * @depends testRestMoCreate + * + * @param int $mos_id Id of MO that was created + * @return void + */ + public function testRestMoList($mos_id) + { + + $test = "Produce MO "; + + //$data = ['ref' => 'Try1', 'mrptype' => 0, 'fk_product' => 1, 'qty' => 1, 'status' => 0, ]; + $data = null; + $result = $this->getUrl("mos", $test, 'GET', ['sortfield' => 't.rowid', 'sortorder' => 'DESC', 'limit' => 100]); + + // print json_encode($result, JSON_PRETTY_PRINT); + + $this->assertEquals($mos_id, $result['content'][0]['id'] ?? null, "{$test}First item in reversed list should be new item"); + } + + /** + * testRestMoProduceAndConsume + * + * @depends testRestMoCreate + * + * @param int $mos_id Id of MO that was created + * @return int + */ + public function testRestMoProduceAndConsume($mos_id) + { + + $test = "Produce and Consume MO "; + + $mos_state_id = 1; // $depends; + + + + $data + = [ + "inventorylabel" => "Produce and consume using API", + "inventorycode" => "PRODUCEAPI-YY-MM-DD", + "autoclose" => 1, + "arraytoconsume" => [], + "arraytoproduce" => [$mod_id] ]; + + $result = $this->getUrl("mos/{$mos_state_id}/produceandconsume", $test, 'POST', $data); + + print json_encode($result, JSON_PRETTY_PRINT); + $this->assertTrue(is_int($result['content']), "{$test}Result data is expected to be integer"); + + /// return $object['id']; + return $result['content']; + } +} diff --git a/test/phpunit/RestAPIUserTest.php b/test/phpunit/RestAPIUserTest.php index 851a26abec4..1d95870abc9 100644 --- a/test/phpunit/RestAPIUserTest.php +++ b/test/phpunit/RestAPIUserTest.php @@ -25,22 +25,10 @@ * \remarks To run this script as CLI: phpunit filename.php */ -global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver //require_once 'PHPUnit/Autoload.php'; -require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; -require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; -require_once dirname(__FILE__).'/../../htdocs/core/lib/geturl.lib.php'; -require_once dirname(__FILE__).'/CommonClassTest.class.php'; - -if (empty($user->id)) { - print "Load permissions for admin user nb 1\n"; - $user->fetch(1); - $user->getrights(); -} -$conf->global->MAIN_DISABLE_ALL_MAILS = 1; -$conf->global->MAIN_UMASK = '0666'; +require_once __DIR__."/AbstractRestAPITest.php"; /** * Class for PHPUnit tests @@ -49,66 +37,8 @@ $conf->global->MAIN_UMASK = '0666'; * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ -class RestAPIUserTest extends CommonClassTest +class RestAPIUserTest extends AbstractRestAPITest { - protected $api_url; - protected $api_key; - - /** - * setUpBeforeClass - * - * @return void - */ - public static function setUpBeforeClass(): void - { - global $conf,$user,$langs,$db; - $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. - - if (!isModEnabled('api')) { - print __METHOD__." module api must be enabled.\n"; - die(1); - } - - print __METHOD__."\n"; - } - - /** - * Init phpunit tests - * - * @return void - */ - protected function setUp(): void - { - global $conf,$user,$langs,$db; - $conf = $this->savconf; - $user = $this->savuser; - $langs = $this->savlangs; - $db = $this->savdb; - - $this->api_url = DOL_MAIN_URL_ROOT.'/api/index.php'; - - $test = "API Test Setup - "; - $login = 'admin'; - $password = 'admin'; - $url = $this->api_url.'/login?login='.$login.'&password='.$password; - // Call the API login method to save api_key for this test class. - // At first call, if token is not defined a random value is generated and returned. - $result = getURLContent($url, 'GET', '', 1, array(), array('http', 'https'), 2); - print __METHOD__." result = ".var_export($result, true)."\n"; - print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n"; - $this->assertEquals('', $result['curl_error_no'], "$test Should not have a curl error"); - $object = json_decode($result['content'], true); // If success content is just an id, if not an array - - $this->assertNotNull($object, "$test Parsing of JSON result must not be null"); - $this->assertNotEquals(500, (empty($object['error']['code']) ? 0 : $object['error']['code']), "$test Error".(empty($object['error']['message']) ? '' : ' '.$object['error']['message'])); - $this->assertEquals('200', $object['success']['code']); - - $this->api_key = $object['success']['token']; - - print __METHOD__." api_key: $this->api_key \n"; - } - - /** * testRestGetUser * From a1462d6f29d61e9ad937f95519040c263d1f007a Mon Sep 17 00:00:00 2001 From: Mohamed DAOUD Date: Wed, 28 Feb 2024 18:40:53 +0100 Subject: [PATCH 0275/1862] Fix GETPOST to GETPOSTINT issue (#28506) * Fix GETPOST to GETPOSTINT issue * Update list.php * Update list.php --------- Co-authored-by: Laurent Destailleur --- htdocs/product/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 387e4a43b53..214802925b8 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -90,19 +90,19 @@ $catid = GETPOSTINT('catid'); if (!empty($catid) && empty($searchCategoryProductList)) { $searchCategoryProductList = array($catid); } -$search_tosell = GETPOSTINT("search_tosell"); -$search_tobuy = GETPOSTINT("search_tobuy"); +$search_tosell = GETPOST("search_tosell"); +$search_tobuy = GETPOST("search_tobuy"); $search_country = GETPOSTINT("search_country"); $search_state = GETPOSTINT("state_id"); $fourn_id = GETPOSTINT("fourn_id"); -$search_tobatch = GETPOSTINT("search_tobatch"); +$search_tobatch = GETPOST("search_tobatch"); $search_accountancy_code_sell = GETPOST("search_accountancy_code_sell", 'alpha'); $search_accountancy_code_sell_intra = GETPOST("search_accountancy_code_sell_intra", 'alpha'); $search_accountancy_code_sell_export = GETPOST("search_accountancy_code_sell_export", 'alpha'); $search_accountancy_code_buy = GETPOST("search_accountancy_code_buy", 'alpha'); $search_accountancy_code_buy_intra = GETPOST("search_accountancy_code_buy_intra", 'alpha'); $search_accountancy_code_buy_export = GETPOST("search_accountancy_code_buy_export", 'alpha'); -$search_finished = GETPOSTINT("search_finished"); +$search_finished = GETPOST("search_finished"); $search_units = GETPOSTINT('search_units'); $optioncss = GETPOST('optioncss', 'alpha'); $type = GETPOSTINT("type"); From a0c4af79293bbca41233f5ae7eba7cb417635e8c Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 28 Feb 2024 18:52:05 +0100 Subject: [PATCH 0276/1862] Fix amount type in api_invoices (#28475) * Fix amount type in api_invoices * Update api_invoices.class.php --------- Co-authored-by: Laurent Destailleur --- .../compta/facture/class/api_invoices.class.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 61258a62655..2c4995989e1 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1478,27 +1478,23 @@ class Invoices extends DolibarrApi // Clean parameters amount if payment is for a credit note if ($this->invoice->type == Facture::TYPE_CREDIT_NOTE) { $resteapayer = price2num($resteapayer, 'MT'); - $amounts[$id] = price2num(-1 * $resteapayer, 'MT'); + $amounts[$id] = (float) price2num(-1 * $resteapayer, 'MT'); // Multicurrency $newvalue = price2num($this->invoice->multicurrency_total_ttc, 'MT'); - $multicurrency_amounts[$id] = price2num(-1 * $newvalue, 'MT'); + $multicurrency_amounts[$id] = (float) price2num(-1 * $newvalue, 'MT'); } else { $resteapayer = price2num($resteapayer, 'MT'); - $amounts[$id] = $resteapayer; + $amounts[$id] = (float) $resteapayer; // Multicurrency $newvalue = price2num($this->invoice->multicurrency_total_ttc, 'MT'); - $multicurrency_amounts[$id] = $newvalue; + $multicurrency_amounts[$id] = (float) $newvalue; } // Creation of payment line $paymentobj = new Paiement($this->db); $paymentobj->datepaye = $datepaye; - $paymentobj->amounts = $amounts; // Array with all payments dispatching with invoice id - $multicurrencyAmountsConverted = []; - foreach ($multicurrency_amounts as $key => $value) { - $multicurrencyAmountsConverted[$key] = (float) $value; - } - $paymentobj->multicurrency_amounts = $multicurrencyAmountsConverted; // Array with all payments dispatching + $paymentobj->amounts = $amounts; + $paymentobj->multicurrency_amounts = $multicurrency_amounts; $paymentobj->paiementid = $paymentid; $paymentobj->paiementcode = (string) dol_getIdFromCode($this->db, $paymentid, 'c_paiement', 'id', 'code', 1); $paymentobj->num_payment = $num_payment; From d59e3e5bc8da8252bee5d8102f2e7bca21f51638 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Wed, 28 Feb 2024 18:54:41 +0100 Subject: [PATCH 0277/1862] FIX subscription must be editable when accounting isn't reconciled (#28469) --- htdocs/adherents/subscription/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index a9446083faf..c258485760b 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -358,7 +358,7 @@ if ($rowid && $action != 'edit') { print '
'; if ($user->hasRight('adherent', 'cotisation', 'creer')) { - if (!empty($bankline->rappro) || empty($bankline)) { + if (empty($bankline->rappro) || empty($bankline)) { print '"; } else { print '"; From 7c36864ff9ea86eba1fe616d606cf070f2b2ab42 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 28 Feb 2024 20:03:26 +0100 Subject: [PATCH 0278/1862] FIX saveFile by adding null in return (#28508) * FIX saveFile by adding null in return * Update html_generic.modules.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/modules/dons/html_generic.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/dons/html_generic.modules.php b/htdocs/core/modules/dons/html_generic.modules.php index fa16c9a03b1..49bd1a7a29a 100644 --- a/htdocs/core/modules/dons/html_generic.modules.php +++ b/htdocs/core/modules/dons/html_generic.modules.php @@ -166,9 +166,9 @@ class html_generic extends ModeleDon /** * Write the object to document file to disk * - * @param string $path Path for the file + * @param string $path Path for the file * @param string $contents Contents of the file - * @return NULL + * @return int Return code */ private function saveFile($path, $contents) { @@ -178,7 +178,7 @@ class html_generic extends ModeleDon fclose($handle); dolChmod($path); - return; + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps From b41020a801f49547d7e3391e088c7636fc550d32 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 28 Feb 2024 20:05:33 +0100 Subject: [PATCH 0279/1862] Fix method by changing return type (#28507) * FIX return method getListOfCharacterSet by adding null type * Fix return method getListOfCollation by adding return null --- htdocs/core/db/pgsql.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 1e218d9cd1f..35ce3ff072b 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -1332,7 +1332,7 @@ class DoliDBPgsql extends DoliDB /** * Return list of available charset that can be used to store data in database * - * @return array List of Charset + * @return array|null List of Charset */ public function getListOfCharacterSet() { @@ -1371,7 +1371,7 @@ class DoliDBPgsql extends DoliDB /** * Return list of available collation that can be used for database * - * @return array Liste of Collation + * @return array|null Liste of Collation */ public function getListOfCollation() { From 6c5855c99fd72c36503e0a77d8aa9a1963109eec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 28 Feb 2024 20:07:26 +0100 Subject: [PATCH 0280/1862] Clean code --- htdocs/core/lib/functions.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1619f147c3b..f8357732cef 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2800,7 +2800,7 @@ function dol_bc($var, $moreclass = '') */ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs = null, $mode = 0, $extralangcode = '') { - global $conf, $langs, $hookmanager; + global $langs, $hookmanager; $ret = ''; $countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR', 'CN'); // See also MAIN_FORCE_STATE_INTO_ADDRESS @@ -2889,6 +2889,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs * @param int $ts Timestamp (If is_gmt is true, timestamp is already includes timezone and daylight saving offset, if is_gmt is false, timestamp is a GMT timestamp and we must compensate with server PHP TZ) * @param bool $is_gmt See comment of timestamp parameter * @return string A formatted string + * @see dol_stringtotime() */ function dol_strftime($fmt, $ts = false, $is_gmt = false) { @@ -3552,7 +3553,7 @@ function getArrayOfSocialNetworks() */ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetworks = array()) { - global $conf, $user, $langs; + global $user, $langs; $htmllink = $value; From b666d17eede5ac8ab98394796e9a104fb61d72d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 28 Feb 2024 20:18:35 +0100 Subject: [PATCH 0281/1862] FIX #28504 --- htdocs/core/class/menubase.class.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 96cf95ceb6a..b86ee41f60f 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -126,12 +126,6 @@ class Menubase */ public $langs; - /** - * @var string Not used - * @deprecated - */ - public $level; - /** * @var string Name family/module for left menu (setup, info, ...) */ @@ -183,7 +177,7 @@ class Menubase */ public function create($user = null) { - global $conf, $langs; + global $conf; // Clean parameters if (!isset($this->enabled)) { @@ -209,9 +203,6 @@ class Menubase if (empty($this->position)) { $this->position = 0; } - if (!$this->level) { - $this->level = 0; - } // Check parameters if (empty($this->menu_handler)) { From aea79e6fbffff769dfaa4d9d4f27f8cdaa7d8e4c Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 28 Feb 2024 20:21:29 +0100 Subject: [PATCH 0282/1862] FIX return type of return by adding null in return (#28503) --- htdocs/core/class/lessc.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/lessc.class.php b/htdocs/core/class/lessc.class.php index 0484968f526..5cfbfe2ed09 100644 --- a/htdocs/core/class/lessc.class.php +++ b/htdocs/core/class/lessc.class.php @@ -2281,7 +2281,7 @@ class Lessc * * @param mixed $in Input * @param bool $force Force rebuild? - * @return array lessphp cache structure + * @return array|null lessphp cache structure */ public function cachedCompile($in, $force = false) { From 67d6c988998ca044723ef6b3692a2a914f8993f3 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 28 Feb 2024 20:22:17 +0100 Subject: [PATCH 0283/1862] FIX return by adding null (#28502) --- htdocs/core/class/html.formcategory.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formcategory.class.php b/htdocs/core/class/html.formcategory.class.php index 5841f5035e1..34a1961bc84 100644 --- a/htdocs/core/class/html.formcategory.class.php +++ b/htdocs/core/class/html.formcategory.class.php @@ -136,7 +136,7 @@ class FormCategory extends Form return $num_rows; } else { dol_print_error($this->db); - return; + return null; } } } From c8f8286fa3f5deb307e76104eef6fe2f20810ab4 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 28 Feb 2024 20:23:49 +0100 Subject: [PATCH 0284/1862] Fix return type in howdocuments (#28500) --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index c8589d9b088..5c527e016c2 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -332,7 +332,7 @@ class FormFile * @param int $hideifempty Hide section of generated files if there is no file * @param string $removeaction (optional) The action to remove a file * @param string $tooltipontemplatecombo Text to show on a tooltip after the combo list of templates - * @return string Output string with HTML array of documents (might be empty string) + * @return string|int Output string with HTML array of documents (might be empty string) */ public function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '', $morepicto = '', $object = null, $hideifempty = 0, $removeaction = 'remove_file', $tooltipontemplatecombo = '') { From 946abbfbd1ff943778a6550acefcb644abbd81b9 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 28 Feb 2024 20:33:36 +0100 Subject: [PATCH 0285/1862] Fix variable and return in method (#28498) --- htdocs/core/class/html.formsetup.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index d6e0e56f688..32215871529 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -683,7 +683,7 @@ class FormSetupItem $this->fieldValue = getDolGlobalString($this->confKey); return true; } else { - $this->fieldValue = null; + $this->fieldValue = ''; return false; } } @@ -1103,7 +1103,7 @@ class FormSetupItem } elseif (!empty($errors)) { $this->errors[] = $errors; } - return; + return null; } /** From eda3b8e1617874193f775359771611e90b9f6aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 28 Feb 2024 20:36:53 +0100 Subject: [PATCH 0286/1862] fix phpstan (#28497) --- htdocs/core/class/html.formcompany.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index f142c22c87a..b3be55a633f 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -143,7 +143,7 @@ class FormCompany extends Form * @param int $empty Add empty value in list * @return void */ - public function form_prospect_level($page, $selected = '', $htmlname = 'prospect_level_id', $empty = 0) + public function form_prospect_level($page, $selected = 0, $htmlname = 'prospect_level_id', $empty = 0) { // phpcs:enable global $user, $langs; @@ -195,7 +195,7 @@ class FormCompany extends Form * @param int $empty Add empty value in list * @return void */ - public function formProspectContactLevel($page, $selected = '', $htmlname = 'prospect_contact_level_id', $empty = 0) + public function formProspectContactLevel($page, $selected = 0, $htmlname = 'prospect_contact_level_id', $empty = 0) { global $user, $langs; @@ -643,7 +643,7 @@ class FormCompany extends Form * @param string $morecss More CSS on select component * @return int The selected third party ID */ - public function selectCompaniesForNewContact($object, $var_id, $selected = '', $htmlname = 'newcompany', $limitto = '', $forceid = 0, $moreparam = '', $morecss = '') + public function selectCompaniesForNewContact($object, $var_id, $selected = 0, $htmlname = 'newcompany', $limitto = '', $forceid = 0, $moreparam = '', $morecss = '') { global $conf, $hookmanager; From d4a548a48f664a5f7217a1291827db8b9fd06098 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Wed, 28 Feb 2024 20:57:03 +0100 Subject: [PATCH 0287/1862] Fix return method select_conditions_paiements (#28495) --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5c8ea19dc73..ce7594a56f1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4323,7 +4323,7 @@ class Form * 0 : use default deposit percentage from entry * > 0 : force deposit percentage (for example, from company object) * @param int $noprint if set to one we return the html to print, if 0 (default) we print it - * @return void + * @return void|string * @deprecated */ public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1, $noprint = 0) From 32995e3b7306bab263aefbdb890edbc1481d8c92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 28 Feb 2024 21:11:47 +0100 Subject: [PATCH 0288/1862] Fix #28478 --- htdocs/compta/facture/class/api_invoices.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 2c4995989e1..e86e221bbb7 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1630,9 +1630,9 @@ class Invoices extends DolibarrApi if ($is_multicurrency) { $amounts[$id] = null; // Multicurrency - $multicurrency_amounts[$id] = $amount; + $multicurrency_amounts[$id] = (float) $amount; } else { - $amounts[$id] = $amount; + $amounts[$id] = (float) $amount; // Multicurrency $multicurrency_amounts[$id] = null; } @@ -1644,7 +1644,7 @@ class Invoices extends DolibarrApi $paymentobj->amounts = $amounts; // Array with all payments dispatching with invoice id $paymentobj->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching $paymentobj->paiementid = $paymentid; - $paymentobj->paiementcode = dol_getIdFromCode($this->db, $paymentid, 'c_paiement', 'id', 'code', 1); + $paymentobj->paiementcode = (string) dol_getIdFromCode($this->db, $paymentid, 'c_paiement', 'id', 'code', 1); $paymentobj->num_payment = $num_payment; $paymentobj->note_private = $comment; $paymentobj->ref_ext = $ref_ext; From 3c1c6f61ff64ea1c254f2887fd61c9b07445c985 Mon Sep 17 00:00:00 2001 From: Mohamed DAOUD Date: Wed, 28 Feb 2024 21:36:16 +0100 Subject: [PATCH 0289/1862] warnings fix some php warnings (#28467) --- htdocs/website/websiteaccount_card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 6194a540789..8621c398af9 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -209,13 +209,13 @@ if ($action == 'create') { if ($backtopage) { print ''; } - if ($backtopageforcancel) { + if (!empty($backtopageforcancel)) { print ''; } - if ($backtopagejsfields) { + if (!empty($backtopagejsfields)) { print ''; } - if ($dol_openinpopup) { + if (!empty($dol_openinpopup)) { print ''; } From eb6aa92359b6f1e7c7327f13f3b44cb9adb05176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 28 Feb 2024 21:43:23 +0100 Subject: [PATCH 0290/1862] fix isModEnabled for all case (#28465) * Update conf.class.php * new test * new test * new test * ficheinter not fichinter --- htdocs/core/lib/functions.lib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f8357732cef..6f47523cc3c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -219,7 +219,7 @@ define( 'entrepot' => 'stock', 'expedition' => 'delivery_note', 'facture' => 'invoice', - 'fichinter' => 'intervention', + 'ficheinter' => 'intervention', 'product_fournisseur_price' => 'productsupplierprice', 'product_price' => 'productprice', 'projet' => 'project', @@ -240,6 +240,7 @@ function isModEnabled($module) // Fix old names (map to new names) $arrayconv = DEPRECATED_MODULE_MAPPING; + $arrayconvbis = array_flip(DEPRECATED_MODULE_MAPPING); if (!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) { // Special cases: both use the same module. @@ -251,8 +252,12 @@ function isModEnabled($module) if (!empty($arrayconv[$module])) { $module_alt = $arrayconv[$module]; } + $module_bis = $module; + if (!empty($arrayconvbis[$module])) { + $module_bis = $arrayconvbis[$module]; + } - return !empty($conf->modules[$module]) || !empty($conf->modules[$module_alt]); + return !empty($conf->modules[$module]) || !empty($conf->modules[$module_alt]) || !empty($conf->modules[$module_bis]); //return !empty($conf->$module->enabled); } From 1b4a1510ecceee7fcf170f2c301c382b04b14776 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 28 Feb 2024 22:47:28 +0100 Subject: [PATCH 0291/1862] Modify module mapping principle (#28511) --- htdocs/core/lib/functions.lib.php | 53 ++++++++++++------- htdocs/core/modules/import/modules_import.php | 2 +- test/phpunit/CodingPhpTest.php | 7 +-- test/phpunit/CommonClassTest.class.php | 13 ++++- 4 files changed, 50 insertions(+), 25 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6f47523cc3c..c2851a3ffcb 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -206,25 +206,40 @@ function getDolUserInt($key, $default = 0, $tmpuser = null) return (int) (empty($tmpuser->conf->$key) ? $default : $tmpuser->conf->$key); } + +/** + * This mapping defines the conversion to the current internal + * names from the alternative allowed names (including effectively deprecated + * and future new names (not yet used as internal names). + * + * This allows to map any temporary or future name to the effective internal name. + * + * The value is typically the name of module's root directory. + */ define( - 'DEPRECATED_MODULE_MAPPING', + 'MODULE_MAPPING', array( - 'actioncomm' => 'agenda', - 'adherent' => 'member', - 'adherent_type' => 'member_type', - 'banque' => 'bank', - 'categorie' => 'category', - 'commande' => 'order', - 'contrat' => 'contract', - 'entrepot' => 'stock', - 'expedition' => 'delivery_note', - 'facture' => 'invoice', - 'ficheinter' => 'intervention', - 'product_fournisseur_price' => 'productsupplierprice', - 'product_price' => 'productprice', - 'projet' => 'project', - 'propale' => 'propal', - 'socpeople' => 'contact', + // Map deprecated names to internal names + 'adherent' => 'member', // Has new directory + 'member_type' => 'adherent_type', // No directory, but file called adherent_type + 'banque' => 'bank', // Has new directory + 'contrat' => 'contract', // Has new directory + 'entrepot' => 'stock', // Has new directory + 'projet' => 'project', // Has new directory + + 'actioncomm' => 'agenda', // NO module directory (public dir agenda) + 'product_price' => 'productprice', // NO directory + 'product_fournisseur_price' => 'productsupplierprice', // NO directory + + // Map future names to current internal names + 'category' => 'categorie', // Has old directory + 'order' => 'commande', // Has old directory + 'shipping' => 'expedition', // Has old directory + 'invoice' => 'facture', // Has old directory + 'intervention' => 'fichinter', // Has old directory + 'ficheinter' => 'fichinter', // Backup for 'fichinter' + 'propal' => 'propale', // Has old directory + 'contact' => 'socpeople', // Has old directory ) ); @@ -239,8 +254,8 @@ function isModEnabled($module) global $conf; // Fix old names (map to new names) - $arrayconv = DEPRECATED_MODULE_MAPPING; - $arrayconvbis = array_flip(DEPRECATED_MODULE_MAPPING); + $arrayconv = MODULE_MAPPING; + $arrayconvbis = array_flip(MODULE_MAPPING); if (!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) { // Special cases: both use the same module. diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php index ce6956b0d0e..537284e238f 100644 --- a/htdocs/core/modules/import/modules_import.php +++ b/htdocs/core/modules/import/modules_import.php @@ -119,7 +119,7 @@ class ModeleImports /** * @var array Element mapping from table name */ - public static $mapTableToElement = DEPRECATED_MODULE_MAPPING; + public static $mapTableToElement = MODULE_MAPPING; /** * Constructor diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 5dd8a43257a..0fd96ee1374 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -695,15 +695,16 @@ class CodingPhpTest extends CommonClassTest */ private function assertModuleIsOk($module_name, $message = '') { - if (isset(self::DEPRECATED_MODULE_MAPPING[$module_name])) { - $new_name = self::DEPRECATED_MODULE_MAPPING[$module_name]; + if (isset(self::EFFECTIVE_DEPRECATED_MODULE_MAPPING[$module_name])) { + $new_name = self::EFFECTIVE_DEPRECATED_MODULE_MAPPING[$module_name]; print("\033[31mDeprecated module name, use '$new_name':\033[0m$message".PHP_EOL); //trigger_error("Deprecated module name, use '$new_name': $message", E_USER_NOTICE); //trigger_error("Deprecated module name, use '$new_name': $message", E_USER_DEPRECATED); } else { $this->assertTrue( - array_key_exists($module_name, self::VALID_MODULE_MAPPING), + array_key_exists($module_name, self::VALID_MODULE_MAPPING) + || array_key_exists($module_name, self::DEPRECATED_MODULE_MAPPIG), "Unknown module: $message" ); } diff --git a/test/phpunit/CommonClassTest.class.php b/test/phpunit/CommonClassTest.class.php index 52960396f51..e5c63965f55 100644 --- a/test/phpunit/CommonClassTest.class.php +++ b/test/phpunit/CommonClassTest.class.php @@ -39,7 +39,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS = 1; use PHPUnit\Framework\TestCase; - /** * Class for PHPUnit tests * @@ -204,7 +203,7 @@ abstract class CommonClassTest extends TestCase 'entrepot' => 'stock', 'expedition' => 'delivery_note', 'facture' => 'invoice', - 'ficheinter' => 'intervention', + 'fichinter' => 'intervention', 'product_fournisseur_price' => 'productsupplierprice', 'product_price' => 'productprice', 'projet' => 'project', @@ -212,6 +211,16 @@ abstract class CommonClassTest extends TestCase 'socpeople' => 'contact', ); + const EFFECTIVE_DEPRECATED_MODULE_MAPPING = array( + 'adherent' => 'member', + 'adherent_type' => 'member_type', + 'banque' => 'bank', + 'contrat' => 'contract', + 'entrepot' => 'stock', + 'ficheinter' => 'fichinter', + 'projet' => 'project', + ); + /** * Map module names to the 'class' name (the class is: mod) * Value is null when the module is not internal to the default From 20c1992aec28bf93148e032cdb653cde2abe007c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 28 Feb 2024 22:56:00 +0100 Subject: [PATCH 0292/1862] fix translate with memcached and multilangs (#28510) * fix translate with memcached and multilangs * fix --- htdocs/core/class/translate.class.php | 39 +++++++++++++-------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 336241261ad..5cd303acaa0 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -31,7 +31,7 @@ class Translate { /** - * @var string Directory containing the /langs subdirectory + * @var string[] Directory containing the /langs subdirectory */ public $dir; @@ -248,10 +248,12 @@ class Translate * @param string $forcelangdir To force a different lang directory * @param int $loadfromfileonly 1=Do not load overwritten translation from file or old conf. * @param int $forceloadifalreadynotfound Force attempt to reload lang file if it was previously not found + * @param array $tabtranslatedomain Store translations to be stored in cache + * @param string $langkey To create key for cachekey in recursivity * @return int Return integer <0 if KO, 0 if already loaded or loading not required, >0 if OK * @see loadLangs() */ - public function load($domain, $alt = 0, $stopafterdirection = 0, $forcelangdir = '', $loadfromfileonly = 0, $forceloadifalreadynotfound = 0) + public function load($domain, $alt = 0, $stopafterdirection = 0, $forcelangdir = '', $loadfromfileonly = 0, $forceloadifalreadynotfound = 0, &$tabtranslatedomain = [], $langkey = '') { global $conf, $db; @@ -294,6 +296,7 @@ class Translate $fileread = 0; $langofdir = (empty($forcelangdir) ? $this->defaultlang : $forcelangdir); + $langkey = (empty($langkey) ? $langofdir : $langkey); // Redefine alt $langarray = explode('_', $langofdir); @@ -309,6 +312,7 @@ class Translate return -1; } + $usecachekey = ''; foreach ($this->dir as $searchdir) { // Directory of translation files $file_lang = $searchdir . ($modulename ? '/' . $modulename : '') . "/langs/" . $langofdir . "/" . $newdomain . ".lang"; @@ -328,7 +332,7 @@ class Translate $usecachekey = ''; // Using a memcached server if (isModEnabled('memcached') && getDolGlobalString('MEMCACHED_SERVER')) { - $usecachekey = $newdomain . '_' . $langofdir . '_' . md5($file_lang); // Should not contains special chars + $usecachekey = $newdomain . '_' . $langkey . '_' . md5($file_lang); // Should not contains special chars } elseif (getDolGlobalInt('MAIN_OPTIMIZE_SPEED') & 0x02) { // Using cache with shmop. Speed gain: 40ms - Memory overusage: 200ko (Size of session cache file) $usecachekey = $newdomain; @@ -336,14 +340,10 @@ class Translate if ($usecachekey) { //dol_syslog('Translate::Load we will cache result into usecachekey '.$usecachekey); - //global $aaa; $aaa+=1; - //print $aaa." ".$usecachekey."\n"; require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; $tmparray = dol_getcache($usecachekey); if (is_array($tmparray) && count($tmparray)) { $this->tab_translate += $tmparray; // Faster than array_merge($tmparray,$this->tab_translate). Note: If a value already exists into tab_translate, value into tmparaay is not added. - //print $newdomain."\n"; - //var_dump($this->tab_translate); if ($alt == 2) { $fileread = 1; } @@ -354,7 +354,7 @@ class Translate if (!$found) { if ($fp = @fopen($file_lang, "rt")) { if ($usecachekey) { - $tabtranslatedomain = array(); // To save lang content in cache + // $tabtranslatedomain = array(); // To save lang content in cache } /** @@ -392,16 +392,6 @@ class Translate fclose($fp); $fileread = 1; - // TODO Move cache write out of loop on dirs - // To save lang content for usecachekey into cache - if ($usecachekey && count($tabtranslatedomain)) { - $ressetcache = dol_setcache($usecachekey, $tabtranslatedomain); - if ($ressetcache < 0) { - $error = 'Failed to set cache for usecachekey=' . $usecachekey . ' result=' . $ressetcache; - dol_syslog($error, LOG_ERR); - } - } - if (!getDolGlobalString('MAIN_FORCELANGDIR')) { break; // Break loop on each root dir. If a module has forced dir, we do not stop loop. } @@ -421,7 +411,7 @@ class Translate if ($langofdir == 'ar_AR') { $langofdir = 'ar_SA'; // main parent for ar_EG is not 'ar_AR' but 'ar_SA' } - $this->load($domain, $alt + 1, $stopafterdirection, $langofdir); + $this->load($domain, $alt + 1, $stopafterdirection, $langofdir, 0, 0, $tabtranslatedomain, $langkey); } // Now we complete with reference file (en_US) @@ -429,7 +419,7 @@ class Translate // This function MUST NOT contains call to syslog //dol_syslog("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$newdomain.".lang file)", LOG_DEBUG); $langofdir = 'en_US'; - $this->load($domain, $alt + 1, $stopafterdirection, $langofdir); + $this->load($domain, $alt + 1, $stopafterdirection, $langofdir, 0, 0, $tabtranslatedomain, $langkey); } // We are in the pass of the reference file. No more files to scan to complete. @@ -459,6 +449,15 @@ class Translate } } + // To save lang content for usecachekey into cache + if ($usecachekey && count($tabtranslatedomain)) { + $ressetcache = dol_setcache($usecachekey, $tabtranslatedomain); + if ($ressetcache < 0) { + $error = 'Failed to set cache for usecachekey=' . $usecachekey . ' result=' . $ressetcache; + dol_syslog($error, LOG_ERR); + } + } + // Check to be sure that SeparatorDecimal differs from SeparatorThousand if ( !empty($this->tab_translate["SeparatorDecimal"]) && !empty($this->tab_translate["SeparatorThousand"]) From 12757dda6f0b3e135ce45e2141124a669721cb43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 28 Feb 2024 22:57:30 +0100 Subject: [PATCH 0293/1862] Update .gitignore (#28513) --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index ea477725a2c..efe6c66dfc0 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,10 @@ doc/install.lock /composer.json /composer.lock +# to execute pre-commit +local.sh + +# ignore cache builds /build/phpstan/phpstan /build/phpstan/bootstrap_custom.php phpstan_custom.neon From c332251816aaa7896f80bded79da4de579727d92 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 28 Feb 2024 23:01:01 +0100 Subject: [PATCH 0294/1862] Fix: Replace deprecated module names in code strings (#28462) * Fix: Replace deprecated module names in code strings # Fix: Replace deprecated module names in code strings A few cases that slipped through the manual replacements * Qual: Enable deprecation notices in CodingPhpTest for isModEnabled # Qual: Enable deprecation notices in CodingPhpTest for isModEnabled As all detections are now fixed, we can enable the deprecation notice trigger in the CodingPhpTest. --- htdocs/comm/propal/class/propal.class.php | 112 +++++++++--------- htdocs/commande/class/commande.class.php | 104 ++++++++-------- .../facture/class/facture-rec.class.php | 80 ++++++------- test/phpunit/CodingPhpTest.php | 2 +- 4 files changed, 149 insertions(+), 149 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 937b3424acb..f7c25ae4545 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -322,55 +322,55 @@ class Propal extends CommonObject * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1), - 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>20), - 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>22), - 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>40), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'isModEnabled("societe")', 'visible'=>-1, 'position'=>23), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label'=>'Fk projet', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>24), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'datep' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>60), - 'fin_validite' =>array('type'=>'datetime', 'label'=>'DateEnd', 'enabled'=>1, 'visible'=>-1, 'position'=>65), - 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>70), - 'date_cloture' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>75), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>85), - 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user cloture', 'enabled'=>1, 'visible'=>-1, 'position'=>95), - 'price' =>array('type'=>'double', 'label'=>'Price', 'enabled'=>1, 'visible'=>-1, 'position'=>105), - 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'TotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>125, 'isameasure'=>1), - 'total_tva' =>array('type'=>'double(24,8)', 'label'=>'VAT', 'enabled'=>1, 'visible'=>-1, 'position'=>130, 'isameasure'=>1), - 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'LocalTax1', 'enabled'=>1, 'visible'=>-1, 'position'=>135, 'isameasure'=>1), - 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LocalTax2', 'enabled'=>1, 'visible'=>-1, 'position'=>140, 'isameasure'=>1), - 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'TotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>145, 'isameasure'=>1), - 'fk_account' =>array('type'=>'integer', 'label'=>'BankAccount', 'enabled'=>'isModEnabled("banque")', 'visible'=>-1, 'position'=>150), - 'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'Currency', 'enabled'=>1, 'visible'=>-1, 'position'=>155), - 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>160), - 'deposit_percent' =>array('type'=>'varchar(63)', 'label'=>'DepositPercent', 'enabled'=>1, 'visible'=>-1, 'position'=>161), - 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>165), - 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>170), - 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>175), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'PDFTemplate', 'enabled'=>1, 'visible'=>0, 'position'=>180), - 'date_livraison' =>array('type'=>'date', 'label'=>'DateDeliveryPlanned', 'enabled'=>1, 'visible'=>-1, 'position'=>185), - 'fk_shipping_method' =>array('type'=>'integer', 'label'=>'ShippingMethod', 'enabled'=>1, 'visible'=>-1, 'position'=>190), - 'fk_warehouse' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Fk warehouse', 'enabled'=>'isModEnabled("stock")', 'visible'=>-1, 'position'=>191), - 'fk_availability' =>array('type'=>'integer', 'label'=>'Availability', 'enabled'=>1, 'visible'=>-1, 'position'=>195), - 'fk_delivery_address' =>array('type'=>'integer', 'label'=>'DeliveryAddress', 'enabled'=>1, 'visible'=>0, 'position'=>200), // deprecated - 'fk_input_reason' =>array('type'=>'integer', 'label'=>'InputReason', 'enabled'=>1, 'visible'=>-1, 'position'=>205), - 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>215), - 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>220), - 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>225), - 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'MulticurrencyID', 'enabled'=>1, 'visible'=>-1, 'position'=>230), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCurrency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>235), - 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>240, 'isameasure'=>1), - 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>245, 'isameasure'=>1), - 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>250, 'isameasure'=>1), - 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>255, 'isameasure'=>1), - 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>260), - 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1), + 'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'showoncombobox' => 1, 'position' => 20), + 'ref_client' => array('type' => 'varchar(255)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => -1, 'position' => 22), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 40), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'position' => 23), + 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Fk projet', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 24), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 25), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 55), + 'datep' => array('type' => 'date', 'label' => 'Date', 'enabled' => 1, 'visible' => -1, 'position' => 60), + 'fin_validite' => array('type' => 'datetime', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => -1, 'position' => 65), + 'date_valid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 70), + 'date_cloture' => array('type' => 'datetime', 'label' => 'DateClosing', 'enabled' => 1, 'visible' => -1, 'position' => 75), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'position' => 80), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 85), + 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'fk_user_cloture' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user cloture', 'enabled' => 1, 'visible' => -1, 'position' => 95), + 'price' => array('type' => 'double', 'label' => 'Price', 'enabled' => 1, 'visible' => -1, 'position' => 105), + 'total_ht' => array('type' => 'double(24,8)', 'label' => 'TotalHT', 'enabled' => 1, 'visible' => -1, 'position' => 125, 'isameasure' => 1), + 'total_tva' => array('type' => 'double(24,8)', 'label' => 'VAT', 'enabled' => 1, 'visible' => -1, 'position' => 130, 'isameasure' => 1), + 'localtax1' => array('type' => 'double(24,8)', 'label' => 'LocalTax1', 'enabled' => 1, 'visible' => -1, 'position' => 135, 'isameasure' => 1), + 'localtax2' => array('type' => 'double(24,8)', 'label' => 'LocalTax2', 'enabled' => 1, 'visible' => -1, 'position' => 140, 'isameasure' => 1), + 'total_ttc' => array('type' => 'double(24,8)', 'label' => 'TotalTTC', 'enabled' => 1, 'visible' => -1, 'position' => 145, 'isameasure' => 1), + 'fk_account' => array('type' => 'integer', 'label' => 'BankAccount', 'enabled' => 'isModEnabled("bank")', 'visible' => -1, 'position' => 150), + 'fk_currency' => array('type' => 'varchar(3)', 'label' => 'Currency', 'enabled' => 1, 'visible' => -1, 'position' => 155), + 'fk_cond_reglement' => array('type' => 'integer', 'label' => 'PaymentTerm', 'enabled' => 1, 'visible' => -1, 'position' => 160), + 'deposit_percent' => array('type' => 'varchar(63)', 'label' => 'DepositPercent', 'enabled' => 1, 'visible' => -1, 'position' => 161), + 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'PaymentMode', 'enabled' => 1, 'visible' => -1, 'position' => 165), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 170), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 175), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'PDFTemplate', 'enabled' => 1, 'visible' => 0, 'position' => 180), + 'date_livraison' => array('type' => 'date', 'label' => 'DateDeliveryPlanned', 'enabled' => 1, 'visible' => -1, 'position' => 185), + 'fk_shipping_method' => array('type' => 'integer', 'label' => 'ShippingMethod', 'enabled' => 1, 'visible' => -1, 'position' => 190), + 'fk_warehouse' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php', 'label' => 'Fk warehouse', 'enabled' => 'isModEnabled("stock")', 'visible' => -1, 'position' => 191), + 'fk_availability' => array('type' => 'integer', 'label' => 'Availability', 'enabled' => 1, 'visible' => -1, 'position' => 195), + 'fk_delivery_address' => array('type' => 'integer', 'label' => 'DeliveryAddress', 'enabled' => 1, 'visible' => 0, 'position' => 200), // deprecated + 'fk_input_reason' => array('type' => 'integer', 'label' => 'InputReason', 'enabled' => 1, 'visible' => -1, 'position' => 205), + 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 215), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 220), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 225), + 'fk_multicurrency' => array('type' => 'integer', 'label' => 'MulticurrencyID', 'enabled' => 1, 'visible' => -1, 'position' => 230), + 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'MulticurrencyCurrency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 235), + 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyRate', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 240, 'isameasure' => 1), + 'multicurrency_total_ht' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountHT', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 245, 'isameasure' => 1), + 'multicurrency_total_tva' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountVAT', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 250, 'isameasure' => 1), + 'multicurrency_total_ttc' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountTTC', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 255, 'isameasure' => 1), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => -1, 'position' => 260), + 'fk_statut' => array('type' => 'smallint(6)', 'label' => 'Status', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 500), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 900), ); // END MODULEBUILDER PROPERTIES @@ -1536,7 +1536,7 @@ class Propal extends CommonObject if (!$error) { // Hook of thirdparty module if (is_object($hookmanager)) { - $parameters = array('objFrom'=>$this, 'clonedObj'=>$object); + $parameters = array('objFrom' => $this, 'clonedObj' => $object); $action = ''; $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -2714,12 +2714,12 @@ class Propal extends CommonObject $modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_TOBILL') ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL : $this->model_pdf; // The connected company is classified as a client - $soc=new Societe($this->db); + $soc = new Societe($this->db); $soc->id = $this->socid; $result = $soc->setAsCustomer(); if ($result < 0) { - $this->error=$this->db->lasterror(); + $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; } @@ -2744,7 +2744,7 @@ class Propal extends CommonObject } if (!$error) { - $this->oldcopy= clone $this; + $this->oldcopy = clone $this; $this->statut = $status; $this->status = $status; $this->date_signature = $date_signature; @@ -2753,7 +2753,7 @@ class Propal extends CommonObject if (!$notrigger && empty($error)) { // Call trigger - $result=$this->call_trigger($trigger_name, $user); + $result = $this->call_trigger($trigger_name, $user); if ($result < 0) { $error++; } @@ -3974,7 +3974,7 @@ class Propal extends CommonObject global $action; $hookmanager->initHooks(array($this->element . 'dao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; @@ -4092,7 +4092,7 @@ class Propal extends CommonObject $return .= '
'.$arraydata['authorlink'].''; } if (property_exists($this, 'total_ht')) { - $return .='
'.price($this->total_ht).''; + $return .= '
'.price($this->total_ht).''; } if (method_exists($this, 'getLibStatut')) { $return .= '
'.$this->getLibStatut(3).'
'; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index cb2f301c2d9..e7f81eb8af5 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -313,56 +313,56 @@ class Commande extends CommonOrder * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1), - 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>25), - 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>26), - 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'isModEnabled("societe")', 'visible'=>-1, 'notnull'=>1, 'position'=>20), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>25), - 'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>1, 'position'=>60, 'csslist'=>'nowraponall'), - 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>62, 'csslist'=>'nowraponall'), - 'date_cloture' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>65, 'csslist'=>'nowraponall'), - 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>85), - 'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'source' =>array('type'=>'smallint(6)', 'label'=>'Source', 'enabled'=>1, 'visible'=>-1, 'position'=>95), - 'total_tva' =>array('type'=>'double(24,8)', 'label'=>'VAT', 'enabled'=>1, 'visible'=>-1, 'position'=>125, 'isameasure'=>1), - 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'LocalTax1', 'enabled'=>1, 'visible'=>-1, 'position'=>130, 'isameasure'=>1), - 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LocalTax2', 'enabled'=>1, 'visible'=>-1, 'position'=>135, 'isameasure'=>1), - 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'TotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>140, 'isameasure'=>1), - 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'TotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>145, 'isameasure'=>1), - 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>150), - 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>155), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'PDFTemplate', 'enabled'=>1, 'visible'=>0, 'position'=>160), - 'fk_account' =>array('type'=>'integer', 'label'=>'BankAccount', 'enabled'=>'isModEnabled("banque")', 'visible'=>-1, 'position'=>170), - 'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'MulticurrencyID', 'enabled'=>1, 'visible'=>-1, 'position'=>175), - 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>180), - 'deposit_percent' =>array('type'=>'varchar(63)', 'label'=>'DepositPercent', 'enabled'=>1, 'visible'=>-1, 'position'=>181), - 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>185), - 'date_livraison' =>array('type'=>'date', 'label'=>'DateDeliveryPlanned', 'enabled'=>1, 'visible'=>-1, 'position'=>190, 'csslist'=>'nowraponall'), - 'fk_shipping_method' =>array('type'=>'integer', 'label'=>'ShippingMethod', 'enabled'=>1, 'visible'=>-1, 'position'=>195), - 'fk_warehouse' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Fk warehouse', 'enabled'=>'isModEnabled("stock")', 'visible'=>-1, 'position'=>200), - 'fk_availability' =>array('type'=>'integer', 'label'=>'Availability', 'enabled'=>1, 'visible'=>-1, 'position'=>205), - 'fk_input_reason' =>array('type'=>'integer', 'label'=>'InputReason', 'enabled'=>1, 'visible'=>-1, 'position'=>210), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 20, 'index' => 1), + 'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'showoncombobox' => 1, 'position' => 25), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 26), + 'ref_client' => array('type' => 'varchar(255)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => -1, 'position' => 28), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'notnull' => 1, 'position' => 20), + 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Project', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 25), + 'date_commande' => array('type' => 'date', 'label' => 'Date', 'enabled' => 1, 'visible' => 1, 'position' => 60, 'csslist' => 'nowraponall'), + 'date_valid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 62, 'csslist' => 'nowraponall'), + 'date_cloture' => array('type' => 'datetime', 'label' => 'DateClosing', 'enabled' => 1, 'visible' => -1, 'position' => 65, 'csslist' => 'nowraponall'), + 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 85), + 'fk_user_cloture' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserClosing', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'source' => array('type' => 'smallint(6)', 'label' => 'Source', 'enabled' => 1, 'visible' => -1, 'position' => 95), + 'total_tva' => array('type' => 'double(24,8)', 'label' => 'VAT', 'enabled' => 1, 'visible' => -1, 'position' => 125, 'isameasure' => 1), + 'localtax1' => array('type' => 'double(24,8)', 'label' => 'LocalTax1', 'enabled' => 1, 'visible' => -1, 'position' => 130, 'isameasure' => 1), + 'localtax2' => array('type' => 'double(24,8)', 'label' => 'LocalTax2', 'enabled' => 1, 'visible' => -1, 'position' => 135, 'isameasure' => 1), + 'total_ht' => array('type' => 'double(24,8)', 'label' => 'TotalHT', 'enabled' => 1, 'visible' => -1, 'position' => 140, 'isameasure' => 1), + 'total_ttc' => array('type' => 'double(24,8)', 'label' => 'TotalTTC', 'enabled' => 1, 'visible' => -1, 'position' => 145, 'isameasure' => 1), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 150), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'PDFTemplate', 'enabled' => 1, 'visible' => 0, 'position' => 160), + 'fk_account' => array('type' => 'integer', 'label' => 'BankAccount', 'enabled' => 'isModEnabled("bank")', 'visible' => -1, 'position' => 170), + 'fk_currency' => array('type' => 'varchar(3)', 'label' => 'MulticurrencyID', 'enabled' => 1, 'visible' => -1, 'position' => 175), + 'fk_cond_reglement' => array('type' => 'integer', 'label' => 'PaymentTerm', 'enabled' => 1, 'visible' => -1, 'position' => 180), + 'deposit_percent' => array('type' => 'varchar(63)', 'label' => 'DepositPercent', 'enabled' => 1, 'visible' => -1, 'position' => 181), + 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'PaymentMode', 'enabled' => 1, 'visible' => -1, 'position' => 185), + 'date_livraison' => array('type' => 'date', 'label' => 'DateDeliveryPlanned', 'enabled' => 1, 'visible' => -1, 'position' => 190, 'csslist' => 'nowraponall'), + 'fk_shipping_method' => array('type' => 'integer', 'label' => 'ShippingMethod', 'enabled' => 1, 'visible' => -1, 'position' => 195), + 'fk_warehouse' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php', 'label' => 'Fk warehouse', 'enabled' => 'isModEnabled("stock")', 'visible' => -1, 'position' => 200), + 'fk_availability' => array('type' => 'integer', 'label' => 'Availability', 'enabled' => 1, 'visible' => -1, 'position' => 205), + 'fk_input_reason' => array('type' => 'integer', 'label' => 'InputReason', 'enabled' => 1, 'visible' => -1, 'position' => 210), //'fk_delivery_address' =>array('type'=>'integer', 'label'=>'DeliveryAddress', 'enabled'=>1, 'visible'=>-1, 'position'=>215), - 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>225), - 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>230), - 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>235), - 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>240), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCurrency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>245), - 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>250, 'isameasure'=>1), - 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>255, 'isameasure'=>1), - 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>260, 'isameasure'=>1), - 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>265, 'isameasure'=>1), - 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270), - 'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>275), - 'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>280), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>300), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>302), - 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>304, 'csslist'=>'nowraponall'), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>306), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>400), - 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500), + 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 225), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 230), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 235), + 'fk_multicurrency' => array('type' => 'integer', 'label' => 'Fk multicurrency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 240), + 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'MulticurrencyCurrency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 245), + 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyRate', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 250, 'isameasure' => 1), + 'multicurrency_total_ht' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountHT', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 255, 'isameasure' => 1), + 'multicurrency_total_tva' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountVAT', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 260, 'isameasure' => 1), + 'multicurrency_total_ttc' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountTTC', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 265, 'isameasure' => 1), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => -1, 'position' => 270), + 'module_source' => array('type' => 'varchar(32)', 'label' => 'POSModule', 'enabled' => 1, 'visible' => -1, 'position' => 275), + 'pos_source' => array('type' => 'varchar(32)', 'label' => 'POSTerminal', 'enabled' => 1, 'visible' => -1, 'position' => 280), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -1, 'position' => 300), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 302), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'position' => 304, 'csslist' => 'nowraponall'), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 306), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 400), + 'fk_statut' => array('type' => 'smallint(6)', 'label' => 'Status', 'enabled' => 1, 'visible' => -1, 'position' => 500), ); // END MODULEBUILDER PROPERTIES @@ -1282,7 +1282,7 @@ class Commande extends CommonOrder if (!$error) { // Hook of thirdparty module if (is_object($hookmanager)) { - $parameters = array('objFrom'=>$objFrom); + $parameters = array('objFrom' => $objFrom); $action = ''; $reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -1441,7 +1441,7 @@ class Commande extends CommonOrder // Actions hooked (by external module) $hookmanager->initHooks(array('orderdao')); - $parameters = array('objFrom'=>$object); + $parameters = array('objFrom' => $object); $action = ''; $reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -3914,7 +3914,7 @@ class Commande extends CommonOrder global $action; $hookmanager->initHooks(array($this->element . 'dao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 2e10c0077b6..14e090339bb 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -174,45 +174,45 @@ class FactureRec extends CommonInvoice * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'titre' =>array('type'=>'varchar(100)', 'label'=>'Titre', 'enabled'=>1, 'showoncombobox' => 1, 'visible'=>-1, 'position'=>15), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'isModEnabled("societe")', 'visible'=>-1, 'notnull'=>1, 'position'=>25), - 'subtype' =>array('type'=>'smallint(6)', 'label'=>'InvoiceSubtype', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>30), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>35), - 'total_tva' =>array('type'=>'double(24,8)', 'label'=>'Tva', 'enabled'=>1, 'visible'=>-1, 'position'=>55, 'isameasure'=>1), - 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'Localtax1', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'isameasure'=>1), - 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'Localtax2', 'enabled'=>1, 'visible'=>-1, 'position'=>65, 'isameasure'=>1), - 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'Total', 'enabled'=>1, 'visible'=>-1, 'position'=>70, 'isameasure'=>1), - 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>75, 'isameasure'=>1), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label'=>'Fk projet', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>85), - 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Fk cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'Fk mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>95), - 'date_lim_reglement' =>array('type'=>'date', 'label'=>'Date lim reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>100), - 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>105), - 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>110), - 'modelpdf' =>array('type'=>'varchar(255)', 'label'=>'Modelpdf', 'enabled'=>1, 'visible'=>-1, 'position'=>115), - 'date_when' =>array('type'=>'datetime', 'label'=>'Date when', 'enabled'=>1, 'visible'=>-1, 'position'=>130), - 'date_last_gen' =>array('type'=>'datetime', 'label'=>'Date last gen', 'enabled'=>1, 'visible'=>-1, 'position'=>135), - 'nb_gen_done' =>array('type'=>'integer', 'label'=>'Nb gen done', 'enabled'=>1, 'visible'=>-1, 'position'=>140), - 'nb_gen_max' =>array('type'=>'integer', 'label'=>'Nb gen max', 'enabled'=>1, 'visible'=>-1, 'position'=>145), - 'frequency' =>array('type'=>'integer', 'label'=>'Frequency', 'enabled'=>1, 'visible'=>-1, 'position'=>150), - 'unit_frequency' =>array('type'=>'varchar(2)', 'label'=>'UnitFrequency', 'enabled'=>1, 'visible'=>-1, 'position'=>152), - 'usenewprice' =>array('type'=>'integer', 'label'=>'UseNewPrice', 'enabled'=>1, 'visible'=>0, 'position'=>155), - 'revenuestamp' =>array('type'=>'double(24,8)', 'label'=>'RevenueStamp', 'enabled'=>1, 'visible'=>-1, 'position'=>160, 'isameasure'=>1), - 'auto_validate' =>array('type'=>'integer', 'label'=>'Auto validate', 'enabled'=>1, 'visible'=>-1, 'position'=>165), - 'generate_pdf' =>array('type'=>'integer', 'label'=>'Generate pdf', 'enabled'=>1, 'visible'=>-1, 'position'=>170), - 'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>'isModEnabled("banque")', 'visible'=>-1, 'position'=>175), - 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>-1, 'position'=>180), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Multicurrency code', 'enabled'=>1, 'visible'=>-1, 'position'=>185), - 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency tx', 'enabled'=>1, 'visible'=>-1, 'position'=>190, 'isameasure'=>1), - 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ht', 'enabled'=>1, 'visible'=>-1, 'position'=>195, 'isameasure'=>1), - 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total tva', 'enabled'=>1, 'visible'=>-1, 'position'=>200, 'isameasure'=>1), - 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>205, 'isameasure'=>1), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>210), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>215), - 'suspended' =>array('type'=>'integer', 'label'=>'Suspended', 'enabled'=>1, 'visible'=>-1, 'position'=>225), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'titre' => array('type' => 'varchar(100)', 'label' => 'Titre', 'enabled' => 1, 'showoncombobox' => 1, 'visible' => -1, 'position' => 15), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 20, 'index' => 1), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'notnull' => 1, 'position' => 25), + 'subtype' => array('type' => 'smallint(6)', 'label' => 'InvoiceSubtype', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 30), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 35), + 'total_tva' => array('type' => 'double(24,8)', 'label' => 'Tva', 'enabled' => 1, 'visible' => -1, 'position' => 55, 'isameasure' => 1), + 'localtax1' => array('type' => 'double(24,8)', 'label' => 'Localtax1', 'enabled' => 1, 'visible' => -1, 'position' => 60, 'isameasure' => 1), + 'localtax2' => array('type' => 'double(24,8)', 'label' => 'Localtax2', 'enabled' => 1, 'visible' => -1, 'position' => 65, 'isameasure' => 1), + 'total_ht' => array('type' => 'double(24,8)', 'label' => 'Total', 'enabled' => 1, 'visible' => -1, 'position' => 70, 'isameasure' => 1), + 'total_ttc' => array('type' => 'double(24,8)', 'label' => 'Total ttc', 'enabled' => 1, 'visible' => -1, 'position' => 75, 'isameasure' => 1), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'position' => 80), + 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Fk projet', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 85), + 'fk_cond_reglement' => array('type' => 'integer', 'label' => 'Fk cond reglement', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'Fk mode reglement', 'enabled' => 1, 'visible' => -1, 'position' => 95), + 'date_lim_reglement' => array('type' => 'date', 'label' => 'Date lim reglement', 'enabled' => 1, 'visible' => -1, 'position' => 100), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 105), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 110), + 'modelpdf' => array('type' => 'varchar(255)', 'label' => 'Modelpdf', 'enabled' => 1, 'visible' => -1, 'position' => 115), + 'date_when' => array('type' => 'datetime', 'label' => 'Date when', 'enabled' => 1, 'visible' => -1, 'position' => 130), + 'date_last_gen' => array('type' => 'datetime', 'label' => 'Date last gen', 'enabled' => 1, 'visible' => -1, 'position' => 135), + 'nb_gen_done' => array('type' => 'integer', 'label' => 'Nb gen done', 'enabled' => 1, 'visible' => -1, 'position' => 140), + 'nb_gen_max' => array('type' => 'integer', 'label' => 'Nb gen max', 'enabled' => 1, 'visible' => -1, 'position' => 145), + 'frequency' => array('type' => 'integer', 'label' => 'Frequency', 'enabled' => 1, 'visible' => -1, 'position' => 150), + 'unit_frequency' => array('type' => 'varchar(2)', 'label' => 'UnitFrequency', 'enabled' => 1, 'visible' => -1, 'position' => 152), + 'usenewprice' => array('type' => 'integer', 'label' => 'UseNewPrice', 'enabled' => 1, 'visible' => 0, 'position' => 155), + 'revenuestamp' => array('type' => 'double(24,8)', 'label' => 'RevenueStamp', 'enabled' => 1, 'visible' => -1, 'position' => 160, 'isameasure' => 1), + 'auto_validate' => array('type' => 'integer', 'label' => 'Auto validate', 'enabled' => 1, 'visible' => -1, 'position' => 165), + 'generate_pdf' => array('type' => 'integer', 'label' => 'Generate pdf', 'enabled' => 1, 'visible' => -1, 'position' => 170), + 'fk_account' => array('type' => 'integer', 'label' => 'Fk account', 'enabled' => 'isModEnabled("bank")', 'visible' => -1, 'position' => 175), + 'fk_multicurrency' => array('type' => 'integer', 'label' => 'Fk multicurrency', 'enabled' => 1, 'visible' => -1, 'position' => 180), + 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'Multicurrency code', 'enabled' => 1, 'visible' => -1, 'position' => 185), + 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'Multicurrency tx', 'enabled' => 1, 'visible' => -1, 'position' => 190, 'isameasure' => 1), + 'multicurrency_total_ht' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total ht', 'enabled' => 1, 'visible' => -1, 'position' => 195, 'isameasure' => 1), + 'multicurrency_total_tva' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total tva', 'enabled' => 1, 'visible' => -1, 'position' => 200, 'isameasure' => 1), + 'multicurrency_total_ttc' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total ttc', 'enabled' => 1, 'visible' => -1, 'position' => 205, 'isameasure' => 1), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 210), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 215), + 'suspended' => array('type' => 'integer', 'label' => 'Suspended', 'enabled' => 1, 'visible' => -1, 'position' => 225), ); // END MODULEBUILDER PROPERTIES @@ -1503,7 +1503,7 @@ class FactureRec extends CommonInvoice $result .= $linkend; global $action; $hookmanager->initHooks(array($this->element . 'dao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 0fd96ee1374..8aebf3216fa 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -700,7 +700,7 @@ class CodingPhpTest extends CommonClassTest print("\033[31mDeprecated module name, use '$new_name':\033[0m$message".PHP_EOL); //trigger_error("Deprecated module name, use '$new_name': $message", E_USER_NOTICE); - //trigger_error("Deprecated module name, use '$new_name': $message", E_USER_DEPRECATED); + trigger_error("Deprecated module name, use '$new_name': $message", E_USER_DEPRECATED); } else { $this->assertTrue( array_key_exists($module_name, self::VALID_MODULE_MAPPING) From e827f0a5ab53adb7b5bf5169956ed8adbd37466e Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Wed, 28 Feb 2024 23:02:46 +0100 Subject: [PATCH 0295/1862] Use the date pre-fill function also in edit mode (#28470) * Use the date pre-fill function also in edit mode Supports date prefill function (with last found dates) in row edit mode * Update objectline_edit.tpl.php --- htdocs/core/tpl/objectline_edit.tpl.php | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 28e382c4f4b..aacf0be0b0d 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -358,11 +358,43 @@ $coldisplay++;
'; if (!$i) { $totalarray['nbfield']++; @@ -2008,10 +2010,12 @@ if ($search_date_signature_endyear) { } // Source - input reason if (!empty($arrayfields['p.fk_input_reason']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; From dd3415b1ac533fb2c327a8b92078b6b334b6a140 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 16:41:00 +0100 Subject: [PATCH 0316/1862] Fix phan error and remove false alert --- dev/tools/phan/config.php | 1 + dev/tools/phan/config_extended.php | 2 +- dev/tools/phan/config_fixer.php | 2 +- htdocs/accountancy/admin/account.php | 13 +++++++------ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 2031e32501c..e20476455ed 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -391,6 +391,7 @@ return [ 'PhanPluginUnknownFunctionParamType', 'PhanTypeSuspiciousStringExpression', 'PhanPluginRedundantAssignment', + 'PhanTypeExpectedObjectPropAccess', 'PhanTypeInvalidRightOperandOfNumericOp', 'PhanPluginInlineHTML', diff --git a/dev/tools/phan/config_extended.php b/dev/tools/phan/config_extended.php index c6dbc07a314..01e34d0a727 100644 --- a/dev/tools/phan/config_extended.php +++ b/dev/tools/phan/config_extended.php @@ -343,7 +343,7 @@ return [ 'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences 'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences 'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences - + 'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning ], // You can put relative paths to internal stubs in this config option. // Phan will continue using its detailed type annotations, diff --git a/dev/tools/phan/config_fixer.php b/dev/tools/phan/config_fixer.php index 04ae1d7207c..97b421ac07e 100644 --- a/dev/tools/phan/config_fixer.php +++ b/dev/tools/phan/config_fixer.php @@ -190,7 +190,7 @@ return [ 'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences 'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences 'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences - + 'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning ], // You can put relative paths to internal stubs in this config option. // Phan will continue using its detailed type annotations, diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 7532b8fc9f4..e64af930999 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -203,21 +203,21 @@ if (empty($reshook)) { if ($accounting->fetch($id)) { $mode = GETPOSTINT('mode'); $result = $accounting->accountDeactivate($id, $mode); + if ($result < 0) { + setEventMessages($accounting->error, $accounting->errors, 'errors'); + } } $action = 'update'; - if ($result < 0) { - setEventMessages($accounting->error, $accounting->errors, 'errors'); - } } elseif ($action == 'enable' && $permissiontoadd) { if ($accounting->fetch($id)) { $mode = GETPOSTINT('mode'); $result = $accounting->accountActivate($id, $mode); + if ($result < 0) { + setEventMessages($accounting->error, $accounting->errors, 'errors'); + } } $action = 'update'; - if ($result < 0) { - setEventMessages($accounting->error, $accounting->errors, 'errors'); - } } } @@ -387,6 +387,7 @@ if ($resql) { } // List of mass actions available + $arrayofmassactions = array(); if ($user->hasRight('accounting', 'chartofaccount')) { $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); } From ef224a7a45ea8c321c49a2ee1696a08d41817d55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 16:48:52 +0100 Subject: [PATCH 0317/1862] Clean code --- htdocs/accountancy/admin/account.php | 2 +- htdocs/accountancy/admin/subaccount.php | 2 +- htdocs/accountancy/bookkeeping/export.php | 2 +- htdocs/accountancy/bookkeeping/list.php | 2 +- htdocs/adherents/list.php | 2 +- htdocs/adherents/subscription/list.php | 2 +- htdocs/admin/emailcollector_list.php | 2 +- htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/admin/system/modules.php | 2 +- htdocs/bom/bom_list.php | 2 +- htdocs/bookcal/availabilities_list.php | 2 +- htdocs/bookcal/calendar_list.php | 2 +- htdocs/bookmarks/list.php | 2 +- htdocs/comm/mailing/list.php | 2 +- htdocs/comm/propal/list.php | 2 +- htdocs/commande/list.php | 2 +- htdocs/commande/list_det.php | 2 +- htdocs/compta/bank/list.php | 2 +- htdocs/compta/bank/various_payment/list.php | 2 +- htdocs/compta/facture/invoicetemplate_list.php | 4 ++-- htdocs/compta/facture/list.php | 2 +- htdocs/compta/paiement/cheque/list.php | 2 +- htdocs/compta/paiement/list.php | 2 +- htdocs/compta/prelevement/list.php | 2 +- htdocs/compta/prelevement/orders_list.php | 2 +- htdocs/compta/tva/list.php | 2 +- htdocs/contact/list.php | 2 +- htdocs/contrat/services_list.php | 2 +- htdocs/core/class/html.form.class.php | 14 +++++++------- htdocs/core/lib/company.lib.php | 2 +- htdocs/don/list.php | 2 +- htdocs/don/paiement/list.php | 2 +- .../eventorganization/conferenceorbooth_list.php | 2 +- .../conferenceorboothattendee_list.php | 2 +- htdocs/expedition/list.php | 2 +- htdocs/expensereport/payment/list.php | 2 +- htdocs/fichinter/list.php | 2 +- htdocs/fourn/facture/list-rec.php | 4 ++-- htdocs/fourn/facture/list.php | 2 +- htdocs/fourn/paiement/list.php | 2 +- htdocs/holiday/define_holiday.php | 2 +- htdocs/holiday/list.php | 2 +- htdocs/holiday/view_log.php | 2 +- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/position_list.php | 2 +- htdocs/hrm/skill_list.php | 2 +- htdocs/intracommreport/list.php | 2 +- .../knowledgemanagement/knowledgerecord_list.php | 2 +- htdocs/loan/list.php | 2 +- htdocs/modulebuilder/template/myobject_list.php | 2 +- htdocs/mrp/mo_list.php | 2 +- htdocs/mrp/mo_movements.php | 2 +- htdocs/partnership/partnership_list.php | 2 +- htdocs/product/inventory/list.php | 2 +- htdocs/product/list.php | 2 +- htdocs/product/stock/list.php | 2 +- htdocs/product/stock/movement_list.php | 2 +- htdocs/product/stock/productlot_list.php | 2 +- .../stock/stocktransfer/stocktransfer_list.php | 2 +- htdocs/projet/list.php | 2 +- htdocs/projet/tasks/list.php | 4 ++-- htdocs/projet/tasks/time.php | 2 +- htdocs/reception/list.php | 2 +- htdocs/recruitment/recruitmentcandidature_list.php | 2 +- htdocs/salaries/list.php | 2 +- htdocs/societe/list.php | 4 ++-- htdocs/societe/website.php | 2 +- htdocs/supplier_proposal/list.php | 2 +- htdocs/user/group/list.php | 2 +- htdocs/user/list.php | 2 +- htdocs/variants/list.php | 2 +- htdocs/website/index.php | 2 +- htdocs/workstation/workstation_list.php | 2 +- 74 files changed, 84 insertions(+), 84 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index e64af930999..20d561ed752 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -456,7 +456,7 @@ if ($resql) { print '
'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields + $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); $moreforfilter = ''; diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index b048663e405..54550180947 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -329,7 +329,7 @@ if ($resql) { print '
'.$langs->trans("WarningCreateSubAccounts").'
'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields + $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); $moreforfilter = ''; diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index b2d205f74eb..dd68ab09998 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -898,7 +898,7 @@ if (!getDolGlobalString('ACCOUNTING_REEXPORT')) { include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields if ($massactionbutton && $contextpage != 'poslist') { $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); } diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 2c62409c4ae..064ec0547f1 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -798,7 +798,7 @@ if ($massaction == 'preunletteringauto') { include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields if ($massactionbutton && $contextpage != 'poslist') { $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); } diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 403026ff209..371d197f8fb 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -816,7 +816,7 @@ if ($search_all) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); $moreforfilter = ''; diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 28ad3ef7dd7..6c3d7a228ce 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -414,7 +414,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index e431b1f19dc..8a04945c453 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -414,7 +414,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 1d718819e79..4adc4878e0e 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -536,7 +536,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 94c29927cb9..8316969135a 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -224,7 +224,7 @@ $mode = ''; $arrayofmassactions = array(); $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); $moreforfilter = ''; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index cd6aaf1eaee..a1bb6de9595 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -547,7 +547,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index a98a6beb8bb..76a217451e6 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -507,7 +507,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php index e8fc92b546d..11b2dccafaf 100644 --- a/htdocs/bookcal/calendar_list.php +++ b/htdocs/bookcal/calendar_list.php @@ -490,7 +490,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 50212e04137..86f6dbcef7b 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -296,7 +296,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 082c75b6fe3..42673dea754 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -377,7 +377,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 1bceb107128..63ae45c6308 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1193,7 +1193,7 @@ if ($search_date_signature_endyear) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields + $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index b8308827c6c..37cf3d1e97e 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1509,7 +1509,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); if (GETPOSTINT('autoselectall')) { diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 2be6cd61baf..eb8f9311f1d 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -973,7 +973,7 @@ if ($resql) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields + $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); if (GETPOSTINT('autoselectall')) { diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index d88cb100991..6b4d5d623d3 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -423,7 +423,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index d750864de6f..abf92b1237b 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -465,7 +465,7 @@ $arrayofmassactions = array(); $moreforfilter= ''; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 13052314892..0013cd92406 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -533,7 +533,7 @@ $arrayofmassactions = array( $massactionbutton = $form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"))); $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields //$selectedfields.=$form->showCheckAddButtons('checkforselect', 1); print ''."\n"; @@ -574,7 +574,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 274ea165a53..cea102af870 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1335,7 +1335,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields // Show the massaction checkboxes only when this page is not opend from the Extended POS if ($massactionbutton && $contextpage != 'poslist') { diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 3d7129afbcd..c17cb3a73e1 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -274,7 +274,7 @@ if ($resql) { print_barre_liste($langs->trans("MenuChequeDeposits"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit); $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields + $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $massactionbutton = ''; if ($massactionbutton) { $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 769a0bd9ce7..b3b7de15c38 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -396,7 +396,7 @@ if ($search_all) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $massactionbutton = ''; if ($massactionbutton) { $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index e77bd4a2343..7f7e83b9502 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -323,7 +323,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index 5efc08d75ea..48d871f0b22 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -314,7 +314,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 31d96758fcc..9a36f881ae4 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -401,7 +401,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 7d5d3858601..6ad1a75ad81 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1046,7 +1046,7 @@ print $hookmanager->resPrint; print '
'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= ((count($arrayofmassactions) && $contextpage != 'poslist') ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index a0d00d27442..4f92114505d 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -556,7 +556,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 33260bc65ff..c87e028e720 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8924,18 +8924,18 @@ class Form /** - * Show a multiselect dropbox from an array. If a saved selection of fields exists for user (into $user->conf->MAIN_SELECTEDFIELDS_contextofpage), we use this one instead of default. + * Show a multiselect dropbox from an array. If a saved selection of fields exists for user (into $user->conf->MAIN_SELECTEDFIELDS_contextofpage), we use this one instead of default. * - * @param string $htmlname Name of HTML field - * @param array $array Array with array of fields we could show. This array may be modified according to setup of user. - * @param string $varpage Id of context for page. Can be set by caller with $varpage=(empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage); - * @param string $pos Position colon on liste value 'left' or '' (meaning 'right'). - * @return string HTML multiselect string + * @param string $htmlname Name of HTML field + * @param array $array Array with array of fields we could show. This array may be modified according to setup of user. + * @param string $varpage Id of context for page. Can be set by caller with $varpage=(empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage); + * @param string $pos Position colon on liste value 'left' or '' (meaning 'right'). + * @return string HTML multiselect string * @see selectarray() */ public static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage, $pos = '') { - global $conf, $langs, $user, $extrafields; + global $langs, $user; if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { return ''; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index f09dda32803..864bfabd0c5 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1151,7 +1151,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $mode = 'view'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields + $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 71bb09c41bc..9cba55f01d7 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -308,7 +308,7 @@ if ($search_all) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/don/paiement/list.php b/htdocs/don/paiement/list.php index 32162646c27..70112d0b0f1 100644 --- a/htdocs/don/paiement/list.php +++ b/htdocs/don/paiement/list.php @@ -326,7 +326,7 @@ if ($search_all) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $massactionbutton = ''; if ($massactionbutton) { $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index ce211834b8c..e648af10fb2 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -827,7 +827,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 0c9722c4b78..ae874c2fcd1 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -803,7 +803,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index de32d3fc972..ccfd824db35 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -686,7 +686,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); if ($massactionbutton) { $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); // This also change content of $arrayfields } diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index 8034da0845a..1dc7e453e5f 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -355,7 +355,7 @@ if ($moreforfilter) { $arrayofmassactions = array(); $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index ddc8d0c332b..177f8117d88 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -562,7 +562,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index d815eda212b..46c864aaa0c 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -527,7 +527,7 @@ $arrayofmassactions = array( $massactionbutton = $form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"))); $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields //$selectedfields.=$form->showCheckAddButtons('checkforselect', 1); print ''."\n"; @@ -569,7 +569,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 5fa0373d095..dbceca56a4b 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1064,7 +1064,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 49c9a20a1c4..28665f0a8c5 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -377,7 +377,7 @@ if ($moreforfilter) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields if (!empty($massactionbutton)) { $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); } diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 262f018054e..e1cff740510 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -330,7 +330,7 @@ if (count($typeleaves) == 0) { $selectedfields = ''; if ($massactionbutton) { $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields .= ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields + $selectedfields .= ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); } diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index e07efba6b2d..63af2a22c65 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -582,7 +582,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); $include = ''; diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index f5e6bb89491..4d8e19e8526 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -309,7 +309,7 @@ $disabled = 0; $include = ''; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index f9d820c9d89..b34b6285ee4 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -495,7 +495,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index d184a6bb6bd..2049387eb1e 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -470,7 +470,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index 5d8dcf538e9..bc7ff33f827 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -481,7 +481,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index fc867019aa9..1f392a16ff6 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -483,7 +483,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 8e7ae4fa679..8c5e2e7fe02 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -431,7 +431,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index c20ccb99e2c..2777bd5d92f 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -523,7 +523,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 38c9b66f0a2..e4db0081d44 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -320,7 +320,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 41264b0a467..06cd5c81f7a 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -581,7 +581,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 5a3442ace8d..c06b3f0d517 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -474,7 +474,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 31f2c784d98..deb9d39a97a 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -599,7 +599,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields + $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 3bd6005661f..2fcd215c197 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -721,7 +721,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 38e51960c08..64ac82d10f1 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -508,7 +508,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 214802925b8..5bbda11dc4d 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -954,7 +954,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 5eab969d4ce..bc801ba1bb8 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -523,7 +523,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 18d40cdcc82..f053f3d06fa 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -1142,7 +1142,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index e73d364863f..3e2b4e3fddf 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -475,7 +475,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_list.php b/htdocs/product/stock/stocktransfer/stocktransfer_list.php index ea9875ad375..3e9c5adc0c1 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_list.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_list.php @@ -470,7 +470,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 1b030ac72f7..4e06ca01148 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1156,7 +1156,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 8524b0ccb1e..cf3f3dc1405 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -294,7 +294,7 @@ if ($search_task_user > 0) { $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields if ($id) { @@ -836,7 +836,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 4ddc831827a..85b372e248b 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1548,7 +1548,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $tasks = array(); $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields + $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $sql = "SELECT t.rowid, t.fk_element, t.element_date, t.element_datehour, t.element_date_withhour, t.element_duration, t.fk_user, t.note, t.thm,"; $sql .= " t.fk_product,"; diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 6551eb35d36..9f33c9caea4 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -951,7 +951,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); if ($massactionbutton) { $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); // This also change content of $arrayfields } diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index eb71f70cf0d..16aa9af1985 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -606,7 +606,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 91f57d2d880..4a0f9bc0552 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -473,7 +473,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 1864043e62b..155eab9e0c5 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1245,8 +1245,8 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields -//$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields +//$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= ((count($arrayofmassactions) && $contextpage != 'poslist') ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index d7d9ae2bed2..69e77953a77 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -419,7 +419,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 3fb07664ffa..178e55fb4b3 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -719,7 +719,7 @@ if ($resql) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields + $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index c03b6264255..78fc1c83d99 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -329,7 +329,7 @@ if (!empty($moreforfilter)) { } $varpage=empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index a5d146dc282..307d68b8d79 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -729,7 +729,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index 4115d3b4c8f..2797c305cc4 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -506,7 +506,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/website/index.php b/htdocs/website/index.php index c4083ba3dfc..43f3e2e9686 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -4791,7 +4791,7 @@ if ($mode == 'replacesite' || $massaction == 'replace') { $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - //$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields + //$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields = ''; $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index 1e6b89f4937..6f78f3ab4b3 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -491,7 +491,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table From b62222c7e4b7e6d95458a32a841746b94d8680e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 16:51:17 +0100 Subject: [PATCH 0318/1862] Fix bad const --- test/phpunit/CodingPhpTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 8aebf3216fa..0d192ad6b33 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -704,7 +704,7 @@ class CodingPhpTest extends CommonClassTest } else { $this->assertTrue( array_key_exists($module_name, self::VALID_MODULE_MAPPING) - || array_key_exists($module_name, self::DEPRECATED_MODULE_MAPPIG), + || array_key_exists($module_name, self::DEPRECATED_MODULE_MAPPING), "Unknown module: $message" ); } From ed3b04a1c7bea28ad7a89a58706c155862af9253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 29 Feb 2024 16:59:32 +0100 Subject: [PATCH 0319/1862] fix phpstan (#28525) --- htdocs/core/lib/company.lib.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 864bfabd0c5..54b4400b333 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -679,7 +679,7 @@ function getState($id, $withcode = '', $dbtouse = 0, $withregion = 0, $outputlan * @param Translate $outputlangs Output language * @return string Label translated of currency */ -function currency_name($code_iso, $withcode = '', $outputlangs = null) +function currency_name($code_iso, $withcode = 0, $outputlangs = null) { global $langs, $db; @@ -1550,14 +1550,14 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl /** * Show html area with actions to do * - * @param Conf $conf Object conf - * @param Translate $langs Object langs - * @param DoliDB $db Object db - * @param Adherent|Societe $filterobj Object thirdparty or member - * @param Contact $objcon Object contact - * @param int $noprint Return string but does not output it - * @param int $actioncode Filter on actioncode - * @return string|void Return html part or void if noprint is 1 + * @param Conf $conf Object conf + * @param Translate $langs Object langs + * @param DoliDB $db Object db + * @param Adherent|Societe $filterobj Object thirdparty or member + * @param Contact $objcon Object contact + * @param int $noprint Return string but does not output it + * @param string|string[] $actioncode Filter on actioncode + * @return string|void Return html part or void if noprint is 1 */ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '') { From 4c116e1577ff543fb15cc9b8cd1f3bc0564fb91f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 17:59:17 +0100 Subject: [PATCH 0320/1862] Doc --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2cb7b41316a..8bc8cb9a9c1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8850,7 +8850,7 @@ abstract class CommonObject /** - * Function to prepare a part of the query for insert. + * Function to return the array of data key-value from the ->fields and all the ->properties of an object. * Note $this->${field} are set by the page that make the createCommon or the updateCommon. * $this->${field} should be a clean value. The page can run * From 9a41edfdc4959a5ef455ace6a53f45e8d3c154f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 18:22:48 +0100 Subject: [PATCH 0321/1862] Add code for better transition of using user_creation_id and user_modification_id --- htdocs/core/class/commonobject.class.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5cf411ade65..e5fa13c6521 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9714,20 +9714,26 @@ abstract class CommonObject $fieldvalues = $this->setSaveQuery(); + // Note: Here, $fieldvalues contains same keys (or less) that are inside ->fields + if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) { $fieldvalues['date_creation'] = $this->db->idate($now); } if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) { $fieldvalues['fk_user_creat'] = $user->id; } + if (array_key_exists('user_creation_id', $fieldvalues) && !($fieldvalues['user_creation_id'] > 0)) { + $fieldvalues['user_creation_id'] = $user->id; + } if (array_key_exists('pass_crypted', $fieldvalues) && property_exists($this, 'pass')) { $fieldvalues['pass_crypted'] = dol_hash($this->pass); } - unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert. if (array_key_exists('ref', $fieldvalues)) { $fieldvalues['ref'] = dol_string_nospecial($fieldvalues['ref']); // If field is a ref, we sanitize data } + unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert. + $keys = array(); $values = array(); // Array to store string forged for SQL syntax foreach ($fieldvalues as $k => $v) { @@ -10011,17 +10017,23 @@ abstract class CommonObject $fieldvalues = $this->setSaveQuery(); + // Note: Here, $fieldvalues contains same keys (or less) that are inside ->fields + if (array_key_exists('date_modification', $fieldvalues) && empty($fieldvalues['date_modification'])) { $fieldvalues['date_modification'] = $this->db->idate($now); } if (array_key_exists('fk_user_modif', $fieldvalues) && !($fieldvalues['fk_user_modif'] > 0)) { $fieldvalues['fk_user_modif'] = $user->id; } - unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into update. + if (array_key_exists('user_modification_id', $fieldvalues) && !($fieldvalues['user_modification_id'] > 0)) { + $fieldvalues['user_modification_id'] = $user->id; + } if (array_key_exists('ref', $fieldvalues)) { $fieldvalues['ref'] = dol_string_nospecial($fieldvalues['ref']); // If field is a ref, we sanitize data } + unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into update. + // Add quotes and escape on fields with type string $keys = array(); $values = array(); From 284fb49f607b8dec04bf0234528273af3a62d04b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 19:35:34 +0100 Subject: [PATCH 0322/1862] Try a better fix for #28526 --- htdocs/core/class/commonobject.class.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8bc8cb9a9c1..ed3203848bc 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -570,6 +570,19 @@ abstract class CommonObject public $user_modification_id; + /** + * @var int ID + * @deprecated Use $user_creation_id + */ + public $fk_user_creat; + + /** + * @var int ID + * @deprecated Use $user_modification_id + */ + public $fk_user_modif; + + public $next_prev_filter; /** @@ -9048,6 +9061,11 @@ abstract class CommonObject } if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) { $fieldvalues['fk_user_creat'] = $user->id; + $this->fk_user_creat = $user->id; + } + if (array_key_exists('user_modification_id', $fieldvalues) && !($fieldvalues['user_modification_id'] > 0)) { + $fieldvalues['user_modification_id'] = $user->id; + $this->user_modification_id = $user->id; } unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert. if (array_key_exists('ref', $fieldvalues)) { From a0fc77cd76a5ca9b229d8503cc85ddc46bd84445 Mon Sep 17 00:00:00 2001 From: thomas-Ngr Date: Thu, 29 Feb 2024 19:40:51 +0100 Subject: [PATCH 0323/1862] Fix Form::load_cache_vatrates() countries dict (#28528) --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cd9f44130b9..e262eb163c9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6348,7 +6348,7 @@ class Form if (!empty($user) && $user->admin && preg_match('/\'(..)\'/', $country_code, $reg)) { $langs->load("errors"); $new_country_code = $reg[1]; - $country_id = dol_getIdFromCode($this->db, $new_country_code, 'c_pays', 'code', 'rowid'); + $country_id = dol_getIdFromCode($this->db, $new_country_code, 'c_country', 'code', 'rowid'); $this->error .= '
'.$langs->trans("ErrorFixThisHere", DOL_URL_ROOT.'/admin/dict.php?id=10'.($country_id > 0 ? '&countryidforinsert='.$country_id : '')); } $this->error .= ''; From 821f327da4c7d8d075598f39b65b1741c019f80c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 19:47:58 +0100 Subject: [PATCH 0324/1862] Fix name of webservice --- htdocs/core/class/commonobject.class.php | 14 ++++++++++++++ htdocs/fourn/commande/card.php | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e5fa13c6521..a85f2485179 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -692,6 +692,18 @@ abstract class CommonObject */ public $user_modification_id; + /** + * @var int ID + * @deprecated Use $user_creation_id + */ + public $fk_user_creat; + + /** + * @var int ID + * @deprecated Use $user_modification_id + */ + public $fk_user_modif; + public $next_prev_filter; @@ -9721,9 +9733,11 @@ abstract class CommonObject } if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) { $fieldvalues['fk_user_creat'] = $user->id; + $this->fk_user_creat = $user->id; } if (array_key_exists('user_creation_id', $fieldvalues) && !($fieldvalues['user_creation_id'] > 0)) { $fieldvalues['user_creation_id'] = $user->id; + $this->user_modification_id = $user->id; } if (array_key_exists('pass_crypted', $fieldvalues) && property_exists($this, 'pass')) { $fieldvalues['pass_crypted'] = dol_hash($this->pass); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index b41024bbc26..58bd75669d7 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1448,8 +1448,8 @@ if (empty($reshook)) { ); // Is sync supplier web services module activated? and everything filled? - if (isModEnabled('syncsupplierwebservices')) { - setEventMessages($langs->trans("WarningModuleNotActive", $langs->transnoentities("Module2650Name")), null, 'mesgs'); + if (isModEnabled('webservicesclient')) { + setEventMessages($langs->trans("WarningModuleNotActive", $langs->transnoentities("Module2660Name")), null, 'mesgs'); } elseif (empty($ws_url) || empty($ws_key)) { setEventMessages($langs->trans("ErrorWebServicesFieldsRequired"), null, 'errors'); } elseif (empty($ws_user) || empty($ws_password) || empty($ws_thirdparty)) { From 034d6d8174b279fd2a80b6f86558f2e0635763dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 19:54:41 +0100 Subject: [PATCH 0325/1862] Fix bad property name --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a85f2485179..be8f26bbd47 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9737,7 +9737,7 @@ abstract class CommonObject } if (array_key_exists('user_creation_id', $fieldvalues) && !($fieldvalues['user_creation_id'] > 0)) { $fieldvalues['user_creation_id'] = $user->id; - $this->user_modification_id = $user->id; + $this->user_creation_id = $user->id; } if (array_key_exists('pass_crypted', $fieldvalues) && property_exists($this, 'pass')) { $fieldvalues['pass_crypted'] = dol_hash($this->pass); From 0e0a7b0d21554decd9e360648c4324093e6724bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 20:05:37 +0100 Subject: [PATCH 0326/1862] Clean code --- htdocs/core/modules/modWebServicesClient.class.php | 2 +- htdocs/fourn/commande/card.php | 2 +- htdocs/societe/card.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/modWebServicesClient.class.php b/htdocs/core/modules/modWebServicesClient.class.php index bdd2f222cf6..c88080cc605 100644 --- a/htdocs/core/modules/modWebServicesClient.class.php +++ b/htdocs/core/modules/modWebServicesClient.class.php @@ -76,7 +76,7 @@ class modWebServicesClient extends DolibarrModules // Permissions $this->rights = array(); - $this->rights_class = 'syncsupplierwebservices'; + $this->rights_class = 'webservicesclient'; $r = 0; } } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 58bd75669d7..f1b8dafbf38 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2654,7 +2654,7 @@ if ($action == 'create') { } // Create a remote order using WebService only if module is activated - if (!empty($conf->syncsupplierwebservices->enabled) && $object->statut >= 2) { // 2 means accepted + if (isModEnabled('webservicesclient') && $object->statut >= 2) { // 2 means accepted print ''.$langs->trans('CreateRemoteOrder').''; } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index facb6cc3d9c..aa8e03f9d5e 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2501,7 +2501,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Webservices url/key - if (!empty($conf->syncsupplierwebservices->enabled)) { + if (isModEnabled('webservicesclient')) { print '
'; print ''; print ''; @@ -3101,7 +3101,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio */ // Webservices url/key - if (!empty($conf->syncsupplierwebservices->enabled)) { + if (isModEnabled('webservicesclient')) { print ''; print ''; } From 59b0d6ca1b133965b14ab8be18d46d539d4c08b7 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Thu, 29 Feb 2024 20:15:23 +0100 Subject: [PATCH 0327/1862] Fix:False constant name (#28532) Fix:False constant name --- htdocs/mrp/class/mo.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 3aec46aa856..061f8461495 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1627,8 +1627,8 @@ class Mo extends CommonObject if ($this->model_pdf) { $modele = $this->model_pdf; - } elseif (getDolGlobalString('MO_ADDON_PDF')) { - $modele = getDolGlobalString('MO_ADDON_PDF'); + } elseif (getDolGlobalString('MRP_MO_ADDON_PDF')) { + $modele = getDolGlobalString('MRP_MO_ADDON_PDF'); } } From ef050962977986488f94fbaaf8fa44d436c929d0 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Thu, 29 Feb 2024 20:15:23 +0100 Subject: [PATCH 0328/1862] Fix:False constant name (#28532) Conflicts: htdocs/mrp/class/mo.class.php Fix:False constant name --- htdocs/mrp/class/mo.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index e3d3999196d..2341f1fd406 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1631,8 +1631,8 @@ class Mo extends CommonObject if ($this->model_pdf) { $modele = $this->model_pdf; - } elseif (getDolGlobalString('MO_ADDON_PDF')) { - $modele = $conf->global->MO_ADDON_PDF; + } elseif (getDolGlobalString('MRP_MO_ADDON_PDF')) { + $modele = getDolGlobalString('MRP_MO_ADDON_PDF'); } } From 632b06c5d8560328c2f7a47472206ffb21678b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NASSIET?= <109105553+comaiteseb@users.noreply.github.com> Date: Thu, 29 Feb 2024 20:22:38 +0100 Subject: [PATCH 0329/1862] ajout unitprice dans import FIX #28382 (#28531) --- htdocs/core/modules/modFacture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 34f303fec9c..d26f893386e 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -368,7 +368,7 @@ class modFacture extends DolibarrModules 'fd.remise_percent' => 'Reduc. (%)', // remise // fk_remise_except - // subprice + 'fd.subprice' => 'UnitPriceHT', // price 'fd.total_ht' => 'LineTotalHT', 'fd.total_tva' => 'LineTotalVAT', @@ -433,7 +433,7 @@ class modFacture extends DolibarrModules 'fd.remise_percent' => '0', // remise // fk_remise_except - // subprice + 'fd.subprice' => '100', // price 'fd.total_ht' => '100', 'fd.total_tva' => '21', From e6c4583bc46ed07aba68066517c32f4aa3a09117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NASSIET?= <109105553+comaiteseb@users.noreply.github.com> Date: Thu, 29 Feb 2024 20:23:08 +0100 Subject: [PATCH 0330/1862] Prevent infinite loop with add notrigger parameter to the functions create, update & setMultiLangs (#28530) --- htdocs/categories/class/categorie.class.php | 23 +++++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 6e88c1d2373..063207be7d8 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -416,12 +416,13 @@ class Categorie extends CommonObject * Add category into database * * @param User $user Object user + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int -1 : SQL error * -2 : new ID unknown * -3 : Invalid category * -4 : category already exists */ - public function create($user) + public function create($user, $notrigger = 0) { global $conf, $langs, $hookmanager; $langs->load('categories'); @@ -505,7 +506,7 @@ class Categorie extends CommonObject } } - if (!$error) { + if (!$error && !$notrigger) { // Call trigger $result = $this->call_trigger('CATEGORY_CREATE', $user); if ($result < 0) { @@ -536,11 +537,12 @@ class Categorie extends CommonObject * Update category * * @param User $user Object user + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int 1 : OK * -1 : SQL error * -2 : invalid category */ - public function update(User $user) + public function update(User $user, $notrigger = 0) { global $langs; @@ -586,7 +588,7 @@ class Categorie extends CommonObject } } - if (!$error) { + if (!$error && !$notrigger) { // Call trigger $result = $this->call_trigger('CATEGORY_MODIFY', $user); if ($result < 0) { @@ -1913,10 +1915,11 @@ class Categorie extends CommonObject * Update ou cree les traductions des infos produits * * @param User $user Object user + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * * @return int Return integer <0 if KO, >0 if OK */ - public function setMultiLangs($user) + public function setMultiLangs(User $user, $notrigger = 0) { global $langs; @@ -1971,10 +1974,12 @@ class Categorie extends CommonObject } // Call trigger - $result = $this->call_trigger('CATEGORY_SET_MULTILANGS', $user); - if ($result < 0) { - $this->error = $this->db->lasterror(); - return -1; + if (!$notrigger) { + $result = $this->call_trigger('CATEGORY_SET_MULTILANGS', $user); + if ($result < 0) { + $this->error = $this->db->lasterror(); + return -1; + } } // End call triggers From df8a6bd33666b78d5bd1c31d38c19404c606a492 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 20:39:21 +0100 Subject: [PATCH 0331/1862] Fix warning --- htdocs/core/class/commonobject.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index be8f26bbd47..14fa0eb3565 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -583,11 +583,17 @@ abstract class CommonObject */ public $total_ttc; + /** * @var CommonObjectLine[] */ public $lines; + /** + * @var string Action code to use to record auto event in agenda. For exemple 'AC_OTH_AUTO' + */ + public $actiontypecode; + /** * @var mixed Comments * @see fetchComments() From f717343d70f884626c2511758af3ada55344aecb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 21:42:33 +0100 Subject: [PATCH 0332/1862] Clean code --- htdocs/accountancy/admin/accountmodel.php | 70 ++--------------------- 1 file changed, 5 insertions(+), 65 deletions(-) diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 1ba824eb86e..6186bd2dc13 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -53,6 +53,8 @@ $id = 31; $rowid = GETPOST('rowid', 'alpha'); $code = GETPOST('code', 'alpha'); +$acts = array(); +$actl = array(); $acts[0] = "activate"; $acts[1] = "disable"; $actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"'); @@ -314,19 +316,8 @@ if ($action == 'confirm_delete' && $confirm == 'yes') { // delete } // activate -if ($action == $acts[0]) { - if ($tabrowid[$id]) { - $rowidcol = $tabrowid[$id]; - } else { - $rowidcol = "rowid"; - } - - if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = ".((int) $rowid); - } elseif ($code) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".$db->escape($code)."'"; - } - +if ($action == 'activate') { + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE rowid = ".((int) $rowid); $result = $db->query($sql); if (!$result) { dol_print_error($db); @@ -335,58 +326,7 @@ if ($action == $acts[0]) { // disable if ($action == $acts[1]) { - if ($tabrowid[$id]) { - $rowidcol = $tabrowid[$id]; - } else { - $rowidcol = "rowid"; - } - - if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = ".((int) $rowid); - } elseif ($code) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".$db->escape($code)."'"; - } - - $result = $db->query($sql); - if (!$result) { - dol_print_error($db); - } -} - -// favorite -if ($action == 'activate_favorite') { - if ($tabrowid[$id]) { - $rowidcol = $tabrowid[$id]; - } else { - $rowidcol = "rowid"; - } - - if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = ".((int) $rowid); - } elseif ($code) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".$db->escape($code)."'"; - } - - $result = $db->query($sql); - if (!$result) { - dol_print_error($db); - } -} - -// disable favorite -if ($action == 'disable_favorite') { - if ($tabrowid[$id]) { - $rowidcol = $tabrowid[$id]; - } else { - $rowidcol = "rowid"; - } - - if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = ".((int) $rowid); - } elseif ($code) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".$db->escape($code)."'"; - } - + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE rowid = ".((int) $rowid); $result = $db->query($sql); if (!$result) { dol_print_error($db); From eae14a4022de613b72930f0c314c9024625b7b0f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 23:45:02 +0100 Subject: [PATCH 0333/1862] Fix test on country similarty for MQ and GP --- htdocs/core/lib/functions.lib.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 62c8bc0ec3f..56f7a222aa4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6876,7 +6876,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi */ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournprice = 0) { - global $db, $conf, $mysoc; + global $db, $mysoc; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -6888,8 +6888,10 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric $product = new Product($db); $product->fetch($idprod); - if ($mysoc->country_code == $thirdpartytouse->country_code) { - // If country to consider is ours + if (($mysoc->country_code == $thirdpartytouse->country_code) + || (in_array($mysoc->country_code, array('FR', 'MC')) && in_array($thirdpartytouse->country_code, array('FR', 'MC'))) + || (in_array($mysoc->country_code, array('MQ', 'GP')) && in_array($thirdpartytouse->country_code, array('MQ', 'GP'))) { + // If country of thirdparty to consider is ours if ($idprodfournprice > 0) { // We want vat for product for a "supplier" object $result = $product->get_buyprice($idprodfournprice, 0, 0, 0); if ($result > 0) { From 7722f0e7d48252834ff0c3c54d03b8d2756dc107 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Mar 2024 01:11:41 +0100 Subject: [PATCH 0334/1862] Fix syntax error --- htdocs/core/lib/functions.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 56f7a222aa4..ba02ca41753 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6890,7 +6890,8 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric if (($mysoc->country_code == $thirdpartytouse->country_code) || (in_array($mysoc->country_code, array('FR', 'MC')) && in_array($thirdpartytouse->country_code, array('FR', 'MC'))) - || (in_array($mysoc->country_code, array('MQ', 'GP')) && in_array($thirdpartytouse->country_code, array('MQ', 'GP'))) { + || (in_array($mysoc->country_code, array('MQ', 'GP')) && in_array($thirdpartytouse->country_code, array('MQ', 'GP'))) + ) { // If country of thirdparty to consider is ours if ($idprodfournprice > 0) { // We want vat for product for a "supplier" object $result = $product->get_buyprice($idprodfournprice, 0, 0, 0); From 04c560faa4a20a7d6e7c32aff7226f740884ed66 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Mar 2024 01:52:40 +0100 Subject: [PATCH 0335/1862] Fix warning --- htdocs/accountancy/admin/accountmodel.php | 2 +- htdocs/accountancy/admin/categories.php | 2 +- htdocs/accountancy/admin/categories_list.php | 2 +- htdocs/accountancy/admin/fiscalyear.php | 2 +- htdocs/accountancy/admin/journals_list.php | 2 +- htdocs/accountancy/admin/productaccount.php | 2 +- htdocs/accountancy/admin/subaccount.php | 2 +- htdocs/accountancy/bookkeeping/balance.php | 2 +- htdocs/accountancy/bookkeeping/export.php | 2 +- htdocs/accountancy/bookkeeping/list.php | 2 +- htdocs/accountancy/bookkeeping/listbyaccount.php | 2 +- htdocs/accountancy/customer/lines.php | 2 +- htdocs/accountancy/customer/list.php | 2 +- htdocs/accountancy/expensereport/lines.php | 2 +- htdocs/accountancy/expensereport/list.php | 2 +- htdocs/accountancy/supplier/lines.php | 2 +- htdocs/accountancy/supplier/list.php | 2 +- htdocs/adherents/agenda.php | 2 +- htdocs/adherents/document.php | 2 +- htdocs/adherents/list.php | 2 +- htdocs/adherents/subscription.php | 2 +- htdocs/adherents/subscription/list.php | 2 +- htdocs/adherents/type.php | 2 +- htdocs/admin/const.php | 2 +- htdocs/admin/defaultvalues.php | 2 +- htdocs/admin/dict.php | 2 +- htdocs/admin/emailcollector_list.php | 2 +- htdocs/admin/events.php | 2 +- htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/admin/mails_templates.php | 2 +- htdocs/admin/tools/dolibarr_export.php | 2 +- htdocs/admin/tools/export.php | 2 +- htdocs/admin/tools/export_files.php | 2 +- htdocs/admin/tools/listevents.php | 2 +- htdocs/admin/tools/listsessions.php | 2 +- htdocs/admin/translation.php | 2 +- htdocs/admin/website.php | 2 +- htdocs/admin/website_options.php | 2 +- htdocs/asset/agenda.php | 2 +- htdocs/asset/document.php | 2 +- htdocs/asset/list.php | 2 +- htdocs/asset/model/agenda.php | 2 +- htdocs/asset/model/list.php | 2 +- htdocs/blockedlog/admin/blockedlog_list.php | 2 +- htdocs/bom/bom_agenda.php | 2 +- htdocs/bom/bom_document.php | 2 +- htdocs/bookcal/availabilities_agenda.php | 2 +- htdocs/bookcal/availabilities_document.php | 2 +- htdocs/bookcal/availabilities_list.php | 2 +- htdocs/bookcal/calendar_agenda.php | 2 +- htdocs/bookcal/calendar_document.php | 2 +- htdocs/bookcal/calendar_list.php | 2 +- htdocs/bookmarks/list.php | 2 +- htdocs/categories/viewcat.php | 2 +- htdocs/comm/action/document.php | 2 +- htdocs/comm/action/index.php | 2 +- htdocs/comm/action/list.php | 2 +- htdocs/comm/action/pertype.php | 2 +- htdocs/comm/action/peruser.php | 2 +- htdocs/comm/action/rapport/index.php | 2 +- htdocs/comm/card.php | 2 +- htdocs/comm/contact.php | 2 +- htdocs/comm/mailing/advtargetemailing.php | 2 +- htdocs/comm/mailing/cibles.php | 2 +- htdocs/comm/propal/agenda.php | 2 +- htdocs/comm/propal/document.php | 2 +- htdocs/comm/propal/list.php | 2 +- htdocs/commande/agenda.php | 2 +- htdocs/commande/customer.php | 2 +- htdocs/commande/document.php | 2 +- htdocs/commande/list.php | 2 +- htdocs/commande/list_det.php | 2 +- htdocs/compta/accounting-files.php | 2 +- htdocs/compta/bank/account_statement_document.php | 2 +- htdocs/compta/bank/bankentries_list.php | 2 +- htdocs/compta/bank/document.php | 2 +- htdocs/compta/bank/list.php | 2 +- htdocs/compta/bank/releve.php | 2 +- htdocs/compta/bank/various_payment/document.php | 2 +- htdocs/compta/bank/various_payment/list.php | 2 +- htdocs/compta/cashcontrol/cashcontrol_card.php | 2 +- htdocs/compta/cashcontrol/cashcontrol_list.php | 2 +- htdocs/compta/charges/index.php | 2 +- htdocs/compta/clients.php | 2 +- htdocs/compta/deplacement/document.php | 2 +- htdocs/compta/deplacement/index.php | 2 +- htdocs/compta/deplacement/list.php | 2 +- htdocs/compta/facture/agenda-rec.php | 2 +- htdocs/compta/facture/agenda.php | 2 +- htdocs/compta/facture/card-rec.php | 2 +- htdocs/compta/facture/document.php | 2 +- htdocs/compta/facture/invoicetemplate_list.php | 2 +- htdocs/compta/facture/list.php | 2 +- htdocs/compta/paiement.php | 2 +- htdocs/compta/paiement/cheque/card.php | 2 +- htdocs/compta/paiement/cheque/list.php | 2 +- htdocs/compta/paiement/list.php | 2 +- htdocs/compta/paiement/tovalidate.php | 2 +- htdocs/compta/prelevement/card.php | 2 +- htdocs/compta/prelevement/create.php | 2 +- htdocs/compta/prelevement/demandes.php | 2 +- htdocs/compta/prelevement/factures.php | 2 +- htdocs/compta/prelevement/fiche-rejet.php | 2 +- htdocs/compta/prelevement/fiche-stat.php | 2 +- htdocs/compta/prelevement/line.php | 2 +- htdocs/compta/prelevement/list.php | 2 +- htdocs/compta/prelevement/orders_list.php | 2 +- htdocs/compta/prelevement/rejets.php | 2 +- htdocs/compta/recap-compta.php | 2 +- htdocs/compta/resultat/clientfourn.php | 2 +- htdocs/compta/sociales/document.php | 2 +- htdocs/compta/sociales/list.php | 2 +- htdocs/compta/sociales/payments.php | 2 +- htdocs/compta/tva/document.php | 2 +- htdocs/compta/tva/payments.php | 2 +- htdocs/contact/agenda.php | 2 +- htdocs/contact/consumption.php | 2 +- htdocs/contact/document.php | 2 +- htdocs/contact/list.php | 2 +- htdocs/contrat/agenda.php | 2 +- htdocs/contrat/document.php | 2 +- htdocs/contrat/index.php | 2 +- htdocs/contrat/list.php | 2 +- htdocs/contrat/messaging.php | 2 +- htdocs/contrat/services_list.php | 2 +- htdocs/core/ajax/ajaxdirpreview.php | 2 +- htdocs/core/customreports.php | 2 +- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/modules/movement/doc/pdf_standard.modules.php | 2 +- htdocs/cron/list.php | 2 +- htdocs/don/document.php | 2 +- htdocs/don/list.php | 2 +- htdocs/don/paiement/list.php | 2 +- htdocs/ecm/dir_add_card.php | 2 +- htdocs/ecm/dir_card.php | 2 +- htdocs/ecm/file_card.php | 2 +- htdocs/ecm/file_note.php | 2 +- htdocs/ecm/index.php | 2 +- htdocs/ecm/index_auto.php | 2 +- htdocs/ecm/index_medias.php | 2 +- htdocs/ecm/search.php | 2 +- htdocs/eventorganization/conferenceorbooth_document.php | 2 +- htdocs/eventorganization/conferenceorbooth_list.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_list.php | 2 +- htdocs/expedition/document.php | 2 +- htdocs/expedition/list.php | 2 +- htdocs/expensereport/document.php | 2 +- htdocs/expensereport/index.php | 2 +- htdocs/fichinter/agenda.php | 2 +- htdocs/fichinter/card-rec.php | 2 +- htdocs/fichinter/document.php | 2 +- htdocs/fichinter/list.php | 2 +- htdocs/fourn/commande/document.php | 2 +- htdocs/fourn/commande/list.php | 2 +- htdocs/fourn/contact.php | 2 +- htdocs/fourn/facture/card-rec.php | 2 +- htdocs/fourn/facture/document.php | 2 +- htdocs/fourn/facture/list-rec.php | 2 +- htdocs/fourn/facture/list.php | 2 +- htdocs/fourn/paiement/document.php | 2 +- htdocs/fourn/product/list.php | 2 +- htdocs/ftp/index.php | 2 +- htdocs/holiday/define_holiday.php | 2 +- htdocs/holiday/document.php | 2 +- htdocs/holiday/list.php | 2 +- htdocs/holiday/month_report.php | 2 +- htdocs/holiday/view_log.php | 2 +- htdocs/hrm/establishment/info.php | 2 +- htdocs/hrm/evaluation_agenda.php | 2 +- htdocs/hrm/evaluation_document.php | 2 +- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_agenda.php | 2 +- htdocs/hrm/job_document.php | 2 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/position_agenda.php | 2 +- htdocs/hrm/position_document.php | 2 +- htdocs/hrm/position_list.php | 2 +- htdocs/hrm/skill_agenda.php | 2 +- htdocs/hrm/skill_card.php | 2 +- htdocs/hrm/skill_document.php | 2 +- htdocs/hrm/skill_list.php | 2 +- htdocs/intracommreport/list.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_agenda.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_document.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_list.php | 2 +- htdocs/loan/document.php | 2 +- htdocs/loan/list.php | 2 +- htdocs/margin/agentMargins.php | 2 +- htdocs/margin/checkMargins.php | 2 +- htdocs/margin/customerMargins.php | 2 +- htdocs/margin/productMargins.php | 2 +- htdocs/margin/tabs/productMargins.php | 2 +- htdocs/margin/tabs/thirdpartyMargins.php | 2 +- htdocs/mrp/mo_document.php | 2 +- htdocs/mrp/mo_list.php | 2 +- htdocs/opensurvey/list.php | 2 +- htdocs/partnership/partnership_agenda.php | 2 +- htdocs/partnership/partnership_document.php | 2 +- htdocs/partnership/partnership_list.php | 2 +- htdocs/product/agenda.php | 2 +- htdocs/product/document.php | 2 +- htdocs/product/inventory/inventory.php | 2 +- htdocs/product/inventory/list.php | 2 +- htdocs/product/list.php | 2 +- htdocs/product/popuprop.php | 2 +- htdocs/product/reassort.php | 2 +- htdocs/product/reassortlot.php | 2 +- htdocs/product/stats/bom.php | 2 +- htdocs/product/stats/commande.php | 2 +- htdocs/product/stats/commande_fournisseur.php | 2 +- htdocs/product/stats/contrat.php | 2 +- htdocs/product/stats/facture.php | 2 +- htdocs/product/stats/facture_fournisseur.php | 2 +- htdocs/product/stats/facturerec.php | 2 +- htdocs/product/stats/mo.php | 2 +- htdocs/product/stats/propal.php | 2 +- htdocs/product/stats/supplier_proposal.php | 2 +- htdocs/product/stock/list.php | 2 +- htdocs/product/stock/massstockmove.php | 2 +- htdocs/product/stock/movement_card.php | 2 +- htdocs/product/stock/movement_list.php | 2 +- htdocs/product/stock/productlot_document.php | 2 +- htdocs/product/stock/productlot_list.php | 2 +- htdocs/product/stock/replenish.php | 2 +- htdocs/product/stock/replenishorders.php | 2 +- htdocs/product/stock/stats/commande_fournisseur.php | 2 +- htdocs/product/stock/stats/expedition.php | 2 +- htdocs/product/stock/stats/mo.php | 2 +- htdocs/product/stock/stats/reception.php | 2 +- htdocs/product/stock/stockatdate.php | 2 +- htdocs/product/stock/stocktransfer/stocktransfer_agenda.php | 2 +- htdocs/product/stock/stocktransfer/stocktransfer_document.php | 2 +- htdocs/product/stock/stocktransfer/stocktransfer_list.php | 2 +- htdocs/projet/agenda.php | 2 +- htdocs/projet/list.php | 2 +- htdocs/projet/messaging.php | 2 +- htdocs/projet/tasks.php | 2 +- htdocs/projet/tasks/document.php | 2 +- htdocs/projet/tasks/list.php | 2 +- htdocs/projet/tasks/time.php | 2 +- htdocs/public/members/public_list.php | 2 +- htdocs/public/opensurvey/index.php | 2 +- htdocs/public/recruitment/index.php | 2 +- htdocs/public/ticket/list.php | 2 +- htdocs/reception/document.php | 2 +- htdocs/reception/list.php | 2 +- htdocs/recruitment/recruitmentcandidature_agenda.php | 2 +- htdocs/recruitment/recruitmentcandidature_document.php | 2 +- htdocs/recruitment/recruitmentcandidature_list.php | 2 +- htdocs/recruitment/recruitmentjobposition_agenda.php | 2 +- htdocs/recruitment/recruitmentjobposition_document.php | 2 +- htdocs/recruitment/recruitmentjobposition_list.php | 2 +- htdocs/resource/agenda.php | 2 +- htdocs/resource/document.php | 2 +- htdocs/resource/list.php | 2 +- htdocs/salaries/document.php | 2 +- htdocs/salaries/list.php | 2 +- htdocs/salaries/payments.php | 2 +- htdocs/societe/agenda.php | 2 +- htdocs/societe/list.php | 2 +- htdocs/societe/messaging.php | 2 +- htdocs/societe/notify/card.php | 2 +- htdocs/societe/price.php | 2 +- htdocs/societe/societecontact.php | 2 +- htdocs/societe/website.php | 2 +- htdocs/stripe/charge.php | 2 +- htdocs/stripe/payout.php | 2 +- htdocs/stripe/transaction.php | 2 +- htdocs/supplier_proposal/document.php | 2 +- htdocs/supplier_proposal/list.php | 2 +- htdocs/ticket/agenda.php | 2 +- htdocs/ticket/document.php | 2 +- htdocs/ticket/list.php | 2 +- htdocs/ticket/messaging.php | 2 +- htdocs/user/agenda.php | 2 +- htdocs/user/document.php | 2 +- htdocs/user/group/list.php | 2 +- htdocs/user/hierarchy.php | 2 +- htdocs/user/list.php | 2 +- htdocs/user/messaging.php | 2 +- htdocs/user/notify/card.php | 2 +- htdocs/variants/list.php | 2 +- htdocs/webhook/target_list.php | 2 +- htdocs/website/index.php | 2 +- htdocs/workstation/workstation_agenda.php | 2 +- htdocs/workstation/workstation_document.php | 2 +- htdocs/workstation/workstation_list.php | 2 +- 287 files changed, 287 insertions(+), 287 deletions(-) diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 6186bd2dc13..8ff908b61e8 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -66,7 +66,7 @@ $active = 1; $sortfield = GETPOST("sortfield", 'aZ09comma'); $sortorder = GETPOST("sortorder", 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 131886d76f9..465f2836122 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -49,7 +49,7 @@ if ($cat_id == 0) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 7761efd6145..848b6f14d52 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -57,7 +57,7 @@ $listlimit = GETPOSTINT('listlimit') > 0 ? GETPOSTINT('listlimit') : 1000; $sortfield = GETPOST("sortfield", 'aZ09comma'); $sortorder = GETPOST("sortorder", 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 8f2aff9a587..d1ba74b8b56 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -32,7 +32,7 @@ $action = GETPOST('action', 'aZ09'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 1df04810801..5aca1af44a3 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -61,7 +61,7 @@ $active = 1; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index b625446ca60..164b5c72c04 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -87,7 +87,7 @@ if (empty($accounting_product_mode)) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalInt('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index 54550180947..188915b0ec0 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -58,7 +58,7 @@ if (!$user->hasRight('accounting', 'chartofaccount')) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 13d9fe6dc16..a3edb6e68e0 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -67,7 +67,7 @@ $search_not_reconciled = GETPOST('search_not_reconciled', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index dd68ab09998..0b826be4a1e 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -138,7 +138,7 @@ $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNT $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $optioncss = GETPOST('optioncss', 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 064ec0547f1..06921fc9d38 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -133,7 +133,7 @@ $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNT $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $optioncss = GETPOST('optioncss', 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 24856b36ae3..4a39d78e5ef 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -108,7 +108,7 @@ $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNT $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $optioncss = GETPOST('optioncss', 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 5c9457d818f..5994dba600e 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -68,7 +68,7 @@ $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index d51b43eccd9..6ef21c0f21e 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -83,7 +83,7 @@ if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDI $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 4fbc0642bc9..2320620fec7 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -62,7 +62,7 @@ $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_en $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index d70729d4521..8f996c42412 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -76,7 +76,7 @@ if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDI $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 3571a5e2df5..496a32b9825 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -70,7 +70,7 @@ $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index a97bfb1d531..db087830144 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -80,7 +80,7 @@ $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 742905600af..a42090f5b3c 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -44,7 +44,7 @@ $id = GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('rowid'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index ac692433247..e92e1da0d41 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -47,7 +47,7 @@ $confirm = GETPOST('confirm', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 371d197f8fb..45b3e121d99 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -105,7 +105,7 @@ if ($search_status < -2) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 90ee4d4cf74..9da83c5faf3 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -57,7 +57,7 @@ $cancel = GETPOST('cancel'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 6c3d7a228ce..efd6c1b1c47 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -60,7 +60,7 @@ $date_select = GETPOST("date_select", 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index a56598e360a..738ee68c23b 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -64,7 +64,7 @@ $optioncss = GETPOST('optioncss', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 792fe0b30cf..317e838e922 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -44,7 +44,7 @@ $constnote = GETPOST('constnote', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 0792ad97007..ee27ea183e9 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -49,7 +49,7 @@ $mode = GETPOST('mode', 'aZ09') ? GETPOST('mode', 'aZ09') : 'createform'; // 'cr $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 6d2a0d032d7..a07b083ca12 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -65,7 +65,7 @@ $listoffset = GETPOST('listoffset'); $listlimit = GETPOST('listlimit') > 0 ? GETPOST('listlimit') : 1000; // To avoid too long dictionaries $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 8a04945c453..c8c4869e7d9 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -53,7 +53,7 @@ $id = GETPOSTINT('id'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action $page = 0; diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 6b321316f47..323483601a1 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -44,7 +44,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 4adc4878e0e..e57e3794d3f 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -51,7 +51,7 @@ $rowid = GETPOST('rowid', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index a8c07357a81..9bbeade4cdd 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -84,7 +84,7 @@ $listlimit = GETPOST('listlimit', 'alpha') > 0 ? GETPOST('listlimit', 'alpha') : $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index a3ffe8a8c53..fb65a08dd92 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -34,7 +34,7 @@ $action = GETPOST('action', 'aZ09'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "DESC"; } diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index a708e51adfa..860cef0e9cd 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -41,7 +41,7 @@ $file = dol_sanitizeFileName(GETPOST('filename_template', 'alpha')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 551a90c7b67..446a013df81 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -47,7 +47,7 @@ $file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2|\.zst)$/i', '', $ $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "DESC"; } diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 54fa535d5fc..b56acffee17 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -50,7 +50,7 @@ $langs->loadLangs(array("companies", "admin", "users", "other","withdrawals")); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 4a1861be87b..0fdf1a0e561 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -50,7 +50,7 @@ if ($user->socid > 0) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 04b8cee7488..c8f47d241c6 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -54,7 +54,7 @@ if ($mode == 'searchkey') { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 3bceb532a83..b517491d14c 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -52,7 +52,7 @@ $actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"') $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index 680cd961729..8066ac8604d 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -43,7 +43,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index 7520dda55fc..f25da35dd6a 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -54,7 +54,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index 69112f6e619..bf585199df1 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -44,7 +44,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 427307532e2..c8c105ab5c8 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -50,7 +50,7 @@ $id = GETPOSTINT('id'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index 04739e21408..ff190403410 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -54,7 +54,7 @@ if (GETPOST('actioncode', 'array')) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index 51033b5c2b1..f5c987e15f7 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -48,7 +48,7 @@ $id = GETPOSTINT('id'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 6b4fbec24e3..305c34413e5 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -83,7 +83,7 @@ if (($search_start == -1 || empty($search_start)) && !GETPOSTISSET('search_start $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index 82d832319c1..f6229b309a1 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -59,7 +59,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index 67ef5c7e1c7..458d9d0b1aa 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -49,7 +49,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index 20fdeceede1..ac313e7b699 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -57,7 +57,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bookcal/availabilities_document.php b/htdocs/bookcal/availabilities_document.php index cbd0d169216..433d92b144f 100644 --- a/htdocs/bookcal/availabilities_document.php +++ b/htdocs/bookcal/availabilities_document.php @@ -44,7 +44,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index 76a217451e6..83df6105c77 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -55,7 +55,7 @@ $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hier $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/bookcal/calendar_agenda.php b/htdocs/bookcal/calendar_agenda.php index b7b2d319649..b3b131a8a7e 100644 --- a/htdocs/bookcal/calendar_agenda.php +++ b/htdocs/bookcal/calendar_agenda.php @@ -56,7 +56,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bookcal/calendar_document.php b/htdocs/bookcal/calendar_document.php index 4a71e5d6457..c11253b4503 100644 --- a/htdocs/bookcal/calendar_document.php +++ b/htdocs/bookcal/calendar_document.php @@ -93,7 +93,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php index 11b2dccafaf..fd187d7c757 100644 --- a/htdocs/bookcal/calendar_list.php +++ b/htdocs/bookcal/calendar_list.php @@ -52,7 +52,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 86f6dbcef7b..f333df50690 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -47,7 +47,7 @@ $search_title = GETPOST('search_title', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index ddfe5fc9946..d95e2c17619 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -57,7 +57,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 44107ddaaf1..ccda6ff5be1 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -70,7 +70,7 @@ $hookmanager->initHooks(array('actioncard', 'globalcard')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index a2b18358c1d..45c6579b4a7 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -70,7 +70,7 @@ $newparam = ''; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index bb80ee84540..03efd125979 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -118,7 +118,7 @@ if (empty($filtert) && !getDolGlobalString('AGENDA_ALL_CALENDARS')) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index a190a675b77..f93373fc0f7 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -65,7 +65,7 @@ if (empty($filtert) && !getDolGlobalString('AGENDA_ALL_CALENDARS')) { // Sorting $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 035a4687ea1..70b325ed45f 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -65,7 +65,7 @@ $showbirthday = 0; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 712c3ee0ccc..88e030f7431 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -42,7 +42,7 @@ $optioncss = GETPOST('optioncss', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index c00ff438490..b202ea2b3da 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -96,7 +96,7 @@ $id = (GETPOSTINT('socid') ? GETPOSTINT('socid') : GETPOSTINT('id')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index ca78aa8f9c9..a0eec00fa04 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -32,7 +32,7 @@ $langs->load("companies"); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "ASC"; } diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index adfb7feeffb..bb296e516ee 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -47,7 +47,7 @@ if (isModEnabled('category')) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index d0b95b32522..c6686cae946 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -41,7 +41,7 @@ $langs->loadLangs(array("mails", "admin")); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/propal/agenda.php b/htdocs/comm/propal/agenda.php index 7a6f4d4d6e1..a61ed2e0270 100644 --- a/htdocs/comm/propal/agenda.php +++ b/htdocs/comm/propal/agenda.php @@ -53,7 +53,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 07ea2de457b..e0dbd6b45b1 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -49,7 +49,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 63ae45c6308..c98e2f12da7 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -147,7 +147,7 @@ $object_statut = GETPOST('search_statut', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/commande/agenda.php b/htdocs/commande/agenda.php index 3c0eea17f23..9ffb69fbb9c 100644 --- a/htdocs/commande/agenda.php +++ b/htdocs/commande/agenda.php @@ -53,7 +53,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 07086496213..4f826bf3af3 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -49,7 +49,7 @@ $langs->loadLangs(array("companies", "orders")); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 550ed05cc01..06ada04a04f 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -49,7 +49,7 @@ $ref = GETPOST('ref'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 37cf3d1e97e..2fd664cbb68 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -122,7 +122,7 @@ $diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/ma $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index eb8f9311f1d..9dcbe3711c1 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -137,7 +137,7 @@ $diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/ma $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index b22abd7b33a..bb4b30474b7 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -80,7 +80,7 @@ $hookmanager->initHooks(array('comptafileslist', 'globallist')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/bank/account_statement_document.php b/htdocs/compta/bank/account_statement_document.php index def4c89daa0..26613a6bb49 100644 --- a/htdocs/compta/bank/account_statement_document.php +++ b/htdocs/compta/bank/account_statement_document.php @@ -54,7 +54,7 @@ if ($user->socid) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index e6eacc582a6..5c09181dd3f 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -99,7 +99,7 @@ if (empty($dateop)) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $pageplusone = GETPOSTINT("pageplusone"); if ($pageplusone) { $page = $pageplusone - 1; diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index c4265b4c184..006d8e72a4f 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -54,7 +54,7 @@ if ($user->socid) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 6b4d5d623d3..05c2ef6de13 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -76,7 +76,7 @@ $diroutputmassaction = $conf->bank->dir_output.'/temp/massgeneration/'.$user->id $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index c745bd49245..97e855217a6 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -79,7 +79,7 @@ if ($user->hasRight('banque', 'consolidate') && $action == 'dvprev' && !empty($d $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $pageplusone = GETPOSTINT("pageplusone"); if ($pageplusone) { $page = $pageplusone - 1; diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index ca7fc8f2f9b..83bafc6aaad 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -49,7 +49,7 @@ $result = restrictedArea($user, 'banque', '', '', ''); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index abf92b1237b..ffb7e72bbea 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -78,7 +78,7 @@ $search_type_id = GETPOSTINT('search_type_id'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 7c04430d3d7..fe4d5a15f77 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -49,7 +49,7 @@ $sday = (GETPOSTISSET('closeday') ? GETPOSTINT('closeday') : dol_print_date($now $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 2e57afab05e..a6c9cf5a361 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -48,7 +48,7 @@ $id = GETPOSTINT('id'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index b67014218f5..534b4a45d01 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -66,7 +66,7 @@ $search_account = GETPOSTINT('search_account'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 6b450fe5df1..c7963e95090 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -48,7 +48,7 @@ $mode = GETPOST("mode"); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index 3948fc98308..d950e51d852 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -48,7 +48,7 @@ $confirm = GETPOST('confirm', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index d02a91bc477..588ca81e0e8 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -41,7 +41,7 @@ $result = restrictedArea($user, 'deplacement', '', ''); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 40e5b6cf9c5..a4b9ecad849 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -48,7 +48,7 @@ $search_company = GETPOST('search_company', 'alpha'); // $search_amount=GETPOST('search_amount','alpha'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; if (empty($page) || $page == -1) { $page = 0; diff --git a/htdocs/compta/facture/agenda-rec.php b/htdocs/compta/facture/agenda-rec.php index baee92ef2f1..6f1ed587758 100644 --- a/htdocs/compta/facture/agenda-rec.php +++ b/htdocs/compta/facture/agenda-rec.php @@ -54,7 +54,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/facture/agenda.php b/htdocs/compta/facture/agenda.php index 25affb4c2f2..ab0edfbf10a 100644 --- a/htdocs/compta/facture/agenda.php +++ b/htdocs/compta/facture/agenda.php @@ -53,7 +53,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 036af5a2864..ab544c4ff70 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -76,7 +76,7 @@ $selectedLines = GETPOST('toselect', 'array'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 44519923cbe..47c6faf0c76 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -53,7 +53,7 @@ $confirm = GETPOST('confirm', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 0013cd92406..540242d2763 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -100,7 +100,7 @@ $search_status = GETPOSTINT('search_status'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index cea102af870..5b9d6136b3f 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -157,7 +157,7 @@ $filtre = GETPOST('filtre', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 83620a7e0ad..4d24a875fb1 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -53,7 +53,7 @@ $socid = GETPOSTINT('socid'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $amounts = array(); $amountsresttopay = array(); diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index b2dcd4f0bc5..097006e12e2 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -51,7 +51,7 @@ $object = new RemiseCheque($db); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "ASC"; } diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index c17cb3a73e1..c7150a80504 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -57,7 +57,7 @@ $mode = GETPOST('mode', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index b3b7de15c38..c5c478e4672 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -72,7 +72,7 @@ $mode = GETPOST('mode', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/paiement/tovalidate.php b/htdocs/compta/paiement/tovalidate.php index 8735b7c0ebd..7a79d37cc5c 100644 --- a/htdocs/compta/paiement/tovalidate.php +++ b/htdocs/compta/paiement/tovalidate.php @@ -38,7 +38,7 @@ if ($user->socid > 0) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 508c05c777f..a63f457062f 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -48,7 +48,7 @@ $date_trans = dol_mktime(GETPOSTINT('date_transhour'), GETPOSTINT('date_transmin $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 1e44e0d7088..930c01db9fe 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -55,7 +55,7 @@ $id_bankaccount = GETPOSTINT('id_bankaccount'); $executiondate = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 50177879826..4422ff3da33 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -54,7 +54,7 @@ $search_societe = GETPOST('search_societe', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 358d5c9fff6..09015486e30 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -48,7 +48,7 @@ $type = GETPOST('type', 'aZ09'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index fe3334fcfb9..aafc6f17833 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -54,7 +54,7 @@ $type = GETPOST('type', 'aZ09'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 370a9a21ddc..b0fadbafd1b 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -44,7 +44,7 @@ $type = GETPOST('type', 'aZ09'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index ff5bdf390b3..de713bb137b 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -46,7 +46,7 @@ $type = GETPOST('type', 'aZ09'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortorder = GETPOST('sortorder', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 7f7e83b9502..0ac2ddfc701 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -51,7 +51,7 @@ $type = GETPOST('type', 'aZ09'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index 48d871f0b22..6bf465d1ea1 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -48,7 +48,7 @@ $type = GETPOST('type', 'aZ09'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index 68e5c098bcd..88d1f736422 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -43,7 +43,7 @@ $type = GETPOST('type', 'aZ09'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortorder = GETPOST('sortorder', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index b65e13561d7..bff81de3bda 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -55,7 +55,7 @@ $hookmanager->initHooks(array('recapcomptacard', 'globalcard')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 7c14e3e1d1b..c300817bfa4 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -57,7 +57,7 @@ $showaccountdetail = GETPOST('showaccountdetail', 'aZ09') ? GETPOST('showaccount $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 8c22eeed12d..c66056c47ca 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -50,7 +50,7 @@ $confirm = GETPOST('confirm', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 951faa2c2b8..1d107b9a555 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -78,7 +78,7 @@ $search_account = GETPOSTINT('search_account'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST("sortorder", 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index dd5a463ecd1..22bde6bf509 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -57,7 +57,7 @@ $optioncss = GETPOST('optioncss', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index ba9af57f4c5..f2670861833 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -51,7 +51,7 @@ $confirm = GETPOST('confirm', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index 52405d5e6ce..f67add4b840 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -50,7 +50,7 @@ if (!$year && $mode != 'tvaonly') { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 40d49e2404f..af06f40761f 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -95,7 +95,7 @@ $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'ro $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 9cf303b037e..fb761a5b541 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -52,7 +52,7 @@ $socid = !empty($object->thirdparty->id) ? $object->thirdparty->id : null; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index ede18370781..1a98fb921fa 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -56,7 +56,7 @@ if (!empty($canvas)) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 6ad1a75ad81..6ae0192bfe1 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -135,7 +135,7 @@ $begin = GETPOST('begin'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "ASC"; } diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 5c0506a94c7..848f1a088d7 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -66,7 +66,7 @@ $result = restrictedArea($user, 'contrat', $fieldvalue, '', '', '', $fieldtype); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index df1fe678317..6f19a21fa69 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -56,7 +56,7 @@ if ($user->socid > 0) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index f4ea37d3d53..28f6c49a9fb 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -39,7 +39,7 @@ $langs->loadLangs(array('products', 'companies', 'contracts')); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $statut = GETPOST('statut') ? GETPOST('statut') : 1; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 2b852c38ac6..455d801cb3e 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -111,7 +111,7 @@ $search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $se $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/contrat/messaging.php b/htdocs/contrat/messaging.php index edaeb02525b..f7e1b285291 100644 --- a/htdocs/contrat/messaging.php +++ b/htdocs/contrat/messaging.php @@ -59,7 +59,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ?GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 4f92114505d..928482bc1be 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -47,7 +47,7 @@ $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hier $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 11c2392f953..0f869a97ac0 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -56,7 +56,7 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'aZ09comma'); $sortorder = GETPOST("sortorder", 'aZ09comma'); - $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); + $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 1841254fe3d..02b795734af 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -58,7 +58,7 @@ if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); - $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); + $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 54b4400b333..c71fe088869 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -998,7 +998,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $optioncss = GETPOST('optioncss', 'alpha'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); - $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); + $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $search_status = GETPOSTINT("search_status"); if ($search_status == '') { diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index ede0da6bb76..cfaffb265a2 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -178,7 +178,7 @@ class pdf_standard extends ModelePDFMovement $search_type_mouvement = GETPOSTINT('search_type_mouvement'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; - $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); + $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); if (empty($page) || $page == -1) { diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index f3a87e0ad60..e1010ce2559 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -45,7 +45,7 @@ $id = GETPOSTINT('id'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/don/document.php b/htdocs/don/document.php index 1674eddd54e..4176ac74d7a 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -53,7 +53,7 @@ $projectid = (GETPOST('projectid') ? GETPOSTINT('projectid') : 0); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 9cba55f01d7..6a40d1bbe97 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -42,7 +42,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sc $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $type = GETPOST('type', 'aZ'); $mode = GETPOST('mode', 'alpha'); if (empty($page) || $page == -1) { diff --git a/htdocs/don/paiement/list.php b/htdocs/don/paiement/list.php index 70112d0b0f1..2762f271fa2 100644 --- a/htdocs/don/paiement/list.php +++ b/htdocs/don/paiement/list.php @@ -61,7 +61,7 @@ $search_sale = GETPOSTINT('search_sale'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $type = GETPOST('type', 'aZ'); $mode = GETPOST('mode', 'alpha'); if (empty($page) || $page == -1) { diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index 955e8116253..ad2b5b387c3 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -70,7 +70,7 @@ if ($module == 'ecm') { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index 7e2bdfe8c6d..7444815a11e 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -50,7 +50,7 @@ if (empty($module)) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index e8055639b9a..a2551c18932 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -49,7 +49,7 @@ if ($user->socid > 0) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/ecm/file_note.php b/htdocs/ecm/file_note.php index 5d247c992d8..580f8ab03dd 100644 --- a/htdocs/ecm/file_note.php +++ b/htdocs/ecm/file_note.php @@ -53,7 +53,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 08b3b74ada6..e0c191e8e23 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -48,7 +48,7 @@ $overwritefile = GETPOSTINT('overwritefile'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index a7560e312cb..0751cfd6f5d 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -49,7 +49,7 @@ $search_doc_ref = GETPOST('search_doc_ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/ecm/index_medias.php b/htdocs/ecm/index_medias.php index c5662a98835..8c888b6792a 100644 --- a/htdocs/ecm/index_medias.php +++ b/htdocs/ecm/index_medias.php @@ -56,7 +56,7 @@ $pageid = GETPOSTINT('pageid'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 33fa81665a3..202ea14afb7 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -62,7 +62,7 @@ $upload_dir = $conf->ecm->dir_output.'/'.$section; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index a82d6a419c2..16ab981af3b 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -56,7 +56,7 @@ $project_ref = GETPOST('project_ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index e648af10fb2..41caf186654 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -61,7 +61,7 @@ $projectref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index ae874c2fcd1..94145c852e1 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -69,7 +69,7 @@ $withProjectUrl=''; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index 1f1f33c6151..d34d4b0a72d 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -50,7 +50,7 @@ $ref = GETPOST('ref'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index ccfd824db35..c68cef6ebb6 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -76,7 +76,7 @@ $search_product_category = GETPOSTINT('search_product_category'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortfield) { $sortfield = "e.ref"; } diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index ea22fc857c0..c28c5251dc1 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -49,7 +49,7 @@ $childids = $user->getAllChildIds(1); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index d92721f6eb2..d1ed103e721 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -51,7 +51,7 @@ $result = restrictedArea($user, 'expensereport', '', ''); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/fichinter/agenda.php b/htdocs/fichinter/agenda.php index 9f49c3af6d2..ec91ebd4ae9 100644 --- a/htdocs/fichinter/agenda.php +++ b/htdocs/fichinter/agenda.php @@ -54,7 +54,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 8d4303b9e8d..bd1670c51e8 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -72,7 +72,7 @@ $result = restrictedArea($user, 'ficheinter', $id, $objecttype); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 11e719a8b42..5ec97fd1908 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -58,7 +58,7 @@ $result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 177f8117d88..ff5ca9fa367 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -85,7 +85,7 @@ $diroutputmassaction = $conf->ficheinter->dir_output.'/temp/massgeneration/'.$us $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index e50cfbc2633..56320809feb 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -51,7 +51,7 @@ $confirm = GETPOST('confirm', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index ab1f551519e..f23fc3c07bf 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -139,7 +139,7 @@ $diroutputmassaction = $conf->fournisseur->commande->dir_output.'/temp/massgener $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php index 6087d1bc00a..0be5b7bb135 100644 --- a/htdocs/fourn/contact.php +++ b/htdocs/fourn/contact.php @@ -44,7 +44,7 @@ if ($user->socid > 0) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index 4969b2b387f..d4581c706b3 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -58,7 +58,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'su $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); // Security check $id = (GETPOSTINT('facid') ? GETPOSTINT('facid') : GETPOSTINT('id')); diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 1aaccf4eb14..ea6fe3335d0 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -58,7 +58,7 @@ $hookmanager->initHooks(array('invoicesuppliercarddocument')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index 46c864aaa0c..ef7bb7bc175 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -99,7 +99,7 @@ $search_status = GETPOSTINT('search_status'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index dbceca56a4b..3426dd33313 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -118,7 +118,7 @@ $filter = GETPOST('filtre', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index 540ef560f3c..b407c489822 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -63,7 +63,7 @@ $result = restrictedArea($user, $object->element, $object->id, 'paiementfourn', $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 00d2e015751..5549f799ddd 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -49,7 +49,7 @@ $optioncss = GETPOST('optioncss', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index a3b8612c9de..0d3bf9a9496 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -57,7 +57,7 @@ $download_dir = $conf->ftp->dir_temp; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index e1cff740510..b2ed2279bbc 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -50,7 +50,7 @@ $sortorder = GETPOST('sortorder', 'aZ09comma'); $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $confirm = GETPOST('confirm', 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index e8469b8eb20..94c60cf964e 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -49,7 +49,7 @@ $confirm = GETPOST('confirm', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 63af2a22c65..fb9f7632250 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -69,7 +69,7 @@ $diroutputmassaction = $conf->holiday->dir_output.'/temp/massgeneration/'.$user- $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index a29801a4d52..f38ee1a7069 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -58,7 +58,7 @@ if (!$sortorder) { $sortorder = "ASC"; } -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 4d8e19e8526..3c0a8154dac 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -62,7 +62,7 @@ $search_new_solde = GETPOST('search_new_solde', 'alphanohtml'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index 0df72d8c37c..2d9ebbd1968 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -49,7 +49,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index ce32527702f..a65c659e867 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -61,7 +61,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/hrm/evaluation_document.php b/htdocs/hrm/evaluation_document.php index 12731eedf19..a83905abff9 100644 --- a/htdocs/hrm/evaluation_document.php +++ b/htdocs/hrm/evaluation_document.php @@ -50,7 +50,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index b34b6285ee4..861b25a1507 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -61,7 +61,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index 4b374757026..074f5e008f1 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -59,7 +59,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/hrm/job_document.php b/htdocs/hrm/job_document.php index 2c7e0887a35..2155f033088 100644 --- a/htdocs/hrm/job_document.php +++ b/htdocs/hrm/job_document.php @@ -48,7 +48,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 2049387eb1e..24686b42715 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -60,7 +60,7 @@ $id = GETPOSTINT('id'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index 3ecc73f3dc3..ae37771e4c2 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -61,7 +61,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/hrm/position_document.php b/htdocs/hrm/position_document.php index 35bb7e2ffb4..539a8405f4a 100644 --- a/htdocs/hrm/position_document.php +++ b/htdocs/hrm/position_document.php @@ -49,7 +49,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index bc7ff33f827..c72b7d2af20 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -60,7 +60,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index 743bb51e2e4..92fa94e9c4d 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -61,7 +61,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index 6aeafeb78a3..7ae07c6a26f 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -517,7 +517,7 @@ if ($action != "create" && $action != "edit") { $limit = 0; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); - $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); + $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/hrm/skill_document.php b/htdocs/hrm/skill_document.php index 7d7b1ace384..418208e0465 100644 --- a/htdocs/hrm/skill_document.php +++ b/htdocs/hrm/skill_document.php @@ -49,7 +49,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 1f392a16ff6..344e91be8dd 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -61,7 +61,7 @@ $id = GETPOSTINT('id'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 8c5e2e7fe02..3611ae2c51e 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -49,7 +49,7 @@ $diroutputmassaction = $conf->product->dir_output.'/temp/massgeneration/'.$user- $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index 56cd8d53062..77c814d60c9 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -57,7 +57,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/knowledgemanagement/knowledgerecord_document.php b/htdocs/knowledgemanagement/knowledgerecord_document.php index 80761fbef89..fa4d8f75ed7 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_document.php +++ b/htdocs/knowledgemanagement/knowledgerecord_document.php @@ -45,7 +45,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 2777bd5d92f..9e77ee2e30e 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -60,7 +60,7 @@ if (GETPOSTISSET('formfilteraction')) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 19b7c76bfaf..1b6f586bb58 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -50,7 +50,7 @@ $result = restrictedArea($user, 'loan', $id, '', ''); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index e4db0081d44..50f9b572833 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -46,7 +46,7 @@ $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hier $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 46fd62f5782..1113fe8ae4e 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -39,7 +39,7 @@ $mesg = ''; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index 598cb5610e7..730f5ea1479 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -43,7 +43,7 @@ $optioncss = GETPOST('optioncss', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 056b04d09ad..d377da14927 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -36,7 +36,7 @@ $langs->loadLangs(array('companies', 'bills', 'products', 'margins')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index b336a9a317d..be679953190 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -46,7 +46,7 @@ $mesg = ''; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index fda75f4081f..a921bebd8c2 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -46,7 +46,7 @@ $object = new Product($db); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 9ae75238423..6318eee1520 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -38,7 +38,7 @@ if (!empty($user->socid)) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index 0e5d807f720..c8f09b37a9b 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -46,7 +46,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index c06b3f0d517..535576c789c 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -56,7 +56,7 @@ $id = GETPOSTINT('id'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 1cc35db3789..e993190c45c 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -51,7 +51,7 @@ $search_status = GETPOST('search_status', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index e7b740e94a1..0f0fd217047 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -57,7 +57,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php index 87d8c18402d..3b9e46c9639 100644 --- a/htdocs/partnership/partnership_document.php +++ b/htdocs/partnership/partnership_document.php @@ -45,7 +45,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 2fcd215c197..ba50933b9ec 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -58,7 +58,7 @@ $memberid = GETPOSTINT('rowid'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index 5003be16077..81d18818a48 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -59,7 +59,7 @@ if ($user->socid) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 5ee7dac86cb..1435fa74b3a 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -65,7 +65,7 @@ $hookmanager->initHooks(array('productdocuments')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 1a0eb8a668f..f9aeb2f03ca 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -44,7 +44,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'in $backtopage = GETPOST('backtopage', 'alpha'); $listoffset = GETPOST('listoffset', 'alpha'); $limit = GETPOSTINT('limit') > 0 ? GETPOSTINT('limit') : $conf->liste_limit; -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 64ac82d10f1..8b57061e08e 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -49,7 +49,7 @@ $id = GETPOSTINT('id'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 5bbda11dc4d..b82db510d94 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -120,7 +120,7 @@ $diroutputmassaction = $conf->product->dir_output.'/temp/massgeneration/'.$user- $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index a116513c131..4cd1297d617 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -47,7 +47,7 @@ if (!empty($user->socid)) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 0c91c149e8f..a7ca019a763 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -52,7 +52,7 @@ $search_stock_physique = GETPOST('search_stock_physique', 'alpha'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 008ee43e68a..d78e47d5dfe 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -66,7 +66,7 @@ $search_stock_physique = GETPOST('search_stock_physique', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/product/stats/bom.php b/htdocs/product/stats/bom.php index ce698410b2e..b0257248690 100644 --- a/htdocs/product/stats/bom.php +++ b/htdocs/product/stats/bom.php @@ -53,7 +53,7 @@ $option = ''; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 4d3476f72d9..0e7f8c297b5 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -53,7 +53,7 @@ $hookmanager->initHooks(array('productstatsorder')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index b56374addb6..b71ab30826b 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -53,7 +53,7 @@ $mesg = ''; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 33828c5faf5..8223a333022 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -49,7 +49,7 @@ $hookmanager->initHooks(array('productstatscontract')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index cc81c4170b4..b0b5ba6ea89 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -61,7 +61,7 @@ $showmessage = GETPOST('showmessage'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 61a98993331..7f68d34490d 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -53,7 +53,7 @@ $hookmanager->initHooks(array('productstatssupplierinvoice')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stats/facturerec.php b/htdocs/product/stats/facturerec.php index b2a0ae85510..6ba186fb886 100644 --- a/htdocs/product/stats/facturerec.php +++ b/htdocs/product/stats/facturerec.php @@ -56,7 +56,7 @@ $showmessage = GETPOST('showmessage'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php index 6060a224a87..998ca70a3db 100644 --- a/htdocs/product/stats/mo.php +++ b/htdocs/product/stats/mo.php @@ -51,7 +51,7 @@ $hookmanager->initHooks(array('productstatsmo')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 578bf62d489..becd2350fdd 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -53,7 +53,7 @@ $hookmanager->initHooks(array('productstatspropal')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 34cec31dc40..704ec0457c4 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -52,7 +52,7 @@ $hookmanager->initHooks(array('productstatssupplierpropal')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index bc801ba1bb8..d41180191b7 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -63,7 +63,7 @@ if (isModEnabled('category')) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index 24ba968be41..88b51aa78ab 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -64,7 +64,7 @@ $idline = GETPOST('idline'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index 403b9984d34..5eb441f835e 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -75,7 +75,7 @@ $search_qty = trim(GETPOST("search_qty", 'alpha')); $search_type_mouvement = GETPOSTINT('search_type_mouvement'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); if (empty($page) || $page == -1) { diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index f053f3d06fa..969b058cf81 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -95,7 +95,7 @@ $type = GETPOSTINT("type"); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 9bd760e8e3b..3adc9370df5 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -63,7 +63,7 @@ $hookmanager->initHooks(array('productlotdocuments')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 3e2b4e3fddf..0b61dffa99d 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -56,7 +56,7 @@ $search_import_key = GETPOSTINT('search_import_key'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 1adc5d07f47..ee51a45c4d5 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -89,7 +89,7 @@ $texte = ''; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php index ed87bea7254..86573d63deb 100644 --- a/htdocs/product/stock/replenishorders.php +++ b/htdocs/product/stock/replenishorders.php @@ -45,7 +45,7 @@ $sref = GETPOST('search_ref', 'alpha'); $snom = GETPOST('search_nom', 'alpha'); $suser = GETPOST('search_user', 'alpha'); $sttc = GETPOST('search_ttc', 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $search_product = GETPOSTINT('search_product'); $search_dateyear = GETPOSTINT('search_dateyear'); $search_datemonth = GETPOSTINT('search_datemonth'); diff --git a/htdocs/product/stock/stats/commande_fournisseur.php b/htdocs/product/stock/stats/commande_fournisseur.php index 1603a1c1b23..2d77dc86512 100644 --- a/htdocs/product/stock/stats/commande_fournisseur.php +++ b/htdocs/product/stock/stats/commande_fournisseur.php @@ -59,7 +59,7 @@ $showmessage = GETPOST('showmessage'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stock/stats/expedition.php b/htdocs/product/stock/stats/expedition.php index 9569c9e5794..75be59f5d18 100644 --- a/htdocs/product/stock/stats/expedition.php +++ b/htdocs/product/stock/stats/expedition.php @@ -59,7 +59,7 @@ $showmessage = GETPOST('showmessage'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stock/stats/mo.php b/htdocs/product/stock/stats/mo.php index bbf7aeeb62e..174dea1507c 100644 --- a/htdocs/product/stock/stats/mo.php +++ b/htdocs/product/stock/stats/mo.php @@ -52,7 +52,7 @@ $hookmanager->initHooks(array('batchproductstatsmo')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stock/stats/reception.php b/htdocs/product/stock/stats/reception.php index 2f088e1cb2f..26e6455ad32 100644 --- a/htdocs/product/stock/stats/reception.php +++ b/htdocs/product/stock/stats/reception.php @@ -59,7 +59,7 @@ $showmessage = GETPOST('showmessage'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index e6d2f5a6757..6b39de66295 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -85,7 +85,7 @@ foreach ($search_fk_warehouse as $key => $val) { $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php index c1daca5153f..9f328000513 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php @@ -55,7 +55,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_document.php b/htdocs/product/stock/stocktransfer/stocktransfer_document.php index 06b2be4f50a..7e851677dc1 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_document.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_document.php @@ -44,7 +44,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_list.php b/htdocs/product/stock/stocktransfer/stocktransfer_list.php index 3e9c5adc0c1..864a9957c7f 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_list.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_list.php @@ -51,7 +51,7 @@ $id = GETPOSTINT('id'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/projet/agenda.php b/htdocs/projet/agenda.php index 3a07093cae1..d06cde2a04b 100644 --- a/htdocs/projet/agenda.php +++ b/htdocs/projet/agenda.php @@ -41,7 +41,7 @@ $contextpage = GETPOST('contextpage', 'aZ09'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", "aZ09comma"); $sortorder = GETPOST("sortorder", 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $page = is_numeric($page) ? $page : 0; $page = $page == -1 ? 0 : $page; if (!$sortfield) { diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 4e06ca01148..04463dc292f 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -78,7 +78,7 @@ $diroutputmassaction = $conf->project->dir_output.'/temp/massgeneration/'.$user- $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/projet/messaging.php b/htdocs/projet/messaging.php index 50555e99995..ea2ff3e7a89 100644 --- a/htdocs/projet/messaging.php +++ b/htdocs/projet/messaging.php @@ -41,7 +41,7 @@ $contextpage = GETPOST('contextpage', 'aZ09'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", "aZ09comma"); $sortorder = GETPOST("sortorder", 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $page = is_numeric($page) ? $page : 0; $page = $page == -1 ? 0 : $page; if (!$sortfield) { diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index d8c6ca3b391..4ae290dcf7a 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -57,7 +57,7 @@ $taskref = GETPOST('taskref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 33d0ec29877..207f331d327 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -49,7 +49,7 @@ $project_ref = GETPOST('project_ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index cf3f3dc1405..e47933d0efe 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -128,7 +128,7 @@ $diroutputmassaction = $conf->project->dir_output.'/tasks/temp/massgeneration/'. $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 85b372e248b..d4a18ca5fcc 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -96,7 +96,7 @@ $search_timespent_endmin = GETPOSTINT("search_timespent_duration_endmin"); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index a39d3670b03..1401d22b82a 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -87,7 +87,7 @@ function llxFooterVierge() $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/public/opensurvey/index.php b/htdocs/public/opensurvey/index.php index 64b8bd5a2c3..ef274a9efe5 100644 --- a/htdocs/public/opensurvey/index.php +++ b/htdocs/public/opensurvey/index.php @@ -56,7 +56,7 @@ $suffix = ""; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters diff --git a/htdocs/public/recruitment/index.php b/htdocs/public/recruitment/index.php index 753cf09eb1c..070e489af48 100644 --- a/htdocs/public/recruitment/index.php +++ b/htdocs/public/recruitment/index.php @@ -57,7 +57,7 @@ $suffix = ""; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index d1e4e142a1c..f257972f69c 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -326,7 +326,7 @@ if ($action == "view_ticketlist") { $limit = $conf->liste_limit; - $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); + $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/reception/document.php b/htdocs/reception/document.php index d834589f628..36d9a6efb15 100644 --- a/htdocs/reception/document.php +++ b/htdocs/reception/document.php @@ -52,7 +52,7 @@ $ref = GETPOST('ref'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 9f33c9caea4..347ed2c756a 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -82,7 +82,7 @@ $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alph $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortfield) { $sortfield = "e.ref"; } diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index 19d341267ca..a8339a0ca7b 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -57,7 +57,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php index 29aa3de893c..741e0107a45 100644 --- a/htdocs/recruitment/recruitmentcandidature_document.php +++ b/htdocs/recruitment/recruitmentcandidature_document.php @@ -44,7 +44,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 16aa9af1985..53f3ee74511 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -53,7 +53,7 @@ $lineid = GETPOSTINT('lineid'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index 2440f0f343d..665f26bc75d 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -56,7 +56,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php index 045c64f0dd2..11e4fe7bb62 100644 --- a/htdocs/recruitment/recruitmentjobposition_document.php +++ b/htdocs/recruitment/recruitmentjobposition_document.php @@ -44,7 +44,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 396fa2a780b..b1e24a0fc52 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -49,7 +49,7 @@ $id = GETPOSTINT('id'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php index fa3c2d8a98a..61c17c3a66c 100644 --- a/htdocs/resource/agenda.php +++ b/htdocs/resource/agenda.php @@ -61,7 +61,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php index 790ccf85be0..9bf219dfcec 100644 --- a/htdocs/resource/document.php +++ b/htdocs/resource/document.php @@ -55,7 +55,7 @@ $result = restrictedArea($user, 'resource', $id, 'resource'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 4ada45bd358..585d643bd26 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -78,7 +78,7 @@ if (empty($arch)) { } $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index f3d73ad78f2..89f6ee1b1f9 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -56,7 +56,7 @@ $projectid = (GETPOSTINT('projectid') ? GETPOSTINT('projectid') : GETPOSTINT('fk $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 4a0f9bc0552..0c7dea4f3c9 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -51,7 +51,7 @@ $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hier $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index 2b77863cb04..b9f93125294 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -52,7 +52,7 @@ $mode = GETPOST('mode', 'alpha'); // mode view for result $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index eab5c459f87..5acb9e4f050 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -55,7 +55,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 155eab9e0c5..df441063a51 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -155,7 +155,7 @@ $diroutputmassaction = $conf->societe->dir_output.'/temp/massgeneration/'.$user- $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "ASC"; } diff --git a/htdocs/societe/messaging.php b/htdocs/societe/messaging.php index b3846293463..50ff1d6b7d7 100644 --- a/htdocs/societe/messaging.php +++ b/htdocs/societe/messaging.php @@ -55,7 +55,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index e5dd3f08b31..d2bad348b37 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -48,7 +48,7 @@ $result = restrictedArea($user, 'societe', '', ''); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "DESC"; } diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 3e7302ca93f..31d8f9cec31 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -265,7 +265,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; - $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); + $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 3dc6e26dee1..4411b7a1c37 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -46,7 +46,7 @@ $massaction = GETPOST('massaction', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "ASC"; } diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 69e77953a77..1557332ec18 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -57,7 +57,7 @@ $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hier $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 4c279dd09e9..947fccafdb3 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -45,7 +45,7 @@ $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $rowid = GETPOST("rowid", 'alpha'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php index c476f27b52d..0abc7a5063d 100644 --- a/htdocs/stripe/payout.php +++ b/htdocs/stripe/payout.php @@ -45,7 +45,7 @@ $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $rowid = GETPOST("rowid", 'alpha'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index d44f54631a2..bdca6980414 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -45,7 +45,7 @@ $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $rowid = GETPOST("rowid", 'alpha'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index ee8a3e2a0b7..650d89ffdc5 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -55,7 +55,7 @@ $result = restrictedArea($user, 'supplier_proposal', $id); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 178e55fb4b3..eaa09a1b157 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -109,7 +109,7 @@ $optioncss = GETPOST('optioncss', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index ee55271a55d..74cb95e87d5 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -52,7 +52,7 @@ $url_page_current = DOL_URL_ROOT.'/ticket/agenda.php'; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $page = is_numeric($page) ? $page : 0; $page = $page == -1 ? 0 : $page; if (!$sortfield) { diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index 0d690214cc8..12ec2a2d953 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -56,7 +56,7 @@ $url_page_current = DOL_URL_ROOT.'/ticket/document.php'; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 5370e41ef85..a5ea8eaf13b 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -75,7 +75,7 @@ $search_dateclose_end = dol_mktime(23, 59, 59, GETPOSTINT('search_dateclose_endm $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index f8afb48b125..98fb7551fe1 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -52,7 +52,7 @@ $url_page_current = DOL_URL_ROOT.'/ticket/messaging.php'; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", "aZ09comma"); $sortorder = GETPOST("sortorder", 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $page = is_numeric($page) ? $page : 0; $page = $page == -1 ? 0 : $page; if (!$sortfield) { diff --git a/htdocs/user/agenda.php b/htdocs/user/agenda.php index 65aa9624f1b..a9887cc577c 100644 --- a/htdocs/user/agenda.php +++ b/htdocs/user/agenda.php @@ -55,7 +55,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/user/document.php b/htdocs/user/document.php index a4198526658..1c1f0895d46 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -85,7 +85,7 @@ if ($user->id != $id && !$canreaduser) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 78fc1c83d99..f491bdad587 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -51,7 +51,7 @@ $search = array(); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index 57e34004faa..e5861cf00bc 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -48,7 +48,7 @@ if (empty($mode)) { $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $search_statut = GETPOSTINT('search_statut'); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 307d68b8d79..b74db885f69 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -57,7 +57,7 @@ if ($user->socid > 0) { $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/user/messaging.php b/htdocs/user/messaging.php index 5ea25929406..d9db450b985 100644 --- a/htdocs/user/messaging.php +++ b/htdocs/user/messaging.php @@ -56,7 +56,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 5e90d52f0b2..dce0a64db09 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -48,7 +48,7 @@ $actionid = GETPOSTINT('actionid'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "DESC"; } diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index 2797c305cc4..3fd8e4b3b4c 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -47,7 +47,7 @@ $id = GETPOSTINT('id'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index 83deb784f41..d1c307ba730 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -57,7 +57,7 @@ $id = GETPOSTINT('id'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 43f3e2e9686..92c1f56adad 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -145,7 +145,7 @@ if (GETPOST('refreshsite') || GETPOST('refreshsite_x') || GETPOST('refreshsite.x $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index c5c998aef4f..cf25d186ae8 100644 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -59,7 +59,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php index 2c5f77c6173..e1b891da1ce 100644 --- a/htdocs/workstation/workstation_document.php +++ b/htdocs/workstation/workstation_document.php @@ -47,7 +47,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index 6f78f3ab4b3..3ee747367d9 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -54,7 +54,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; From 4f3a6d1959c0bdfb67b2728f5e0c0036364bbbfe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Mar 2024 01:58:06 +0100 Subject: [PATCH 0336/1862] Removed false positive --- dev/tools/phan/config_extended.php | 1 + dev/tools/phan/config_fixer.php | 1 + 2 files changed, 2 insertions(+) diff --git a/dev/tools/phan/config_extended.php b/dev/tools/phan/config_extended.php index 01e34d0a727..ad7f49b2755 100644 --- a/dev/tools/phan/config_extended.php +++ b/dev/tools/phan/config_extended.php @@ -341,6 +341,7 @@ return [ 'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences 'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences 'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences + 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences 'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences 'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning diff --git a/dev/tools/phan/config_fixer.php b/dev/tools/phan/config_fixer.php index 97b421ac07e..3a923aab530 100644 --- a/dev/tools/phan/config_fixer.php +++ b/dev/tools/phan/config_fixer.php @@ -188,6 +188,7 @@ return [ 'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences 'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences 'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences + 'PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences 'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences 'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning From 255af0fb3320b0f004219cab9ead3dfba1d3d60d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 1 Mar 2024 12:37:56 +0100 Subject: [PATCH 0337/1862] feat: add price label UI #28544 --- htdocs/product/class/product.class.php | 20 ++++++- .../class/productcustomerprice.class.php | 23 ++++++++ htdocs/product/price.php | 55 ++++++++++++++++++- 3 files changed, 92 insertions(+), 6 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 1cfc859b2b9..0cd4a63b0f6 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -178,6 +178,7 @@ class Product extends CommonObject * @var string */ public $price_base_type; + public $price_label; //! Arrays for multiprices public $multiprices = array(); @@ -674,6 +675,7 @@ class Product extends CommonObject $this->price = (float) price2num($this->price); $this->price_min_ttc = (float) price2num($this->price_min_ttc); $this->price_min = (float) price2num($this->price_min); + $this->price_label = trim($this->price_label); if (empty($this->tva_tx)) { $this->tva_tx = 0; } @@ -816,6 +818,7 @@ class Product extends CommonObject $sql .= ", price"; $sql .= ", price_ttc"; $sql .= ", price_base_type"; + $sql .= ", price_label"; $sql .= ", tobuy"; $sql .= ", tosell"; if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { @@ -843,6 +846,7 @@ class Product extends CommonObject $sql .= ", ".(!empty($this->label) ? "'".$this->db->escape($this->label)."'" : "null"); $sql .= ", ".((int) $user->id); $sql .= ", ".((int) $this->type); + $sql .= ", ".(!empty($this->price_label) ? "'".$this->db->escape($this->price_label)."'" : "null"); $sql .= ", ".price2num($price_ht, 'MT'); $sql .= ", ".price2num($price_ttc, 'MT'); $sql .= ", '".$this->db->escape($this->price_base_type)."'"; @@ -1954,9 +1958,9 @@ class Product extends CommonObject } // Add new price - $sql = "INSERT INTO ".$this->db->prefix()."product_price(price_level,date_price, fk_product, fk_user_author, price, price_ttc, price_base_type,tosell, tva_tx, default_vat_code, recuperableonly,"; + $sql = "INSERT INTO ".$this->db->prefix()."product_price(price_level,date_price, fk_product, fk_user_author, price_label, price, price_ttc, price_base_type,tosell, tva_tx, default_vat_code, recuperableonly,"; $sql .= " localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, price_min,price_min_ttc,price_by_qty,entity,fk_price_expression) "; - $sql .= " VALUES(".($level ? ((int) $level) : 1).", '".$this->db->idate($now)."', ".((int) $this->id).", ".((int) $user->id).", ".((float) price2num($this->price)).", ".((float) price2num($this->price_ttc)).",'".$this->db->escape($this->price_base_type)."',".((int) $this->status).", ".((float) price2num($this->tva_tx)).", ".($this->default_vat_code ? ("'".$this->db->escape($this->default_vat_code)."'") : "null").", ".((int) $this->tva_npr).","; + $sql .= " VALUES(".($level ? ((int) $level) : 1).", '".$this->db->idate($now)."', ".((int) $this->id).", ".((int) $user->id).", ".(empty($this->price_label)?"null":"'".$this->db->escape($this->price_label)."'").", ".((float) price2num($this->price)).", ".((float) price2num($this->price_ttc)).",'".$this->db->escape($this->price_base_type)."',".((int) $this->status).", ".((float) price2num($this->tva_tx)).", ".($this->default_vat_code ? ("'".$this->db->escape($this->default_vat_code)."'") : "null").", ".((int) $this->tva_npr).","; $sql .= " ".price2num($this->localtax1_tx).", ".price2num($this->localtax2_tx).", '".$this->db->escape($this->localtax1_type)."', '".$this->db->escape($this->localtax2_type)."', ".price2num($this->price_min).", ".price2num($this->price_min_ttc).", ".price2num($this->price_by_qty).", ".((int) $conf->entity).",".($this->fk_price_expression > 0 ? ((int) $this->fk_price_expression) : 'null'); $sql .= ")"; @@ -2301,10 +2305,11 @@ class Product extends CommonObject * @param int $ignore_autogen Used to avoid infinite loops * @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 string $price_label Price Label * @param int $notrigger Disable triggers * @return int Return integer <0 if KO, >0 if OK */ - public function updatePrice($newprice, $newpricebase, $user, $newvat = '', $newminprice = 0, $level = 0, $newnpr = 0, $newpbq = 0, $ignore_autogen = 0, $localtaxes_array = array(), $newdefaultvatcode = '', $notrigger = 0) + public function updatePrice($newprice, $newpricebase, $user, $newvat = '', $newminprice = 0, $level = 0, $newnpr = 0, $newpbq = 0, $ignore_autogen = 0, $localtaxes_array = array(), $newdefaultvatcode = '', $price_label = '', $notrigger = 0) { global $conf, $langs; @@ -2431,6 +2436,7 @@ class Product extends CommonObject $sql .= " localtax1_type = ".($localtaxtype1 != '' ? "'".$this->db->escape($localtaxtype1)."'" : "'0'").","; $sql .= " localtax2_type = ".($localtaxtype2 != '' ? "'".$this->db->escape($localtaxtype2)."'" : "'0'").","; $sql .= " default_vat_code = ".($newdefaultvatcode ? "'".$this->db->escape($newdefaultvatcode)."'" : "null").","; + $sql .= " price_label = ".(!empty($price_label) ? "'".$this->db->escape($price_label)."'" : "null").","; $sql .= " tva_tx = ".(float) price2num($newvat).","; $sql .= " recuperableonly = '".$this->db->escape($newnpr)."'"; $sql .= " WHERE rowid = ".((int) $id); @@ -2448,6 +2454,7 @@ class Product extends CommonObject $this->multiprices_recuperableonly[$level] = $newnpr; $this->price = $price; + $this->price_label = $price_label; $this->price_ttc = $price_ttc; $this->price_min = $price_min; $this->price_min_ttc = $price_min_ttc; @@ -2455,6 +2462,7 @@ class Product extends CommonObject $this->default_vat_code = $newdefaultvatcode; $this->tva_tx = $newvat; $this->tva_npr = $newnpr; + //Local taxes $this->localtax1_tx = $localtax1; $this->localtax2_tx = $localtax2; @@ -2572,6 +2580,7 @@ class Product extends CommonObject } $sql .= " p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.sell_or_eat_by_mandatory, p.batch_mask, p.fk_unit,"; $sql .= " p.fk_price_expression, p.price_autogen, p.model_pdf,"; + $sql .= " p.price_label,"; if ($separatedStock) { $sql .= " SUM(sp.reel) as stock"; } else { @@ -2615,6 +2624,7 @@ class Product extends CommonObject } $sql .= " p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.sell_or_eat_by_mandatory, p.batch_mask, p.fk_unit,"; $sql .= " p.fk_price_expression, p.price_autogen, p.model_pdf"; + $sql .= " ,p.price_label"; if (!$separatedStock) { $sql .= ", p.stock"; } @@ -2638,6 +2648,7 @@ class Product extends CommonObject $this->note = $obj->note_private; // deprecated $this->type = $obj->fk_product_type; + $this->price_label = $obj->price_label; $this->status = $obj->tosell; $this->status_buy = $obj->tobuy; $this->status_batch = $obj->tobatch; @@ -2734,6 +2745,7 @@ class Product extends CommonObject for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { $sql = "SELECT price, price_ttc, price_min, price_min_ttc,"; $sql .= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid, recuperableonly"; + $sql .= " ,price_label"; $sql .= " FROM ".$this->db->prefix()."product_price"; $sql .= " WHERE entity IN (".getEntity('productprice').")"; $sql .= " AND price_level=".((int) $i); @@ -4802,6 +4814,7 @@ class Product extends CommonObject $sql .= ", price_min"; $sql .= ", price_min_ttc"; $sql .= ", price_base_type"; + $sql .= ", price_label"; $sql .= ", default_vat_code"; $sql .= ", tva_tx"; $sql .= ", recuperableonly"; @@ -4829,6 +4842,7 @@ class Product extends CommonObject $sql .= ", price_min"; $sql .= ", price_min_ttc"; $sql .= ", price_base_type"; + $sql .= ", price_label"; $sql .= ", default_vat_code"; $sql .= ", tva_tx"; $sql .= ", recuperableonly"; diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 2c63a76b059..025e7c9ca8e 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -42,6 +42,7 @@ class ProductCustomerPrice extends CommonObject 'price_ttc' => array('type' => 'decimal(20,6)', 'label' => 'TTC', 'enabled' => 1, 'visible' => 1, 'position' => 8, 'notnull' => -1, 'comment' => 'Price TTC'), 'price_min' => array('type' => 'decimal(20,6)', 'label' => 'MinPriceHT', 'enabled' => 1, 'visible' => 1, 'position' => 9, 'notnull' => -1, 'comment' => 'Minimum Price'), 'price_min_ttc' => array('type' => 'decimal(20,6)', 'label' => 'MinPriceTTC', 'enabled' => 1, 'visible' => 1, 'position' => 10, 'notnull' => -1, 'comment' => 'Minimum Price TTC'), + 'price_label' => array('type' => 'varchar(255)', 'label' => 'PriceLabel', 'enabled' => 1, 'visible' => 1, 'position' => 20, 'notnull' => -1, 'comment' => 'Price Label'), 'fk_user' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>1, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax100'), ); @@ -89,6 +90,7 @@ class ProductCustomerPrice extends CommonObject public $localtax1_tx; public $localtax2_type; public $localtax2_tx; + public $price_label; /** * @var int User ID @@ -168,6 +170,9 @@ class ProductCustomerPrice extends CommonObject if (isset($this->fk_user)) { $this->fk_user = (int) $this->fk_user; } + if (isset($this->price_label)) { + $this->price_label = trim($this->price_label); + } if (isset($this->import_key)) { $this->import_key = trim($this->import_key); } @@ -226,6 +231,7 @@ class ProductCustomerPrice extends CommonObject $sql .= "localtax2_type,"; $sql .= "localtax2_tx,"; $sql .= "fk_user,"; + $sql .= "price_label,"; $sql .= "import_key"; $sql .= ") VALUES ("; $sql .= " ".((int) $conf->entity).","; @@ -246,6 +252,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " ".(empty($this->localtax2_type) ? "'0'" : "'".$this->db->escape($this->localtax2_type)."'").","; $sql .= " ".(!isset($this->localtax2_tx) ? 'NULL' : (empty($this->localtax2_tx) ? 0 : $this->localtax2_tx)).","; $sql .= " ".((int) $user->id).","; + $sql .= " ".(!isset($this->price_label) ? 'NULL' : "'".$this->db->escape($this->price_label)."'").","; $sql .= " ".(!isset($this->import_key) ? 'NULL' : "'".$this->db->escape($this->import_key)."'"); $sql .= ")"; @@ -319,6 +326,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " t.localtax1_tx,"; $sql .= " t.localtax2_tx,"; $sql .= " t.fk_user,"; + $sql .= " t.price_label,"; $sql .= " t.import_key"; $sql .= " FROM ".$this->db->prefix()."product_customer_price as t"; $sql .= " WHERE t.rowid = ".((int) $id); @@ -348,6 +356,7 @@ class ProductCustomerPrice extends CommonObject $this->localtax1_tx = $obj->localtax1_tx; $this->localtax2_tx = $obj->localtax2_tx; $this->fk_user = $obj->fk_user; + $this->price_label = $obj->price_label; $this->import_key = $obj->import_key; $this->db->free($resql); @@ -405,6 +414,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " t.localtax1_type,"; $sql .= " t.localtax2_type,"; $sql .= " t.fk_user,"; + $sql .= " t.price_label,"; $sql .= " t.import_key,"; $sql .= " soc.nom as socname,"; $sql .= " prod.ref as prodref"; @@ -467,6 +477,7 @@ class ProductCustomerPrice extends CommonObject $line->localtax1_type = $obj->localtax1_type; $line->localtax2_type = $obj->localtax2_type; $line->fk_user = $obj->fk_user; + $line->price_label = $obj->price_label; $line->import_key = $obj->import_key; $line->socname = $obj->socname; $line->prodref = $obj->prodref; @@ -519,6 +530,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " t.localtax1_tx,"; $sql .= " t.localtax2_tx,"; $sql .= " t.fk_user,"; + $sql .= " t.price_label,"; $sql .= " t.import_key,"; $sql .= " soc.nom as socname,"; $sql .= " prod.ref as prodref"; @@ -574,6 +586,7 @@ class ProductCustomerPrice extends CommonObject $line->localtax1_tx = $obj->localtax1_tx; $line->localtax2_tx = $obj->localtax2_tx; $line->fk_user = $obj->fk_user; + $line->price_label = $obj->price_label; $line->import_key = $obj->import_key; $line->socname = $obj->socname; $line->prodref = $obj->prodref; @@ -646,6 +659,9 @@ class ProductCustomerPrice extends CommonObject if (isset($this->fk_user)) { $this->fk_user = (int) $this->fk_user; } + if (isset($this->price_label)) { + $this->price_label = trim($this->price_label); + } if (isset($this->import_key)) { $this->import_key = trim($this->import_key); } @@ -706,6 +722,7 @@ class ProductCustomerPrice extends CommonObject $sql .= "localtax1_type,"; $sql .= "localtax2_type,"; $sql .= "fk_user,"; + $sql .= "price_label,"; $sql .= "import_key"; $sql .= ") "; @@ -729,6 +746,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " t.localtax1_type,"; $sql .= " t.localtax2_type,"; $sql .= " t.fk_user,"; + $sql .= " t.price_label,"; $sql .= " t.import_key"; $sql .= " FROM ".$this->db->prefix()."product_customer_price as t"; @@ -764,6 +782,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " localtax1_type=".(!empty($this->localtax1_type) ? "'".$this->db->escape($this->localtax1_type)."'" : "'0'").","; $sql .= " localtax2_type=".(!empty($this->localtax2_type) ? "'".$this->db->escape($this->localtax2_type)."'" : "'0'").","; $sql .= " fk_user=".$user->id.","; + $sql .= " price_label=".(isset($this->price_label) ? "'".$this->db->escape($this->price_label)."'" : "null").","; $sql .= " import_key=".(isset($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null"); $sql .= " WHERE rowid=".((int) $this->id); @@ -860,6 +879,7 @@ class ProductCustomerPrice extends CommonObject $prodsocpriceupd->price_base_type = $this->price_base_type; $prodsocpriceupd->tva_tx = $this->tva_tx; $prodsocpriceupd->recuperableonly = $this->recuperableonly; + $prodsocpriceupd->price_label = $this->price_label; $resultupd = $prodsocpriceupd->update($user, 0, $forceupdateaffiliate); if ($resultupd < 0) { @@ -878,6 +898,7 @@ class ProductCustomerPrice extends CommonObject $prodsocpricenew->price_base_type = $this->price_base_type; $prodsocpricenew->tva_tx = $this->tva_tx; $prodsocpricenew->recuperableonly = $this->recuperableonly; + $prodsocpricenew->price_label = $this->price_label; $resultupd = $prodsocpricenew->create($user, 0, $forceupdateaffiliate); if ($resultupd < 0) { @@ -1023,6 +1044,7 @@ class ProductCustomerPrice extends CommonObject $this->localtax1_tx = ''; $this->localtax2_tx = ''; $this->fk_user = 0; + $this->price_label = ''; $this->import_key = ''; } } @@ -1075,6 +1097,7 @@ class PriceByCustomerLine * @var int User ID */ public $fk_user; + public $price_label; public $import_key; public $socname; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index ee636b4efcb..e915e3aa46a 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -123,6 +123,8 @@ if (empty($reshook)) { if (($action == 'update_vat') && !$cancel && ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer'))) { $tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)' + $price_label = GETPOST('price_label', 'alpha'); + // We must define tva_tx, npr and local taxes $tva_tx = $tva_tx_txt; $reg = array(); @@ -190,6 +192,7 @@ if (empty($reshook)) { $object->localtax2_tx = $localtax2; $object->localtax1_type = $localtax1_type; $object->localtax2_type = $localtax2_type; + $object->price_label = $price_label; $db->begin(); @@ -216,7 +219,7 @@ if (empty($reshook)) { //$localtaxarray=array('0'=>$localtax1_type,'1'=>$localtax1,'2'=>$localtax2_type,'3'=>$localtax2); $localtaxarray = array(); // We do not store localtaxes into product, we will use instead the "vat code" to retrieve them. $level = $i; - $ret = $object->updatePrice($oldprice, $oldpricebasetype, $user, $tva_tx, $oldminprice, $level, $oldnpr, 0, 0, $localtaxarray, $vatratecode); + $ret = $object->updatePrice($oldprice, $oldpricebasetype, $user, $tva_tx, $oldminprice, $level, $oldnpr, 0, 0, $localtaxarray, $vatratecode, $price_label); if ($ret < 0) { $error++; @@ -238,7 +241,7 @@ if (empty($reshook)) { //$localtaxarray=array('0'=>$localtax1_type,'1'=>$localtax1,'2'=>$localtax2_type,'3'=>$localtax2); $localtaxarray = array(); // We do not store localtaxes into product, we will use instead the "vat code" to retrieve them when required. $level = 0; - $ret = $object->updatePrice($oldprice, $oldpricebasetype, $user, $tva_tx, $oldminprice, $level, $oldnpr, 0, 0, $localtaxarray, $vatratecode); + $ret = $object->updatePrice($oldprice, $oldpricebasetype, $user, $tva_tx, $oldminprice, $level, $oldnpr, 0, 0, $localtaxarray, $vatratecode, $price_label); if ($ret < 0) { $error++; @@ -382,6 +385,7 @@ if (empty($reshook)) { $newprice_min = price2num(GETPOST('price_min', 'alpha'), '', 2); $newpricebase = GETPOST('price_base_type', 'alpha'); $tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)' + $price_label = GETPOST('price_label', 'alpha'); $tva_tx = $tva_tx_txt; $vatratecode = ''; @@ -447,6 +451,7 @@ if (empty($reshook)) { $pricestoupdate[0] = array( 'price' => $newprice, + 'price_label' => $price_label, 'price_min' => $newprice_min, 'price_base_type' => $newpricebase, 'default_vat_code' => $vatratecode, @@ -478,7 +483,7 @@ if (empty($reshook)) { // If price has changed, we update it if (!array_key_exists($key, $object->multiprices) || $object->multiprices[$key] != $newprice || $object->multiprices_min[$key] != $newprice_min || $object->multiprices_base_type[$key] != $val['price_base_type'] || $object->multiprices_tva_tx[$key] != $newvattx) { - $res = $object->updatePrice($newprice, $val['price_base_type'], $user, $val['vat_tx'], $newprice_min, $key, $val['npr'], $psq, 0, $val['localtaxes_array'], $val['default_vat_code']); + $res = $object->updatePrice($newprice, $val['price_base_type'], $user, $val['vat_tx'], $newprice_min, $key, $val['npr'], $psq, 0, $val['localtaxes_array'], $val['default_vat_code'], $val['price_label']); } else { $res = 0; } @@ -638,6 +643,7 @@ if (empty($reshook)) { $prodcustprice->price = price2num(GETPOST("price"), 'MU'); $prodcustprice->price_min = price2num(GETPOST("price_min"), 'MU'); $prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha'); + $prodcustprice->price_label = GETPOST("price_label", 'alpha'); $tva_tx_txt = GETPOST("tva_tx", 'alpha'); @@ -761,6 +767,7 @@ if (empty($reshook)) { $prodcustprice->price = price2num(GETPOST("price"), 'MU'); $prodcustprice->price_min = price2num(GETPOST("price_min"), 'MU'); $prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha'); + $prodcustprice->price_label = GETPOST("price_label", 'alpha'); $tva_tx_txt = GETPOST("tva_tx"); @@ -1234,7 +1241,11 @@ if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUS print ' - ' . price($object->price_min_ttc).' '.$langs->trans('TTC') . ''; } } + print ''; + // Price Label + print ''; // Price by quantity @@ -1521,6 +1532,14 @@ if ($action == 'edit_price' && $object->getRights()->creer) { print ''; print ''; + // Price Label + print ''; + print ''; + $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -1661,6 +1680,7 @@ if ((!getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || $action == 'showlog_defau $sql = "SELECT p.rowid, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.default_vat_code, p.recuperableonly, p.localtax1_tx, p.localtax1_type, p.localtax2_tx, p.localtax2_type,"; $sql .= " p.price_level, p.price_min, p.price_min_ttc,p.price_by_qty,"; $sql .= " p.date_price as dp, p.fk_price_expression, u.rowid as user_id, u.login"; + $sql .= " ,p.price_label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_price as p,"; $sql .= " ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE fk_product = ".((int) $object->id); @@ -1867,6 +1887,11 @@ if ((!getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || $action == 'showlog_defau } print ''; + // Price Label + print ''; + // User print ''; + // Action if ($user->hasRight('produit', 'supprimer')) { $candelete = 0; @@ -2012,6 +2038,14 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { } print ''; + // Price Label + print ''; + print ''; + print '
'; - $arrayvisibility = array('private'=>$langs->trans("Private"), 'all'=>$langs->trans("Everybody")); + $arrayvisibility = array('private' => $langs->trans("Private"), 'all' => $langs->trans("Everybody")); print $form->selectarray('visibility', $arrayvisibility, 'private'); print ''; @@ -1876,7 +1877,7 @@ if ($step == 5 && $datatoimport) { //dol_syslog("line ".$sourcelinenb.' - '.$nboflines.' - '.$excludefirstline.' - '.$endatlinenb); $arrayrecord = $obj->import_read_record(); if ($arrayrecord === false) { - $arrayofwarnings[$sourcelinenb][0] = array('lib'=>'File has '.$nboflines.' lines. However we reach the end of file or an empty line at record '.$sourcelinenb.'. This may occurs when some records are split onto several lines and not correctly delimited by the "Char delimiter", or if there is line with no data on all fields.', 'type'=>'EOF_RECORD_ON_SEVERAL_LINES'); + $arrayofwarnings[$sourcelinenb][0] = array('lib' => 'File has '.$nboflines.' lines. However we reach the end of file or an empty line at record '.$sourcelinenb.'. This may occurs when some records are split onto several lines and not correctly delimited by the "Char delimiter", or if there is line with no data on all fields.', 'type' => 'EOF_RECORD_ON_SEVERAL_LINES'); $endoffile++; continue; } @@ -1940,7 +1941,7 @@ if ($step == 5 && $datatoimport) { $i++; $resqlafterimport = $db->query($sqlafterimport); if (!$resqlafterimport) { - $arrayoferrors['none'][] = array('lib'=>$langs->trans("Error running final request: ".$sqlafterimport)); + $arrayoferrors['none'][] = array('lib' => $langs->trans("Error running final request: ".$sqlafterimport)); $error++; } } @@ -2286,7 +2287,7 @@ if ($step == 6 && $datatoimport) { $sourcelinenb++; $arrayrecord = $obj->import_read_record(); if ($arrayrecord === false) { - $arrayofwarnings[$sourcelinenb][0] = array('lib'=>'File has '.$nboflines.' lines. However we reach the end of file or an empty line at record '.$sourcelinenb.'. This may occurs when some records are split onto several lines and not correctly delimited by the "Char delimiter", or if there is line with no data on all fields.', 'type'=>'EOF_RECORD_ON_SEVERAL_LINES'); + $arrayofwarnings[$sourcelinenb][0] = array('lib' => 'File has '.$nboflines.' lines. However we reach the end of file or an empty line at record '.$sourcelinenb.'. This may occurs when some records are split onto several lines and not correctly delimited by the "Char delimiter", or if there is line with no data on all fields.', 'type' => 'EOF_RECORD_ON_SEVERAL_LINES'); $endoffile++; continue; } @@ -2361,7 +2362,7 @@ if ($step == 6 && $datatoimport) { $i++; $resqlafterimport = $db->query($sqlafterimport); if (!$resqlafterimport) { - $arrayoferrors['none'][] = array('lib'=>$langs->trans("Error running final request: ".$sqlafterimport)); + $arrayoferrors['none'][] = array('lib' => $langs->trans("Error running final request: ".$sqlafterimport)); $error++; } } @@ -2467,12 +2468,8 @@ function show_elem($fieldssource, $pos, $key) if (!utf8_check($example)) { $example = mb_convert_encoding($example, 'UTF-8', 'ISO-8859-1'); } - if (!empty($conf->dol_optimize_smallscreen)) { - //print '
'; - print ' - '; - } else { - print ' - '; - } + // if (!empty($conf->dol_optimize_smallscreen)) { //print '
'; } + print ' - '; print ''.dol_escape_htmltag($example).''; } print '
'; //print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"'); - print $object->getNomUrl(1);; + print $object->getNomUrl(1); + ; print ''; - $array = array(''=>'', 0 => $langs->trans("PrivateProject"), 1 => $langs->trans("SharedProject")); + $array = array('' => '', 0 => $langs->trans("PrivateProject"), 1 => $langs->trans("SharedProject")); print $form->selectarray('search_public', $array, $search_public, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth75'); print ''; print img_picto('', 'service'); - print $form->select_produits((GETPOSTISSET('fk_product')?GETPOSTINT("fk_product"):''), 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1); + print $form->select_produits((GETPOSTISSET('fk_product') ? GETPOSTINT("fk_product") : ''), 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1); print ''; - print $form->selectarray('search_status', array('0'=>$langs->trans('StatusReceptionDraftShort'), '1'=>$langs->trans('StatusReceptionValidatedShort'), '2'=>$langs->trans('StatusReceptionProcessedShort')), $search_status, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage'); + print $form->selectarray('search_status', array('0' => $langs->trans('StatusReceptionDraftShort'), '1' => $langs->trans('StatusReceptionValidatedShort'), '2' => $langs->trans('StatusReceptionProcessedShort')), $search_status, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage'); print ''; - $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"), 'other'=>$langs->trans("Genderother")); + $arraygender = array('man' => $langs->trans("Genderman"), 'woman' => $langs->trans("Genderwoman"), 'other' => $langs->trans("Genderother")); print $form->selectarray('search_gender', $arraygender, $search_gender, 1); print ''; - print $form->selectarray('search_statut', array('-1'=>'', '0'=>$langs->trans('Disabled'), '1'=>$langs->trans('Enabled')), $search_statut, 0, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage'); + print $form->selectarray('search_statut', array('-1' => '', '0' => $langs->trans('Disabled'), '1' => $langs->trans('Enabled')), $search_statut, 0, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage'); print 'trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> lines)) { + for ($j = $i - 1; $j >= 0; $j--) { + $lastline = $object->lines[$j]; + if ($lastline->product_type == Product::TYPE_SERVICE && (!empty($lastline->date_start) || !empty($lastline->date_end))) { + $date_start_prefill = $lastline->date_start; + $date_end_prefill = $lastline->date_end; + $prefillDates = true; + break; + } + } + } $hourmin = (isset($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE : ''); print $form->selectDate($line->date_start, 'date_start', $hourmin, $hourmin, $line->date_start ? 0 : 1, "updateline", 1, 0); print ' '.$langs->trans('to').' '; print $form->selectDate($line->date_end, 'date_end', $hourmin, $hourmin, $line->date_end ? 0 : 1, "updateline", 1, 0); + if ($prefillDates) { + echo ' '.$langs->trans('FillWithLastServiceDates').''; + } print '";*/ - } else { + if ($disabled) { $retstringbutton = ''; - $retsring = $retstringbutton . $retstring; + $retstring = $retstringbutton . $retstring; } $retstring .= ''; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index c610fed538a..129a7d0feb0 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1275,4 +1275,5 @@ EnterYourAIPromptHere=Enter your AI prompt here UseOrOperatorShort=or GoOnList=Go on list ShowSearchFields=Do a search -MyUserCard=My user file \ No newline at end of file +MyUserCard=My user file +PublicFile=Public file \ No newline at end of file From ef31b0969b3c3ebd2c37b4d9d21dd367f427c8ac Mon Sep 17 00:00:00 2001 From: gti-eu <60189441+gti-eu@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:25:20 +0100 Subject: [PATCH 0309/1862] Fix entity when creating project (#28519) --- htdocs/projet/class/project.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index b071f2db420..dee6d2bcef5 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -494,7 +494,7 @@ class Project extends CommonObject $sql .= ", ".($this->email_msgid ? "'".$this->db->escape($this->email_msgid)."'" : 'null'); $sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : 'null'); $sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null'); - $sql .= ", ".((int) $conf->entity); + $sql .= ", ".setEntity($this); $sql .= ", ".(!isset($this->ip) ? 'NULL' : "'".$this->db->escape($this->ip)."'"); $sql .= ")"; From 88fde71187195d3d86f0f054da86ae0d139f2a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 29 Feb 2024 15:25:38 +0100 Subject: [PATCH 0310/1862] Update codespell-dict.txt (#28517) --- dev/tools/codespell/codespell-dict.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tools/codespell/codespell-dict.txt b/dev/tools/codespell/codespell-dict.txt index 00764f45d53..c40c7608602 100644 --- a/dev/tools/codespell/codespell-dict.txt +++ b/dev/tools/codespell/codespell-dict.txt @@ -9,6 +9,7 @@ aploha->alpha aplohanothtml->alphanohtml aplphanothtml->alphanohtml choosed->chosen +dokument->document dolibar->dolibarr dollibar->dolibarr dollibarr->dolibarr From c5fccd41108e3279d38f08816555733ce1954a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 29 Feb 2024 15:26:53 +0100 Subject: [PATCH 0311/1862] fix phpstan (#28516) * fix phpstan * fix phpstan * fix phpstan * fix phpstan --- htdocs/compta/deplacement/card.php | 10 +++++----- htdocs/compta/deplacement/class/deplacement.class.php | 4 ++-- htdocs/core/lib/agenda.lib.php | 4 ++-- htdocs/core/lib/barcode.lib.php | 3 ++- htdocs/core/lib/company.lib.php | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 34e00414b43..785bc96edc5 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2013 Florian Henry - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -97,7 +97,7 @@ if ($action == 'validate' && $user->hasRight('deplacement', 'creer')) { $error = 0; $object->date = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); - $object->km = price2num(GETPOST('km', 'alpha'), 'MU'); // Not 'int', it may be a formatted amount + $object->km = (float) price2num(GETPOST('km', 'alpha'), 'MU'); // Not 'int', it may be a formatted amount $object->type = GETPOST('type', 'alpha'); $object->socid = GETPOSTINT('socid'); $object->fk_user = GETPOSTINT('fk_user'); @@ -140,9 +140,9 @@ if ($action == 'validate' && $user->hasRight('deplacement', 'creer')) { if (!GETPOST('cancel', 'alpha')) { $result = $object->fetch($id); - $object->date = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); - $object->km = price2num(GETPOST('km', 'alpha'), 'MU'); // Not 'int', it may be a formatted amount - $object->type = GETPOST('type', 'alpha'); + $object->date = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); + $object->km = (float) price2num(GETPOST('km', 'alpha'), 'MU'); // Not 'int', it may be a formatted amount + $object->type = GETPOST('type', 'alpha'); $object->socid = GETPOSTINT('socid'); $object->fk_user = GETPOSTINT('fk_user'); $object->note_private = GETPOST('note_private', 'alpha'); diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index 8a91ee9b50a..62208f5066c 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2013 Florian Henry - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -215,7 +215,7 @@ class Deplacement extends CommonObject public function update($user) { // Clean parameters - $this->km = price2num($this->km); + $this->km = (float) price2num($this->km); // Check parameters if (!is_numeric($this->km)) { diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 73b09437bbb..6e2772e1e59 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -2,7 +2,7 @@ /* Copyright (C) 2008-2014 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2022-2024 Frédéric France + * Copyright (C) 2022-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,7 +46,7 @@ * @param int $usergroupid Id of group to filter on users * @param string $excludetype A type to exclude ('systemauto', 'system', '') * @param int $resourceid Preselected value of resource for filter on resource - * @param array $search_categ_cus Tag id + * @param int $search_categ_cus Tag id * @return void */ function print_actions_filter( diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index 9f3ce7d3468..a236d108771 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * Copyright (C) 2004-2010 Folke Ashberg: Some lines of code were inspired from work * of Folke Ashberg into PHP-Barcode 0.3pl2, available as GPL * source code at http://www.ashberg.de/bar. @@ -407,7 +408,7 @@ function barcode_encode_genbarcode($code, $encoding) * @param array $space default: $space[top] = 2 * $scale; $space[bottom]= 2 * $scale; $space[left] = 2 * $scale; $space[right] = 2 * $scale; * @return string|void */ -function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, $space = '') +function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, $space = []) { global $bar_color, $bg_color, $text_color; global $font_loc, $filebarcode; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 65373fb5b3e..f09dda32803 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -7,7 +7,7 @@ * Copyright (C) 2013-2014 Juanjo Menent * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013-2018 Alexandre Spangaro - * Copyright (C) 2015-2021 Frédéric France + * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2017 Rui Strecht * Copyright (C) 2018 Ferran Marcet @@ -596,7 +596,7 @@ function getCountry($searchkey, $withcode = '', $dbtouse = 0, $outputlangs = '', * Return state translated from an id. Return value is always utf8 encoded and without entities. * * @param int $id id of state (province/departement) - * @param int $withcode '0'=Return label, + * @param string $withcode '0'=Return label, * '1'=Return string code + label, * '2'=Return code, * 'all'=return array('id'=>,'code'=>,'label'=>) From a5624528322878e0313a276f8899613daf5d9cb4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 15:45:27 +0100 Subject: [PATCH 0312/1862] Try to restore consistency into isModEnabled. The array must contains old name -> new name --- htdocs/core/lib/functions.lib.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c33108fc51e..62c8bc0ec3f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -219,27 +219,25 @@ function getDolUserInt($key, $default = 0, $tmpuser = null) define( 'MODULE_MAPPING', array( - // Map deprecated names to internal names + // Map deprecated names to new names 'adherent' => 'member', // Has new directory 'member_type' => 'adherent_type', // No directory, but file called adherent_type 'banque' => 'bank', // Has new directory 'contrat' => 'contract', // Has new directory 'entrepot' => 'stock', // Has new directory 'projet' => 'project', // Has new directory + 'categorie' => 'category', // Has old directory + 'commande' => 'order', // Has old directory + 'expedition' => 'shipping', // Has old directory + 'facture' => 'invoice', // Has old directory + 'fichinter' => 'intervention', // Has old directory + 'ficheinter' => 'intervention', // Backup for 'fichinter' + 'propale' => 'propal', // Has old directory + 'socpeople' => 'contact', // Has old directory 'actioncomm' => 'agenda', // NO module directory (public dir agenda) 'product_price' => 'productprice', // NO directory 'product_fournisseur_price' => 'productsupplierprice', // NO directory - - // Map future names to current internal names - 'category' => 'categorie', // Has old directory - 'order' => 'commande', // Has old directory - 'shipping' => 'expedition', // Has old directory - 'invoice' => 'facture', // Has old directory - 'intervention' => 'fichinter', // Has old directory - 'ficheinter' => 'fichinter', // Backup for 'fichinter' - 'propal' => 'propale', // Has old directory - 'contact' => 'socpeople', // Has old directory ) ); From 700c0e3e736e220b56dd2df88d2421acd65f4b28 Mon Sep 17 00:00:00 2001 From: atm-adrien <67913809+atm-adrien@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:49:26 +0100 Subject: [PATCH 0313/1862] FIX : Add new hidden conf "DISABLE_QTY_OVERWRITTEN" (#28523) * FIX : Add new hidden conf "DISABLE_QTY_OVERWRITTEN" * FIX : Change conf name * FIX : PR returns --- htdocs/product/inventory/inventory.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 4ca3768fa11..b924b9c442c 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -1045,8 +1045,9 @@ if ($resql) { // Expected quantity = Quantity in stock when we start inventory print ''; $valuetoshow = $obj->qty_stock; + // For inventory not yet close, we overwrite with the real value in stock now - if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) { + if (($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) && !getDolGlobalString('DISABLE_QTY_OVERWRITE')) { if (isModEnabled('productbatch') && $product_static->hasbatch()) { $valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->detail_batch[$obj->batch]->qty; } else { From d55650f206f2d29e8f6e6b8f9726de9abcbb51a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 16:10:14 +0100 Subject: [PATCH 0314/1862] FIX #24174 --- htdocs/fourn/commande/card.php | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index adc56f49324..b41024bbc26 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1053,7 +1053,7 @@ if (empty($reshook)) { } // Force mandatory order method - if ($action == 'commande') { + if ($action == 'commande') { // Not a real action so no permission test $methodecommande = GETPOSTINT('methodecommande'); if ($cancel) { @@ -1189,11 +1189,10 @@ if (empty($reshook)) { // Actions to build doc $upload_dir = $conf->fournisseur->commande->dir_output; - $permissiontoadd = $usercancreate; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; - if ($action == 'update_extras') { + if ($action == 'update_extras' && $permissiontoadd) { $object->oldcopy = dol_clone($object, 2); // Fill array 'array_options' with data from add form @@ -1221,7 +1220,7 @@ if (empty($reshook)) { /* * Create an order */ - if ($action == 'add' && $usercancreate) { + if ($action == 'add' && $permissiontoadd) { $error = 0; $selectedLines = GETPOST('toselect', 'array'); if ($socid < 1) { @@ -1430,7 +1429,7 @@ if (empty($reshook)) { } } - if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && !GETPOST('cancel', 'alpha')) { + if ($action == 'webservice' && $permissiontoadd && GETPOST('mode', 'alpha') == "send" && !GETPOST('cancel', 'alpha')) { $ws_url = $object->thirdparty->webservices_url; $ws_key = $object->thirdparty->webservices_key; $ws_user = GETPOST('ws_user', 'alpha'); @@ -1448,8 +1447,8 @@ if (empty($reshook)) { 'entity' => $ws_entity ); - //Is sync supplier web services module activated? and everything filled? - if (empty($conf->syncsupplierwebservices->enabled)) { + // Is sync supplier web services module activated? and everything filled? + if (isModEnabled('syncsupplierwebservices')) { setEventMessages($langs->trans("WarningModuleNotActive", $langs->transnoentities("Module2650Name")), null, 'mesgs'); } elseif (empty($ws_url) || empty($ws_key)) { setEventMessages($langs->trans("ErrorWebServicesFieldsRequired"), null, 'errors'); @@ -1513,7 +1512,7 @@ if (empty($reshook)) { } } - if (getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB') && $usercancreate) { + if (getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB') && $permissiontoadd) { if ($action == 'addcontact') { if ($object->id > 0) { $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); @@ -2165,7 +2164,7 @@ if ($action == 'create') { print ''; } print '
'; print $langs->trans('PaymentConditions'); print ''; - if ($action != 'editconditions') { + if ($action != 'editconditions' && $permissiontoadd) { print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).'
'; @@ -2184,7 +2183,7 @@ if ($action == 'create') { print ''; - if ($action != 'editmode') { + if ($action != 'editmode' && $permissiontoadd) { print ''; } print '
'; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'
'; @@ -2204,7 +2203,7 @@ if ($action == 'create') { print ''; - if ($action != 'editmulticurrencycode' && $object->statut == $object::STATUS_DRAFT) { + if ($action != 'editmulticurrencycode' && $object->statut == $object::STATUS_DRAFT && $permissiontoadd) { print ''; } print '
'; print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'
'; @@ -2252,7 +2251,7 @@ if ($action == 'create') { print ''; } print '
'; print $langs->trans('BankAccount'); print ''; - if ($action != 'editbankaccount' && $usercancreate) { + if ($action != 'editbankaccount' && $permissiontoadd) { print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'
'; From c18ea8a4566c226ba36c429ab240e602a818a9ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:15:14 +0100 Subject: [PATCH 0315/1862] php V8 Warning (empty value) (#26869) * Update list.php * Update list.php * Update list.php * Update list.php * Update list.php * Update list.php --------- Co-authored-by: Laurent Destailleur --- htdocs/comm/propal/list.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 24c92ad317c..1bceb107128 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -11,7 +11,7 @@ * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016-2021 Ferran Marcet - * Copyright (C) 2017-2018 Charlene Benke + * Copyright (C) 2017-2023 Charlene Benke * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2019-2021 Alexandre Spangaro * Copyright (C) 2021 Anthony Berton @@ -1935,7 +1935,9 @@ if ($search_date_signature_endyear) { } print '
'; - print $typenArray[$obj->typent_code]; + if (!empty($obj->typent_code)) { + print $typenArray[$obj->typent_code]; + } print ''; + $labelInputReason = ''; if ($obj->fk_input_reason > 0) { - print $form->cache_demand_reason[$obj->fk_input_reason]['label']; + $labelInputReason = $form->cache_demand_reason[$obj->fk_input_reason]['label']; } + print ''; + print dol_escape_htmltag($labelInputReason); print '
'.$form->editfieldkey('WebServiceURL', 'webservices_url', '', $object, 0).''.$form->editfieldkey('WebServiceKey', 'webservices_key', '', $object, 0).'
'.$langs->trans("WebServiceURL").''.dol_print_url($object->webservices_url).''.$langs->trans('WebServiceKey').''.$object->webservices_key.'
'.$langs->trans("PriceLabel").''; + print $object->price_label; print '
'; + print $langs->trans('PriceLabel'); + print ''; + print ''; + print '
'; + print $objp->price_label; + print ''; if ($objp->user_id > 0) { @@ -1876,6 +1901,7 @@ if ((!getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || $action == 'showlog_defau } print '
'; + print $langs->trans('PriceLabel'); + print ''; + print ''; + print '
'; print '
'; @@ -2099,6 +2133,16 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { } print '
'; + print $langs->trans('PriceLabel'); + print ''; + print ''; + print '
'; @@ -2161,6 +2205,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { } print '
'.$langs->trans("MinPrice").' '.$langs->trans("HT").''.$langs->trans("MinPrice").' '.$langs->trans("TTC").''.$langs->trans("PriceLabel").''.$langs->trans("ChangedBy").' 
'.price($line->price_min).''.price($line->price_min_ttc).''.$line->price_label.''.$langs->trans("MinPrice").' '.$langs->trans("HT").''.$langs->trans("MinPrice").' '.$langs->trans("TTC").''.$langs->trans("PriceLabel").''.$langs->trans("ChangedBy").'
'.price($object->price_min).''.price($object->price_min_ttc).''.$object->price_label.''; print ''.price($line->price_min).''.price($line->price_min_ttc).''.$line->price_label.''; print ''; print img_picto($langs->trans('TooltipDeleteAndRevertStockMovement'), 'delete'); From 0ac22e1f75c15d268604f2e43c86db5b3f479f94 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 1 Mar 2024 12:49:35 +0100 Subject: [PATCH 0344/1862] FIX avoid warning "error parsing attribute name in Entity" (#28543) --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8b109dbee3b..a979f18e3a3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7653,7 +7653,7 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = ' } else { $out = '
'.dol_nl2br($out).'
'; } - $dom->loadHTML($out, LIBXML_HTML_NODEFDTD | LIBXML_ERR_NONE | LIBXML_HTML_NOIMPLIED | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_NOXMLDECL); + $dom->loadHTML($out, LIBXML_HTML_NODEFDTD | LIBXML_ERR_NONE | LIBXML_HTML_NOIMPLIED | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_NOERROR | LIBXML_NOXMLDECL); $out = trim($dom->saveHTML()); // Remove the trick added to solve pb with text without parent tag From 57f4fc14d8cbb8d86840105890b1eb7a856cd3a7 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 1 Mar 2024 12:50:51 +0100 Subject: [PATCH 0345/1862] Fix: phpunit - Add adapter to "not existing directory" assertion (#28534) # Fix: phpunit - Add adapter to "not existing directory" assertion This is a helper function added to the common test class which is useful to maintain cross phpunit version compatibility without triggering a deprecation error for internal phpunit test functions. Used in a testcase for dol_dir_move in a pending PR --- test/phpunit/CommonClassTest.class.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/phpunit/CommonClassTest.class.php b/test/phpunit/CommonClassTest.class.php index e5c63965f55..0e5f49dd24b 100644 --- a/test/phpunit/CommonClassTest.class.php +++ b/test/phpunit/CommonClassTest.class.php @@ -339,4 +339,24 @@ abstract class CommonClassTest extends TestCase 'workstation' => 'Workstation', 'zapier' => 'Zapier', ); + + /** + * Assert that a directory does not exist without triggering deprecation + * + * @param string $directory The directory to test + * @param string $message The message to show if the directory exists + * + * @return void + */ + protected function assertDirectoryNotExistsCompat($directory, $message = '') + { + $phpunitVersion = \PHPUnit\Runner\Version::id(); + + // Check if PHPUnit version is less than 9.0.0 + if (version_compare($phpunitVersion, '9.0.0', '<')) { + $this->assertDirectoryNotExists($directory, $message); + } else { + $this->assertDirectoryDoesNotExist($directory, $message); + } + } } From 3c055f671ebcc19c2b3d72ca6b30d71f82319b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Mar 2024 12:51:48 +0100 Subject: [PATCH 0346/1862] fix phpstan (#28545) * fix phpstan * fix phpstan --- .../core/class/commonnumrefgenerator.class.php | 13 +++++++------ .../barcode/mod_barcode_product_standard.php | 17 +---------------- .../barcode/mod_barcode_thirdparty_standard.php | 6 +----- .../modules/barcode/modules_barcode.class.php | 2 +- .../modules/contract/mod_contract_magre.php | 10 ++++++++-- .../modules/contract/mod_contract_olive.php | 17 ++++++++++++----- .../modules/contract/mod_contract_serpis.php | 11 ++++++++--- .../modules/holiday/mod_holiday_immaculate.php | 10 ++++++++-- .../modules/holiday/mod_holiday_madonna.php | 11 ++++++++--- .../core/modules/member/mod_member_advanced.php | 12 ++++++++---- .../core/modules/member/mod_member_simple.php | 12 ++++++++---- .../modules/member/modules_member.class.php | 12 +----------- .../product/mod_codeproduct_elephant.php | 8 +------- .../modules/product/mod_codeproduct_leopard.php | 7 +------ .../modules/product/modules_product.class.php | 9 +-------- .../core/modules/product_batch/mod_lot_free.php | 8 +------- .../core/modules/product_batch/mod_sn_free.php | 7 +------ .../modules/societe/mod_codeclient_elephant.php | 8 +------- .../modules/societe/mod_codeclient_leopard.php | 6 +----- .../modules/societe/mod_codeclient_monkey.php | 7 +------ .../modules/societe/modules_societe.class.php | 9 +-------- 21 files changed, 80 insertions(+), 122 deletions(-) diff --git a/htdocs/core/class/commonnumrefgenerator.class.php b/htdocs/core/class/commonnumrefgenerator.class.php index a4359db0aa5..c4edb202031 100644 --- a/htdocs/core/class/commonnumrefgenerator.class.php +++ b/htdocs/core/class/commonnumrefgenerator.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,32 +55,32 @@ abstract class CommonNumRefGenerator protected $db; /** - * @var int<0,1> Code facultatif + * @var int<0,1> Is Code optional 0 or 1 */ public $code_null; /** - * @var int<0,1> Code modifiable + * @var int<0,1> Is Code editable 0 or 1 */ public $code_modifiable; /** - * @var int<0,1> Code modifiable si il est invalid + * @var int<0,1> Is Code editable if invalid 0 or 1 */ public $code_modifiable_invalide; /** - * @var int<0,1> Code modifiable si il est null + * @var int<0,1> Is Code editable if null */ public $code_modifiable_null; /** - * @var int<0,1> Automatic numbering + * @var int<0,1> Automatic numbering 0 or 1 */ public $code_auto; /** - * @var int<0,1> Le champ prefix du tiers doit etre renseigne quand on utilise {pre} + * @var int<0,1> The third party prefix field must be filled in when using {pre} */ public $prefixIsRequired; diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index b338c65ea28..ceaf9cc1169 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -3,6 +3,7 @@ * Copyright (C) 2006-2014 Laurent Destailleur * Copyright (C) 2007-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,32 +36,16 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode { public $name = 'Standard'; // Model Name - public $code_modifiable; // Editable code - - public $code_modifiable_invalide; // Modified code if it is invalid - - public $code_modifiable_null; // Modified code if it is null - - public $code_null; // Optional code - /** * Dolibarr version of the loaded document * @var string */ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' - /** - * @var int Automatic numbering - */ - public $code_auto; - public $searchcode; // Search string public $numbitcounter; // Number of digits the counter - public $prefixIsRequired; // The prefix field of third party must be filled when using {pre} - - /** * Constructor */ diff --git a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php index 2c7a716aded..10e33d763f1 100644 --- a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php @@ -4,6 +4,7 @@ * Copyright (C) 2007-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2022 Faustin Boitel + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,11 +51,6 @@ class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode */ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' - /** - * @var int Automatic numbering - */ - public $code_auto; - public $searchcode; // Search string public $numbitcounter; // Number of digits the counter diff --git a/htdocs/core/modules/barcode/modules_barcode.class.php b/htdocs/core/modules/barcode/modules_barcode.class.php index 4137ec09571..f8026af15e1 100644 --- a/htdocs/core/modules/barcode/modules_barcode.class.php +++ b/htdocs/core/modules/barcode/modules_barcode.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -56,7 +57,6 @@ abstract class ModeleNumRefBarCode extends CommonNumRefGenerator // variables inherited from CommonNumRefGenerator public $code_null; - public $code_auto; /** diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php index 9797d077a6b..f68e180a65c 100644 --- a/htdocs/core/modules/contract/mod_contract_magre.php +++ b/htdocs/core/modules/contract/mod_contract_magre.php @@ -1,6 +1,6 @@ - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,8 +35,14 @@ class mod_contract_magre extends ModelNumRefContracts public $name = 'Magre'; public $version = 'dolibarr'; public $error = ''; - public $code_auto = 1; + /** + * Constructor + */ + public function __construct() + { + $this->code_auto = 1; + } /** * Return default description of numbering model diff --git a/htdocs/core/modules/contract/mod_contract_olive.php b/htdocs/core/modules/contract/mod_contract_olive.php index 0f7bffaebfe..2fd4d27f6fe 100644 --- a/htdocs/core/modules/contract/mod_contract_olive.php +++ b/htdocs/core/modules/contract/mod_contract_olive.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2006-2009 Laurent Destailleur * Copyright (C) 2014 Floran Henry + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,13 +37,19 @@ class mod_contract_olive extends ModelNumRefContracts // variables inherited from ModelNumRefContracts class public $name = 'Olive'; public $version = 'dolibarr'; - public $code_null = 1; - public $code_modifiable = 1; - public $code_modifiable_invalide = 1; - public $code_modifiable_null = 1; - public $code_auto = 0; + /** + * Constructor + */ + public function __construct() + { + $this->code_null = 1; + $this->code_modifiable = 1; + $this->code_modifiable_invalide = 1; + $this->code_modifiable_null = 1; + $this->code_auto = 0; + } /** * Return description of module * diff --git a/htdocs/core/modules/contract/mod_contract_serpis.php b/htdocs/core/modules/contract/mod_contract_serpis.php index 81386498593..fe155099ac7 100644 --- a/htdocs/core/modules/contract/mod_contract_serpis.php +++ b/htdocs/core/modules/contract/mod_contract_serpis.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,9 +33,6 @@ class mod_contract_serpis extends ModelNumRefContracts // variables inherited from ModelNumRefContracts class public $name = 'Serpis'; public $version = 'dolibarr'; - public $error = ''; - public $code_auto = 1; - // variables not inherited @@ -43,6 +41,13 @@ class mod_contract_serpis extends ModelNumRefContracts */ public $prefix = 'CT'; + /** + * Constructor + */ + public function __construct() + { + $this->code_auto = 1; + } /** * Return default description of numbering model diff --git a/htdocs/core/modules/holiday/mod_holiday_immaculate.php b/htdocs/core/modules/holiday/mod_holiday_immaculate.php index 556c79db2b5..ca246324929 100644 --- a/htdocs/core/modules/holiday/mod_holiday_immaculate.php +++ b/htdocs/core/modules/holiday/mod_holiday_immaculate.php @@ -1,6 +1,7 @@ * Copyright (C) 2018 Charlene Benke + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,9 +35,14 @@ class mod_holiday_immaculate extends ModelNumRefHolidays // variables inherited from ModelNumRefHolidays class public $name = 'Immaculate'; public $version = 'dolibarr'; - public $error = ''; - public $code_auto = 1; + /** + * Constructor + */ + public function __construct() + { + $this->code_auto = 1; + } /** * Return default description of numbering model diff --git a/htdocs/core/modules/holiday/mod_holiday_madonna.php b/htdocs/core/modules/holiday/mod_holiday_madonna.php index 85681c7b99f..d2eeceeafc2 100644 --- a/htdocs/core/modules/holiday/mod_holiday_madonna.php +++ b/htdocs/core/modules/holiday/mod_holiday_madonna.php @@ -1,6 +1,7 @@ * Copyright (C) 2018-2023 Charlene Benke + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,9 +34,6 @@ class mod_holiday_madonna extends ModelNumRefHolidays // variables inherited from ModelNumRefHolidays class public $name = 'Madonna'; public $version = 'dolibarr'; - public $error = ''; - public $code_auto = 1; - // variables not inherited @@ -44,6 +42,13 @@ class mod_holiday_madonna extends ModelNumRefHolidays */ public $prefix = 'HL'; + /** + * Constructor + */ + public function __construct() + { + $this->code_auto = 1; + } /** * Return default description of numbering model diff --git a/htdocs/core/modules/member/mod_member_advanced.php b/htdocs/core/modules/member/mod_member_advanced.php index 1d1d3dad21f..2147961ea82 100644 --- a/htdocs/core/modules/member/mod_member_advanced.php +++ b/htdocs/core/modules/member/mod_member_advanced.php @@ -1,6 +1,6 @@ - * Copyright (C) 2022 Frédéric France + * Copyright (C) 2022-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,9 +35,6 @@ class mod_member_advanced extends ModeleNumRefMembers // variables inherited from ModeleNumRefMembers class public $name = 'Advanced'; public $version = 'dolibarr'; - public $error = ''; - public $code_auto = 1; - // variables not inherited @@ -46,6 +43,13 @@ class mod_member_advanced extends ModeleNumRefMembers */ public $prefix = 'MEM'; + /** + * Constructor + */ + public function __construct() + { + $this->code_auto = 1; + } /** * Return description of numbering module diff --git a/htdocs/core/modules/member/mod_member_simple.php b/htdocs/core/modules/member/mod_member_simple.php index 1c228b1729f..c76d7a38c38 100644 --- a/htdocs/core/modules/member/mod_member_simple.php +++ b/htdocs/core/modules/member/mod_member_simple.php @@ -1,6 +1,6 @@ - * Copyright (C) 2022 Frédéric France + * Copyright (C) 2022-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,9 +35,6 @@ class mod_member_simple extends ModeleNumRefMembers // variables inherited from ModeleNumRefMembers class public $name = 'Simple'; public $version = 'dolibarr'; - public $error = ''; - public $code_auto = 1; - // variables not inherited @@ -46,6 +43,13 @@ class mod_member_simple extends ModeleNumRefMembers */ public $prefix = ''; + /** + * Constructor + */ + public function __construct() + { + $this->code_auto = 1; + } /** * Return description of numbering module diff --git a/htdocs/core/modules/member/modules_member.class.php b/htdocs/core/modules/member/modules_member.class.php index 897bdd03086..ca21a6d7820 100644 --- a/htdocs/core/modules/member/modules_member.class.php +++ b/htdocs/core/modules/member/modules_member.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -63,17 +64,6 @@ abstract class ModelePDFMember extends CommonDocGenerator */ abstract class ModeleNumRefMembers extends CommonNumRefGenerator { - public $code_modifiable; // Editable code - - public $code_modifiable_invalide; // Modified code if it is invalid - - public $code_modifiable_null; // Modified code if it is null - - public $code_null; // - - public $code_auto; - - /** * Return description of module parameters * diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index e6469e087b4..d0bc9d30e16 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -3,6 +3,7 @@ * Copyright (C) 2006-2009 Laurent Destailleur * Copyright (C) 2007-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,13 +38,6 @@ class mod_codeproduct_elephant extends ModeleProductCode // variables inherited from ModelProductCode class public $name = 'Elephant'; public $version = 'dolibarr'; - public $code_null; - public $code_modifiable; - public $code_modifiable_invalide; - public $code_modifiable_null; - public $code_auto; - public $prefixIsRequired; - // variables not inherited diff --git a/htdocs/core/modules/product/mod_codeproduct_leopard.php b/htdocs/core/modules/product/mod_codeproduct_leopard.php index 89c3ef5638c..921f2a2617f 100644 --- a/htdocs/core/modules/product/mod_codeproduct_leopard.php +++ b/htdocs/core/modules/product/mod_codeproduct_leopard.php @@ -1,6 +1,7 @@ * Copyright (C) 2006-2009 Laurent Destailleur + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,12 +42,6 @@ class mod_codeproduct_leopard extends ModeleProductCode // variables inherited from ModelProductCode class public $name = 'Leopard'; public $version = 'dolibarr'; - public $code_null; - public $code_modifiable; - public $code_modifiable_invalide; - public $code_modifiable_null; - public $code_auto; - /** * Constructor diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index 126684966a8..893dc9dc2dc 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -60,14 +61,6 @@ abstract class ModelePDFProduct extends CommonDocGenerator */ abstract class ModeleProductCode extends CommonNumRefGenerator { - - // variables inherited from CommonNumRefGenerator class - public $code_null; - public $code_modifiable; - public $code_modifiable_invalide; - public $code_auto; - - /** * Return next value available * diff --git a/htdocs/core/modules/product_batch/mod_lot_free.php b/htdocs/core/modules/product_batch/mod_lot_free.php index 721d6b3268e..4a7de7a4499 100644 --- a/htdocs/core/modules/product_batch/mod_lot_free.php +++ b/htdocs/core/modules/product_batch/mod_lot_free.php @@ -1,7 +1,7 @@ * Copyright (C) 2006-2009 Laurent Destailleur - * Copyright (C) 2022-2023 Frédéric France + * Copyright (C) 2023-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,12 +42,6 @@ class mod_lot_free extends ModeleNumRefBatch // variables inherited from ModeleNumRefBatch class public $name = 'lot_free'; public $version = 'dolibarr'; - public $code_null; - public $code_modifiable; - public $code_modifiable_invalide; - public $code_modifiable_null; - public $code_auto; - /** * Constructor diff --git a/htdocs/core/modules/product_batch/mod_sn_free.php b/htdocs/core/modules/product_batch/mod_sn_free.php index c34b1703637..bd795c726a1 100644 --- a/htdocs/core/modules/product_batch/mod_sn_free.php +++ b/htdocs/core/modules/product_batch/mod_sn_free.php @@ -1,6 +1,7 @@ * Copyright (C) 2006-2009 Laurent Destailleur + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,12 +41,6 @@ class mod_sn_free extends ModeleNumRefBatch // variables inherited from ModeleThirdPartyCode class public $name = 'sn_free'; public $version = 'dolibarr'; - public $code_null; - public $code_modifiable; - public $code_modifiable_invalide; - public $code_modifiable_null; - public $code_auto; - /** * Constructor diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index c82ed88b925..9039c9a2907 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -4,7 +4,7 @@ * Copyright (C) 2007-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2013-2018 Philippe Grand - * Copyright (C) 2020 Frédéric France + * Copyright (C) 2020-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,12 +39,6 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode // variables inherited from ModeleThirdPartyCode class public $name = 'Elephant'; public $version = 'dolibarr'; - public $code_null; - public $code_modifiable; - public $code_modifiable_invalide; - public $code_modifiable_null; - public $code_auto; - public $prefixIsRequired; // variables not inherited diff --git a/htdocs/core/modules/societe/mod_codeclient_leopard.php b/htdocs/core/modules/societe/mod_codeclient_leopard.php index ca0be8edb33..9729c15e7d7 100644 --- a/htdocs/core/modules/societe/mod_codeclient_leopard.php +++ b/htdocs/core/modules/societe/mod_codeclient_leopard.php @@ -1,6 +1,7 @@ * Copyright (C) 2006-2014 Laurent Destailleur + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,11 +42,6 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode // variables inherited from ModeleThirdPartyCode class public $name = 'Leopard'; public $version = 'dolibarr'; - public $code_null; - public $code_modifiable; - public $code_modifiable_invalide; - public $code_modifiable_null; - public $code_auto; /** diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index 1f6b771896c..1d843fd007e 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2006-2007 Laurent Destailleur * Copyright (C) 2006-2012 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,12 +37,6 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode // variables inherited from ModeleThirdPartyCode class public $name = 'Monkey'; public $version = 'dolibarr'; - public $code_null; - public $code_modifiable; - public $code_modifiable_invalide; - public $code_modifiable_null; - public $code_auto; - public $prefixIsRequired; // variables not inherited public $prefixcustomer = 'CU'; diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index efd226af406..1408c2cdf99 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,14 +60,6 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator */ abstract class ModeleThirdPartyCode extends CommonNumRefGenerator { - - // variables inherited from CommonNumRefGenerator class - public $code_null; - public $code_modifiable; - public $code_modifiable_invalide; - public $code_auto; - - /** * Constructor * From cb302fbb631854a1ea60f5e0421313a4defd2136 Mon Sep 17 00:00:00 2001 From: noec764 <58433943+noec764@users.noreply.github.com> Date: Fri, 1 Mar 2024 12:55:07 +0100 Subject: [PATCH 0347/1862] FIX: Special code is now transmitted by args only in order supplier (#28546) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Noé --- htdocs/fourn/commande/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index c9e5e8f4fee..2c1e723df00 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1350,8 +1350,6 @@ if (empty($reshook)) { $tva_tx = get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $product_fourn_price_id); } - $object->special_code = $lines[$i]->special_code; - $result = $object->addline( $desc, $lines[$i]->subprice, @@ -1374,7 +1372,9 @@ if (empty($reshook)) { $lines[$i]->fk_unit, 0, $element, - !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid + !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid, + -1, + $lines[$i]->special_code ); if ($result < 0) { From 34c98ce4aa842101dae5cc6b707792a389dc3de4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Mar 2024 14:07:14 +0100 Subject: [PATCH 0348/1862] Fix constant name --- htdocs/includes/OAuth/OAuth2/Service/Microsoft.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/includes/OAuth/OAuth2/Service/Microsoft.php b/htdocs/includes/OAuth/OAuth2/Service/Microsoft.php index 6c3b18b3c0f..2bac0430101 100644 --- a/htdocs/includes/OAuth/OAuth2/Service/Microsoft.php +++ b/htdocs/includes/OAuth/OAuth2/Service/Microsoft.php @@ -38,11 +38,11 @@ class Microsoft extends AbstractService const SCOPE_APPLICATIONS = 'applications'; const SCOPE_APPLICATIONS_CREATE = 'applications_create'; const SCOPE_IMAP = 'imap'; - const SOCPE_IMAP_ACCESSASUSERALL = 'https://outlook.office365.com/IMAP.AccessAsUser.All'; - const SOCPE_SMTPSEND = 'https://outlook.office365.com/SMTP.Send'; - const SOCPE_USERREAD = 'User.Read'; - const SOCPE_MAILREAD = 'Mail.Read'; - const SOCPE_MAILSEND = 'Mail.Send'; + const SCOPE_IMAP_ACCESSASUSERALL = 'https://outlook.office365.com/IMAP.AccessAsUser.All'; + const SCOPE_SMTPSEND = 'https://outlook.office365.com/SMTP.Send'; + const SCOPE_USERREAD = 'User.Read'; + const SCOPE_MAILREAD = 'Mail.Read'; + const SCOPE_MAILSEND = 'Mail.Send'; protected $storage; From c4142496df6b0113bf6376ee9a192df41c213f8a Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Fri, 1 Mar 2024 16:32:33 +0100 Subject: [PATCH 0349/1862] Fix problem with param action --- htdocs/bookcal/availabilities_card.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/bookcal/availabilities_card.php b/htdocs/bookcal/availabilities_card.php index 9cbd48253e6..f3fe963f906 100644 --- a/htdocs/bookcal/availabilities_card.php +++ b/htdocs/bookcal/availabilities_card.php @@ -227,9 +227,13 @@ if ($action == 'create') { } print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Availabilities")), '', 'object_'.$object->picto); - print '
'; + print ''; print ''; - print ''; + if ($error != 0) { + print ''; + } else { + print ''; + } if ($backtopage) { print ''; } From 17015095aa8aeecdcda3218f4d25eb15e71834b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Mar 2024 18:15:58 +0100 Subject: [PATCH 0350/1862] Add option to allow better compatibility with computed fields using unsecured chars --- htdocs/core/lib/functions.lib.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8b109dbee3b..fa2d6f0f30f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9629,7 +9629,11 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' if ($onlysimplestring == '1') { // We must accept: '1 && getDolGlobalInt("doesnotexist1") && getDolGlobalString("MAIN_FEATURES_LEVEL")' // We must accept: '$user->hasRight("cabinetmed", "read") && !$object->canvas=="patient@cabinetmed"' - if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@', '/').']/i', $s)) { + $specialcharsallowed = '^$_+-.*>&|=!?():"\',/@'; + if (getDolGlobalString('MAIN_ALLOW_UNSECURED_SPECIAL_CHARS_IN_DOL_EVAL')) { + $specialcharsallowed .= getDolGlobalString('MAIN_ALLOW_UNSECURED_SPECIAL_CHARS_IN_DOL_EVAL'); + } + if (preg_match('/[^a-z0-9\s'.preg_quote($specialcharsallowed, '/').']/i', $s)) { if ($returnvalue) { return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s; } else { @@ -9656,7 +9660,11 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' // We can exclude $ char that are not: $db, $langs, $leftmenu, $topmenu, $user, $langs, $objectoffield, $object..., } elseif ($onlysimplestring == '2') { // We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found" - if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@[]', '/').']/i', $s)) { + $specialcharsallowed = '^$_+-.*>&|=!?():"\',/@[]'; + if (getDolGlobalString('MAIN_ALLOW_UNSECURED_SPECIAL_CHARS_IN_DOL_EVAL')) { + $specialcharsallowed .= getDolGlobalString('MAIN_ALLOW_UNSECURED_SPECIAL_CHARS_IN_DOL_EVAL'); + } + if (preg_match('/[^a-z0-9\s'.preg_quote($specialcharsallowed, '/').']/i', $s)) { if ($returnvalue) { return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s; } else { From af8e086aacb29fd366d426b9a87c4693397ead85 Mon Sep 17 00:00:00 2001 From: Liammer <104431491+Liammer@users.noreply.github.com> Date: Fri, 1 Mar 2024 18:24:31 +0100 Subject: [PATCH 0351/1862] Update adherent.class.php (#28554) To not send the Email to cancelled members. They already asked not to be members anymore. Sending reminders can be exhausting. --- htdocs/adherents/class/adherent.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 8717ecd010a..25fa2b6a257 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -3102,6 +3102,7 @@ class Adherent extends CommonObject $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'adherent'; $sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity('adherent').")" here, we want the batch to be on its entity only; + $sql .= " AND statut = 1"; $sql .= " AND datefin = '".$this->db->idate($datetosearchfor)."'"; //$sql .= " LIMIT 10000"; From a96f1a85d667c0a9e0ddc359fbed74829d2e1f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Mar 2024 18:24:41 +0100 Subject: [PATCH 0352/1862] fix phpstan (#28555) * fix phpstan * fix phpstan --- .../class/price_global_variable.class.php | 9 +++--- .../price_global_variable_updater.class.php | 29 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index e14075cfd48..13cf5233342 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2012 Laurent Destailleur * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Ion Agorria + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -169,11 +170,11 @@ class PriceGlobalVariable /** * Update object into database * - * @param User $user User that modifies - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param User|null $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function update($user = 0, $notrigger = 0) + public function update($user = null, $notrigger = 0) { $error = 0; diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index 5097d8ac7ba..d36c0477bf4 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2012 Laurent Destailleur * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Ion Agorria + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -189,11 +190,11 @@ class PriceGlobalVariableUpdater /** * Update object into database * - * @param User $user User that modifies - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param User|null $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function update($user = 0, $notrigger = 0) + public function update($user = null, $notrigger = 0) { $error = 0; @@ -557,12 +558,12 @@ class PriceGlobalVariableUpdater /** * Update next_update into database * - * @param string $next_update Next update to write - * @param User $user User that modifies - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param string $next_update Next update to write + * @param User|null $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function update_next_update($next_update, $user = 0, $notrigger = 0) + public function update_next_update($next_update, $user = null, $notrigger = 0) { // phpcs:enable $error = 0; @@ -602,12 +603,12 @@ class PriceGlobalVariableUpdater /** * Update last_status into database * - * @param string $last_status Status to write - * @param User $user User that modifies - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param string $last_status Status to write + * @param User|null $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function update_status($last_status, $user = 0, $notrigger = 0) + public function update_status($last_status, $user = null, $notrigger = 0) { // phpcs:enable $error = 0; From 3c28480fda5f1c39a78ff5a3f6dccb3e6aa8fd5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 1 Mar 2024 18:26:36 +0100 Subject: [PATCH 0353/1862] Update list.php add some init field array (#28550) --- htdocs/compta/facture/list.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 6a089f7a87d..a6fa25cfd13 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1821,6 +1821,9 @@ if ($resql) { $totalarray['val']['f.total_tva'] = 0; $totalarray['val']['f.total_ht'] = 0; $totalarray['val']['f.total_ttc'] = 0; + $totalarray['val']['totalam'] = 0; + $totalarray['val']['rtp'] = 0; + $with_margin_info = false; if (isModEnabled('margin') && ( From 8419cb2f0f14e94aaa7c5b8e004d2dc39aa39793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Mar 2024 18:27:00 +0100 Subject: [PATCH 0354/1862] fix phpstan (#28548) --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index a518ec79f9d..f82a0fccd6e 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2620,7 +2620,7 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only * @return array Array with properties (full path, date, ...) of to most recent file */ -function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('(\.meta|_preview.*\.png)$', '^\.'), $nohook = 0, $mode = '') +function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('(\.meta|_preview.*\.png)$', '^\.'), $nohook = 0, $mode = 0) { $tmparray = dol_dir_list($dir, 'files', 0, $regexfilter, $excludefilter, 'date', SORT_DESC, $mode, $nohook); return isset($tmparray[0]) ? $tmparray[0] : null; From de76330aae03c7a936f46716a6bde7149c9520a4 Mon Sep 17 00:00:00 2001 From: atm-adrien <67913809+atm-adrien@users.noreply.github.com> Date: Fri, 1 Mar 2024 18:39:32 +0100 Subject: [PATCH 0355/1862] FIX : Adding the dependencies list feature for extrafields "select" (#28549) * FIX : Adding thez dependencies list feature for select fields * FIX : Adding some spaces * FIX : View --- htdocs/core/class/commonobject.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 449bb20dbdc..3fd14f2ca3c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7326,6 +7326,7 @@ abstract class CommonObject } $out .= '
'; print ''; print img_picto($langs->trans('TooltipDeleteAndRevertStockMovement'), 'delete'); From b870a84d8a8084a9624c79aa8d2a59a18313d7b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Mar 2024 20:19:37 +0100 Subject: [PATCH 0362/1862] FIX #28564 --- htdocs/mrp/class/mo.class.php | 44 ++++++++++++++++++++++++++--------- htdocs/mrp/mo_production.php | 4 ++-- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 2341f1fd406..e3438cad7e0 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -900,17 +900,21 @@ class Mo extends CommonObject } $productstatic = new Product($this->db); $fk_movement = GETPOST('fk_movement', 'int'); - $arrayoflines = $this->fetchLinesLinked('consumed', $idline); + $arrayoflines = $this->fetchLinesLinked('consumed', $idline); // Get lines consummed under the one to delete + + $result = 0; + + $this->db->begin(); if (!empty($arrayoflines)) { - $this->db->begin(); - + // If there is child lines $stockmove = new MouvementStock($this->db); $stockmove->setOrigin($this->element, $this->id); if (!empty($fk_movement)) { + // The fk_movement was not recorded so we try to guess the product and quantity to restore. $moline = new MoLine($this->db); - $TArrayMoLine = $moline->fetchAll('', '', 1, 0, array('customsql' => 'fk_stock_movement ='.$fk_movement)); + $TArrayMoLine = $moline->fetchAll('', '', 1, 0, array('customsql' => 'fk_stock_movement = '.(int) $fk_movement)); $moline = array_shift($TArrayMoLine); $movement = new MouvementStock($this->db); @@ -929,13 +933,12 @@ class Mo extends CommonObject } if ($idstockmove < 0) { $this->error++; - $this->db->rollback(); setEventMessages($stockmove->error, $stockmove->errors, 'errors'); } else { - $this->db->commit(); + $result = $moline->delete($user, $notrigger); } - return $moline->delete($user, $notrigger); } else { + // Loop on each child lines foreach ($arrayoflines as $key => $arrayofline) { $lineDetails = $arrayoflines[$key]; $productstatic->fetch($lineDetails['fk_product']); @@ -945,6 +948,7 @@ class Mo extends CommonObject $labelmovementCancel = $langs->trans("CancelProductionForRef", $productstatic->ref); $codemovementCancel = $langs->trans("StockIncrease"); + if ($qtytoprocess >= 0) { $idstockmove = $stockmove->reception($user, $lineDetails['fk_product'], $lineDetails['fk_warehouse'], $qtytoprocess, 0, $labelmovementCancel, '', '', $lineDetails['batch'], dol_now(), 0, $codemovementCancel); } else { @@ -952,17 +956,35 @@ class Mo extends CommonObject } if ($idstockmove < 0) { $this->error++; - $this->db->rollback(); setEventMessages($stockmove->error, $stockmove->errors, 'errors'); } else { - $this->db->commit(); + $moline = new MoLine($this->db); + $moline->fetch($lineDetails['rowid']); + + $resdel = $moline->delete($user, $notrigger); + if ($resdel < 0) { + $this->error++; + setEventMessages($moline->error, $moline->errors, 'errors'); + } } } - return $this->deleteLineCommon($user, $idline, $notrigger); + + if (empty($this->error)) { + $result = $this->deleteLineCommon($user, $idline, $notrigger); + } } } else { - return $this->deleteLineCommon($user, $idline, $notrigger); + // No child lines + $result = $this->deleteLineCommon($user, $idline, $notrigger); } + + if (!empty($this->error) || $result <= 0) { + $this->db->rollback(); + } else { + $this->db->commit(); + } + + return $result; } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 0caba7cb777..d28b856e6a8 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -1278,7 +1278,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Action Edit line if ($object->status == Mo::STATUS_DRAFT) { - $href = $_SERVER["PHP_SELF"] . '?id=' . ((int) $object->id) . '&action=editline&token=' . newToken() . '&lineid=' . ((int) $line->id); + $href = $_SERVER["PHP_SELF"] . '?id=' . ((int) $object->id) . '&action=editline&token=' . newToken() . '&lineid=' . ((int) $line2['rowid']); print ''; print ''; print img_picto($langs->trans('TooltipEditAndRevertStockMovement'), 'edit'); @@ -1288,7 +1288,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Action delete line if ($permissiontodelete) { - $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line->id).'&fk_movement='.((int) $line2['fk_stock_movement']); + $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line2['rowid']).'&fk_movement='.((int) $line2['fk_stock_movement']); print ''; print ''; print img_picto($langs->trans('TooltipDeleteAndRevertStockMovement'), 'delete'); From b94303462257aed71f2abfd09e9a3b9b2698636a Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Fri, 1 Mar 2024 20:38:27 +0100 Subject: [PATCH 0363/1862] FIX return in method put on api_ticket (#28563) * FIX return in method put on api_ticket * Update api_tickets.class.php * Update api_tickets.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/ticket/class/api_tickets.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index 6163ae449b2..28e87fc428f 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -382,11 +382,11 @@ class Tickets extends DolibarrApi $this->ticket->$field = $value; } - if ($this->ticket->update(DolibarrApiAccess::$user)) { + if ($this->ticket->update(DolibarrApiAccess::$user) > 0) { return $this->get($id); + } else { + throw new RestException(500, $this->ticket->error); } - - return false; } /** From 7e8b45f287ad0347ab9b01502b4273f709ede986 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 1 Mar 2024 20:39:52 +0100 Subject: [PATCH 0364/1862] Qual: Improve PhpUnit logging in case of error. (#28562) # Qual: Improve PhpUnit logging in case of error. - Log exception message with extra log information. - Do not output markers for dolibarr.log if no log lines should be shown. - Use GitHub action style prefixes to group messages --- test/phpunit/CommonClassTest.class.php | 47 ++++++++++++++++++++------ 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/test/phpunit/CommonClassTest.class.php b/test/phpunit/CommonClassTest.class.php index 0e5f49dd24b..0322cdd28bc 100644 --- a/test/phpunit/CommonClassTest.class.php +++ b/test/phpunit/CommonClassTest.class.php @@ -116,11 +116,7 @@ abstract class CommonClassTest extends TestCase if ($t instanceof PHPUnit\Framework\Error\Notice) { $nbLinesToShow = 3; } - $totalLines = count($lines); - $first_line = max(0, $totalLines - $nbLinesToShow); - // Get the last line of the log - $last_lines = array_slice($lines, $first_line, $nbLinesToShow); $failedTestMethod = $this->getName(false); $className = get_called_class(); @@ -131,14 +127,25 @@ abstract class CommonClassTest extends TestCase // Get the test method's data set $argsText = $this->getDataSetAsString(true); - // Show log file + $totalLines = count($lines); + $first_line = max(0, $totalLines - $nbLinesToShow); + // Get the last line of the log + $last_lines = array_slice($lines, $first_line, $nbLinesToShow); + print PHP_EOL; - print "----- $className::$failedTestMethod failed - $argsText.".PHP_EOL; - print "Show last ".$nbLinesToShow." lines of dolibarr.log file -----".PHP_EOL; - foreach ($last_lines as $line) { - print $line.PHP_EOL; + // Use GitHub Action compatible group output (:warning: arguments not encoded) + print "##[group]$className::$failedTestMethod failed - $argsText.".PHP_EOL; + print "## Exception: {$t->getMessage()}".PHP_EOL; + + if ($nbLinesToShow) { + // Show partial log file contents when requested. + print "## Show last ".$nbLinesToShow." lines of dolibarr.log file -----".PHP_EOL; + foreach ($last_lines as $line) { + print $line.PHP_EOL; + } + print "## end of dolibarr.log for $className::$failedTestMethod".PHP_EOL; } - print "----- end of dolibarr.log for $className::$failedTestMethod".PHP_EOL; + print "##[endgroup]".PHP_EOL; parent::onNotSuccessfulTest($t); } @@ -359,4 +366,24 @@ abstract class CommonClassTest extends TestCase $this->assertDirectoryDoesNotExist($directory, $message); } } + + /** + * Assert that a file does not exist without triggering deprecation + * + * @param string $file The file to test + * @param string $message The message to show if the directory exists + * + * @return void + */ + protected function assertFileNotExistsCompat($file, $message = '') + { + $phpunitVersion = \PHPUnit\Runner\Version::id(); + + // Check if PHPUnit version is less than 9.0.0 + if (version_compare($phpunitVersion, '9.0.0', '<')) { + $this->assertFileNotExists($file, $message); + } else { + $this->assertFileDoesNotExist($file, $message); + } + } } From e39070af37f902d22feb6c820f6903a9116d4415 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Fri, 1 Mar 2024 20:41:16 +0100 Subject: [PATCH 0365/1862] Fix return type by changin boot to string (#28557) --- htdocs/fourn/class/fournisseur.facture-rec.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 8a85a32e37a..820c92baa11 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -1249,7 +1249,7 @@ class FactureFournisseurRec extends CommonInvoice * Format string to output with by striking the string if max number of generation was reached * * @param string $ret Default value to output - * @return boolean False by default, True if maximum number of generation is reached + * @return string False by default, True if maximum number of generation is reached */ public function strikeIfMaxNbGenReached($ret) { From e0c161e4c2ee6b5ce347b1f6da3345e06fe3e695 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Fri, 1 Mar 2024 20:47:47 +0100 Subject: [PATCH 0366/1862] fix assigne variable (#28559) * fix assigne variable * Update paiement.php --------- Co-authored-by: Laurent Destailleur --- htdocs/fourn/facture/paiement.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index cb36f12fe4f..4f1c81602a1 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -311,7 +311,13 @@ if (empty($reshook)) { // Creation of payment line $paiement = new PaiementFourn($db); $paiement->datepaye = $datepaye; - $paiement->amounts = $amounts; // Array of amounts + + $correctedAmounts = []; + foreach ($amounts as $key => $value) { + $correctedAmounts[$key] = (float) $value; + } + + $paiement->amounts = $correctedAmounts; // Array of amounts $paiement->multicurrency_amounts = $multicurrency_amounts; $paiement->multicurrency_code = $multicurrency_code; // Array with all currency of payments dispatching $paiement->multicurrency_tx = $multicurrency_tx; // Array with all currency tx of payments dispatching From 262f5ffd217c7e6c80b2de08c200b854515fe282 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Fri, 1 Mar 2024 20:48:14 +0100 Subject: [PATCH 0367/1862] change assignement type to int (#28561) --- htdocs/website/class/website.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index b7fb7ec2c6b..f22db99fd9c 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -923,7 +923,7 @@ class Website extends CommonObject $this->lang = 'en'; $this->otherlang = 'fr,es'; $this->status = 1; - $this->fk_default_home = null; + $this->fk_default_home = 0; $this->virtualhost = 'http://myvirtualhost'; $this->fk_user_creat = $user->id; $this->fk_user_modif = $user->id; From 389d58284663efa9135d3ba7fe94b2faa7d365d2 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Fri, 1 Mar 2024 20:48:52 +0100 Subject: [PATCH 0368/1862] Fix return in deleteLine and cast a variable to string (#28558) --- htdocs/fourn/class/api_supplier_invoices.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 00ba4fa8532..fe44a813231 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -474,7 +474,7 @@ class SupplierInvoices extends DolibarrApi $paiement->amounts = $amounts; // Array with all payments dispatching with invoice id $paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching $paiement->paiementid = $payment_mode_id; - $paiement->paiementcode = dol_getIdFromCode($this->db, $payment_mode_id, 'c_paiement', 'id', 'code', 1); + $paiement->paiementcode = (string) dol_getIdFromCode($this->db, $payment_mode_id, 'c_paiement', 'id', 'code', 1); $paiement->num_payment = $num_payment; $paiement->note_public = $comment; @@ -704,7 +704,12 @@ class SupplierInvoices extends DolibarrApi $updateRes = $this->invoice->deleteLine($lineid); if ($updateRes > 0) { - return $this->get($id); + return array( + 'success' => array( + 'code' => 200, + 'message' => 'line '.$lineid.' deleted' + ) + ); } else { throw new RestException(405, $this->invoice->error); } From 351ea07229bdb53cf0825ef1c4d26de5526bf11a Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Fri, 1 Mar 2024 20:49:23 +0100 Subject: [PATCH 0369/1862] Fix return type when output is 1 (#28501) * Fix return type when output is 1 * update doc method --- htdocs/core/class/html.formcontract.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index fc869901f01..954f0b6ea75 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -61,7 +61,7 @@ class FormContract * @param int $showRef Show customer and supplier reference on each contract (when found) * @param int $noouput 1=Return the output instead of display * @param string $morecss More CSS - * @return int Nbr of contract if OK, <0 if KO + * @return int|string If nooutput = 0: Nbr of contract if OK, <0 if KO, If nooutput = 1: The HTML select string */ public function select_contract($socid = -1, $selected = 0, $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0, $noouput = 0, $morecss = 'minwidth150') { From 19a22f6b6dac089e85c09d2f2cdbefd59db9f974 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Mar 2024 20:55:01 +0100 Subject: [PATCH 0370/1862] Fix #28509 --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f4e3dd0f5f3..f266588d090 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -770,7 +770,7 @@ abstract class CommonObject public $output; /** - * @var array extra parameters + * @var array|string extra parameters. Try to store here the array of parameters. Old code is sometimes storing a string. */ public $extraparams = array(); From dd7be6c9324f8f3852002a7175662161e5d60185 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Fri, 1 Mar 2024 21:00:49 +0100 Subject: [PATCH 0371/1862] Fix return type string instead of int (#28499) * Fix return type string instead of int * update doc method for return --- htdocs/core/class/html.formintervention.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index d6f7a8bf795..08587f3fad2 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -59,7 +59,7 @@ class FormIntervention * @param int $maxlength Maximum length of label * @param int $showempty Show empty line ('1' or string to show for empty line) * @param bool $draftonly Show only drafts intervention - * @return int Nbre of project if OK, <0 if KO + * @return string HTML code for the select list if OK, empty if KO */ public function select_interventions($socid = -1, $selected = 0, $htmlname = 'interventionid', $maxlength = 16, $showempty = 1, $draftonly = false) { From 94b9686db5df1c1703f113fb90e9b3f7baf292e3 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Fri, 1 Mar 2024 21:02:35 +0100 Subject: [PATCH 0372/1862] Fix type of variable in api_invoices (#28474) * Fix type of variable in api_invoices * remove coma * replace strtotime --------- Co-authored-by: Laurent Destailleur --- htdocs/compta/facture/class/api_invoices.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index af115c3aab2..ef52e74f6c8 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1494,9 +1494,9 @@ class Invoices extends DolibarrApi // Creation of payment line $paymentobj = new Paiement($this->db); - $paymentobj->datepaye = $datepaye; - $paymentobj->amounts = $amounts; - $paymentobj->multicurrency_amounts = $multicurrency_amounts; + $paymentobj->datepaye = dol_stringtotime($datepaye); + $paymentobj->amounts = $amounts; // Array with all payments dispatching with invoice id + $paymentobj->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching $paymentobj->paiementid = $paymentid; $paymentobj->paiementcode = (string) dol_getIdFromCode($this->db, $paymentid, 'c_paiement', 'id', 'code', 1); $paymentobj->num_payment = $num_payment; From 7b92c9912b14a709b6b0dca53a7b4d21381d2355 Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Fri, 1 Mar 2024 21:13:12 +0100 Subject: [PATCH 0373/1862] Fix return type by adding string in select_comptes method (#28496) * Fix return type by addin string in select_comptes method * update return doc for method * Update html.form.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 938333ef730..6c4a8bd4e55 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4904,7 +4904,7 @@ class Form * @param int $showcurrency Show currency in label * @param string $morecss More CSS * @param int $nooutput 1=Return string, do not send to output - * @return int Return integer <0 if error, Num of bank account found if OK (0, 1, 2, ...) + * @return int|string If noouput=0: Return integer <0 if error, Num of bank account found if OK (0, 1, 2, ...), If nooutput=1: Return a HTML select string. */ public function select_comptes($selected = '', $htmlname = 'accountid', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '', $showcurrency = 0, $morecss = '', $nooutput = 0) { From 74ecd5c660347560c50d1386a9d07ee4ad4e4a0f Mon Sep 17 00:00:00 2001 From: lamrani abdelwadoud Date: Fri, 1 Mar 2024 21:13:40 +0100 Subject: [PATCH 0374/1862] FIX return method DeleteLine in api_boms file (#28471) * FIX return method DeleteLine in api_boms file * update type of return in deleteLine method --- htdocs/bom/class/api_boms.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/class/api_boms.class.php b/htdocs/bom/class/api_boms.class.php index 6f1e8b31ced..f551600797a 100644 --- a/htdocs/bom/class/api_boms.class.php +++ b/htdocs/bom/class/api_boms.class.php @@ -438,7 +438,7 @@ class Boms extends DolibarrApi * * @url DELETE {id}/lines/{lineid} * - * @return int + * @return array * * @throws RestException 403 Access denied * @throws RestException 404 BOM not found @@ -473,7 +473,12 @@ class Boms extends DolibarrApi $updateRes = $this->bom->deleteLine(DolibarrApiAccess::$user, $lineid); if ($updateRes > 0) { - return $this->get($id); + return array( + 'success' => array( + 'code' => 200, + 'message' => 'line ' .$lineid. ' deleted' + ) + ); } else { throw new RestException(500, $this->bom->error); } From 595d735feec89f8054be35c14db84f6fc01907da Mon Sep 17 00:00:00 2001 From: Thomas C <56068416+Thomas905@users.noreply.github.com> Date: Fri, 1 Mar 2024 21:17:52 +0100 Subject: [PATCH 0375/1862] NEW : Statistic page donation (#28463) * v1 statistic page don * add link * fix phpstan * fix * fix * Update index.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/menus/standard/eldy.lib.php | 1 + htdocs/don/class/donstats.class.php | 41 +++- htdocs/don/stats/index.php | 239 +++++++++++++++--------- htdocs/langs/en_US/donations.lang | 1 + 4 files changed, 185 insertions(+), 97 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 47cfd7c081d..c8561fd1f11 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1547,6 +1547,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $newmenu->add("/don/card.php?leftmenu=donations&action=create", $langs->trans("NewDonation"), 1, $user->hasRight('don', 'creer')); $newmenu->add("/don/list.php?leftmenu=donations", $langs->trans("List"), 1, $user->hasRight('don', 'lire')); $newmenu->add("/don/paiement/list.php?leftmenu=donations", $langs->trans("Payments"), 1, $user->hasRight('don', 'lire')); + $newmenu->add("/don/stats/index.php", $langs->trans("Statistics"), 1, $user->hasRight('don', 'lire')); } // if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->hasRight('don', 'lire')); } diff --git a/htdocs/don/class/donstats.class.php b/htdocs/don/class/donstats.class.php index a4b8043f5ae..15ab2e454e3 100644 --- a/htdocs/don/class/donstats.class.php +++ b/htdocs/don/class/donstats.class.php @@ -28,7 +28,6 @@ include_once DOL_DOCUMENT_ROOT.'/core/class/stats.class.php'; include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - /** * Class to manage donations statistics */ @@ -57,6 +56,10 @@ class DonationStats extends Stats */ public $where; + /** + * @var string JOIN + */ + public $join; /** * Constructor @@ -65,8 +68,10 @@ class DonationStats extends Stats * @param int $socid Id third party for filter * @param string $mode Option (not used) * @param int $userid Id user for filter (creation user) + * @param int $typentid Id of type of third party for filter + * @param int $status Status of donation for filter */ - public function __construct($db, $socid, $mode, $userid = 0) + public function __construct($db, $socid, $mode, $userid = 0, $typentid = 0, $status = 4) { global $conf; @@ -76,17 +81,31 @@ class DonationStats extends Stats $this->socid = ($socid > 0 ? $socid : 0); $this->userid = $userid; $this->cachefilesuffix = $mode; + $this->join = ''; + + if ($status == 0 || $status == 1 || $status == 2) { + $this->where = ' d.fk_statut IN ('.$db->sanitize($status).')'; + } elseif ($status == 3) { + $this->where = ' d.fk_statut IN (-1)'; + } elseif ($status == 4) { + $this->where = ' d.fk_statut >= 0'; + } $object = new Don($this->db); $this->from = MAIN_DB_PREFIX.$object->table_element." as d"; - //$this->from.= ", ".MAIN_DB_PREFIX."societe as s"; - //$this->field='weight'; // Warning, unit of weight is NOT USED AND MUST BE - $this->where .= " d.fk_statut > 0"; // Not draft and not cancelled - //$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; + if ($socid !== "-1" && $socid > 0) { + $this->where .= " AND d.fk_soc = ".((int) $socid); + } + $this->where .= " AND d.entity = ".$conf->entity; if ($this->userid > 0) { - $this->where .= ' WHERE c.fk_user_author = '.((int) $this->userid); + $this->where .= ' AND d.fk_user_author = '.((int) $this->userid); + } + + if ($typentid) { + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = d.fk_soc'; + $this->where .= ' AND s.fk_typent = '.((int) $typentid); } } @@ -101,13 +120,13 @@ class DonationStats extends Stats { $sql = "SELECT date_format(d.datedon,'%m') as dm, COUNT(*) as nb"; $sql .= " FROM ".$this->from; + $sql .= $this->join; $sql .= " WHERE d.datedon BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); - $res = $this->_getNbByMonth($year, $sql, $format); - return $res; + return $this->_getNbByMonth($year, $sql, $format); } /** @@ -120,6 +139,7 @@ class DonationStats extends Stats { $sql = "SELECT date_format(d.datedon,'%Y') as dm, COUNT(*) as nb, SUM(d.".$this->field.")"; $sql .= " FROM ".$this->from; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -138,6 +158,7 @@ class DonationStats extends Stats { $sql = "SELECT date_format(d.datedon,'%m') as dm, sum(d.".$this->field.")"; $sql .= " FROM ".$this->from; + $sql .= $this->join; $sql .= " WHERE ".dolSqlDateFilter('d.datedon', 0, 0, (int) $year, 1); $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -156,6 +177,7 @@ class DonationStats extends Stats { $sql = "SELECT date_format(d.datedon,'%m') as dm, avg(d.".$this->field.")"; $sql .= " FROM ".$this->from; + $sql .= $this->join; $sql .= " WHERE ".dolSqlDateFilter('d.datedon', 0, 0, (int) $year, 1); $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -173,6 +195,7 @@ class DonationStats extends Stats { $sql = "SELECT date_format(d.datedon,'%Y') as year, COUNT(*) as nb, SUM(d.".$this->field.") as total, AVG(".$this->field.") as avg"; $sql .= " FROM ".$this->from; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY year"; $sql .= $this->db->order('year', 'DESC'); diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index 1629ac2e984..1bb4458c37e 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -29,10 +29,16 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/donstats.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; - +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +if (isModEnabled('category')) { + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +} $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); +// Load translation files required by the page +$langs->loadLangs("donations"); + $userid = GETPOSTINT('userid'); $socid = GETPOSTINT('socid'); // Security check @@ -41,44 +47,44 @@ if ($user->socid > 0) { $socid = $user->socid; } +$status = GETPOSTINT('status'); $nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); +$typent_id = GETPOSTINT('typent_id'); $year = GETPOST('year') > 0 ? GETPOST('year') : $nowyear; -$startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS')))); +$startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalInt('MAIN_STATS_GRAPHS_SHOW_N_YEARS')))); $endyear = $year; - -// Load translation files required by the page -$langs->loadLangs(array("companies", "other", "sendings")); +$mode = GETPOST("mode") ? GETPOST("mode") : 'customer'; +$custcats = GETPOST('custcats', 'array'); // Security check $result = restrictedArea($user, 'don'); - /* * View */ - $form = new Form($db); -$title = $langs->trans("DonationsStatistics"); -llxHeader('', $title, '', '', 0, 0, '', '', '', 'mod-donation page-stats'); +$formcompany = new FormCompany($db); -print load_fiche_titre($langs->trans("DonationsStatistics"), $mesg); +llxHeader(); +$dir = $conf->don->dir_temp; + +print load_fiche_titre($langs->trans("DonationsStatistics"), '', 'donation'); dol_mkdir($dir); -$stats = new DonationStats($db, $socid, '', ($userid > 0 ? $userid : 0)); +$stats = new DonationStats($db, $socid, '', ($userid > 0 ? $userid : 0), ($typent_id > 0 ? $typent_id : 0), ($status > 0 ? $status : 4)); + +if (is_array($custcats) && !empty($custcats)) { + $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cat ON (d.fk_soc = cat.fk_soc)'; + $stats->where .= ' AND cat.fk_categorie IN ('.$db->sanitize(implode(',', $custcats)).')'; +} // Build graphic number of object $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); -//var_dump($data);exit; -// $data = array(array('Lib',val1,val2,val3),...) - -if (!$user->hasRight('societe', 'client', 'voir')) { - $filenamenb = $dir.'/donationnbinyear-'.$user->id.'-'.$year.'.png'; -} else { - $filenamenb = $dir.'/donationnbinyear-'.$year.'.png'; -} +$filenamenb = $dir."/salariesnbinyear-".$year.".png"; +$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=donationStats&file=donationinyear-'.$year.'.png'; $px1 = new DolGraph(); $mesg = $px1->isGraphKo(); @@ -99,11 +105,67 @@ if (!$mesg) { $px1->SetShading(3); $px1->SetHorizTickIncrement(1); $px1->mode = 'depth'; - $px1->SetTitle($langs->trans("NumberOfDonationsByMonth")); + $px1->SetTitle($langs->trans("NumberByMonth")); $px1->draw($filenamenb, $fileurlnb); } +$data = $stats->getAmountByMonthWithPrevYear($endyear, $startyear); + +$filenameamount = $dir."/donationamount-".$year.".png"; +$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=donationStats&file=donationamoutinyear-'.$year.'.png'; + +$px2 = new DolGraph(); +$mesg = $px2->isGraphKo(); +if (!$mesg) { + $px2->SetData($data); + $i=$startyear;$legend=array(); + while ($i <= $endyear) { + $legend[]=$i; + $i++; + } + $px2->SetLegend($legend); + $px2->SetMaxValue($px2->GetCeilMaxValue()); + $px2->SetMinValue(min(0, $px2->GetFloorMinValue())); + $px2->SetWidth($WIDTH); + $px2->SetHeight($HEIGHT); + $px2->SetYLabel($langs->trans("Amount")); + $px2->SetShading(3); + $px2->SetHorizTickIncrement(1); + $px2->mode='depth'; + $px2->SetTitle($langs->trans("AmountTotal")); + + $px2->draw($filenameamount, $fileurlamount); +} + +$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); + +$filename_avg = $dir."/donationaverage-".$year.".png"; +$fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=donationStats&file=donationaverageinyear-'.$year.'.png'; + +$px3 = new DolGraph(); +$mesg = $px3->isGraphKo(); +if (!$mesg) { + $px3->SetData($data); + $i = $startyear; + $legend = array(); + while ($i <= $endyear) { + $legend[] = $i; + $i++; + } + $px3->SetLegend($legend); + $px3->SetYLabel($langs->trans("AmountAverage")); + $px3->SetMaxValue($px3->GetCeilMaxValue()); + $px3->SetMinValue($px3->GetFloorMinValue()); + $px3->SetWidth($WIDTH); + $px3->SetHeight($HEIGHT); + $px3->SetShading(3); + $px3->SetHorizTickIncrement(1); + $px3->mode = 'depth'; + $px3->SetTitle($langs->trans("AmountAverage")); + + $px3->draw($filename_avg, $fileurl_avg); +} // Show array $data = $stats->getAllByYear(); @@ -133,33 +195,62 @@ print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
'; - // Show filter box print ''; print ''; -print ''; +print '
'; print ''; + // Company -print ''; +} + +// ThirdParty Type +print ''; + +// Category +if (isModEnabled('category')) { + $cat_type = Categorie::TYPE_CUSTOMER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); + print ''; +} + // User -print ''; + +// Status +print ''; print ''; print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; -print img_picto('', 'company', 'class="pictofixedwidth"'); -print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); +if (empty(!$conf->global->DONATION_USE_THIRDPARTIES)) { + print '
'.$langs->trans("ThirdParty").''; + print img_picto('', 'company', 'class="pictofixedwidth"'); + print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); + print '
'.$langs->trans("ThirdPartyType").''; +$sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); +print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 1, 0, 0, '', 0, 0, 0, $sortparam_typent, '', 1); +if ($user->admin) { + print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); +} print '
'.$cat_label.''; + $cate_arbo = $form->select_all_categories($cat_type, null, 'parent', null, null, 1); + print img_picto('', 'category', 'class="pictofixedwidth"'); + print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), 0, 0, 'widthcentpercentminusx maxwidth300'); + print '
'.$langs->trans("CreatedBy").''; +print '
'.$langs->trans("CreatedBy").''; print img_picto('', 'user', 'class="pictofixedwidth"'); print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); print '
'.$langs->trans("Status").''; +$liststatus = array( + '2' => $langs->trans("DonationStatusPaid"), + '0' => $langs->trans("DonationStatusPromiseNotValidated"), + '1' => $langs->trans("DonationStatusPromiseValidated"), + '3' => $langs->trans("Canceled") +); +print $form->selectarray('status', $liststatus, 4, 1); + // Year -print '
'.$langs->trans("Year").''; -if (!in_array($year, $arrayyears)) { - $arrayyears[$year] = $year; -} -if (!in_array($nowyear, $arrayyears)) { - $arrayyears[$nowyear] = $nowyear; -} +print '
'.$langs->trans("Year").''; arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0, 0, 0, '', 0, 0, 0, '', 'width75'); + print '
'; @@ -167,33 +258,46 @@ print ''; print '

'; print '
'; -print ''; -print ''; +print '
'; +print ''; print ''; print ''; -/*print ''; -print '';*/ +print ''; +print ''; +print ''; +print ''; +print ''; print ''; $oldyear = 0; foreach ($data as $val) { $year = $val['year']; - while (!empty($year) && $oldyear > $year + 1) { // If we have empty year + while (!empty($year) && $oldyear > $year + 1) { $oldyear--; - print ''; + print ''; print ''; print ''; - /*print ''; - print '';*/ + print ''; + print ''; + print ''; + print ''; + print ''; print ''; } - print ''; - print ''; + $greennb = (empty($val['nb_diff']) || $val['nb_diff'] >= 0); + $greentotal = (empty($val['total_diff']) || $val['total_diff'] >= 0); + $greenavg = (empty($val['avg_diff']) || $val['avg_diff'] >= 0); + + print ''; + print ''; print ''; - /*print ''; - print '';*/ + print ''; + print ''; + print ''; + print ''; + print ''; print ''; $oldyear = $year; } @@ -201,10 +305,8 @@ foreach ($data as $val) { print '
'.$langs->trans("Year").''.$langs->trans("NbOfDonations").''.$langs->trans("AmountTotal").''.$langs->trans("AmountAverage").'%'.$langs->trans("AmountTotal").'%'.$langs->trans("AmountAverage").'%
'.$oldyear.'00000
'.$year.'
0 ? '&userid='.$userid : '').'">'.$year.''.$val['nb'].''.price(price2num($val['total'],'MT'),1).''.price(price2num($val['avg'],'MT'),1).''.(!empty($val['nb_diff']) && $val['nb_diff'] < 0 ? '' : '+').round(!empty($val['nb_diff']) ? $val['nb_diff'] : 0).'%'.price(price2num($val['total'], 'MT'), 1).''.( !empty($val['total_diff']) && $val['total_diff'] < 0 ? '' : '+').round(!empty($val['total_diff']) ? $val['total_diff'] : 0).'%'.price(price2num($val['avg'], 'MT'), 1).''.(!empty($val['avg_diff']) && $val['avg_diff'] < 0 ? '' : '+').round(!empty($val['avg_diff']) ? $val['avg_diff'] : 0).'%
'; print '
'; - print '
'; - // Show graphs print '
'; if ($mesg) { @@ -212,55 +314,16 @@ if ($mesg) { } else { print $px1->show(); print "
\n"; - /*print $px2->show(); + print $px2->show(); print "
\n"; - print $px3->show();*/ + print $px3->show(); } print '
'; - print '
'; print '
'; print dol_get_fiche_end(); - - -// TODO USe code similar to commande/stats/index.php instead of this one. -/* -print ''; -print ''; -print ''; - -$sql = "SELECT count(*) as nb, date_format(date_expedition,'%Y') as dm"; -$sql.= " FROM ".MAIN_DB_PREFIX."expedition"; -$sql.= " WHERE fk_statut > 0"; -$sql.= " AND entity = ".$conf->entity; -$sql.= " GROUP BY dm DESC"; - -$resql=$db->query($sql); -if ($resql) -{ - $num = $db->num_rows($resql); - $i = 0; - while ($i < $num) - { - $row = $db->fetch_row($resql); - $nbproduct = $row[0]; - $year = $row[1]; - print ""; - print ''; - $i++; - } -} -$db->free($resql); - -print '
'.$langs->trans("Year").''.$langs->trans("NbOfSendings").'
'.$year.''.$nbproduct.'
'; -*/ - -print '
'; -print ''.$langs->trans("StatsOnDonationsOnlyValidated").''; - llxFooter(); - $db->close(); diff --git a/htdocs/langs/en_US/donations.lang b/htdocs/langs/en_US/donations.lang index e60a65efb46..eaebe7c2b03 100644 --- a/htdocs/langs/en_US/donations.lang +++ b/htdocs/langs/en_US/donations.lang @@ -35,3 +35,4 @@ DonationPayments=Donation payments DonationValidated=Donation %s validated DonationUseThirdparties=Use the address of an existing thirdparty as the address of the donor DonationsStatistics=Donation's statistics +NbOfDonations=Number of donations From 239652647ab6151481980251af4fcb61b41b2990 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Mar 2024 02:37:55 +0100 Subject: [PATCH 0376/1862] Fix $db --- htdocs/don/class/donstats.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/class/donstats.class.php b/htdocs/don/class/donstats.class.php index 15ab2e454e3..1e8f9f09d47 100644 --- a/htdocs/don/class/donstats.class.php +++ b/htdocs/don/class/donstats.class.php @@ -84,7 +84,7 @@ class DonationStats extends Stats $this->join = ''; if ($status == 0 || $status == 1 || $status == 2) { - $this->where = ' d.fk_statut IN ('.$db->sanitize($status).')'; + $this->where = ' d.fk_statut IN ('.$this->db->sanitize($status).')'; } elseif ($status == 3) { $this->where = ' d.fk_statut IN (-1)'; } elseif ($status == 4) { From d0e6933b6da160b9b80d8f465905aecd5be37b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 2 Mar 2024 12:39:30 +0100 Subject: [PATCH 0377/1862] fix phpstan (#28567) --- htdocs/core/lib/functions.lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2feb0e85511..629cf050548 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1684,7 +1684,7 @@ function dol_escape_json($stringtoescape) * Returns text escaped for inclusion into a php string, build with double quotes " or ' * * @param string $stringtoescape String to escape - * @param string $stringforquotes 2=String for doublequotes, 1=String for simple quotes + * @param int<1,2> $stringforquotes 2=String for doublequotes, 1=String for simple quotes * @return string Escaped string for json content. */ function dol_escape_php($stringtoescape, $stringforquotes = 2) @@ -1695,8 +1695,7 @@ function dol_escape_php($stringtoescape, $stringforquotes = 2) if ($stringforquotes == 2) { return str_replace('"', "'", $stringtoescape); - } - if ($stringforquotes == 1) { + } elseif ($stringforquotes == 1) { // We remove the \ char. // If we allow the \ char, we can have $stringtoescape = // abc\';phpcodedanger; so the escapement will become From d0fe3c9a6b6e502e657762fd6e2ebfa209f43b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 2 Mar 2024 12:39:53 +0100 Subject: [PATCH 0378/1862] fix phpstan (#28569) * fix bad use of properties * fix bad use of properties * fix bad use of properties --- htdocs/salaries/class/paymentsalary.class.php | 14 ++++++++++---- htdocs/salaries/payments.php | 5 +++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index ef54b12b43a..0f2760668df 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2011-2022 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -983,11 +984,16 @@ class PaymentSalary extends CommonObject if ($selected >= 0) { $return .= ''; } - if (property_exists($this, 'fk_bank')) { - $return .= ' | '.$this->fk_bank.''; + if (property_exists($this, 'fk_bank') && is_numeric($this->fk_bank)) { + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + $account = new AccountLine($this->db); + $account->fetch($this->fk_bank); + $return .= ' | '.$account->getNomUrl(1).''; } - if (property_exists($this, 'fk_user_author')) { - $return .= '
'.$this->fk_user_author.''; + if (property_exists($this, 'fk_user_author') && is_numeric($this->fk_user_author)) { + $userstatic = new User($this->db); + $userstatic->fetch($this->fk_user_author); + $return .= '
'.$userstatic->getNomUrl(1).''; } if (property_exists($this, 'fk_typepayment')) { diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index b9f93125294..3921451d174 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -3,6 +3,7 @@ * Copyright (C) 2015-2016 Laurent Destailleur * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -613,8 +614,8 @@ while ($i < $imaxinloop) { $accountlinestatic->id = $obj->fk_bank; $accountlinestatic->ref = $obj->fk_bank; - $paymentsalstatic->fk_bank = $accountlinestatic->getNomUrl(1); - $paymentsalstatic->fk_user_author = $userstatic->getNomUrl(1); + $paymentsalstatic->fk_bank = $accountlinestatic->id; + $paymentsalstatic->fk_user_author = $userstatic->id; if ($mode == 'kanban') { if ($i == 0) { From 39debebe270002fee12eb913d08807db05d5197e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 2 Mar 2024 12:40:06 +0100 Subject: [PATCH 0379/1862] fix phpstan (#28570) --- htdocs/product/class/html.formproduct.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 282917f2099..d272bc6e95a 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2015-2017 Francis Appels + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -235,8 +236,8 @@ class FormProduct * Return full path to current warehouse in $tab (recursive function) * * @param array $tab warehouse data in $this->cache_warehouses line - * @param String $final_label full label with all parents, separated by ' >> ' (completed on each call) - * @return String full label with all parents, separated by ' >> ' + * @param string $final_label full label with all parents, separated by ' >> ' (completed on each call) + * @return string full label with all parents, separated by ' >> ' */ private function get_parent_path($tab, $final_label = '') { @@ -550,7 +551,7 @@ class FormProduct * @param int|string $adddefault 1=Add empty unit called "Default", ''=Add empty value * @param int $mode 1=Use short label as value, 0=Use rowid, 2=Use scale (power) * @param string $morecss More CSS - * @return string + * @return string|-1 */ public function selectMeasuringUnits($name = 'measuring_units', $measuring_style = '', $default = '0', $adddefault = 0, $mode = 0, $morecss = 'maxwidth125') { From 99d7b76ba94e364a47a4a6c8b2b42034f481c32c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 2 Mar 2024 12:40:25 +0100 Subject: [PATCH 0380/1862] fix phpstan (#28568) --- .../generate/modGeneratePassNone.class.php | 17 ++--------------- .../generate/modGeneratePassPerso.class.php | 15 +-------------- .../generate/modGeneratePassStandard.class.php | 17 ++--------------- .../security/generate/modules_genpassword.php | 15 +++++++++++++++ 4 files changed, 20 insertions(+), 44 deletions(-) diff --git a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php index d9688edfcd2..e5f1f77c00c 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,20 +38,6 @@ class modGeneratePassNone extends ModeleGenPassword public $picto = 'fa-keyboard'; - /** - * Minimum length (text visible by end user) - * - * @var int - */ - public $length; - - /** - * Minimum length in number of characters - * - * @var integer - */ - public $length2; - /** * Constructor * @@ -62,7 +49,7 @@ class modGeneratePassNone extends ModeleGenPassword public function __construct($db, $conf, $langs, $user) { $this->id = "none"; - $this->length = 0; + $this->length = '0'; $this->length2 = 0; $this->db = $db; diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php index e3769c66f78..a588e62eeef 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2006-2011 Laurent Destailleur * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * Copyright (C) 2017 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,20 +40,6 @@ class modGeneratePassPerso extends ModeleGenPassword public $picto = 'fa-shield-alt'; - /** - * Minimum length (text visible by end user) - * - * @var int - */ - public $length; - - /** - * Minimum length in number of characters - * - * @var integer - */ - public $length2; - public $NbMaj; public $NbNum; public $NbSpe; diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php index 026ec34a852..53f40260dbc 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,20 +38,6 @@ class modGeneratePassStandard extends ModeleGenPassword public $picto = 'fa-shield-alt'; - /** - * Minimum length (text visible by end user) - * - * @var int - */ - public $length; - - /** - * Minimum length in number of characters - * - * @var integer - */ - public $length2; - /** * Constructor * @@ -62,7 +49,7 @@ class modGeneratePassStandard extends ModeleGenPassword public function __construct($db, $conf, $langs, $user) { $this->id = "standard"; - $this->length = 12; + $this->length = '12'; $this->length2 = 12; $this->db = $db; diff --git a/htdocs/core/modules/security/generate/modules_genpassword.php b/htdocs/core/modules/security/generate/modules_genpassword.php index ec17cac6e9b..a463f11b061 100644 --- a/htdocs/core/modules/security/generate/modules_genpassword.php +++ b/htdocs/core/modules/security/generate/modules_genpassword.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -63,6 +64,20 @@ abstract class ModeleGenPassword */ public $user; + /** + * Minimum length (text visible by end user) + * + * @var string + */ + public $length; + + /** + * Minimum length in number of characters + * + * @var integer + */ + public $length2; + /** * Return if a module can be used or not * From b1f01b1e705c54d9a30bb98ed8f669bf1de459ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 2 Mar 2024 12:40:59 +0100 Subject: [PATCH 0381/1862] fix phpstan (#28571) --- htdocs/projet/class/task.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 265f218fc53..f474d200783 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -451,7 +451,7 @@ class Task extends CommonObjectLine // Clean parameters if (isset($this->fk_project)) { - $this->fk_project = trim($this->fk_project); + $this->fk_project = (int) $this->fk_project; } if (isset($this->ref)) { $this->ref = trim($this->ref); @@ -472,7 +472,7 @@ class Task extends CommonObjectLine $this->planned_workload = trim($this->planned_workload); } if (isset($this->budget_amount)) { - $this->budget_amount = trim($this->budget_amount); + $this->budget_amount = (float) $this->budget_amount; } if (!empty($this->date_start) && !empty($this->date_end) && $this->date_start > $this->date_end) { From 04749842b2dbbd1daecc68dfbbed08ded4b71ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 2 Mar 2024 12:41:12 +0100 Subject: [PATCH 0382/1862] fix phpstan property does not accept string (#28574) * fix phpstan property does not accept string * fix phpstan property does not accept string --- htdocs/stripe/class/stripe.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index b00c46b6dc6..70ed30c225f 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,6 +49,9 @@ class Stripe extends CommonObject */ public $id; + /** + * @var string + */ public $mode; /** @@ -55,11 +59,21 @@ class Stripe extends CommonObject */ public $entity; + /** + * @var string + */ public $statut; public $type; + /** + * @var string + */ public $code; + + /** + * @var string + */ public $declinecode; /** From b131013c82ff67fb2831c2e51d4ae9aa8a20dba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 2 Mar 2024 12:41:46 +0100 Subject: [PATCH 0383/1862] fix parameter of method is incompatible with type int (#28573) fix parameter of method is incompatible with type int --- htdocs/expedition/class/expedition.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 70a7b3a6a2d..d5d689618d8 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -11,7 +11,7 @@ * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016-2022 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2022 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Lenin Rivas * * This program is free software; you can redistribute it and/or modify @@ -2133,7 +2133,7 @@ class Expedition extends CommonObject * @param int $id only this carrier, all if none * @return void */ - public function list_delivery_methods($id = '') + public function list_delivery_methods($id = 0) { // phpcs:enable global $langs; @@ -2143,7 +2143,7 @@ class Expedition extends CommonObject $sql = "SELECT em.rowid, em.code, em.libelle as label, em.description, em.tracking, em.active"; $sql .= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as em"; - if ($id != '') { + if (!empty($id)) { $sql .= " WHERE em.rowid=".((int) $id); } From 2a52a35dc1bfffd8067e6bab7f211bc5ec03de6b Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 2 Mar 2024 12:42:20 +0100 Subject: [PATCH 0384/1862] Qual: Improve logging on phpunit error by limiting to new log lines (#28575) # Qual: Improve logging on phpunit error by limiting to new log lines Log only the new files since the start of the failed test within the limit of the number of requested lines. To do this, the log file size is recorded in setUp() to show only the data beyond this limit on error. --- test/phpunit/CommonClassTest.class.php | 45 ++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/test/phpunit/CommonClassTest.class.php b/test/phpunit/CommonClassTest.class.php index 0322cdd28bc..bd1bfa4948b 100644 --- a/test/phpunit/CommonClassTest.class.php +++ b/test/phpunit/CommonClassTest.class.php @@ -60,6 +60,16 @@ abstract class CommonClassTest extends TestCase */ public $nbLinesToShow = 100; + /** + * Log file from which to extract lines in case of failing test + */ + public $logfile = DOL_DATA_ROOT.'/dolibarr.log'; + + /** + * Log file size before a test started (=in setUp() call) + */ + public $logSizeAtSetup = 0; + /** * Constructor * We save global variables into local variables @@ -108,15 +118,25 @@ abstract class CommonClassTest extends TestCase */ protected function onNotSuccessfulTest(Throwable $t): void { - $logfile = DOL_DATA_ROOT.'/dolibarr.log'; - $lines = file($logfile); + // Get the lines that were added since the start of the test + + $filecontent = (string) @file_get_contents($this->logfile); + $currentSize = strlen($filecontent); + if ($currentSize >= $this->logSizeAtSetup) { + $filecontent = substr($filecontent, $this->logSizeAtSetup); + } + $lines = preg_split("/\r?\n/", $filecontent, -1, PREG_SPLIT_NO_EMPTY); + + + // Determine the number of lines to show $nbLinesToShow = $this->nbLinesToShow; if ($t instanceof PHPUnit\Framework\Error\Notice) { $nbLinesToShow = 3; } + // Determine test information to show $failedTestMethod = $this->getName(false); $className = get_called_class(); @@ -132,18 +152,26 @@ abstract class CommonClassTest extends TestCase // Get the last line of the log $last_lines = array_slice($lines, $first_line, $nbLinesToShow); + + // Show log information + print PHP_EOL; // Use GitHub Action compatible group output (:warning: arguments not encoded) print "##[group]$className::$failedTestMethod failed - $argsText.".PHP_EOL; print "## Exception: {$t->getMessage()}".PHP_EOL; if ($nbLinesToShow) { - // Show partial log file contents when requested. - print "## Show last ".$nbLinesToShow." lines of dolibarr.log file -----".PHP_EOL; - foreach ($last_lines as $line) { - print $line.PHP_EOL; + $newLines = count($last_lines); + if ($newLines > 0) { + // Show partial log file contents when requested. + print "## Show last ".count($last_lines)." lines of dolibarr.log file -----".PHP_EOL; + foreach ($last_lines as $line) { + print $line.PHP_EOL; + } + print "## end of dolibarr.log for $className::$failedTestMethod".PHP_EOL; + } else { + print "## No new lines in 'dolibarr.log' since start of this test.".PHP_EOL; } - print "## end of dolibarr.log for $className::$failedTestMethod".PHP_EOL; } print "##[endgroup]".PHP_EOL; @@ -164,6 +192,9 @@ abstract class CommonClassTest extends TestCase $langs = $this->savlangs; $db = $this->savdb; + // Record the filesize to determine which part of the log to show on error + $this->logSizeAtSetup = (int) filesize($this->logfile); + if ((int) getenv('PHPUNIT_DEBUG') > 0) { print get_called_class().'::'.$this->getName(false)."::".__FUNCTION__.PHP_EOL; } From 2044a133e9734af33d60911c2eb2ad5455df81e8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Mar 2024 13:15:20 +0100 Subject: [PATCH 0385/1862] Fix warning --- htdocs/core/class/conf.class.php | 8 ++++---- htdocs/core/lib/functions.lib.php | 1 + test/phpunit/BuildDocTest.php | 16 ++++++++++------ test/phpunit/WebservicesInvoicesTest.php | 5 ++++- test/phpunit/WebservicesProductsTest.php | 5 ++++- test/phpunit/WebservicesThirdpartyTest.php | 5 ++++- 6 files changed, 27 insertions(+), 13 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index e9ef6837439..647354ef247 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -566,8 +566,8 @@ class Conf extends stdClass // Exception: Some dir are not the name of module. So we keep exception here for backward compatibility. - // Module fournisseur - if (!empty($this->fournisseur)) { + // Module supplier is on + if (isModEnabled('fournisseur')) { $this->fournisseur->commande = new stdClass(); $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata."/fournisseur/commande"); $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp."/fournisseur/commande/temp"); @@ -592,8 +592,8 @@ class Conf extends stdClass $this->fournisseur->payment->dir_output = $rootfordata."/fournisseur/payment"; // For backward compatibility $this->fournisseur->payment->dir_temp = $rootfortemp."/fournisseur/payment/temp"; // For backward compatibility - // To prepare split of module fournisseur into module 'fournisseur' + supplier_order + supplier_invoice - if (!empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) { // By default, if module supplier is on, and we don't use yet the new modules, we set artificially the module properties + // To prepare split of module supplier into module 'supplier' + 'supplier_order' + 'supplier_invoice' + if (!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) { // By default, if module supplier is on, and we don't use yet the new modules, we set artificially the module properties $this->supplier_order = new stdClass(); $this->supplier_order->enabled = 1; $this->supplier_order->multidir_output = array($this->entity => $rootfordata."/fournisseur/commande"); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2feb0e85511..d454e76bebd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -234,6 +234,7 @@ define( 'ficheinter' => 'intervention', // Backup for 'fichinter' 'propale' => 'propal', // Has old directory 'socpeople' => 'contact', // Has old directory + 'fournisseur' => 'supplier', // Has old directory 'actioncomm' => 'agenda', // NO module directory (public dir agenda) 'product_price' => 'productprice', // NO directory diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index b5bbc17e2ce..2ef528c7b84 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -87,11 +87,15 @@ class BuildDocTest extends CommonClassTest { global $conf,$user,$langs,$db; - if (!isModEnabled('facture')) { + if (!isModEnabled('supplier')) { + print __METHOD__." supplier module not enabled\n"; + die(1); + } + if (!isModEnabled('invoice')) { print __METHOD__." invoice module not enabled\n"; die(1); } - if (!isModEnabled('commande')) { + if (!isModEnabled('order')) { print __METHOD__." order module not enabled\n"; die(1); } @@ -99,15 +103,15 @@ class BuildDocTest extends CommonClassTest print __METHOD__." propal module not enabled\n"; die(1); } - if (!isModEnabled('projet')) { + if (!isModEnabled('project')) { print __METHOD__." project module not enabled\n"; die(1); } - if (!isModEnabled('expedition')) { + if (!isModEnabled('shipping')) { print __METHOD__." shipment module not enabled\n"; die(1); } - if (!isModEnabled('ficheinter')) { + if (!isModEnabled('intervention')) { print __METHOD__." intervention module not enabled\n"; die(1); } @@ -233,7 +237,7 @@ class BuildDocTest extends CommonClassTest $langs = $this->savlangs; $db = $this->savdb; - $conf->fournisseur->facture->dir_output .= '/temp'; + $conf->fournisseur->facture->dir_output .= '/temp'; // To not poluate the existing dir_output dir $localobject = new FactureFournisseur($db); $localobject->initAsSpecimen(); diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index 7a2404f2dd7..a11a7a43569 100644 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -231,7 +231,10 @@ class WebservicesInvoicesTest extends CommonClassTest } print __METHOD__." result=".$result['result']['result_code']." ".$result['result']['result_label']."\n"; - $this->assertEquals('OK', $result['result']['result_code']); + + $resultcode = empty($result['result']['result_code']) ? 'KO' : $result['result']['result_code']; + + $this->assertEquals('OK', $resultcode); $this->assertEquals('ref-phpunit-2', $result['ref_ext']); diff --git a/test/phpunit/WebservicesProductsTest.php b/test/phpunit/WebservicesProductsTest.php index 920254f618d..25e350d4a86 100644 --- a/test/phpunit/WebservicesProductsTest.php +++ b/test/phpunit/WebservicesProductsTest.php @@ -126,7 +126,10 @@ class WebservicesProductsTest extends CommonClassTest } print var_export($result, true); print __METHOD__." count(result)=".(is_array($result) ? count($result) : '')."\n"; - $this->assertEquals('OK', $result['result']['result_code']); + + $resultcode = empty($result['result']['result_code']) ? 'KO' : $result['result']['result_code']; + + $this->assertEquals('OK', $resultcode); return $result['id']; } diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index d3de9ec4a72..4df603a910d 100644 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -348,7 +348,10 @@ class WebservicesThirdpartyTest extends CommonClassTest } print __METHOD__." count(result)=".(is_array($result) ? count($result) : 0)."\n"; - $this->assertEquals('OK', $result['result']['result_code']); + + $resultcode = empty($result['result']['result_code']) ? 'KO' : $result['result']['result_code']; + + $this->assertEquals('OK', $resultcode); return $result; } From cb6c65183dd57d62160f2fd92b2ed66efdaa0ebd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Mar 2024 13:53:10 +0100 Subject: [PATCH 0386/1862] Fix bad condition on project field --- htdocs/compta/sociales/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 69a69891536..48e8b510877 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -102,7 +102,7 @@ $arrayfields = array( 'cs.fk_type' =>array('label'=>"Type", 'checked'=>1, 'position'=>30), 'cs.date_ech' =>array('label'=>"Date", 'checked'=>1, 'position'=>40), 'cs.periode' =>array('label'=>"PeriodEndDate", 'checked'=>1, 'position'=>50), - 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(isModEnabled('project'))), + 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled('project'))), 'cs.fk_user' =>array('label'=>"Employee", 'checked'=>1, 'position'=>70), 'cs.fk_mode_reglement' =>array('checked'=>-1, 'position'=>80, 'label'=>"DefaultPaymentMode"), 'cs.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>100), From 39458e7c313a1411e228d81d0c3686bdb4313217 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Mar 2024 14:28:04 +0100 Subject: [PATCH 0387/1862] Better error management --- htdocs/core/class/dolreceiptprinter.class.php | 3 +++ htdocs/takepos/ajax/ajax.php | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index ceed3bb58c4..0efd7b5a923 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -1028,6 +1028,9 @@ class dolReceiptPrinter extends Printer } if (!$error) { $parameter = (isset($obj['parameter']) ? $obj['parameter'] : ''); + + dol_syslog("initPrinter printerid=".$printerid." parameter=".$parameter); + try { $type = $obj['fk_type']; switch ($type) { diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index ee27b0541ba..887785c5137 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -397,15 +397,18 @@ if ($action == 'getProducts') { } } elseif ($action == "opendrawer" && $term != '') { top_httphead('application/html'); - require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; $printer = new dolReceiptPrinter($db); // check printer for terminal if (getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) { $printer->initPrinter(getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term)); // open cashdrawer - $printer->pulse(); - $printer->close(); + if ($printer->getPrintConnector()) { + $printer->pulse(); + $printer->close(); + } else { + print 'Failed to init printer with ID='.getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term); + } } } elseif ($action == "printinvoiceticket" && $term != '' && $id > 0 && $user->hasRight('facture', 'lire')) { top_httphead('application/html'); From 717297ef295f69c627295eff4f0dfdee3b37f2e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Mar 2024 14:49:27 +0100 Subject: [PATCH 0388/1862] FIX Wrong currency shown in TakePOS payment page --- htdocs/takepos/pay.php | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index f2e58f98573..df498a5fec7 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -248,6 +248,7 @@ if ($resql) { } } } + ?> +currency != $_SESSION["takeposcustomercurrency"]) { + //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency + $showothercurrency = 1; + include_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php'; + $multicurrency = new MultiCurrency($db); + $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]); +} +?> +
- trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?> + trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $conf->currency); + if ($showothercurrency) { + print '   (' . price($invoice->total_ht * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')'; + } + ?>
total_ttc) { ?>
- trans('RemainToPay'); ?>: multicurrency_code); ?> + trans('RemainToPay'); ?>: multicurrency_code); + if ($showothercurrency) { + print '   (' . price($remaintopay * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')'; + } + ?>
- trans("Received"); ?>: multicurrency_code); ?> + trans("Received"); ?>: multicurrency_code); + if ($showothercurrency) { + print '   (' . price(0 * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')'; + } + ?>
- trans("Change"); ?>: multicurrency_code); ?> + trans("Change"); ?>: multicurrency_code); + if ($showothercurrency) { + print '   (' . price(0 * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')'; + } + ?>
global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { From 074041d925ded7951bed03ce0bf0a47ccbc5f535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 2 Mar 2024 16:37:53 +0100 Subject: [PATCH 0389/1862] fix default value is incompatible with int (#28579) --- htdocs/core/lib/functions.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 629cf050548..b99f499e884 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2903,10 +2903,10 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs /** * Format a string. * - * @param string $fmt Format of strftime function (http://php.net/manual/fr/function.strftime.php) - * @param int $ts Timestamp (If is_gmt is true, timestamp is already includes timezone and daylight saving offset, if is_gmt is false, timestamp is a GMT timestamp and we must compensate with server PHP TZ) - * @param bool $is_gmt See comment of timestamp parameter - * @return string A formatted string + * @param string $fmt Format of strftime function (http://php.net/manual/fr/function.strftime.php) + * @param int|false $ts Timestamp (If is_gmt is true, timestamp is already includes timezone and daylight saving offset, if is_gmt is false, timestamp is a GMT timestamp and we must compensate with server PHP TZ) + * @param bool $is_gmt See comment of timestamp parameter + * @return string A formatted string * @see dol_stringtotime() */ function dol_strftime($fmt, $ts = false, $is_gmt = false) From fba15178eb9c52c3c8fd62bbace8416521d6c213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 2 Mar 2024 16:38:35 +0100 Subject: [PATCH 0390/1862] all initAsSpecimen return int (#28577) * all initAsSpecimen return int * all initAsSpecimen return int * all initAsSpecimen return int --- htdocs/accountancy/class/bookkeeping.class.php | 6 ++++-- htdocs/adherents/class/adherent_type.class.php | 5 ++++- htdocs/asset/class/asset.class.php | 5 +++-- htdocs/asset/class/assetmodel.class.php | 5 +++-- htdocs/bom/class/bom.class.php | 9 ++++++--- htdocs/bookcal/class/availabilities.class.php | 5 +++-- htdocs/bookcal/class/calendar.class.php | 6 +++--- htdocs/categories/class/categorie.class.php | 4 +++- .../comm/action/class/actioncommreminder.class.php | 5 +++-- htdocs/comm/propal/class/propal.class.php | 6 ++++-- htdocs/commande/class/commande.class.php | 6 ++++-- htdocs/compta/bank/class/account.class.php | 6 ++++-- htdocs/compta/bank/class/bankcateg.class.php | 5 ++++- htdocs/compta/bank/class/paymentvarious.class.php | 6 ++++-- htdocs/compta/facture/class/facture-rec.class.php | 6 ++++-- htdocs/compta/facture/class/facture.class.php | 5 ++++- htdocs/compta/facture/class/paymentterm.class.php | 5 ++++- htdocs/compta/localtax/class/localtax.class.php | 5 ++++- .../paiement/cheque/class/remisecheque.class.php | 5 ++++- htdocs/compta/paiement/class/cpaiement.class.php | 6 ++++-- htdocs/compta/paiement/class/paiement.class.php | 6 ++++-- .../compta/sociales/class/cchargesociales.class.php | 5 ++++- .../compta/sociales/class/chargesociales.class.php | 6 ++++-- .../class/paymentsocialcontribution.class.php | 5 ++++- htdocs/compta/tva/class/paymentvat.class.php | 5 ++++- htdocs/compta/tva/class/tva.class.php | 6 ++++-- htdocs/contact/class/contact.class.php | 2 ++ htdocs/contrat/class/contrat.class.php | 6 ++++-- htdocs/core/class/cgenericdic.class.php | 5 ++++- htdocs/core/class/ctyperesource.class.php | 5 ++++- htdocs/core/class/defaultvalues.class.php | 6 +++--- htdocs/core/class/discount.class.php | 5 ++++- htdocs/core/class/emailsenderprofile.class.php | 5 +++-- htdocs/core/class/events.class.php | 5 ++++- htdocs/core/class/menubase.class.php | 6 ++++-- htdocs/core/class/timespent.class.php | 8 ++++---- htdocs/cron/class/cronjob.class.php | 5 ++++- htdocs/datapolicy/class/datapolicycron.class.php | 4 ++-- htdocs/delivery/class/delivery.class.php | 4 +++- htdocs/don/class/don.class.php | 8 +++++--- htdocs/don/class/paymentdonation.class.php | 5 ++++- htdocs/ecm/class/ecmdirectory.class.php | 5 ++++- htdocs/ecm/class/ecmfiles.class.php | 6 ++++-- htdocs/emailcollector/class/emailcollector.class.php | 5 +++-- .../class/emailcollectoraction.class.php | 5 +++-- .../class/emailcollectorfilter.class.php | 5 +++-- .../class/conferenceorbooth.class.php | 5 +++-- .../class/conferenceorboothattendee.class.php | 5 +++-- htdocs/expedition/class/expedition.class.php | 6 ++++-- htdocs/expensereport/class/expensereport.class.php | 7 ++++--- .../class/paymentexpensereport.class.php | 5 ++++- htdocs/fichinter/class/fichinter.class.php | 6 ++++-- htdocs/fichinter/class/fichinterrec.class.php | 7 +++++-- htdocs/fourn/class/fournisseur.commande.class.php | 6 ++++-- .../class/fournisseur.commande.dispatch.class.php | 5 ++++- htdocs/fourn/class/fournisseur.facture-rec.class.php | 6 ++++-- htdocs/fourn/class/fournisseur.facture.class.php | 12 +++++++----- htdocs/fourn/class/paiementfourn.class.php | 5 ++++- htdocs/holiday/class/holiday.class.php | 6 ++++-- htdocs/hrm/class/establishment.class.php | 6 ++++-- htdocs/hrm/class/evaluation.class.php | 5 +++-- htdocs/hrm/class/evaluationdet.class.php | 5 +++-- htdocs/hrm/class/job.class.php | 5 +++-- htdocs/hrm/class/position.class.php | 5 +++-- htdocs/hrm/class/skill.class.php | 5 +++-- htdocs/hrm/class/skilldet.class.php | 5 +++-- htdocs/hrm/class/skillrank.class.php | 5 +++-- .../class/knowledgerecord.class.php | 6 ++++-- htdocs/loan/class/loan.class.php | 6 ++++-- .../modulebuilder/template/class/myobject.class.php | 6 +++--- htdocs/mrp/class/mo.class.php | 6 ++++-- htdocs/opensurvey/class/opensurveysondage.class.php | 6 ++++-- htdocs/partnership/class/partnership.class.php | 5 +++-- htdocs/partnership/class/partnership_type.class.php | 5 +++-- htdocs/product/class/product.class.php | 6 ++++-- htdocs/product/class/productbatch.class.php | 5 ++++- htdocs/product/class/productcustomerprice.class.php | 5 ++++- .../product/class/productfournisseurprice.class.php | 5 +++-- htdocs/product/class/propalmergepdfproduct.class.php | 5 ++++- .../dynamic_price/class/price_expression.class.php | 5 ++++- .../class/price_global_variable.class.php | 4 +++- .../class/price_global_variable_updater.class.php | 4 +++- htdocs/product/inventory/class/inventory.class.php | 7 +++++-- htdocs/product/stock/class/entrepot.class.php | 6 ++++-- htdocs/product/stock/class/mouvementstock.class.php | 7 ++++--- htdocs/product/stock/class/productlot.class.php | 6 ++++-- .../stock/class/productstockentrepot.class.php | 6 ++++-- .../stocktransfer/class/stocktransfer.class.php | 6 +++--- .../stocktransfer/class/stocktransferline.class.php | 5 +++-- htdocs/projet/class/project.class.php | 4 +++- htdocs/projet/class/task.class.php | 4 +++- htdocs/reception/class/reception.class.php | 6 ++++-- .../class/recruitmentcandidature.class.php | 5 +++-- .../class/recruitmentjobposition.class.php | 5 +++-- htdocs/salaries/class/paymentsalary.class.php | 6 ++++-- htdocs/salaries/class/salary.class.php | 5 ++++- htdocs/societe/class/companybankaccount.class.php | 5 ++++- htdocs/societe/class/companypaymentmode.class.php | 6 +++--- htdocs/societe/class/societe.class.php | 3 ++- htdocs/societe/class/societeaccount.class.php | 5 +++-- .../class/supplier_proposal.class.php | 4 +++- htdocs/ticket/class/cticketcategory.class.php | 5 +++-- htdocs/ticket/class/ticket.class.php | 3 ++- htdocs/user/class/user.class.php | 3 ++- htdocs/user/class/usergroup.class.php | 6 ++++-- htdocs/webhook/class/target.class.php | 6 ++++-- htdocs/website/class/website.class.php | 6 ++++-- htdocs/website/class/websitepage.class.php | 5 ++++- htdocs/workstation/class/workstation.class.php | 6 +++--- htdocs/zapier/class/hook.class.php | 6 +++--- test/phpunit/CommonClassTest.class.php | 1 + 111 files changed, 400 insertions(+), 198 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index a7d946f5ec7..f8b3215e083 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2014-2017 Olivier Geffroy * Copyright (C) 2015-2022 Alexandre Spangaro * Copyright (C) 2015-2020 Florian Henry - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -1723,7 +1723,7 @@ class BookKeeping extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1753,6 +1753,8 @@ class BookKeeping extends CommonObject $this->journal_label = 'Journal de vente'; $this->piece_num = 1234; $this->date_creation = $now; + + return 1; } /** diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index b0a9d88eaef..44f51ff9aca 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2019 Thibault Foucart * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -883,7 +884,7 @@ class AdherentType extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -907,6 +908,8 @@ class AdherentType extends CommonObject $this->members = array( $user->id => $user ); + + return 1; } /** diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 38da4658d25..4b468a5633c 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1508,7 +1509,7 @@ class Asset extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1516,7 +1517,7 @@ class Asset extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index 0694ae75fd6..12132d4b65a 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2021 Open-Dsi + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -774,7 +775,7 @@ class AssetModel extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -782,7 +783,7 @@ class AssetModel extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index e36415b4077..ba88dfff476 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2019 Laurent Destailleur * Copyright (C) 2023 Benjamin Falière * Copyright (C) 2023 Charlene Benke + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1368,13 +1369,15 @@ class BOM extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { $this->initAsSpecimenCommon(); $this->ref = 'BOM-123'; $this->date_creation = dol_now() - 20000; + + return 1; } @@ -2128,10 +2131,10 @@ class BOMLine extends CommonObjectLine * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 5e9ffe56f5c..a839ae3e52c 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2022 Alice Adminson + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -926,7 +927,7 @@ class Availabilities extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -934,7 +935,7 @@ class Availabilities extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index 5f7352bd493..eec383501db 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-2024 Frédéric France * Copyright (C) 2023 Alice Adminson * * This program is free software; you can redistribute it and/or modify @@ -915,7 +915,7 @@ class Calendar extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -923,7 +923,7 @@ class Calendar extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index b16a0608680..1f901d7381e 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -2078,7 +2078,7 @@ class Categorie extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -2092,6 +2092,8 @@ class Categorie extends CommonObject $this->description = 'This is a description'; $this->socid = 1; $this->type = self::TYPE_PRODUCT; + + return 1; } /** diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index 81d6249eaad..4880e42300d 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/htdocs/comm/action/class/actioncommreminder.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -264,10 +265,10 @@ class ActionCommReminder extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index f7c25ae4545..39c01663d93 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -13,7 +13,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2022 ATM Consulting * Copyright (C) 2022 OpenDSI @@ -3598,7 +3598,7 @@ class Propal extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -3683,6 +3683,8 @@ class Propal extends CommonObject $xnbp++; } + + return 1; } /** diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index e7f81eb8af5..d89d3b39dfb 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -11,7 +11,7 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2016-2022 Ferran Marcet - * Copyright (C) 2021-2023 Frédéric France + * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2022 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -3972,7 +3972,7 @@ class Commande extends CommonOrder * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -4056,6 +4056,8 @@ class Commande extends CommonOrder $xnbp++; } + + return 1; } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index d6568fb9855..980139ac752 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2019 JC Prieto - * Copyright (C) 2022-2023 Frédéric France + * Copyright (C) 2022-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1851,7 +1851,7 @@ class Account extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1876,6 +1876,8 @@ class Account extends CommonObject $this->owner_town = 'Owner town'; $this->owner_country_id = 'Owner country_id'; $this->country_id = 1; + + return 1; } /** diff --git a/htdocs/compta/bank/class/bankcateg.class.php b/htdocs/compta/bank/class/bankcateg.class.php index ad9d08b9fbc..ae96f872ce9 100644 --- a/htdocs/compta/bank/class/bankcateg.class.php +++ b/htdocs/compta/bank/class/bankcateg.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2008 Laurent Destailleur * Copyright (C) 2009 Regis Houssin * Copyright (C) 2016 Marcos García + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -354,11 +355,13 @@ class BankCateg // extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { $this->id = 0; $this->label = ''; + + return 1; } } diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 81f5e8e6320..33ac0d8f817 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -402,7 +402,7 @@ class PaymentVarious extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -419,6 +419,8 @@ class PaymentVarious extends CommonObject $this->fk_bank = 0; $this->fk_user_author = 0; $this->fk_user_modif = 0; + + return 1; } /** diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 14e090339bb..50317b0ece3 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Marcos García - * Copyright (C) 2017-2023 Frédéric France + * Copyright (C) 2017-2024 Frédéric France * Copyright (C) 2023 Nick Fragoulis * * This program is free software; you can redistribute it and/or modify @@ -1710,7 +1710,7 @@ class FactureRec extends CommonInvoice * id must be 0 if object instance is a specimen. * * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void + * @return int */ public function initAsSpecimen($option = '') { @@ -1830,6 +1830,8 @@ class FactureRec extends CommonInvoice } $this->usenewprice = 0; + + return 1; } /** diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index fc0ff165cd2..3f12e4e045f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -21,6 +21,7 @@ * Copyright (C) 2023 Gauthier VERDOL * Copyright (C) 2023 Nick Fragoulis * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -4996,7 +4997,7 @@ class Facture extends CommonInvoice * id must be 0 if object instance is a specimen. * * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void + * @return int */ public function initAsSpecimen($option = '') { @@ -5145,6 +5146,8 @@ class Facture extends CommonInvoice $this->lines[$xnbp] = $line; $xnbp++; } + + return 1; } /** diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 5d665921bc9..f23c8131d9f 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -432,7 +433,7 @@ class PaymentTerm // extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -446,5 +447,7 @@ class PaymentTerm // extends CommonObject $this->type_cdr = ''; $this->nbjour = ''; $this->decalage = ''; + + return 1; } } diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index ffc1c3314fb..579890f9b38 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -320,7 +321,7 @@ class Localtax extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -338,6 +339,8 @@ class Localtax extends CommonObject $this->fk_bank = 0; $this->fk_user_creat = $user->id; $this->fk_user_modif = $user->id; + + return 1; } diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index a659a0b460a..2be5b322d69 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011-2016 Juanjo Menent * Copyright (C) 2015 Marcos García + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -872,7 +873,7 @@ class RemiseCheque extends CommonObject * id must be 0 if object instance is a specimen. * * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void + * @return int */ public function initAsSpecimen($option = '') { @@ -887,6 +888,8 @@ class RemiseCheque extends CommonObject $this->ref = 'SPECIMEN'; $this->specimen = 1; $this->date_bordereau = $nownotime; + + return 1; } /** diff --git a/htdocs/compta/paiement/class/cpaiement.class.php b/htdocs/compta/paiement/class/cpaiement.class.php index 8b77c745061..a8a49ca43d3 100644 --- a/htdocs/compta/paiement/class/cpaiement.class.php +++ b/htdocs/compta/paiement/class/cpaiement.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -360,7 +360,7 @@ class Cpaiement extends CommonDict * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -372,5 +372,7 @@ class Cpaiement extends CommonDict $this->active = 1; $this->accountancy_code = ''; $this->module = ''; + + return 1; } } diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index b9fb85f148b..013c0fcebad 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Thibault FOUCART - * Copyright (C) 2018-2022 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Andreu Bisquerra Gaya * Copyright (C) 2021 OpenDsi * Copyright (C) 2023 Joachim Kueter @@ -1258,7 +1258,7 @@ class Paiement extends CommonObject * id must be 0 if object instance is a specimen. * * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void + * @return int */ public function initAsSpecimen($option = '') { @@ -1274,6 +1274,8 @@ class Paiement extends CommonObject $this->specimen = 1; $this->facid = 1; $this->datepaye = $nownotime; + + return 1; } diff --git a/htdocs/compta/sociales/class/cchargesociales.class.php b/htdocs/compta/sociales/class/cchargesociales.class.php index 287dda0dcb2..5141708f815 100644 --- a/htdocs/compta/sociales/class/cchargesociales.class.php +++ b/htdocs/compta/sociales/class/cchargesociales.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -514,7 +515,7 @@ class Cchargesociales * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -527,6 +528,8 @@ class Cchargesociales $this->fk_pays = 0; $this->module = ''; $this->accountancy_code = ''; + + return 1; } /** diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 066e007ad16..e81d5b80e5d 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur - * Copyright (C) 2016-2022 Frédéric France + * Copyright (C) 2016-2024 Frédéric France * Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2021 Gauthier VERDOL * @@ -737,7 +737,7 @@ class ChargeSociales extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -754,6 +754,8 @@ class ChargeSociales extends CommonObject $this->label = 'Social contribution label'; $this->type = 1; $this->type_label = 'Type of social contribution'; + + return 1; } /** diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 13844252901..2a724f56d42 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2002 Rodolphe Quiedeville * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2022 Alexandre Spangaro + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -527,7 +528,7 @@ class PaymentSocialContribution extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -544,6 +545,8 @@ class PaymentSocialContribution extends CommonObject $this->fk_bank = 0; $this->fk_user_creat = 0; $this->fk_user_modif = 0; + + return 1; } diff --git a/htdocs/compta/tva/class/paymentvat.class.php b/htdocs/compta/tva/class/paymentvat.class.php index 0d2d82b0dd0..f45cc80e909 100644 --- a/htdocs/compta/tva/class/paymentvat.class.php +++ b/htdocs/compta/tva/class/paymentvat.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2002 Rodolphe Quiedeville * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -530,7 +531,7 @@ class PaymentVAT extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -547,6 +548,8 @@ class PaymentVAT extends CommonObject $this->fk_bank = 0; $this->fk_user_creat = 0; $this->fk_user_modif = 0; + + return 1; } diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 568fea68048..9b6081e6d7f 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2011-2017 Alexandre Spangaro * Copyright (C) 2018 Philippe Grand - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2021 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -413,7 +413,7 @@ class Tva extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -428,6 +428,8 @@ class Tva extends CommonObject $this->fk_bank = 0; $this->fk_user_creat = 0; $this->fk_user_modif = 0; + + return 1; } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 65cf34dcaeb..9b6752305a7 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -11,6 +11,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Open-Dsi + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1683,6 +1684,7 @@ class Contact extends CommonObject $this->socid = $socid; $this->statut = 1; + return 1; } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 66f4aad8596..8139d7aa755 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2015-2018 Ferran Marcet * Copyright (C) 2024 William Mead * Copyright (C) 2024 MDW @@ -2442,7 +2442,7 @@ class Contrat extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -2507,6 +2507,8 @@ class Contrat extends CommonObject $this->lines[$xnbp] = $line; $xnbp++; } + + return 1; } /** diff --git a/htdocs/core/class/cgenericdic.class.php b/htdocs/core/class/cgenericdic.class.php index 7e163c56acb..9c617d9c78d 100644 --- a/htdocs/core/class/cgenericdic.class.php +++ b/htdocs/core/class/cgenericdic.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2016 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -471,7 +472,7 @@ class CGenericDic extends CommonDict * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -480,5 +481,7 @@ class CGenericDic extends CommonDict $this->code = 'CODE'; $this->label = 'Label'; $this->active = 1; + + return 1; } } diff --git a/htdocs/core/class/ctyperesource.class.php b/htdocs/core/class/ctyperesource.class.php index 717b7c43ec6..5d839fb0f26 100644 --- a/htdocs/core/class/ctyperesource.class.php +++ b/htdocs/core/class/ctyperesource.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2016 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -425,7 +426,7 @@ class Ctyperesource extends CommonDict * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -434,6 +435,8 @@ class Ctyperesource extends CommonDict $this->code = ''; $this->label = ''; $this->active = 0; + + return 1; } } diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index acd56ec12a5..8389630123a 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2021 Florian HENRY - * Copyright (C) 2021 Frédéric France + * Copyright (C) 2021-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -346,10 +346,10 @@ class DefaultValues extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 6f8157ca22c..bb597cb713b 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2024 Alexandre Janniaux + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -731,7 +732,7 @@ class DiscountAbsolute extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -742,5 +743,7 @@ class DiscountAbsolute extends CommonObject $this->amount_ttc = 11.96; $this->tva_tx = 19.6; $this->description = 'Specimen discount'; + + return 1; } } diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 2370ceaaad6..ec1eea0116c 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -371,11 +372,11 @@ class EmailSenderProfile extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 104a99d2f3d..a5dc47bb64c 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2019 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2023 William Mead + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -305,7 +306,7 @@ class Events // extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -318,5 +319,7 @@ class Events // extends CommonObject $this->ip = '1.2.3.4'; $this->user_agent = 'Mozilla specimen User Agent X.Y'; $this->prefix_session = dol_getprefix(); + + return 1; } } diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index b86ee41f60f..ebda232e331 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -478,7 +478,7 @@ class Menubase * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -499,6 +499,8 @@ class Menubase $this->enabled = ''; $this->user = 0; $this->tms = dol_now(); + + return 1; } diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index 1c5868176c7..36cedd67896 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-2024 Frédéric France * Copyright (C) 2023 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -923,15 +923,15 @@ class TimeSpent extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - // Set here init that are not commonf fields + // Set here init that are not common fields // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 9644153c2e4..eea29c83601 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2022 Laurent Destailleur * Copyright (C) 2013 Florian Henry * Copyright (C) 2023-2024 William Mead + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -934,7 +935,7 @@ class Cronjob extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -972,6 +973,8 @@ class Cronjob extends CommonObject $this->nbrun = 0; $this->maxrun = 100; $this->libname = ''; + + return 1; } diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 3dc187455fb..d83e4534acd 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 William Mead * * This program is free software: you can redistribute it and/or modify @@ -486,7 +486,7 @@ class DataPolicyCron if ($object->isObjectUsed($obj->rowid) == 0) { // If object to clean is used foreach ($params['fields_anonym'] as $field => $val) { if ($val == 'MAKEANONYMOUS') { - $object->$field = $field.'-anonymous-'.$obj->rowid; + $object->$field = $field.'-anonymous-'.$obj->rowid; // @phpstan-ignore-line } else { $object->$field = $val; } diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index a5017547c34..6e634bfb669 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -965,7 +965,7 @@ class Delivery extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1012,6 +1012,8 @@ class Delivery extends CommonObject $line->total_ht = 100; $this->lines[$i] = $line; + + return 1; } /** diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 19cc0ed8dee..dbdd5caf745 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2019 Thibault FOUCART - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2021 Maxime DEMAREST * * This program is free software; you can redistribute it and/or modify @@ -234,7 +234,7 @@ class Don extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -283,7 +283,9 @@ class Don extends CommonObject $this->email = 'email@email.com'; $this->phone = '0123456789'; $this->phone_mobile = '0606060606'; - $this->statut = 1; + $this->status = 1; + + return 1; } diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 6720301d326..3d5a1e9071f 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -540,7 +541,7 @@ class PaymentDonation extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -558,6 +559,8 @@ class PaymentDonation extends CommonObject $this->fk_bank = 0; $this->fk_user_creat = dol_now(); $this->fk_user_modif = dol_now(); + + return 1; } diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 6e73b229858..905eabdb5c1 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2008-2012 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -450,7 +451,7 @@ class EcmDirectory extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -459,6 +460,8 @@ class EcmDirectory extends CommonObject $this->label = 'MyDirectory'; $this->fk_parent = 0; $this->description = 'This is a directory'; + + return 1; } diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 5e1c0107cfa..ce77414b31b 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Francis Appels - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -957,7 +957,7 @@ class EcmFiles extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -983,6 +983,8 @@ class EcmFiles extends CommonObject $this->acl = ''; $this->src_object_type = 'product'; $this->src_object_id = 1; + + return 1; } } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 86672a0f225..bffa405796e 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -698,14 +699,14 @@ class EmailCollector extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { $this->host = 'localhost'; $this->login = 'alogin'; - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index 6a49ee7fa87..bdefd8a1f87 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -1,6 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -449,10 +450,10 @@ class EmailCollectorAction extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index 6618633a6b3..52acc3440d7 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -1,6 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -463,10 +464,10 @@ class EmailCollectorFilter extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index d71fc6b2a9f..69cfcbf7b23 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -1,6 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -749,11 +750,11 @@ class ConferenceOrBooth extends ActionComm * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index eecb06e137c..6df9bad4a72 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -1,6 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -946,11 +947,11 @@ class ConferenceOrBoothAttendee extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index d5d689618d8..4704baf9bb3 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -11,7 +11,7 @@ * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016-2022 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Lenin Rivas * * This program is free software; you can redistribute it and/or modify @@ -2003,7 +2003,7 @@ class Expedition extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -2055,6 +2055,8 @@ class Expedition extends CommonObject $this->lines[] = $line; $xnbp++; } + + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 46b7706d4f6..38d86dc15c7 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2015 Laurent Destailleur * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (c) 2018-2023 Frédéric France + * Copyright (c) 2018-2024 Frédéric France * Copyright (C) 2016-2020 Ferran Marcet * * This program is free software; you can redistribute it and/or modify @@ -876,7 +876,7 @@ class ExpenseReport extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -898,7 +898,6 @@ class ExpenseReport extends CommonObject $type_fees_id = 2; // TF_TRIP $this->status = 5; - $this->fk_statut = 5; $this->fk_user_author = $user->id; $this->fk_user_validator = $user->id; @@ -932,6 +931,8 @@ class ExpenseReport extends CommonObject $this->total_tva += $line->total_tva; $this->total_ttc += $line->total_ttc; } + + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index ca7da95f824..09ea23d79c1 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -495,7 +496,7 @@ class PaymentExpenseReport extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -512,6 +513,8 @@ class PaymentExpenseReport extends CommonObject $this->fk_bank = 0; $this->fk_user_creat = 0; $this->fk_user_modif = 0; + + return 1; } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 6e8195ac3d9..0b29b094202 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015-2020 Charlene Benke * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023-2024 William Mead * * This program is free software; you can redistribute it and/or modify @@ -1401,7 +1401,7 @@ class Fichinter extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1433,6 +1433,8 @@ class Fichinter extends CommonObject $this->duration += $line->duration; } + + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index f81c1812b1c..9e529651f8a 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2016-2018 Charlie Benke * Copyright (C) 2024 William Mead + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -304,7 +305,7 @@ class FichinterRec extends Fichinter $obj = $this->db->fetch_object($result); $this->id = $rowid; - $this->title = $obj->title; + $this->title = $obj->title; $this->ref = $obj->title; $this->description = $obj->description; $this->datec = $obj->datec; @@ -674,7 +675,7 @@ class FichinterRec extends Fichinter * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -685,6 +686,8 @@ class FichinterRec extends Fichinter parent::initAsSpecimen(); $this->usenewprice = 1; + + return 1; } /** diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 7a3ecf3dae6..2e128bcd7ec 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018-2022 Ferran Marcet * Copyright (C) 2021 Josep Lluís Amador * Copyright (C) 2022 Gauthier VERDOL @@ -3079,7 +3079,7 @@ class CommandeFournisseur extends CommonOrder * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -3156,6 +3156,8 @@ class CommandeFournisseur extends CommonOrder $xnbp++; } + + return 1; } /** diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index b8bc60a463d..2b415cfc936 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -619,7 +620,7 @@ class CommandeFournisseurDispatch extends CommonObjectLine * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -638,6 +639,8 @@ class CommandeFournisseurDispatch extends CommonObjectLine $this->batch = ''; $this->eatby = ''; $this->sellby = ''; + + return 1; } /** diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 820c92baa11..f592f36ea9f 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Marcos García - * Copyright (C) 2017-2020 Frédéric France + * Copyright (C) 2017-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1651,7 +1651,7 @@ class FactureFournisseurRec extends CommonInvoice * id must be 0 if object instance is a specimen. * * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void + * @return int */ public function initAsSpecimen($option = '') { @@ -1771,6 +1771,8 @@ class FactureFournisseurRec extends CommonInvoice } $this->usenewprice = 0; + + return 1; } /** diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 887b5ab425f..87af56e106c 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2015-2022 Ferran Marcet * Copyright (C) 2016-2023 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023 Nick Fragoulis * @@ -2989,7 +2989,7 @@ class FactureFournisseur extends CommonInvoice * id must be 0 if object instance is a specimen. * * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void + * @return int */ public function initAsSpecimen($option = '') { @@ -3077,9 +3077,11 @@ class FactureFournisseur extends CommonInvoice } } - $this->total_ht = $xnbp * 100; - $this->total_tva = $xnbp * 19.6; - $this->total_ttc = $xnbp * 119.6; + $this->total_ht = $xnbp * 100; + $this->total_tva = $xnbp * 19.6; + $this->total_ttc = $xnbp * 119.6; + + return 1; } /** diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 7a33f41eb06..132af79c05f 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -9,6 +9,7 @@ * Copyright (C) 2018 Frédéric France * Copyright (C) 2023 Joachim Kueter * Copyright (C) 2023 Sylvain Legrand + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -725,7 +726,7 @@ class PaiementFourn extends Paiement * id must be 0 if object instance is a specimen. * * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void + * @return int */ public function initAsSpecimen($option = '') { @@ -740,6 +741,8 @@ class PaiementFourn extends Paiement $this->facid = 1; $this->socid = 1; $this->datepaye = $nownotime; + + return 1; } /** diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 6d22e0a915d..b778a22466d 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2012-2016 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2016 Juanjo Menent - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2344,7 +2344,7 @@ class Holiday extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -2364,6 +2364,8 @@ class Holiday extends CommonObject $this->fk_type = 1; $this->statut = Holiday::STATUS_VALIDATED; $this->status = Holiday::STATUS_VALIDATED; + + return 1; } /** diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 291546f253b..6825247be89 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -541,12 +541,14 @@ class Establishment extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { $this->id = 0; $this->ref = '0'; $this->label = 'Department AAA'; + + return 1; } } diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index c900f583cb4..be133e09c62 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -906,7 +907,7 @@ class Evaluation extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -914,7 +915,7 @@ class Evaluation extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 6e9099a2f73..216b5ff1704 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -874,7 +875,7 @@ class EvaluationLine extends CommonObjectLine * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -882,7 +883,7 @@ class EvaluationLine extends CommonObjectLine // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 34f0960cb94..743a5f75e02 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -914,7 +915,7 @@ class Job extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -922,7 +923,7 @@ class Job extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index 4577c13ba33..14fe2f18be4 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -956,7 +957,7 @@ class Position extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -964,7 +965,7 @@ class Position extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index 3eed59b8665..6d3be881130 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -955,7 +956,7 @@ class Skill extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -963,7 +964,7 @@ class Skill extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index 78318fc1514..8865aa94db8 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -864,7 +865,7 @@ class Skilldet extends CommonObjectLine * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -872,7 +873,7 @@ class Skilldet extends CommonObjectLine // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index c66a86c5e0d..788cf2a1ded 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -912,7 +913,7 @@ class SkillRank extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -920,7 +921,7 @@ class SkillRank extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index b8148c97f43..5e8011fd645 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -958,12 +959,13 @@ class KnowledgeRecord extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { $this->question = "ABCD"; - $this->initAsSpecimenCommon(); + + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 89b7a974854..3eb5b1bdc45 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015-2023 Frédéric France + * Copyright (C) 2015-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -609,7 +609,7 @@ class Loan extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -631,6 +631,8 @@ class Loan extends CommonObject $this->capital = 20000; $this->nbterm = 48; $this->rate = 4.3; + + return 1; } /** diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index cf83e9228d7..c0363bbc5b6 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-2024 Frédéric France * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify @@ -1118,7 +1118,7 @@ class MyObject extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1126,7 +1126,7 @@ class MyObject extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index eb72e1cdaab..24595cab867 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1589,13 +1589,15 @@ class Mo extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + $ret = $this->initAsSpecimenCommon(); $this->lines = array(); + + return $ret; } /** diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 538b9df3268..e69330ceddd 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2014 Marcos García - * Copyright (C) 2020-2024 Frédéric France + * Copyright (C) 2020-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -615,7 +615,7 @@ class Opensurveysondage extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -630,6 +630,8 @@ class Opensurveysondage extends CommonObject $this->status = 1; $this->format = 'classic'; $this->mailsonde = 0; + + return 1; } /** diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 811697a1216..f3779321a51 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2021 NextGestion + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1161,11 +1162,11 @@ class Partnership extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index f02aa2c011c..06f7ab7b35c 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2019 Thibault Foucart * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -415,7 +416,7 @@ class PartnershipType extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -423,6 +424,6 @@ class PartnershipType extends CommonObject // $this->property1 = ... // $this->property2 = ... - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 1cfc859b2b9..262fbeaeb6c 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -14,7 +14,7 @@ * Copyright (C) 2014 Ion agorria * Copyright (C) 2016-2018 Ferran Marcet * Copyright (C) 2017 Gustavo Novaro - * Copyright (C) 2019-2023 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2023 Benjamin Falière * * This program is free software; you can redistribute it and/or modify @@ -6341,7 +6341,7 @@ class Product extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -6380,6 +6380,8 @@ class Product extends CommonObject $this->volume_units = 0; $this->barcode = -1; // Create barcode automatically + + return 1; } /** diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 5f5987b439f..a447910fe5d 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2013-2014 Cedric GROSS + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -335,7 +336,7 @@ class Productbatch extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -347,6 +348,8 @@ class Productbatch extends CommonObject $this->eatby = ''; $this->batch = ''; $this->import_key = ''; + + return 1; } /** diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 2c63a76b059..a32fea0c6b6 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2014 Florian Henry + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1000,7 +1001,7 @@ class ProductCustomerPrice extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1024,6 +1025,8 @@ class ProductCustomerPrice extends CommonObject $this->localtax2_tx = ''; $this->fk_user = 0; $this->import_key = ''; + + return 1; } } diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index 6812ce9f498..e178fce18e3 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2021 Alexis LAURIER + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -779,11 +780,11 @@ class ProductFournisseurPrice extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index a16edd1f53f..965a251a1f0 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2015 Florian HENRY + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -547,7 +548,7 @@ class Propalmergepdfproduct extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -560,6 +561,8 @@ class Propalmergepdfproduct extends CommonObject $this->datec = ''; $this->tms = dol_now(); $this->import_key = ''; + + return 1; } } diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php index 5a0fa5243ff..ef99ef8603c 100644 --- a/htdocs/product/dynamic_price/class/price_expression.class.php +++ b/htdocs/product/dynamic_price/class/price_expression.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2012 Laurent Destailleur * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Ion Agorria + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -325,11 +326,13 @@ class PriceExpression * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { $this->id = 0; $this->expression = ''; + + return 1; } } diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index 13cf5233342..6b81d780c49 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -281,7 +281,7 @@ class PriceGlobalVariable * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -289,6 +289,8 @@ class PriceGlobalVariable $this->code = ''; $this->description = ''; $this->value = ''; + + return 1; } /** diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index d36c0477bf4..42030aa290e 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -306,7 +306,7 @@ class PriceGlobalVariableUpdater * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -318,6 +318,8 @@ class PriceGlobalVariableUpdater $this->update_interval = 0; $this->next_update = 0; $this->last_status = ''; + + return 1; } /** diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index ae477dafd8e..d20e7336110 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -739,12 +740,14 @@ class Inventory extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + $ret = $this->initAsSpecimenCommon(); $this->title = ''; + + return $ret; } /** diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 010d657cb93..c3106759f8e 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2008 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2016 Francis Appels - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -841,7 +841,7 @@ class Entrepot extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -862,6 +862,8 @@ class Entrepot extends CommonObject $this->town = 'MyTown'; $this->country_id = 1; $this->country_code = 'FR'; + + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 6b310bdac1a..80751ebbec7 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2011 Jean Heimburger * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1066,16 +1067,16 @@ class MouvementStock extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { - global $user, $langs, $conf, $mysoc; - // Initialize parameters $this->id = 0; // There is no specific properties. All data into insert are provided as method parameter. + + return 1; } /** diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index cd4dca967dc..28f8b53c88b 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2018-2022 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -1205,7 +1205,7 @@ class Productlot extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1228,6 +1228,8 @@ class Productlot extends CommonObject $this->fk_user_creat = 0; $this->fk_user_modif = 0; $this->import_key = '123456'; + + return 1; } /** diff --git a/htdocs/product/stock/class/productstockentrepot.class.php b/htdocs/product/stock/class/productstockentrepot.class.php index 7d9e7c07d2b..f4dbdca4a75 100644 --- a/htdocs/product/stock/class/productstockentrepot.class.php +++ b/htdocs/product/stock/class/productstockentrepot.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -596,7 +596,7 @@ class ProductStockEntrepot extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -608,5 +608,7 @@ class ProductStockEntrepot extends CommonObject $this->seuil_stock_alerte = ''; $this->desiredstock = ''; $this->import_key = ''; + + return 1; } } diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index ba3ab193089..ed7c6394d61 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2022 Frédéric France + * Copyright (C) 2022-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -929,11 +929,11 @@ class StockTransfer extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php index 4e6847287ca..bc0c56baa3f 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -911,11 +912,11 @@ class StockTransferLine extends CommonObjectLine * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 893ced6f27c..4f6e2b36480 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1477,7 +1477,7 @@ class Project extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1520,6 +1520,8 @@ class Project extends CommonObject $xnbp++; } */ + + return 1; } /** diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index f474d200783..df339ae9004 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -897,7 +897,7 @@ class Task extends CommonObjectLine * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -912,6 +912,8 @@ class Task extends CommonObjectLine $this->progress = '25'; $this->status = 0; $this->note = 'This is a specimen task not'; + + return 1; } /** diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 2ab50c297f4..0aeb300a666 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -11,7 +11,7 @@ * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016-2022 Ferran Marcet * Copyright (C) 2018 Quentin Vial-Gouteyron - * Copyright (C) 2022-2023 Frédéric France + * Copyright (C) 2022-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1414,7 +1414,7 @@ class Reception extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -1465,6 +1465,8 @@ class Reception extends CommonObject $this->lines[] = $line; $xnbp++; } + + return 1; } /** diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index ae119deae92..0d02a59a573 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -906,11 +907,11 @@ class RecruitmentCandidature extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 049456248dd..3fa9c360610 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -1,6 +1,7 @@ /* Copyright (C) 2022 Alexandre Spangaro + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -973,11 +974,11 @@ class RecruitmentJobPosition extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 0f2760668df..18f3d1263e1 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2011-2022 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -556,7 +556,7 @@ class PaymentSalary extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -573,6 +573,8 @@ class PaymentSalary extends CommonObject $this->fk_bank = 0; $this->fk_user_author = 0; $this->fk_user_modif = 0; + + return 1; } diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index c7cbc98ccb3..85b2b312f16 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2011-2022 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -305,7 +306,7 @@ class Salary extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -323,6 +324,8 @@ class Salary extends CommonObject $this->fk_bank = 0; $this->fk_user_author = 0; $this->fk_user_modif = 0; + + return 1; } /** diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index e67452d4347..6b95ec4ab79 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Peter Fontaine * Copyright (C) 2016 Marcos García + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -673,7 +674,7 @@ class CompanyBankAccount extends Account * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -702,5 +703,7 @@ class CompanyBankAccount extends Account $this->frstrecur = 'FRST'; $this->socid = 1; + + return 1; } } diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index ce94ae75e38..99901fc00c8 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -552,10 +552,10 @@ class CompanyPaymentMode extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 2885555b01a..abdd447f9a1 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -15,7 +15,7 @@ * Copyright (C) 2017 Rui Strecht * Copyright (C) 2018 Philippe Grand * Copyright (C) 2019-2020 Josep Lluís Amador - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2020 Open-Dsi * Copyright (C) 2022 ButterflyOfFire * Copyright (C) 2023 Alexandre Janniaux @@ -4514,6 +4514,7 @@ class Societe extends CommonObject $this->idprof4 = 'idprof4'; $this->idprof5 = 'idprof5'; $this->idprof6 = 'idprof6'; + return 1; } diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 41bf4164981..c4a3f1fa824 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -561,10 +562,10 @@ class SocieteAccount extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index b2a681606df..05f790292a4 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2289,7 +2289,7 @@ class SupplierProposal extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -2362,6 +2362,8 @@ class SupplierProposal extends CommonObject $xnbp++; } + + return 1; } /** diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index e783a40372a..923219858f7 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -1,6 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -637,10 +638,10 @@ class CTicketCategory extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index d2f8fd9bb31..beace9b3dbd 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2016 Christophe Battarel - * Copyright (C) 2019-2023 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2020 Laurent Destailleur * Copyright (C) 2023 Charlene Benke * Copyright (C) 2023 Benjamin Falière @@ -1291,6 +1291,7 @@ class Ticket extends CommonObject $this->date_last_msg_sent = dol_now(); $this->date_close = dol_now(); $this->tms = dol_now(); + return 1; } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 996fbee5611..0d442f9e121 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2018 charlene Benke * Copyright (C) 2018-2021 Nicolas ZABOURI - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2019 Abbes Bahfir * Copyright (C) 2024 MDW * @@ -3471,6 +3471,7 @@ class User extends CommonObject $this->status = 1; $this->entity = 1; + return 1; } diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index b3a60d92d90..48ec6758351 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -7,7 +7,7 @@ * Copyright (C) 2014 Alexis Algoud * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2019 Abbes Bahfir - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -947,7 +947,7 @@ class UserGroup extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return int */ public function initAsSpecimen() { @@ -967,6 +967,8 @@ class UserGroup extends CommonObject $this->members = array( $user->id => $user ); + + return 1; } /** diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 1858d3791cb..6d538208dfa 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -1,6 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -858,13 +859,14 @@ class Target extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { $this->url = "https://thisisunurl"; $this->trigger_codes = "ThisIsATestCode"; - $this->initAsSpecimenCommon(); + + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index f22db99fd9c..a4b80193d02 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -909,7 +909,7 @@ class Website extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -929,6 +929,8 @@ class Website extends CommonObject $this->fk_user_modif = $user->id; $this->date_creation = dol_now(); $this->tms = dol_now(); + + return 1; } diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 5e408330b4f..737e57ac3ec 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2020 Nicolas ZABOURI + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -857,7 +858,7 @@ class WebsitePage extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { @@ -884,5 +885,7 @@ class WebsitePage extends CommonObject $this->date_modification = $now - (24 * 7 * 3600); $this->fk_user_creat = $user->id; $this->author_alias = 'mypublicpseudo'; + + return 1; } } diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index e38039e19c3..506071a26f2 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2020 Gauthier VERDOL - * Copyright (C) 2023-2024 Frédéric France + * Copyright (C) 2023-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -855,11 +855,11 @@ class Workstation extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } /** diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index 17c8d0c2160..68bda9bedb8 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -648,10 +648,10 @@ class Hook extends CommonObject * Initialise object with example values * Id must be 0 if object instance is a specimen * - * @return void + * @return int */ public function initAsSpecimen() { - $this->initAsSpecimenCommon(); + return $this->initAsSpecimenCommon(); } } diff --git a/test/phpunit/CommonClassTest.class.php b/test/phpunit/CommonClassTest.class.php index bd1bfa4948b..daf33bbff69 100644 --- a/test/phpunit/CommonClassTest.class.php +++ b/test/phpunit/CommonClassTest.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2018 Laurent Destailleur * Copyright (C) 2023 Alexandre Janniaux * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 9fc7749b961ce4b9f9bbaf3c05edafa559c86638 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 2 Mar 2024 16:38:53 +0100 Subject: [PATCH 0391/1862] Qual: Show exception type in error detail on phpunit error (#28576) # Qual: Show exception type in error detail on phpunit error Knowing the exception type can be helpful - it's not reported in the summary. --- test/phpunit/CommonClassTest.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/CommonClassTest.class.php b/test/phpunit/CommonClassTest.class.php index daf33bbff69..262dc2ad002 100644 --- a/test/phpunit/CommonClassTest.class.php +++ b/test/phpunit/CommonClassTest.class.php @@ -159,7 +159,7 @@ abstract class CommonClassTest extends TestCase print PHP_EOL; // Use GitHub Action compatible group output (:warning: arguments not encoded) print "##[group]$className::$failedTestMethod failed - $argsText.".PHP_EOL; - print "## Exception: {$t->getMessage()}".PHP_EOL; + print "## ".get_class($t).": {$t->getMessage()}".PHP_EOL; if ($nbLinesToShow) { $newLines = count($last_lines); From fa27adec1bb2e90d1c9cf8569c217cfefff1484f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Mar 2024 16:52:12 +0100 Subject: [PATCH 0392/1862] Clean trans --- .github/ISSUE_TEMPLATE/bug_report.yml | 15 ++------------- htdocs/comm/mailing/card.php | 2 +- htdocs/langs/en_US/datapolicy.lang | 12 ------------ htdocs/langs/en_US/mails.lang | 1 - htdocs/langs/en_US/main.lang | 3 ++- htdocs/langs/en_US/other.lang | 14 ++++++++------ 6 files changed, 13 insertions(+), 34 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 2c79a8cea03..7604b8ce86f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -19,20 +19,9 @@ body: - type: input id: environment-version attributes: - label: Environment Version + label: Dolibarr Version description: Affected Dolibarr version(s) - - - type: input - id: environment-os - attributes: - label: Environment OS - description: Server OS type and version - - - type: input - id: environment-webserver - attributes: - label: Environment Web server - description: Webserver type and version + placeholder: 19.0, develop, ... - type: input id: environment-php diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 639a655efb7..b8cb4c1f8d3 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -880,7 +880,7 @@ if ($action == 'create') { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("ResetMailing"), $langs->trans("ConfirmResetMailing", $object->ref), "confirm_reset", '', '', 2); } elseif ($action == 'delete') { // Confirm delete - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.(!empty($urlfrom) ? '&urlfrom='.urlencode($urlfrom) : ''), $langs->trans("DeleteAMailing"), $langs->trans("ConfirmDeleteMailing"), "confirm_delete", '', '', 1); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.(!empty($urlfrom) ? '&urlfrom='.urlencode($urlfrom) : ''), $langs->trans("DeleteMailing"), $langs->trans("ConfirmDeleteMailing"), "confirm_delete", '', '', 1); } if ($action != 'edit' && $action != 'edittxt' &&$action != 'edithtml') { diff --git a/htdocs/langs/en_US/datapolicy.lang b/htdocs/langs/en_US/datapolicy.lang index 4f3f3682ab1..69482b5884b 100644 --- a/htdocs/langs/en_US/datapolicy.lang +++ b/htdocs/langs/en_US/datapolicy.lang @@ -39,12 +39,7 @@ DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT = Nor prospect/Nor customer DATAPOLICY_CONTACT_FOURNISSEUR = Supplier DATAPOLICY_ADHERENT = Member DATAPOLICY_Tooltip_SETUP = Type of contact - Indicate your choices for each type. -DATAPOLICYMail = Emails Setup -DATAPOLICYSUBJECTMAIL = Subject of the email -DATAPOLICYCONTENTMAIL = Content of the email DATAPOLICYSUBSITUTION = You can use the following variables in your email (LINKACCEPT allows to create a link recording the agreement of the person, LINKREFUSED makes it possible to record the refusal of the person): -DATAPOLICYACCEPT = Message after agreement -DATAPOLICYREFUSE = Message after disagreement SendAgreementText = You can send a GDPR email to all your relevant contacts (who have not yet received an email and for which you have not registered anything about their GDPR agreement). To do this, use the following button. SendAgreement = Send emails AllAgreementSend = All emails have been sent @@ -60,12 +55,6 @@ DATAPOLICY_consentement = Consent obtained for the processing of personal data DATAPOLICY_opposition_traitement = Opposes to the processing of his personal data DATAPOLICY_opposition_prospection = Opposes to the processing of his personal data for the purposes of prospecting -# -# Popup -# -DATAPOLICY_POPUP_ANONYME_TITLE = Anonymize a third party -DATAPOLICY_POPUP_ANONYME_TEXTE = You can not delete this contact from Dolibarr because there are related items. In accordance with the GDPR, you will make all this data anonymous to respect your obligations. Would you like to continue ? - # # Button for portability # @@ -80,7 +69,6 @@ ANONYMISER_AT = Anonymised the %s DATAPOLICY_date = Date of agreement/disagreement GDPR DATAPOLICY_send = Date agreement email sent -DATAPOLICY_SEND = Send GDPR email MailSent = Email has been sent # ERROR diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 159d1a0bd9e..d2e29b3941a 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -30,7 +30,6 @@ NewSMSing=New smsing EditMailing=Edit emailing ResetMailing=Resend emailing DeleteMailing=Delete emailing -DeleteAMailing=Delete an emailing PreviewMailing=Preview emailing CreateMailing=Create emailing TestMailing=Test diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 129a7d0feb0..95042a5cc24 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -383,6 +383,7 @@ PriceUHT=U.P. (net) PriceUHTCurrency=U.P (net) (currency) PriceUTTC=U.P. (inc. tax) Amount=Amount +Amounts=Amounts AmountInvoice=Invoice amount AmountInvoiced=Amount invoiced AmountInvoicedHT=Amount invoiced (excl. tax) @@ -1276,4 +1277,4 @@ UseOrOperatorShort=or GoOnList=Go on list ShowSearchFields=Do a search MyUserCard=My user file -PublicFile=Public file \ No newline at end of file +PublicFile=Public file diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 0e1503187a6..a1e25cea1af 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -185,7 +185,7 @@ SizeUnitfoot=foot SizeUnitpoint=point BugTracker=Bug tracker SendNewPasswordDesc=This form allows you to request a new password. It will be sent to your email address.
Change will become effective once you click on the confirmation link in the email.
Check your inbox. -EnterNewPasswordHere=Enter your new password here +EnterNewPasswordHere=Enter your new password here BackToLoginPage=Back to login page AuthenticationDoesNotAllowSendNewPassword=Authentication mode is %s.
In this mode, Dolibarr can't know nor change your password.
Contact your system administrator if you want to change your password. EnableGDLibraryDesc=Install or enable GD library on your PHP installation to use this option. @@ -260,10 +260,10 @@ PassEncoding=Password encoding PermissionsAdd=Permissions added PermissionsDelete=Permissions removed YourPasswordMustHaveAtLeastXChars=Your password must have at least %s chars -PasswordNeedAtLeastXUpperCaseChars=The password need at least %s upper case chars -PasswordNeedAtLeastXDigitChars=The password need at least %s numeric chars +PasswordNeedAtLeastXUpperCaseChars=The password need at least %s upper case chars +PasswordNeedAtLeastXDigitChars=The password need at least %s numeric chars PasswordNeedAtLeastXSpecialChars=The password need at least %s special chars -PasswordNeedNoXConsecutiveChars=The password must not have %s consecutive similar chars +PasswordNeedNoXConsecutiveChars=The password must not have %s consecutive similar chars YourPasswordHasBeenReset=Your password has been reset successfully ApplicantIpAddress=IP address of applicant SMSSentTo=SMS sent to %s @@ -275,7 +275,9 @@ TicketCreatedByEmailCollector=Ticket created by email collector from email MSGID OpeningHoursFormatDesc=Use a - to separate opening and closing hours.
Use a space to enter different ranges.
Example: 8-12 14-18 SuffixSessionName=Suffix for session name LoginWith=Login with %s - +ObjectId=Object ID +FullData=Full data + ##### Export ##### ExportsArea=Exports area AvailableFormats=Available formats @@ -337,4 +339,4 @@ AddFolder=Create folder FileWasCreateFolder=Folder %s has been created FTPFailedToCreateFolder=Failed to create folder %s. SelectADay=Select a day in calendar -SelectANewDate=Select a new date \ No newline at end of file +SelectANewDate=Select a new date From ff0eea8ce6bbc3426fbf23012a9cdd988a806f79 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Mar 2024 16:56:04 +0100 Subject: [PATCH 0393/1862] Removed field that are never filled --- .github/ISSUE_TEMPLATE/bug_report.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 7604b8ce86f..57628ed8ac5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -35,22 +35,10 @@ body: label: Environment Database description: Database type and version - - type: input - id: environment-urls - attributes: - label: Environment URL(s) - description: Affected URL(s) - - - type: textarea - id: expected-behaviour - attributes: - label: Expected and actual behavior - description: Verbose description - - type: textarea id: reproduce attributes: - label: Steps to reproduce the behavior + label: Steps to reproduce the behavior and expected behavior description: Verbose description - type: textarea From 4b2fb64b51f6329119d15013a1f9b941cf2157a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Mar 2024 18:34:40 +0100 Subject: [PATCH 0394/1862] css --- htdocs/fourn/facture/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index b61ec85ab97..bdbc1777acd 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1273,7 +1273,7 @@ if (!empty($arrayfields['f.tms']['checked'])) { } // Status if (!empty($arrayfields['f.fk_statut']['checked'])) { - print '
'; + print ''; $liststatus = array('0'=>$langs->trans("Draft"), '1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid")); print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', 'center search_status width100 onrightofpage', 1); print ''; + print ''; $liststatus = array('0'=>$langs->trans("Draft"), '1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid")); print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', 'center search_status width100 onrightofpage', 1); print ''; // Combo list of AI features - $out .= ''; $out .= ''; foreach ($arrayofaifeatures as $key => $val) { - $out .= ''; + $labelhtml = $langs->trans($arrayofaifeatures[$key]['label']).($arrayofaifeatures[$key]['status'] == 'notused' ? ' ('.$langs->trans("NotUsed").')' : ""); + $labeltext = $langs->trans($arrayofaifeatures[$key]['label']); + $out .= ''; } /* $sql = "SELECT name FROM llx_const WHERE name LIKE 'MAIN_MODULE_%' AND value = '1'"; @@ -191,7 +192,7 @@ if ($action == 'edit') { } */ $out .= ''; - $out .= ajax_combobox("module_select"); + $out .= ajax_combobox("functioncode"); $out .= '
'; - foreach ($currentConfigurations as $key => $config) { - if (!preg_match('/^[a-z]+$/i', $key)) { // Ignore empty saved setup - continue; + $out = ''; + + if (!empty($currentConfigurations)) { + $out = '
'; + foreach ($currentConfigurations as $key => $config) { + if (!empty($key) && !preg_match('/^[a-z]+$/i', $key)) { // Ignore empty saved setup + continue; + } + + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; } - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; - $out .= ''; + $out .= ''; + $out .= '
'.$arrayofaifeatures[$key]['picto'].' '.$langs->trans($arrayofaifeatures[$key]['label']).'
'; + $out .= 'pre-Prompt'; + $out .= ''; + $out .= ''; + $out .= '
'; + $out .= 'Post-prompt'; + $out .= ''; + $out .= ''; + $out .= '
'.$langs->trans($arrayofaifeatures[$key]).'
'; - $out .= 'pre-Prompt'; - $out .= ''; - $out .= ''; - $out .= '
'; - $out .= 'Post-prompt'; - $out .= ''; - $out .= ''; - $out .= '
'; } - $out .= '
'; $out .= ''; diff --git a/htdocs/ai/admin/setup.php b/htdocs/ai/admin/setup.php index 4fdb1f02435..73e4765d7a4 100644 --- a/htdocs/ai/admin/setup.php +++ b/htdocs/ai/admin/setup.php @@ -61,14 +61,19 @@ if (!class_exists('FormSetup')) { $formSetup = new FormSetup($db); +// List all available IA $arrayofia = array('chatgpt'); foreach ($arrayofia as $ia) { // Setup conf AI_PUBLIC_INTERFACE_TOPIC - $item = $formSetup->newItem('AI_KEY_API_'.strtoupper($ia)); + /*$item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_ENDPOINT'); // Name of constant must end with _KEY so it is encrypted when saved into database. $item->defaultFieldValue = ''; -} + $item->cssClass = 'minwidth500';*/ + $item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_KEY'); // Name of constant must end with _KEY so it is encrypted when saved into database. + $item->defaultFieldValue = ''; + $item->cssClass = 'minwidth500'; +} $setupnotempty =+ count($formSetup->items); diff --git a/htdocs/ai/ajax/generate_content.php b/htdocs/ai/ajax/generate_content.php index 34d7f196753..9b1adf13b84 100644 --- a/htdocs/ai/ajax/generate_content.php +++ b/htdocs/ai/ajax/generate_content.php @@ -45,6 +45,11 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/ai/class/ai.class.php'; + +/* + * View + */ + top_httphead(); //get data from AJAX @@ -54,11 +59,12 @@ $jsonData = json_decode($rawData, true); if (is_null($jsonData)) { dol_print_error('data with format JSON valide.'); } -$chatGPT = new Ai($db); +$ai = new Ai($db); $instructions = dol_string_nohtmltag($jsonData['instructions'], 1, 'UTF-8'); +$function = 'textgeneration'; -$generatedContent = $chatGPT->generateContent($instructions, 'gpt-3.5-turbo', 'MAILING'); +$generatedContent = $ai->generateContent($instructions, 'auto', $function); if (is_array($generatedContent) && $generatedContent['error']) { print "Error : " . $generatedContent['message']; diff --git a/htdocs/ai/class/ai.class.php b/htdocs/ai/class/ai.class.php index 2771c1b0e06..399b3adb1ee 100644 --- a/htdocs/ai/class/ai.class.php +++ b/htdocs/ai/class/ai.class.php @@ -50,38 +50,72 @@ class Ai public function __construct($db) { $this->db = $db; - $this->apiEndpoint = dolibarr_get_const($this->db, 'AI_API_ENDPOINT'); - $this->apiKey = dolibarr_get_const($this->db, 'AI_KEY_API_CHATGPT'); + + $this->apiKey = getDolGlobalString('AI_API_CHATGPT_KEY'); } /** * Generate response of instructions - * @param string $instructions instruction for generate content - * @param string $model model name (chat,text,image...) - * @param string $moduleName Name of module - * @return mixed $response + * + * @param string $instructions instruction for generate content + * @param string $model model name ('gpt-3.5-turbo') + * @param string $function code of the feature we want to use ('emailing', 'transcription', 'audiotext', 'imagegeneration', 'translation') + * @return mixed $response */ - public function generateContent($instructions, $model = 'gpt-3.5-turbo', $moduleName = 'MAILING') + public function generateContent($instructions, $model = 'auto', $function = 'textgeneration') { - global $conf; + if (empty($this->apiEndpoint)) { + if ($function == 'textgeneration') { + $this->apiEndpoint = 'https://api.openai.com/v1/chat/completions'; + if ($model == 'auto') { + $model = getDolGlobalString('AI_API_CHATGPT_MODEL_TEXT', 'gpt-3.5-turbo'); + } + } + if ($function == 'imagegeneration') { + $this->apiEndpoint = 'https://api.openai.com/v1/images/generations'; + if ($model == 'auto') { + $model = getDolGlobalString('AI_API_CHATGPT_MODEL_IMAGE', 'dall-e-3'); + } + } + if ($function == 'audiotext') { + $this->apiEndpoint = 'https://api.openai.com/v1/audio/speech'; + if ($model == 'auto') { + $model = getDolGlobalString('AI_API_CHATGPT_MODEL_AUDIO', 'tts-1'); + } + } + if ($function == 'transcription') { + $this->apiEndpoint = 'https://api.openai.com/v1/audio/transcriptions'; + if ($model == 'auto') { + $model = getDolGlobalString('AI_API_CHATGPT_MODEL_TRANSCRIPT', 'whisper-1'); + } + } + if ($function == 'translation') { + $this->apiEndpoint = 'https://api.openai.com/v1/audio/translations'; + if ($model == 'auto') { + $model = getDolGlobalString('AI_API_CHATGPT_MODEL_TRANSLATE', 'whisper-1'); + } + } + } + try { - $configurationsJson = dolibarr_get_const($this->db, 'AI_CONFIGURATIONS_PROMPT', $conf->entity); + $configurationsJson = getDolGlobalString('AI_CONFIGURATIONS_PROMPT'); $configurations = json_decode($configurationsJson, true); $prePrompt = ''; $postPrompt = ''; - if (isset($configurations[$moduleName])) { - if (isset($configurations[$moduleName]['prePrompt'])) { - $prePrompt = $configurations[$moduleName]['prePrompt']; + if (isset($configurations[$function])) { + if (isset($configurations[$function]['prePrompt'])) { + $prePrompt = $configurations[$function]['prePrompt']; } - if (isset($configurations[$moduleName]['postPrompt'])) { - $postPrompt = $configurations[$moduleName]['postPrompt']; + if (isset($configurations[$function]['postPrompt'])) { + $postPrompt = $configurations[$function]['postPrompt']; } } $fullInstructions = $prePrompt.' '.$instructions.' .'.$postPrompt; + // TODO Replace this with a simple call of getDolURLContent(); $ch = curl_init($this->apiEndpoint); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([ diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index 32215871529..e5199267d31 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -573,6 +573,7 @@ class FormSetup } } + /** * This class help to create item for class formSetup */ @@ -646,6 +647,9 @@ class FormSetupItem public $enabled = 1; + /** + * @var string The css to use on the input field of item + */ public $cssClass = ''; /** diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6182aa8f97b..b7dd42c84e2 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2437,11 +2437,15 @@ ExportUseForce=Use the parameter -f ExportUseForceHelp=Force to continue the export even when an error is found (Backup may not be reliable) CustomPrompt=Custom prompts AiDescription=AI (Artificial Intelligence) features -AiDescriptionLong=Provides AI (Artificial Intelligence) features in different parts of the application. Need external AI API. -AI_KEY_API_CHATGPT= Key for ChatGPT AI api +AiDescriptionLong=Provides AI (Artificial Intelligence) features in different parts of the application. Need external AI API. +AI_API_CHATGPT_ENDPOINT=Endpoint for ChatGPT AI api +AI_API_CHATGPT_KEY=Key for ChatGPT AI api AiSetup=AI module setup AiCustomPrompt=AI custom prompt AI_CONFIGURATIONS_PROMPT=Custom prompt +TextGeneration=Text generation ImageGeneration=Image generation +VideoGeneration=Video generation +AudioText=Audio - Text AIPromptForFeatures=AI custom prompts for features EnterAnIP=Enter an IP address From 43b1adb4c6551cf26d5cd516f609af80b21301a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 01:40:06 +0100 Subject: [PATCH 0496/1862] Fix bad var name in security setup page --- htdocs/admin/system/security.php | 4 ++-- htdocs/langs/en_US/errors.lang | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 6ad04701a52..199b715d2ef 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -272,7 +272,7 @@ print '
'; if (file_exists($installlock)) { // If install not locked, no need to show this. if (file_exists($upgradeunlock)) { print ''.$langs->trans("DolibarrUpgrade").': '; - print img_warning().' '.$langs->trans("UpgradeHasBeenUnlocked", $upgradeunlock); + print img_warning().' '.$langs->trans("WarningUpgradeHasBeenUnlocked", $upgradeunlock); print '
'; } } @@ -756,7 +756,7 @@ print '
'; print 'WEBSITE_MAIN_SECURITY_FORCERP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or")." \"strict-origin-when-cross-origin\")
"; print '
'; -print 'WEBSITE_MAIN_SECURITY_FORCESTS = '.getDolGlobalString('>WEBSITE_MAIN_SECURITY_FORCESTS', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Example").": \"max-age=31536000; includeSubDomains\")
"; +print 'WEBSITE_MAIN_SECURITY_FORCESTS = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCESTS', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Example").": \"max-age=31536000; includeSubDomains\")
"; print '
'; print 'WEBSITE_MAIN_SECURITY_FORCEPP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCEPP', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Example").": \"camera: (); microphone: ();\")
"; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index b4883e7f6f4..625cb2bfc51 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -343,6 +343,7 @@ WarningConfFileMustBeReadOnly=Warning, your config file (htdocs/conf/conf.php WarningsOnXLines=Warnings on %s source record(s) WarningNoDocumentModelActivated=No model, for document generation, has been activated. A model will be chosen by default until you check your module setup. WarningLockFileDoesNotExists=Warning, once setup is finished, you must disable the installation/migration tools by adding a file install.lock into directory %s. Omitting the creation of this file is a grave security risk. +WarningUpgradeHasBeenUnlocked=Warning, upgrade process has been unlocked for everybody WarningUntilDirRemoved=This security warning will remain active as long as the vulnerability is present. WarningCloseAlways=Warning, closing is done even if amount differs between source and target elements. Enable this feature with caution. WarningUsingThisBoxSlowDown=Warning, using this box slow down seriously all pages showing the box. From 1552fac711177f376dee15e39812107619d681db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 01:54:41 +0100 Subject: [PATCH 0497/1862] Fix strict-origin --- htdocs/admin/system/security.php | 2 +- htdocs/main.inc.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 199b715d2ef..fce38310605 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -753,7 +753,7 @@ print 'WEBSITE_MAIN_SECURITY_FORCECSP = '.getDolGlobalString('W print '   ('.$langs->trans("Example").": \"frame-ancestors 'self'; default-src 'self' 'unsafe-inline'; style-src https://cdnjs.cloudflare.com *.googleapis.com; script-src *.transifex.com *.google-analytics.com *.googletagmanager.com; object-src https://youtube.com; frame-src https://youtube.com; img-src * data:;\")
"; print '
'; -print 'WEBSITE_MAIN_SECURITY_FORCERP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or")." \"strict-origin-when-cross-origin\")
"; +print 'WEBSITE_MAIN_SECURITY_FORCERP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").'=\"strict-origin\" '.$langs->trans("or")." \"strict-origin-when-cross-origin\")
"; print '
'; print 'WEBSITE_MAIN_SECURITY_FORCESTS = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCESTS', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Example").": \"max-age=31536000; includeSubDomains\")
"; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 548d2fb2099..44b62e8bb8f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1669,9 +1669,9 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0) // Referrer-Policy // Say if we must provide the referrer when we jump onto another web page. - // Default browser are 'strict-origin-when-cross-origin' (only domain is sent on other domain switching), we want more so we use 'same-origin' so browser doesn't send any referrer when going into another web site domain. + // Default browser are 'strict-origin-when-cross-origin' (only domain is sent on other domain switching), we want more so we use 'strict-origin' so browser doesn't send any referrer when going into another web site domain. if (!defined('MAIN_SECURITY_FORCERP')) { - $referrerpolicy = getDolGlobalString('MAIN_SECURITY_FORCERP', "same-origin"); + $referrerpolicy = getDolGlobalString('MAIN_SECURITY_FORCERP', "strict-origin"); header("Referrer-Policy: ".$referrerpolicy); } From 1a9fa740a5fbe8301a83851c76cdc7bd166be540 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 13:32:15 +0100 Subject: [PATCH 0498/1862] Fix quote --- htdocs/admin/system/security.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index fce38310605..8aee55d46ba 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -753,7 +753,7 @@ print 'WEBSITE_MAIN_SECURITY_FORCECSP = '.getDolGlobalString('W print '   ('.$langs->trans("Example").": \"frame-ancestors 'self'; default-src 'self' 'unsafe-inline'; style-src https://cdnjs.cloudflare.com *.googleapis.com; script-src *.transifex.com *.google-analytics.com *.googletagmanager.com; object-src https://youtube.com; frame-src https://youtube.com; img-src * data:;\")
"; print '
'; -print 'WEBSITE_MAIN_SECURITY_FORCERP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").'=\"strict-origin\" '.$langs->trans("or")." \"strict-origin-when-cross-origin\")
"; +print 'WEBSITE_MAIN_SECURITY_FORCERP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined")."=\"strict-origin\" ".$langs->trans("or")." \"strict-origin-when-cross-origin\")
"; print '
'; print 'WEBSITE_MAIN_SECURITY_FORCESTS = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCESTS', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Example").": \"max-age=31536000; includeSubDomains\")
"; From f1aa29507a62786c8de29fb0afc5c38e477f04bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 15:01:25 +0100 Subject: [PATCH 0499/1862] Fix sec more complete list of forbidden function --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6fe032f5456..0298ce0d439 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9738,6 +9738,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("get_defined_functions", "get_defined_vars", "get_defined_constants", "get_declared_classes")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities $forbiddenphpmethods = array('invoke', 'invokeArgs'); // Method of ReflectionFunction to execute a function From a644adbfe5334b156e8b4321c4769c025128684e Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 6 Mar 2024 15:57:34 +0100 Subject: [PATCH 0500/1862] New hook for getElementProperties --- htdocs/core/lib/functions.lib.php | 131 ++++++++++++++++++------------ 1 file changed, 79 insertions(+), 52 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 162d25420c1..d69dd57271f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -12058,16 +12058,16 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u /** * Get an array with properties of an element. * - * @param string $element_type Element type (Value of $object->element). Example: - * 'action', 'facture', 'project', 'project_task' or - * 'myobject@mymodule' or - * 'myobject_mysubobject' (where mymodule = myobject, like 'project_task') + * @param string $elementType Element type (Value of $object->element). Example: + * 'action', 'facture', 'project', 'project_task' or + * 'myobject@mymodule' or + * 'myobject_mysubobject' (where mymodule = myobject, like 'project_task') * @return array array('module'=>, 'classpath'=>, 'element'=>, 'subelement'=>, 'classfile'=>, 'classname'=>, 'dir_output'=>) * @see fetchObjectByElement(), getMultiDirOutput() */ -function getElementProperties($element_type) +function getElementProperties($elementType) { - global $conf; + global $conf, $db, $hookmanager; $regs = array(); @@ -12076,13 +12076,13 @@ function getElementProperties($element_type) $classfile = $classname = $classpath = $subdir = $dir_output = ''; // Parse element/subelement - $module = $element_type; - $element = $element_type; - $subelement = $element_type; - $table_element = $element_type; + $module = $elementType; + $element = $elementType; + $subelement = $elementType; + $table_element = $elementType; // If we ask a resource form external module (instead of default path) - if (preg_match('/^([^@]+)@([^@]+)$/i', $element_type, $regs)) { // 'myobject@mymodule' + if (preg_match('/^([^@]+)@([^@]+)$/i', $elementType, $regs)) { // 'myobject@mymodule' $element = $subelement = $regs[1]; $module = $regs[2]; } @@ -12095,138 +12095,138 @@ function getElementProperties($element_type) } // For compatibility and to work with non standard path - if ($element_type == "action") { + if ($elementType == "action") { $classpath = 'comm/action/class'; $subelement = 'Actioncomm'; $module = 'agenda'; $table_element = 'actioncomm'; - } elseif ($element_type == 'cronjob') { + } elseif ($elementType == 'cronjob') { $classpath = 'cron/class'; $module = 'cron'; $table_element = 'cron'; - } elseif ($element_type == 'adherent_type') { + } elseif ($elementType == 'adherent_type') { $classpath = 'adherents/class'; $classfile = 'adherent_type'; $module = 'adherent'; $subelement = 'adherent_type'; $classname = 'AdherentType'; $table_element = 'adherent_type'; - } elseif ($element_type == 'bank_account') { + } elseif ($elementType == 'bank_account') { $classpath = 'compta/bank/class'; $module = 'bank'; // We need $conf->bank->dir_output and not $conf->banque->dir_output $classfile = 'account'; $classname = 'Account'; - } elseif ($element_type == 'category') { + } elseif ($elementType == 'category') { $classpath = 'categories/class'; $module = 'categorie'; $subelement = 'categorie'; $table_element = 'categorie'; - } elseif ($element_type == 'contact') { + } elseif ($elementType == 'contact') { $classpath = 'contact/class'; $classfile = 'contact'; $module = 'societe'; $subelement = 'contact'; $table_element = 'socpeople'; - } elseif ($element_type == 'inventory') { + } elseif ($elementType == 'inventory') { $module = 'product'; $classpath = 'product/inventory/class'; - } elseif ($element_type == 'stock') { + } elseif ($elementType == 'stock') { $classpath = 'product/stock/class'; $classfile = 'entrepot'; $classname = 'Entrepot'; $table_element = 'entrepot'; - } elseif ($element_type == 'project') { + } elseif ($elementType == 'project') { $classpath = 'projet/class'; $module = 'projet'; $table_element = 'projet'; - } elseif ($element_type == 'project_task') { + } elseif ($elementType == 'project_task') { $classpath = 'projet/class'; $module = 'projet'; $subelement = 'task'; $table_element = 'projet_task'; - } elseif ($element_type == 'facture' || $element_type == 'invoice') { + } elseif ($elementType == 'facture' || $elementType == 'invoice') { $classpath = 'compta/facture/class'; $module = 'facture'; $subelement = 'facture'; $table_element = 'facture'; - } elseif ($element_type == 'commande' || $element_type == 'order') { + } elseif ($elementType == 'commande' || $elementType == 'order') { $classpath = 'commande/class'; $module = 'commande'; $subelement = 'commande'; $table_element = 'commande'; - } elseif ($element_type == 'propal') { + } elseif ($elementType == 'propal') { $classpath = 'comm/propal/class'; $table_element = 'propal'; - } elseif ($element_type == 'shipping') { + } elseif ($elementType == 'shipping') { $classpath = 'expedition/class'; $classfile = 'expedition'; $classname = 'Expedition'; $module = 'expedition'; $table_element = 'expedition'; - } elseif ($element_type == 'supplier_proposal') { + } elseif ($elementType == 'supplier_proposal') { $classpath = 'supplier_proposal/class'; $module = 'supplier_proposal'; $element = 'supplierproposal'; $classfile = 'supplier_proposal'; $subelement = 'supplierproposal'; - } elseif ($element_type == 'shipping') { + } elseif ($elementType == 'shipping') { $classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon'; - } elseif ($element_type == 'delivery') { + } elseif ($elementType == 'delivery') { $classpath = 'delivery/class'; $subelement = 'delivery'; $module = 'expedition'; - } elseif ($element_type == 'contract') { + } elseif ($elementType == 'contract') { $classpath = 'contrat/class'; $module = 'contrat'; $subelement = 'contrat'; $table_element = 'contract'; - } elseif ($element_type == 'mailing') { + } elseif ($elementType == 'mailing') { $classpath = 'comm/mailing/class'; $module = 'mailing'; $classfile = 'mailing'; $classname = 'Mailing'; $subelement = ''; - } elseif ($element_type == 'member') { + } elseif ($elementType == 'member') { $classpath = 'adherents/class'; $module = 'adherent'; $subelement = 'adherent'; $table_element = 'adherent'; - } elseif ($element_type == 'usergroup') { + } elseif ($elementType == 'usergroup') { $classpath = 'user/class'; $module = 'user'; - } elseif ($element_type == 'mo') { + } elseif ($elementType == 'mo') { $classpath = 'mrp/class'; $classfile = 'mo'; $classname = 'Mo'; $module = 'mrp'; $subelement = ''; $table_element = 'mrp_mo'; - } elseif ($element_type == 'cabinetmed_cons') { + } elseif ($elementType == 'cabinetmed_cons') { $classpath = 'cabinetmed/class'; $module = 'cabinetmed'; $subelement = 'cabinetmedcons'; $table_element = 'cabinetmedcons'; - } elseif ($element_type == 'fichinter') { + } elseif ($elementType == 'fichinter') { $classpath = 'fichinter/class'; $module = 'ficheinter'; $subelement = 'fichinter'; $table_element = 'fichinter'; - } elseif ($element_type == 'dolresource' || $element_type == 'resource') { + } elseif ($elementType == 'dolresource' || $elementType == 'resource') { $classpath = 'resource/class'; $module = 'resource'; $subelement = 'dolresource'; $table_element = 'resource'; - } elseif ($element_type == 'propaldet') { + } elseif ($elementType == 'propaldet') { $classpath = 'comm/propal/class'; $module = 'propal'; $subelement = 'propaleligne'; - } elseif ($element_type == 'opensurvey_sondage') { + } elseif ($elementType == 'opensurvey_sondage') { $classpath = 'opensurvey/class'; $module = 'opensurvey'; $subelement = 'opensurveysondage'; - } elseif ($element_type == 'order_supplier') { + } elseif ($elementType == 'order_supplier') { $classpath = 'fourn/class'; $module = 'fournisseur'; $classfile = 'fournisseur.commande'; @@ -12234,7 +12234,7 @@ function getElementProperties($element_type) $subelement = ''; $classname = 'CommandeFournisseur'; $table_element = 'commande_fournisseur'; - } elseif ($element_type == 'invoice_supplier') { + } elseif ($elementType == 'invoice_supplier') { $classpath = 'fourn/class'; $module = 'fournisseur'; $classfile = 'fournisseur.facture'; @@ -12242,19 +12242,19 @@ function getElementProperties($element_type) $subelement = ''; $classname = 'FactureFournisseur'; $table_element = 'facture_fourn'; - } elseif ($element_type == "service") { + } elseif ($elementType == "service") { $classpath = 'product/class'; $subelement = 'product'; $table_element = 'product'; - } elseif ($element_type == 'salary') { + } elseif ($elementType == 'salary') { $classpath = 'salaries/class'; $module = 'salaries'; - } elseif ($element_type == 'payment_salary') { + } elseif ($elementType == 'payment_salary') { $classpath = 'salaries/class'; $classfile = 'paymentsalary'; $classname = 'PaymentSalary'; $module = 'salaries'; - } elseif ($element_type == 'productlot') { + } elseif ($elementType == 'productlot') { $module = 'productbatch'; $classpath = 'product/stock/class'; $classfile = 'productlot'; @@ -12262,27 +12262,27 @@ function getElementProperties($element_type) $element = 'productlot'; $subelement = ''; $table_element = 'product_lot'; - } elseif ($element_type == 'websitepage') { + } elseif ($elementType == 'websitepage') { $classpath = 'website/class'; $classfile = 'websitepage'; $classname = 'Websitepage'; $module = 'website'; $subelement = 'websitepage'; $table_element = 'website_page'; - } elseif ($element_type == 'fiscalyear') { + } elseif ($elementType == 'fiscalyear') { $classpath = 'core/class'; $module = 'accounting'; $subelement = 'fiscalyear'; - } elseif ($element_type == 'chargesociales') { + } elseif ($elementType == 'chargesociales') { $classpath = 'compta/sociales/class'; $module = 'tax'; $table_element = 'chargesociales'; - } elseif ($element_type == 'tva') { + } elseif ($elementType == 'tva') { $classpath = 'compta/tva/class'; $module = 'tax'; $subdir = '/vat'; $table_element = 'tva'; - } elseif ($element_type == 'emailsenderprofile') { + } elseif ($elementType == 'emailsenderprofile') { $module = ''; $classpath = 'core/class'; $classfile = 'emailsenderprofile'; @@ -12322,7 +12322,7 @@ function getElementProperties($element_type) } $dir_output .= $subdir; - $element_properties = array( + $elementProperties = array( 'module' => $module, 'element' => $element, 'table_element' => $table_element, @@ -12333,8 +12333,35 @@ function getElementProperties($element_type) 'dir_output' => $dir_output ); - //var_dump($element_properties); - return $element_properties; + + // Add hook + if (!is_object($hookmanager)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($db); + } + $hookmanager->initHooks(array('elementproperties')); + + + // Hook params + $parameters = array( + 'elementType' => $elementType, + 'elementProperties' => $elementProperties + ); + + $reshook = $hookmanager->executeHooks('getElementProperties', $parameters); + + if ($reshook) { + $elementProperties = $hookmanager->resArray; + } elseif (!empty($hookmanager->resArray) && is_array($hookmanager->resArray)) { // resArray is always an array but for sécurity against misconfigured external modules + $elementProperties = array_replace($elementProperties, $hookmanager->resArray); + } + + // context of elementproperties doesn't need to exist out of this function so delete it to avoid elementproperties context is equal to all + if (($key = array_search('elementproperties', $hookmanager->contextarray)) !== false) { + unset($hookmanager->contextarray[$key]); + } + + return $elementProperties; } /** From 7866ee472bb7e825a949ab537a65b4efbe763ecf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 17:07:24 +0100 Subject: [PATCH 0501/1862] QUAL Clean code around dol_eval use --- ChangeLog | 1 + htdocs/adherents/list.php | 10 +-- htdocs/admin/emailcollector_list.php | 2 +- htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/admin/mails_templates.php | 2 +- htdocs/admin/menus/edit.php | 4 +- htdocs/admin/perms.php | 2 +- .../class/assetdepreciationoptions.class.php | 2 +- htdocs/asset/list.php | 2 +- htdocs/asset/model/list.php | 2 +- .../tpl/depreciation_options_edit.tpl.php | 2 +- htdocs/bom/bom_list.php | 2 +- htdocs/bookcal/availabilities_list.php | 2 +- htdocs/bookcal/calendar_list.php | 2 +- htdocs/comm/mailing/cibles.php | 2 +- htdocs/comm/propal/list.php | 2 +- .../compta/cashcontrol/cashcontrol_list.php | 2 +- htdocs/compta/facture/list.php | 2 +- htdocs/compta/resultat/result.php | 20 +---- htdocs/contact/list.php | 2 +- htdocs/core/boxes/box_scheduled_jobs.php | 2 +- htdocs/core/class/commonobject.class.php | 16 ++-- htdocs/core/class/extrafields.class.php | 14 +-- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/menu.class.php | 1 - htdocs/core/class/menubase.class.php | 6 +- htdocs/core/class/translate.class.php | 4 - htdocs/core/lib/company.lib.php | 4 +- htdocs/core/lib/customreports.lib.php | 12 +-- htdocs/core/lib/functions.lib.php | 88 ++++++++----------- .../core/tpl/admin_extrafields_view.tpl.php | 2 +- .../tpl/extrafields_list_array_fields.tpl.php | 4 +- .../tpl/extrafields_list_print_fields.tpl.php | 2 +- htdocs/core/tpl/extrafields_view.tpl.php | 6 +- ...terface_50_modTicket_TicketEmail.class.php | 4 +- .../conferenceorbooth_list.php | 2 +- .../conferenceorboothattendee_list.php | 2 +- htdocs/exports/class/export.class.php | 2 +- htdocs/fourn/commande/list.php | 2 +- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/position.php | 2 +- htdocs/hrm/position_list.php | 2 +- htdocs/hrm/skill_card.php | 2 +- htdocs/hrm/skill_list.php | 2 +- .../knowledgerecord_list.php | 2 +- htdocs/loan/list.php | 2 +- .../modulebuilder/template/myobject_list.php | 2 +- htdocs/mrp/mo_list.php | 4 +- htdocs/partnership/partnership_list.php | 2 +- htdocs/product/inventory/list.php | 2 +- htdocs/product/list.php | 2 +- htdocs/product/stock/list.php | 2 +- htdocs/product/stock/productlot_list.php | 2 +- .../stocktransfer/stocktransfer_list.php | 2 +- htdocs/projet/list.php | 2 +- htdocs/public/ticket/list.php | 2 +- .../recruitmentcandidature_list.php | 2 +- .../recruitmentjobposition_list.php | 2 +- htdocs/salaries/list.php | 2 +- htdocs/salaries/payments.php | 2 +- htdocs/societe/price.php | 2 +- htdocs/ticket/list.php | 2 +- htdocs/user/group/perms.php | 2 +- htdocs/user/perms.php | 2 +- htdocs/variants/list.php | 2 +- htdocs/webhook/target_list.php | 2 +- .../class/html.formlistwebportal.class.php | 2 +- .../class/html.formwebportal.class.php | 4 +- htdocs/workstation/workstation_list.php | 6 +- 70 files changed, 140 insertions(+), 172 deletions(-) diff --git a/ChangeLog b/ChangeLog index 278fc2984c0..66fc896615a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ The following changes may create regressions for some external modules, but were * All CLI tools (into /scripts) return a positive value to the shell if error (0 remains success) for a better cross platform compatibility. On linux the exit(-1) was caught as 255, it may be now exit(1) so will be caught as 1. * the parameter $filter of method fetchAll does not accept array of SQL but must be a string of an Universal Search Filter syntax. +* Use of dol_eval with parameter $returnvalue=0 is deprecated. ***** ChangeLog for 19.0.1 compared to 19.0.0 ***** diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 45b3e121d99..9e193f1052c 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -194,11 +194,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields[$tableprefix.'.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>dol_eval($val['enabled'], 1), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' =>(($visible < 0) ? 0 : 1), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 8d0c4ff1f27..84706102216 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -121,7 +121,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index e57e3794d3f..0f314ba993a 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -110,7 +110,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 9bbeade4cdd..6e651307207 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -1176,7 +1176,7 @@ if ($num) { continue; // It means this is a type of template not into elementList (may be because enabled condition of this type is false because module is not enabled) } // Test on 'enabled' - if (!dol_eval($obj->enabled, 1, 1, '1')) { + if (! (int) dol_eval($obj->enabled, 1, 1, '1')) { $i++; continue; // Email template not qualified } diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index f2969e5ed69..ac40bfd21d0 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -505,7 +505,7 @@ if ($action == 'create') { print '
'.$langs->trans('Enabled').''.$langs->trans('DetailEnabled'); if (!empty($menu->enabled)) { - print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->enabled, 1, 1, '1')).')'; + print ' ('.$langs->trans("ConditionIsCurrently").': '.yn((int) dol_eval($menu->enabled, 1, 1, '1')).')'; } print '
'.$langs->trans('Rights').''.$langs->trans('DetailRight'); if (!empty($menu->perms)) { - print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->perms, 1, 1, '1')).')'; + print ' ('.$langs->trans("ConditionIsCurrently").': '.yn((int) dol_eval($menu->perms, 1, 1, '1')).')'; } print '
'; $htmltext = $langs->trans("ID").': '.$obj->id; - $htmltext .= '
'.$langs->trans("Permission").': user->hasRight(\''.$obj->module.'\', \''.$obj->perms.'\''.($obj->subperms ? ', \''.$obj->subperms.'\'' : '').')'; + $htmltext .= '
'.$langs->trans("Permission").': user->hasRight(\''.dol_escape_htmltag($obj->module).'\', \''.dol_escape_htmltag($obj->perms).'\''.($obj->subperms ? ', \''.dol_escape_htmltag($obj->subperms).'\'' : '').')'; print $form->textwithpicto('', $htmltext); //print ''.$obj->id.''; print '
'.price($r).''.price($r).''.price($r).''.price($r).'
'; $htmltext = $langs->trans("ID").': '.$obj->id; - $htmltext .= '
'.$langs->trans("Permission").': user->rights->'.$obj->module.'->'.$obj->perms.($obj->subperms ? '->'.$obj->subperms : ''); + $htmltext .= '
'.$langs->trans("Permission").': user->hasRights(\''.$obj->module.'\', \''.$obj->perms.'\''.($obj->subperms ? ', \''.$obj->subperms.'\'' : '').')'; print $form->textwithpicto('', $htmltext); //print ''.$obj->id.''; print '
'; $htmltext = $langs->trans("ID").': '.$obj->id; - $htmltext .= '
'.$langs->trans("Permission").': user->rights->'.$obj->module.'->'.$obj->perms.($obj->subperms ? '->'.$obj->subperms : ''); + $htmltext .= '
'.$langs->trans("Permission").': user->hasRight(\''.dol_escape_htmltag($obj->module).'\', \''.dol_escape_htmltag($obj->perms).'\''.($obj->subperms ? ', \''.dol_escape_htmltag($obj->subperms).'\'' : '').')'; print $form->textwithpicto('', $htmltext); //print ''.$obj->id.''; print '
'.$langs->trans('Enabled').''.$langs->trans('DetailEnabled'); if (!empty($menu->enabled)) { - print ' ('.$langs->trans("ConditionIsCurrently").': '.yn((int) dol_eval($menu->enabled, 1, 1, '1')).')'; + print ' ('.$langs->trans("ConditionIsCurrently").': '.yn((int) dol_eval($menu->enabled, 1, 1, '1') <= 0 ? 0 : 1).')'; } print '
'.$langs->trans('Rights').''.$langs->trans('DetailRight'); if (!empty($menu->perms)) { - print ' ('.$langs->trans("ConditionIsCurrently").': '.yn((int) dol_eval($menu->perms, 1, 1, '1')).')'; + print ' ('.$langs->trans("ConditionIsCurrently").': '.yn((int) dol_eval($menu->perms, 1, 1, '1') <= 0 ? 0 : 1).')'; } print '
'."\n"; - $param = "socid=".urlencode($object->id); + $param = "socid=".urlencode((string) ($object->id)); if ($search_rowid != '') { - $param .= '&search_rowid='.urlencode($search_rowid); + $param .= '&search_rowid='.urlencode((string) ($search_rowid)); } if ($search_status != '') { - $param .= '&search_status='.urlencode($search_status); + $param .= '&search_status='.urlencode((string) ($search_status)); } if (count($search_roles) > 0) { $param .= implode('&search_roles[]=', $search_roles); From d023b43da96841bd2947a92cbad3824cde5a3646 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:50:35 +0100 Subject: [PATCH 0671/1862] Fix: Ensure string type for urlencode() --- htdocs/core/lib/invoice.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 9e6a39c63f9..14a80f1c751 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -47,7 +47,7 @@ function facture_prepare_head($object) if (!getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) { $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?id='.urlencode($object->id); + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?id='.urlencode((string) ($object->id)); $head[$h][1] = $langs->trans('ContactsAddresses'); if ($nbContact > 0) { $head[$h][1] .= ''.$nbContact.''; @@ -73,7 +73,7 @@ function facture_prepare_head($object) } $langs->load("banks"); - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?id='.urlencode($object->id); + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?id='.urlencode((string) ($object->id)); $head[$h][1] = $langs->trans('StandingOrders'); if ($nbStandingOrders > 0) { $head[$h][1] .= ''.$nbStandingOrders.''; @@ -120,7 +120,7 @@ function facture_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/compta/facture/agenda.php?id='.$object->id; $head[$h][1] = $langs->trans("Events"); - if (isModEnabled('agenda')&& ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { + if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { $nbEvent = 0; // Enable caching of thirdparty count actioncomm require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; @@ -262,7 +262,7 @@ function invoice_rec_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/compta/facture/agenda-rec.php?id='.$object->id; $head[$h][1] = $langs->trans("Events"); - if (isModEnabled('agenda')&& ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { + if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { $nbEvent = 0; // Enable caching of thirdparty count actioncomm require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; @@ -346,7 +346,7 @@ function getNumberInvoicesPieChart($mode) if (($mode == 'customers' && isModEnabled('invoice') && $user->hasRight('facture', 'lire')) || ($mode == 'suppliers' && (isModEnabled('fournisseur') || isModEnabled('supplier_invoice')) && $user->hasRight('fournisseur', 'facture', 'lire')) - ) { + ) { global $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus8, $badgeStatus11; include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; @@ -402,7 +402,7 @@ function getNumberInvoicesPieChart($mode) ,array($langs->trans('InvoiceNotLate15Days'), $obj->nbnotlate15 - $obj->nbnotlate30) ,array($langs->trans('InvoiceNotLate30Days'), $obj->nbnotlate30)); */ - $dataseries[$i]=array($langs->transnoentitiesnoconv('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30); + $dataseries[$i] = array($langs->transnoentitiesnoconv('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30); $i++; } if (!empty($dataseries[0])) { From d994f5f7c5157bc4050789847f777a78383e2c18 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:50:37 +0100 Subject: [PATCH 0672/1862] Fix: Ensure string type for urlencode() --- htdocs/don/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 2e28a7c2655..ac8c85fe697 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -164,7 +164,7 @@ if (empty($reshook)) { // Action update object if ($action == 'update') { if (!empty($cancel)) { - header("Location: ".$_SERVER['PHP_SELF']."?id=".urlencode($id)); + header("Location: ".$_SERVER['PHP_SELF']."?id=".urlencode((string) ($id))); exit; } From 040fc33b02f888b7c0eb5d4f24c89c8bdddc429c Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:50:41 +0100 Subject: [PATCH 0673/1862] Fix: Ensure string type for urlencode() --- htdocs/don/paiement/list.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/don/paiement/list.php b/htdocs/don/paiement/list.php index 4e25ab90823..b314131ca5b 100644 --- a/htdocs/don/paiement/list.php +++ b/htdocs/don/paiement/list.php @@ -269,22 +269,22 @@ if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); } if ($search_date_startday) { - $param .= '&search_date_startday='.urlencode($search_date_startday); + $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); } if ($search_date_startmonth) { - $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); + $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth)); } if ($search_date_startyear) { - $param .= '&search_date_startyear='.urlencode($search_date_startyear); + $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear)); } if ($search_date_endday) { - $param .= '&search_date_endday='.urlencode($search_date_endday); + $param .= '&search_date_endday='.urlencode((string) ($search_date_endday)); } if ($search_date_endmonth) { - $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); + $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth)); } if ($search_date_endyear) { - $param .= '&search_date_endyear='.urlencode($search_date_endyear); + $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear)); } if ($search_company) { $param .= '&search_company='.urlencode($search_company); @@ -296,7 +296,7 @@ if ($search_paymenttype) { $param .= '&search_paymenttype='.urlencode($search_paymenttype); } if ($search_account) { - $param .= '&search_account='.urlencode($search_account); + $param .= '&search_account='.urlencode((string) ($search_account)); } if ($search_payment_num) { $param .= '&search_payment_num='.urlencode($search_payment_num); From b37c850a4b1659920a592bff67d72cd08f36e58e Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:50:44 +0100 Subject: [PATCH 0674/1862] Fix: Ensure string type for urlencode() --- htdocs/ecm/index_medias.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/ecm/index_medias.php b/htdocs/ecm/index_medias.php index 8c888b6792a..cc98e0173b4 100644 --- a/htdocs/ecm/index_medias.php +++ b/htdocs/ecm/index_medias.php @@ -110,7 +110,7 @@ $hookmanager->initHooks(array('ecmmediascard', 'globalcard')); */ $savbacktopage = $backtopage; -$backtopage = $_SERVER["PHP_SELF"].'?file_manager=1&website='.urlencode($websitekey).'&pageid='.urlencode($pageid).(GETPOST('section_dir', 'alpha') ? '§ion_dir='.urlencode(GETPOST('section_dir', 'alpha')) : ''); // used after a confirm_deletefile into actions_linkedfiles.inc.php +$backtopage = $_SERVER["PHP_SELF"].'?file_manager=1&website='.urlencode((string) ($websitekey)).'&pageid='.urlencode((string) ($pageid)).(GETPOST('section_dir', 'alpha') ? '§ion_dir='.urlencode((string) (GETPOST('section_dir', 'alpha'))) : ''); // used after a confirm_deletefile into actions_linkedfiles.inc.php if ($sortfield) { $backtopage .= '&sortfield='.urlencode($sortfield); } @@ -232,11 +232,11 @@ if ($action == 'refreshmanual') { //print $ecmdirtmp->cachenbofdoc."
\n";exit; $id = $ecmdirtmp->create($user); if ($id > 0) { - $newdirsql = array('id'=>$id, - 'id_mere'=>$ecmdirtmp->fk_parent, - 'label'=>$ecmdirtmp->label, - 'description'=>$ecmdirtmp->description, - 'fullrelativename'=>$relativepathmissing); + $newdirsql = array('id' => $id, + 'id_mere' => $ecmdirtmp->fk_parent, + 'label' => $ecmdirtmp->label, + 'description' => $ecmdirtmp->description, + 'fullrelativename' => $relativepathmissing); $sqltree[] = $newdirsql; // We complete fulltree for following loops //var_dump($sqltree); $adirwascreated = 1; From 4d8c3fc588b57f349231e33759d0c10183eb55ef Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:50:47 +0100 Subject: [PATCH 0675/1862] Fix: Ensure string type for urlencode() --- htdocs/eventorganization/class/conferenceorbooth.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 0ff0e06936f..e71e7b2688b 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -258,7 +258,7 @@ class ConferenceOrBooth extends ActionComm $result = parent::fetch($id, $ref, $ref_ext, $email_msgid); - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.urlencode($id).'&type=conf'; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.urlencode((string) ($id)).'&type=conf'; $encodedsecurekey = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.$id, 2); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); From 049ff47d30ad8529400190cfd034fe5d55f40613 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:50:49 +0100 Subject: [PATCH 0676/1862] Fix: Ensure string type for urlencode() --- htdocs/eventorganization/conferenceorboothattendee_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 6e752262eff..93ae78eeeb2 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -709,7 +709,7 @@ if ($confOrBooth->id > 0) { $param .= '&conforboothid='.urlencode($confOrBooth->id); } if ($projectstatic->id > 0) { - $param .= '&fk_project='.urlencode($projectstatic->id); + $param .= '&fk_project='.urlencode((string) ($projectstatic->id)); } $param .= $withProjectUrl; From 1e5ae42b26b08a7f9855061f849d385eec400ee6 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:50:52 +0100 Subject: [PATCH 0677/1862] Fix: Ensure string type for urlencode() --- htdocs/expedition/list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 37e1c6a4e17..86309c6da9f 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -528,10 +528,10 @@ if ($search_ref_customer) { $param .= "&search_ref_customer=".urlencode($search_ref_customer); } if ($search_user > 0) { - $param .= '&search_user='.urlencode($search_user); + $param .= '&search_user='.urlencode((string) ($search_user)); } if ($search_sale > 0) { - $param .= '&search_sale='.urlencode($search_sale); + $param .= '&search_sale='.urlencode((string) ($search_sale)); } if ($search_company) { $param .= "&search_company=".urlencode($search_company); @@ -551,7 +551,7 @@ if ($search_zip) { $param .= '&search_zip='.urlencode($search_zip); } if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { - $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); + $param .= '&search_type_thirdparty='.urlencode((string) ($search_type_thirdparty)); } if ($search_datedelivery_start) { $param .= '&search_datedelivery_startday='.urlencode(dol_print_date($search_datedelivery_start, '%d')).'&search_datedelivery_startmonth='.urlencode(dol_print_date($search_datedelivery_start, '%m')).'&search_datedelivery_startyear='.urlencode(dol_print_date($search_datedelivery_start, '%Y')); @@ -566,10 +566,10 @@ if ($search_datereceipt_end) { $param .= '&search_datereceipt_endday='.urlencode(dol_print_date($search_datereceipt_end, '%d')).'&search_datereceipt_endmonth='.urlencode(dol_print_date($search_datereceipt_end, '%m')).'&search_datereceipt_endyear='.urlencode(dol_print_date($search_datereceipt_end, '%Y')); } if ($search_product_category != '') { - $param .= '&search_product_category='.urlencode($search_product_category); + $param .= '&search_product_category='.urlencode((string) ($search_product_category)); } if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { - $param .= '&search_categ_cus='.urlencode($search_categ_cus); + $param .= '&search_categ_cus='.urlencode((string) ($search_categ_cus)); } if ($search_status != '') { $param .= '&search_status='.urlencode($search_status); From 823c67585016e6a00c34acd4cdc10031d910cfa6 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:50:55 +0100 Subject: [PATCH 0678/1862] Fix: Ensure string type for urlencode() --- htdocs/expedition/shipment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 7809b47105b..1b4f33382a2 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -260,7 +260,7 @@ if ($id > 0 || !empty($ref)) { // Confirm validation if ($action == 'cloture') { - $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".urlencode($id), $langs->trans("CloseShipment"), $langs->trans("ConfirmCloseShipment"), "confirm_cloture"); + $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".urlencode((string) ($id)), $langs->trans("CloseShipment"), $langs->trans("ConfirmCloseShipment"), "confirm_cloture"); } // Call Hook formConfirm @@ -794,7 +794,7 @@ if ($id > 0 || !empty($ref)) { print ' '.img_warning($langs->trans("StockTooLow")); if (getDolGlobalString('STOCK_CORRECT_STOCK_IN_SHIPMENT')) { $nbPiece = $toBeShipped[$objp->fk_product] - $product->stock_reel; - print '   '.$langs->trans("GoTo").' '.$langs->trans("CorrectStock").''; + print '   '.$langs->trans("GoTo").' '.$langs->trans("CorrectStock").''; } } print ''; From 888ac3edeeb22d60397ec245f66cbef05ae89410 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:51:00 +0100 Subject: [PATCH 0679/1862] Fix: Ensure string type for urlencode() --- htdocs/expensereport/list.php | 78 +++++++++++++++++------------------ 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 06fb2d4e9ac..6cc403e87d5 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -149,29 +149,29 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'd.ref'=>'Ref', - 'd.note_public'=>"NotePublic", - 'u.lastname'=>'EmployeeLastname', - 'u.firstname'=>"EmployeeFirstname", - 'u.login'=>"Login", + 'd.ref' => 'Ref', + 'd.note_public' => "NotePublic", + 'u.lastname' => 'EmployeeLastname', + 'u.firstname' => "EmployeeFirstname", + 'u.login' => "Login", ); if (empty($user->socid)) { $fieldstosearchall["d.note_private"] = "NotePrivate"; } $arrayfields = array( - 'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), - 'user'=>array('label'=>$langs->trans("User"), 'checked'=>1), - 'd.date_debut'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1), - 'd.date_fin'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1), - 'd.date_valid'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1), - 'd.date_approve'=>array('label'=>$langs->trans("DateApprove"), 'checked'=>1), - 'd.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1), - 'd.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>1), - 'd.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>1), - 'd.date_create'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - 'd.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + 'd.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1), + 'user' => array('label' => $langs->trans("User"), 'checked' => 1), + 'd.date_debut' => array('label' => $langs->trans("DateStart"), 'checked' => 1), + 'd.date_fin' => array('label' => $langs->trans("DateEnd"), 'checked' => 1), + 'd.date_valid' => array('label' => $langs->trans("DateValidation"), 'checked' => 1), + 'd.date_approve' => array('label' => $langs->trans("DateApprove"), 'checked' => 1), + 'd.total_ht' => array('label' => $langs->trans("AmountHT"), 'checked' => 1), + 'd.total_vat' => array('label' => $langs->trans("AmountVAT"), 'checked' => 1), + 'd.total_ttc' => array('label' => $langs->trans("AmountTTC"), 'checked' => 1), + 'd.date_create' => array('label' => $langs->trans("DateCreation"), 'checked' => 0, 'position' => 500), + 'd.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => 0, 'position' => 500), + 'd.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => 1, 'position' => 1000), ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -193,7 +193,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -397,41 +397,41 @@ if ($resql) { } // Start date if ($search_date_startday) { - $param .= '&search_date_startday='.urlencode($search_date_startday); + $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); } if ($search_date_startmonth) { - $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); + $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth)); } if ($search_date_startyear) { - $param .= '&search_date_startyear='.urlencode($search_date_startyear); + $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear)); } if ($search_date_startendday) { - $param .= '&search_date_startendday='.urlencode($search_date_startendday); + $param .= '&search_date_startendday='.urlencode((string) ($search_date_startendday)); } if ($search_date_startendmonth) { - $param .= '&search_date_startendmonth='.urlencode($search_date_startendmonth); + $param .= '&search_date_startendmonth='.urlencode((string) ($search_date_startendmonth)); } if ($search_date_startendyear) { - $param .= '&search_date_startendyear='.urlencode($search_date_startendyear); + $param .= '&search_date_startendyear='.urlencode((string) ($search_date_startendyear)); } // End date if ($search_date_endday) { - $param .= '&search_date_endday='.urlencode($search_date_endday); + $param .= '&search_date_endday='.urlencode((string) ($search_date_endday)); } if ($search_date_endmonth) { - $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); + $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth)); } if ($search_date_endyear) { - $param .= '&search_date_endyear='.urlencode($search_date_endyear); + $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear)); } if ($search_date_endendday) { - $param .= '&search_date_endendday='.urlencode($search_date_endendday); + $param .= '&search_date_endendday='.urlencode((string) ($search_date_endendday)); } if ($search_date_endendmonth) { - $param .= '&search_date_endendmonth='.urlencode($search_date_endendmonth); + $param .= '&search_date_endendmonth='.urlencode((string) ($search_date_endendmonth)); } if ($search_date_endendyear) { - $param .= '&search_date_endendyear='.urlencode($search_date_endendyear); + $param .= '&search_date_endendyear='.urlencode((string) ($search_date_endendyear)); } if ($search_user) { $param .= "&search_user=".urlencode($search_user); @@ -453,9 +453,9 @@ if ($resql) { // List of mass actions available $arrayofmassactions = array( - 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), - 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), - 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + 'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + 'builddoc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + 'presend' => img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($user->hasRight('expensereport', 'supprimer')) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); @@ -519,8 +519,8 @@ if ($resql) { $url .= '&socid='.$socid; } $newcardbutton = ''; - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewTrip'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('expensereport', 'creer')); @@ -638,7 +638,7 @@ if ($resql) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields); + $parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -714,7 +714,7 @@ if ($resql) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields - $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); + $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['d.date_create']['checked'])) { @@ -921,7 +921,7 @@ if ($resql) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -990,7 +990,7 @@ if ($resql) { $db->free($resql); - $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); + $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From 310550f67621af85d5ace9067b8fe73b20de2b68 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:51:04 +0100 Subject: [PATCH 0680/1862] Fix: Ensure string type for urlencode() --- htdocs/expensereport/payment/list.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index d0c10e49a56..88cd5ecb2d0 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -274,22 +274,22 @@ if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); } if ($search_date_startday) { - $param .= '&search_date_startday='.urlencode($search_date_startday); + $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); } if ($search_date_startmonth) { - $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); + $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth)); } if ($search_date_startyear) { - $param .= '&search_date_startyear='.urlencode($search_date_startyear); + $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear)); } if ($search_date_endday) { - $param .= '&search_date_endday='.urlencode($search_date_endday); + $param .= '&search_date_endday='.urlencode((string) ($search_date_endday)); } if ($search_date_endmonth) { - $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); + $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth)); } if ($search_date_endyear) { - $param .= '&search_date_endyear='.urlencode($search_date_endyear); + $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear)); } if ($search_user) { $param .= '&search_user='.urlencode($search_user); @@ -305,7 +305,7 @@ if ($search_amount) { } if ($search_bank_account) { - $param .= '&search_bank_account='.urlencode($search_bank_account); + $param .= '&search_bank_account='.urlencode((string) ($search_bank_account)); } // Add $param from extra fields From d234c97992224c8a076c256c1b65f063b5bca3df Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:51:09 +0100 Subject: [PATCH 0681/1862] Fix: Ensure string type for urlencode() --- htdocs/fichinter/agenda.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fichinter/agenda.php b/htdocs/fichinter/agenda.php index ec91ebd4ae9..e348b888d55 100644 --- a/htdocs/fichinter/agenda.php +++ b/htdocs/fichinter/agenda.php @@ -95,7 +95,7 @@ restrictedArea($user, 'ficheinter', $object->id, 'fichinter', '', 'fk_soc', 'row * Actions */ -$parameters = array('id'=>$id); +$parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -189,14 +189,14 @@ if ($object->id > 0) { $objthirdparty = $object; $objcon = new stdClass(); - $out = '&origin='.urlencode($object->element.(property_exists($object, 'module') ? '@'.$object->module : '')).'&originid='.urlencode($object->id); + $out = '&origin='.urlencode((string) ($object->element.(property_exists($object, 'module') ? '@'.$object->module : ''))).'&originid='.urlencode((string) ($object->id)); $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; $out .= '&backtopage='.urlencode($urlbacktopage); $permok = $user->hasRight('agenda', 'myactions', 'create'); if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.=' Date: Fri, 8 Mar 2024 02:51:12 +0100 Subject: [PATCH 0682/1862] Fix: Ensure string type for urlencode() --- htdocs/fichinter/list.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 89d86259763..20878a34e16 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -436,7 +436,7 @@ if ($search_all) { $param .= "&search_all=".urlencode($search_all); } if ($socid) { - $param .= "&socid=".urlencode($socid); + $param .= "&socid=".urlencode((string) ($socid)); } if ($search_ref) { $param .= "&search_ref=".urlencode($search_ref); @@ -454,25 +454,25 @@ if ($search_status != '' && $search_status > -1) { $param .= "&search_status=".urlencode($search_status); } if ($search_date_startday > 0) { - $param .= '&search_date_startday='.urlencode($search_date_startday); + $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); } if ($search_date_startmonth > 0) { - $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); + $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth)); } if ($search_date_startyear > 0) { - $param .= '&search_date_startyear='.urlencode($search_date_startyear); + $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear)); } if ($search_date_endday > 0) { - $param .= '&search_date_endday='.urlencode($search_date_endday); + $param .= '&search_date_endday='.urlencode((string) ($search_date_endday)); } if ($search_date_endmonth > 0) { - $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); + $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth)); } if ($search_date_endyear > 0) { - $param .= '&search_date_endyear='.urlencode($search_date_endyear); + $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear)); } if ($show_files) { - $param .= '&show_files='.urlencode($show_files); + $param .= '&show_files='.urlencode((string) ($show_files)); } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); From 3a6e3404e2e1e20a94622ae1883bf428d765e400 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:51:16 +0100 Subject: [PATCH 0683/1862] Fix: Ensure string type for urlencode() --- htdocs/fourn/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index e3729dc7423..0f716bcecc1 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1423,7 +1423,7 @@ if (empty($reshook)) { $_GET['socid'] = $_POST['socid']; } else { $db->commit(); - header("Location: ".$_SERVER['PHP_SELF']."?id=".urlencode($id)); + header("Location: ".$_SERVER['PHP_SELF']."?id=".urlencode((string) ($id))); exit; } } From 97a20b8aa92dd3517443fbf3e30275bc087e9698 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:51:19 +0100 Subject: [PATCH 0684/1862] Fix: Ensure string type for urlencode() --- htdocs/fourn/commande/list.php | 112 ++++++++++++++++----------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index c4d93209600..1bab50ecddd 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -586,7 +586,7 @@ if (empty($reshook)) { if ($nb_bills_created == 1) { $texttoshow = $langs->trans('BillXCreated', '{s1}'); - $texttoshow = str_replace('{s1}', ''.$lastref.'', $texttoshow); + $texttoshow = str_replace('{s1}', ''.$lastref.'', $texttoshow); setEventMessages($texttoshow, null, 'mesgs'); } else { setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs'); @@ -607,82 +607,82 @@ if (empty($reshook)) { $param .= '&sall='.urlencode($sall); } if ($socid > 0) { - $param .= '&socid='.urlencode($socid); + $param .= '&socid='.urlencode((string) ($socid)); } if ($search_status != '') { $param .= '&search_status='.urlencode($search_status); } if ($search_date_order_startday) { - $param .= '&search_date_order_startday='.urlencode($search_date_order_startday); + $param .= '&search_date_order_startday='.urlencode((string) ($search_date_order_startday)); } if ($search_date_order_startmonth) { - $param .= '&search_date_order_startmonth='.urlencode($search_date_order_startmonth); + $param .= '&search_date_order_startmonth='.urlencode((string) ($search_date_order_startmonth)); } if ($search_date_order_startyear) { - $param .= '&search_date_order_startyear='.urlencode($search_date_order_startyear); + $param .= '&search_date_order_startyear='.urlencode((string) ($search_date_order_startyear)); } if ($search_date_order_endday) { - $param .= '&search_date_order_endday='.urlencode($search_date_order_endday); + $param .= '&search_date_order_endday='.urlencode((string) ($search_date_order_endday)); } if ($search_date_order_endmonth) { - $param .= '&search_date_order_endmonth='.urlencode($search_date_order_endmonth); + $param .= '&search_date_order_endmonth='.urlencode((string) ($search_date_order_endmonth)); } if ($search_date_order_endyear) { - $param .= '&search_date_order_endyear='.urlencode($search_date_order_endyear); + $param .= '&search_date_order_endyear='.urlencode((string) ($search_date_order_endyear)); } if ($search_date_delivery_startday) { - $param .= '&search_date_delivery_startday='.urlencode($search_date_delivery_startday); + $param .= '&search_date_delivery_startday='.urlencode((string) ($search_date_delivery_startday)); } if ($search_date_delivery_startmonth) { - $param .= '&search_date_delivery_startmonth='.urlencode($search_date_delivery_startmonth); + $param .= '&search_date_delivery_startmonth='.urlencode((string) ($search_date_delivery_startmonth)); } if ($search_date_delivery_startyear) { - $param .= '&search_date_delivery_startyear='.urlencode($search_date_delivery_startyear); + $param .= '&search_date_delivery_startyear='.urlencode((string) ($search_date_delivery_startyear)); } if ($search_date_delivery_endday) { - $param .= '&search_date_delivery_endday='.urlencode($search_date_delivery_endday); + $param .= '&search_date_delivery_endday='.urlencode((string) ($search_date_delivery_endday)); } if ($search_date_delivery_endmonth) { - $param .= '&search_date_delivery_endmonth='.urlencode($search_date_delivery_endmonth); + $param .= '&search_date_delivery_endmonth='.urlencode((string) ($search_date_delivery_endmonth)); } if ($search_date_delivery_endyear) { - $param .= '&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear); + $param .= '&search_date_delivery_endyear='.urlencode((string) ($search_date_delivery_endyear)); } if ($search_date_valid_startday) { - $param .= '&search_date_valid_startday='.urlencode($search_date_valid_startday); + $param .= '&search_date_valid_startday='.urlencode((string) ($search_date_valid_startday)); } if ($search_date_valid_startmonth) { - $param .= '&search_date_valid_startmonth='.urlencode($search_date_valid_startmonth); + $param .= '&search_date_valid_startmonth='.urlencode((string) ($search_date_valid_startmonth)); } if ($search_date_valid_startyear) { - $param .= '&search_date_valid_startyear='.urlencode($search_date_valid_startyear); + $param .= '&search_date_valid_startyear='.urlencode((string) ($search_date_valid_startyear)); } if ($search_date_valid_endday) { - $param .= '&search_date_valid_endday='.urlencode($search_date_valid_endday); + $param .= '&search_date_valid_endday='.urlencode((string) ($search_date_valid_endday)); } if ($search_date_valid_endmonth) { - $param .= '&search_date_valid_endmonth='.urlencode($search_date_valid_endmonth); + $param .= '&search_date_valid_endmonth='.urlencode((string) ($search_date_valid_endmonth)); } if ($search_date_valid_endyear) { - $param .= '&search_date_valid_endyear='.urlencode($search_date_valid_endyear); + $param .= '&search_date_valid_endyear='.urlencode((string) ($search_date_valid_endyear)); } if ($search_date_approve_startday) { - $param .= '&search_date_approve_startday='.urlencode($search_date_approve_startday); + $param .= '&search_date_approve_startday='.urlencode((string) ($search_date_approve_startday)); } if ($search_date_approve_startmonth) { - $param .= '&search_date_approve_startmonth='.urlencode($search_date_approve_startmonth); + $param .= '&search_date_approve_startmonth='.urlencode((string) ($search_date_approve_startmonth)); } if ($search_date_approve_startyear) { - $param .= '&search_date_approve_startyear='.urlencode($search_date_approve_startyear); + $param .= '&search_date_approve_startyear='.urlencode((string) ($search_date_approve_startyear)); } if ($search_date_approve_endday) { - $param .= '&search_date_approve_endday='.urlencode($search_date_approve_endday); + $param .= '&search_date_approve_endday='.urlencode((string) ($search_date_approve_endday)); } if ($search_date_approve_endmonth) { - $param .= '&search_date_approve_endmonth='.urlencode($search_date_approve_endmonth); + $param .= '&search_date_approve_endmonth='.urlencode((string) ($search_date_approve_endmonth)); } if ($search_date_approve_endyear) { - $param .= '&search_date_approve_endyear='.urlencode($search_date_approve_endyear); + $param .= '&search_date_approve_endyear='.urlencode((string) ($search_date_approve_endyear)); } if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); @@ -695,7 +695,7 @@ if (empty($reshook)) { } //if ($search_ref_customer) $param .= '&search_ref_customer='.urlencode($search_ref_customer); if ($search_user > 0) { - $param .= '&search_user='.urlencode($search_user); + $param .= '&search_user='.urlencode((string) ($search_user)); } if ($search_sale > 0) { $param .= '&search_sale='.urlencode($search_sale); @@ -713,7 +713,7 @@ if (empty($reshook)) { $param .= "&search_project_ref=".urlencode($search_project_ref); } if ($show_files) { - $param .= '&show_files='.urlencode($show_files); + $param .= '&show_files='.urlencode((string) ($show_files)); } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); @@ -1034,82 +1034,82 @@ if ($resql) { $param .= '&sall='.urlencode($sall); } if ($socid > 0) { - $param .= '&socid='.urlencode($socid); + $param .= '&socid='.urlencode((string) ($socid)); } if ($sall) { $param .= "&search_all=".urlencode($sall); } if ($search_date_order_startday) { - $param .= '&search_date_order_startday='.urlencode($search_date_order_startday); + $param .= '&search_date_order_startday='.urlencode((string) ($search_date_order_startday)); } if ($search_date_order_startmonth) { - $param .= '&search_date_order_startmonth='.urlencode($search_date_order_startmonth); + $param .= '&search_date_order_startmonth='.urlencode((string) ($search_date_order_startmonth)); } if ($search_date_order_startyear) { - $param .= '&search_date_order_startyear='.urlencode($search_date_order_startyear); + $param .= '&search_date_order_startyear='.urlencode((string) ($search_date_order_startyear)); } if ($search_date_order_endday) { - $param .= '&search_date_order_endday='.urlencode($search_date_order_endday); + $param .= '&search_date_order_endday='.urlencode((string) ($search_date_order_endday)); } if ($search_date_order_endmonth) { - $param .= '&search_date_order_endmonth='.urlencode($search_date_order_endmonth); + $param .= '&search_date_order_endmonth='.urlencode((string) ($search_date_order_endmonth)); } if ($search_date_order_endyear) { - $param .= '&search_date_order_endyear='.urlencode($search_date_order_endyear); + $param .= '&search_date_order_endyear='.urlencode((string) ($search_date_order_endyear)); } if ($search_date_delivery_startday) { - $param .= '&search_date_delivery_startday='.urlencode($search_date_delivery_startday); + $param .= '&search_date_delivery_startday='.urlencode((string) ($search_date_delivery_startday)); } if ($search_date_delivery_startmonth) { - $param .= '&search_date_delivery_startmonth='.urlencode($search_date_delivery_startmonth); + $param .= '&search_date_delivery_startmonth='.urlencode((string) ($search_date_delivery_startmonth)); } if ($search_date_delivery_startyear) { - $param .= '&search_date_delivery_startyear='.urlencode($search_date_delivery_startyear); + $param .= '&search_date_delivery_startyear='.urlencode((string) ($search_date_delivery_startyear)); } if ($search_date_delivery_endday) { - $param .= '&search_date_delivery_endday='.urlencode($search_date_delivery_endday); + $param .= '&search_date_delivery_endday='.urlencode((string) ($search_date_delivery_endday)); } if ($search_date_delivery_endmonth) { - $param .= '&search_date_delivery_endmonth='.urlencode($search_date_delivery_endmonth); + $param .= '&search_date_delivery_endmonth='.urlencode((string) ($search_date_delivery_endmonth)); } if ($search_date_delivery_endyear) { - $param .= '&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear); + $param .= '&search_date_delivery_endyear='.urlencode((string) ($search_date_delivery_endyear)); } if ($search_date_valid_startday) { - $param .= '&search_date_valid_startday='.urlencode($search_date_valid_startday); + $param .= '&search_date_valid_startday='.urlencode((string) ($search_date_valid_startday)); } if ($search_date_valid_startmonth) { - $param .= '&search_date_valid_startmonth='.urlencode($search_date_valid_startmonth); + $param .= '&search_date_valid_startmonth='.urlencode((string) ($search_date_valid_startmonth)); } if ($search_date_valid_startyear) { - $param .= '&search_date_valid_startyear='.urlencode($search_date_valid_startyear); + $param .= '&search_date_valid_startyear='.urlencode((string) ($search_date_valid_startyear)); } if ($search_date_valid_endday) { - $param .= '&search_date_valid_endday='.urlencode($search_date_valid_endday); + $param .= '&search_date_valid_endday='.urlencode((string) ($search_date_valid_endday)); } if ($search_date_valid_endmonth) { - $param .= '&search_date_valid_endmonth='.urlencode($search_date_valid_endmonth); + $param .= '&search_date_valid_endmonth='.urlencode((string) ($search_date_valid_endmonth)); } if ($search_date_valid_endyear) { - $param .= '&search_date_valid_endyear='.urlencode($search_date_valid_endyear); + $param .= '&search_date_valid_endyear='.urlencode((string) ($search_date_valid_endyear)); } if ($search_date_approve_startday) { - $param .= '&search_date_approve_startday='.urlencode($search_date_approve_startday); + $param .= '&search_date_approve_startday='.urlencode((string) ($search_date_approve_startday)); } if ($search_date_approve_startmonth) { - $param .= '&search_date_approve_startmonth='.urlencode($search_date_approve_startmonth); + $param .= '&search_date_approve_startmonth='.urlencode((string) ($search_date_approve_startmonth)); } if ($search_date_approve_startyear) { - $param .= '&search_date_approve_startyear='.urlencode($search_date_approve_startyear); + $param .= '&search_date_approve_startyear='.urlencode((string) ($search_date_approve_startyear)); } if ($search_date_approve_endday) { - $param .= '&search_date_approve_endday='.urlencode($search_date_approve_endday); + $param .= '&search_date_approve_endday='.urlencode((string) ($search_date_approve_endday)); } if ($search_date_approve_endmonth) { - $param .= '&search_date_approve_endmonth='.urlencode($search_date_approve_endmonth); + $param .= '&search_date_approve_endmonth='.urlencode((string) ($search_date_approve_endmonth)); } if ($search_date_approve_endyear) { - $param .= '&search_date_approve_endyear='.urlencode($search_date_approve_endyear); + $param .= '&search_date_approve_endyear='.urlencode((string) ($search_date_approve_endyear)); } if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); @@ -1121,7 +1121,7 @@ if ($resql) { $param .= '&search_company_alias='.urlencode($search_company_alias); } if ($search_user > 0) { - $param .= '&search_user='.urlencode($search_user); + $param .= '&search_user='.urlencode((string) ($search_user)); } if ($search_request_author) { $param .= '&search_request_author='.urlencode($search_request_author); @@ -1163,13 +1163,13 @@ if ($resql) { $param .= "&search_billed=".urlencode($search_billed); } if ($show_files) { - $param .= '&show_files='.urlencode($show_files); + $param .= '&show_files='.urlencode((string) ($show_files)); } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { - $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); + $param .= '&search_type_thirdparty='.urlencode((string) ($search_type_thirdparty)); } // Add $param from extra fields From 24b0a17c30ffc528fe90fc0c5ee72c530cd189dc Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:51:23 +0100 Subject: [PATCH 0685/1862] Fix: Ensure string type for urlencode() --- htdocs/fourn/facture/list-rec.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index 00e7c8c0a67..62531e8a569 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -432,43 +432,43 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); } if ($socid > 0) { - $param .= '&socid='.urlencode($socid); + $param .= '&socid='.urlencode((string) ($socid)); } if ($search_date_startday) { - $param .= '&search_date_startday='.urlencode($search_date_startday); + $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); } if ($search_date_startmonth) { - $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); + $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth)); } if ($search_date_startyear) { - $param .= '&search_date_startyear='.urlencode($search_date_startyear); + $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear)); } if ($search_date_endday) { - $param .= '&search_date_endday='.urlencode($search_date_endday); + $param .= '&search_date_endday='.urlencode((string) ($search_date_endday)); } if ($search_date_endmonth) { - $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); + $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth)); } if ($search_date_endyear) { - $param .= '&search_date_endyear='.urlencode($search_date_endyear); + $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear)); } if ($search_date_when_startday) { - $param .= '&search_date_when_startday='.urlencode($search_date_when_startday); + $param .= '&search_date_when_startday='.urlencode((string) ($search_date_when_startday)); } if ($search_date_when_startmonth) { - $param .= '&search_date_when_startmonth='.urlencode($search_date_when_startmonth); + $param .= '&search_date_when_startmonth='.urlencode((string) ($search_date_when_startmonth)); } if ($search_date_when_startyear) { - $param .= '&search_date_when_startyear='.urlencode($search_date_when_startyear); + $param .= '&search_date_when_startyear='.urlencode((string) ($search_date_when_startyear)); } if ($search_date_when_endday) { - $param .= '&search_date_when_endday='.urlencode($search_date_when_endday); + $param .= '&search_date_when_endday='.urlencode((string) ($search_date_when_endday)); } if ($search_date_when_endmonth) { - $param .= '&search_date_when_endmonth='.urlencode($search_date_when_endmonth); + $param .= '&search_date_when_endmonth='.urlencode((string) ($search_date_when_endmonth)); } if ($search_date_when_endyear) { - $param .= '&search_date_when_endyear='.urlencode($search_date_when_endyear); + $param .= '&search_date_when_endyear='.urlencode((string) ($search_date_when_endyear)); } if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); From beb0cfe5b429efa42d989b171f3292ee49a490ca Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:51:26 +0100 Subject: [PATCH 0686/1862] Fix: Ensure string type for urlencode() --- htdocs/fourn/facture/list.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 901419f4013..642b4612358 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -839,22 +839,22 @@ if ($search_date_end) { $param .= buildParamDate('search_date_end', null, '', 'tzserver'); } if ($search_datelimit_startday) { - $param .= '&search_datelimit_startday='.urlencode($search_datelimit_startday); + $param .= '&search_datelimit_startday='.urlencode((string) ($search_datelimit_startday)); } if ($search_datelimit_startmonth) { - $param .= '&search_datelimit_startmonth='.urlencode($search_datelimit_startmonth); + $param .= '&search_datelimit_startmonth='.urlencode((string) ($search_datelimit_startmonth)); } if ($search_datelimit_startyear) { - $param .= '&search_datelimit_startyear='.urlencode($search_datelimit_startyear); + $param .= '&search_datelimit_startyear='.urlencode((string) ($search_datelimit_startyear)); } if ($search_datelimit_endday) { - $param .= '&search_datelimit_endday='.urlencode($search_datelimit_endday); + $param .= '&search_datelimit_endday='.urlencode((string) ($search_datelimit_endday)); } if ($search_datelimit_endmonth) { - $param .= '&search_datelimit_endmonth='.urlencode($search_datelimit_endmonth); + $param .= '&search_datelimit_endmonth='.urlencode((string) ($search_datelimit_endmonth)); } if ($search_datelimit_endyear) { - $param .= '&search_datelimit_endyear='.urlencode($search_datelimit_endyear); + $param .= '&search_datelimit_endyear='.urlencode((string) ($search_datelimit_endyear)); } if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); @@ -920,13 +920,13 @@ if ($search_status >= 0) { $param .= "&search_status=".urlencode($search_status); } if ($search_paymentmode) { - $param .= '&search_paymentmode='.urlencode($search_paymentmode); + $param .= '&search_paymentmode='.urlencode((string) ($search_paymentmode)); } if ($search_paymentcond) { - $param .= '&search_paymentcond='.urlencode($search_paymentcond); + $param .= '&search_paymentcond='.urlencode((string) ($search_paymentcond)); } if ($show_files) { - $param .= '&show_files='.urlencode($show_files); + $param .= '&show_files='.urlencode((string) ($show_files)); } if ($option) { $param .= "&search_option=".urlencode($option); @@ -935,7 +935,7 @@ if ($search_categ_sup > 0) { $param .= '&search_categ_sup='.urlencode($search_categ_sup); } if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { - $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); + $param .= '&search_type_thirdparty='.urlencode((string) ($search_type_thirdparty)); } // Add $param from extra fields @@ -967,7 +967,7 @@ $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $url = DOL_URL_ROOT.'/fourn/facture/card.php?action=create'; if (!empty($socid)) { - $url .= '&socid='.urlencode($socid); + $url .= '&socid='.urlencode((string) ($socid)); } $i = 0; From 81e8da34efe2409167b2af22b102bcf62cbc6d10 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:51:29 +0100 Subject: [PATCH 0687/1862] Fix: Ensure string type for urlencode() --- htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index f1bccfcad6d..6ebb4f03f4f 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -36,7 +36,8 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $langs->load("bills"); -$total = 0; $ilink = 0; +$total = 0; +$ilink = 0; foreach ($linkedObjectBlock as $key => $objectlink) { $ilink++; @@ -69,7 +70,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } else { echo $objectlink->getLibStatut(3); } ?> -
+ Date: Fri, 8 Mar 2024 02:51:32 +0100 Subject: [PATCH 0688/1862] Fix: Ensure string type for urlencode() --- htdocs/fourn/paiement/list.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 466f7beaedd..8445377e946 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -307,22 +307,22 @@ if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); } if ($search_date_startday) { - $param .= '&search_date_startday='.urlencode($search_date_startday); + $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); } if ($search_date_startmonth) { - $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); + $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth)); } if ($search_date_startyear) { - $param .= '&search_date_startyear='.urlencode($search_date_startyear); + $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear)); } if ($search_date_endday) { - $param .= '&search_date_endday='.urlencode($search_date_endday); + $param .= '&search_date_endday='.urlencode((string) ($search_date_endday)); } if ($search_date_endmonth) { - $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); + $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth)); } if ($search_date_endyear) { - $param .= '&search_date_endyear='.urlencode($search_date_endyear); + $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear)); } if ($search_company) { $param .= '&search_company='.urlencode($search_company); From b18d226c28b53410cd02b12a50688cb4f329e458 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:51:34 +0100 Subject: [PATCH 0689/1862] Fix: Ensure string type for urlencode() --- htdocs/holiday/list.php | 58 ++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 58a073fcad3..42c2d0808f6 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -111,26 +111,26 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'cp.ref'=>'Ref', - 'cp.description'=>'Description', - 'uu.lastname'=>'EmployeeLastname', - 'uu.firstname'=>'EmployeeFirstname', - 'uu.login'=>'Login' + 'cp.ref' => 'Ref', + 'cp.description' => 'Description', + 'uu.lastname' => 'EmployeeLastname', + 'uu.firstname' => 'EmployeeFirstname', + 'uu.login' => 'Login' ); $arrayfields = array( - 'cp.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), - 'cp.fk_user'=>array('label'=>$langs->trans("Employee"), 'checked'=>1, 'position'=>20), - 'cp.fk_validator'=>array('label'=>$langs->trans("ValidatorCP"), 'checked'=>1, 'position'=>30), - 'cp.fk_type'=>array('label'=>$langs->trans("Type"), 'checked'=>1, 'position'=>35), - 'duration'=>array('label'=>$langs->trans("NbUseDaysCPShort"), 'checked'=>1, 'position'=>38), - 'cp.date_debut'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>40), - 'cp.date_fin'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>42), - 'cp.date_valid'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1, 'position'=>60), - 'cp.date_approval'=>array('label'=>$langs->trans("DateApprove"), 'checked'=>1, 'position'=>70), - 'cp.date_create'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'cp.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>501), - 'cp.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + 'cp.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1), + 'cp.fk_user' => array('label' => $langs->trans("Employee"), 'checked' => 1, 'position' => 20), + 'cp.fk_validator' => array('label' => $langs->trans("ValidatorCP"), 'checked' => 1, 'position' => 30), + 'cp.fk_type' => array('label' => $langs->trans("Type"), 'checked' => 1, 'position' => 35), + 'duration' => array('label' => $langs->trans("NbUseDaysCPShort"), 'checked' => 1, 'position' => 38), + 'cp.date_debut' => array('label' => $langs->trans("DateStart"), 'checked' => 1, 'position' => 40), + 'cp.date_fin' => array('label' => $langs->trans("DateEnd"), 'checked' => 1, 'position' => 42), + 'cp.date_valid' => array('label' => $langs->trans("DateValidation"), 'checked' => 1, 'position' => 60), + 'cp.date_approval' => array('label' => $langs->trans("DateApprove"), 'checked' => 1, 'position' => 70), + 'cp.date_create' => array('label' => $langs->trans("DateCreation"), 'checked' => 0, 'position' => 500), + 'cp.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => 0, 'position' => 501), + 'cp.statut' => array('label' => $langs->trans("Status"), 'checked' => 1, 'position' => 1000), ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -183,7 +183,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -451,10 +451,10 @@ if ($search_employee > 0) { $param .= '&search_employee='.urlencode($search_employee); } if ($search_valideur > 0) { - $param .= '&search_valideur='.urlencode($search_valideur); + $param .= '&search_valideur='.urlencode((string) ($search_valideur)); } if ($search_type > 0) { - $param .= '&search_type='.urlencode($search_type); + $param .= '&search_type='.urlencode((string) ($search_type)); } if ($search_status > 0) { $param .= '&search_status='.urlencode($search_status); @@ -538,8 +538,8 @@ if ($id > 0) { // For user tab $newcardbutton = ''; - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('MenuAddCP'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/holiday/card.php?action=create', '', $user->hasRight('holiday', 'write')); @@ -575,7 +575,7 @@ if (empty($reshook)) { if (!empty($moreforfilter)) { print '
'; print $moreforfilter; - $parameters = array('type'=>$type); + $parameters = array('type' => $type); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
'; @@ -701,7 +701,7 @@ if (!empty($arrayfields['cp.date_approval']['checked'])) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -787,7 +787,7 @@ if (!empty($arrayfields['cp.date_approval']['checked'])) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['cp.date_create']['checked'])) { @@ -809,7 +809,7 @@ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { } print ''."\n"; -$listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon")); +$listhalfday = array('morning' => $langs->trans("Morning"), "afternoon" => $langs->trans("Afternoon")); // Loop on record @@ -895,7 +895,7 @@ if ($id && !$user->hasRight('holiday', 'readall') && !in_array($id, $childids)) $labeltypeleavetoshow = ($langs->trans($typeleaves[$obj->fk_type]['code']) != $typeleaves[$obj->fk_type]['code'] ? $langs->trans($typeleaves[$obj->fk_type]['code']) : $typeleaves[$obj->fk_type]['label']); } - $arraydata = array('user'=>$userstatic, 'labeltype'=>$labeltypeleavetoshow, 'selected'=>$selected, 'nbopenedday'=>$nbopenedday); + $arraydata = array('user' => $userstatic, 'labeltype' => $labeltypeleavetoshow, 'selected' => $selected, 'nbopenedday' => $nbopenedday); } print $holidaystatic->getKanbanView('', $arraydata); if ($i == ($imaxinloop - 1)) { @@ -1004,7 +1004,7 @@ if ($id && !$user->hasRight('holiday', 'readall') && !in_array($id, $childids)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -1086,7 +1086,7 @@ if ($num == 0) { $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From a39cf7318665e5d9958bad19dfb298700ee17536 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:51:37 +0100 Subject: [PATCH 0690/1862] Fix: Ensure string type for urlencode() --- htdocs/holiday/month_report.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index f38ee1a7069..6f10f9c9ce9 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -119,16 +119,16 @@ if (empty($reshook)) { } $arrayfields = array( - 'cp.ref'=>array('label' => 'Ref', 'checked'=>1, 'position'=>5), - 'cp.fk_type'=>array('label' => 'Type', 'checked'=>1, 'position'=>10), - 'cp.fk_user'=>array('label' => 'Employee', 'checked'=>1, 'position'=>20), - 'cp.date_debut'=>array('label' => 'DateDebCP', 'checked'=>-1, 'position'=>30), - 'cp.date_fin'=>array('label' => 'DateFinCP', 'checked'=>-1, 'position'=>32), - 'used_days'=>array('label' => 'NbUseDaysCPShort', 'checked'=>-1, 'position'=>34), - 'date_start_month'=>array('label' => 'DateStartInMonth', 'checked'=>1, 'position'=>50), - 'date_end_month'=>array('label' => 'DateEndInMonth', 'checked'=>1, 'position'=>52), - 'used_days_month'=>array('label' => 'NbUseDaysCPShortInMonth', 'checked'=>1, 'position'=>54), - 'cp.description'=>array('label' => 'DescCP', 'checked'=>-1, 'position'=>800), + 'cp.ref' => array('label' => 'Ref', 'checked' => 1, 'position' => 5), + 'cp.fk_type' => array('label' => 'Type', 'checked' => 1, 'position' => 10), + 'cp.fk_user' => array('label' => 'Employee', 'checked' => 1, 'position' => 20), + 'cp.date_debut' => array('label' => 'DateDebCP', 'checked' => -1, 'position' => 30), + 'cp.date_fin' => array('label' => 'DateFinCP', 'checked' => -1, 'position' => 32), + 'used_days' => array('label' => 'NbUseDaysCPShort', 'checked' => -1, 'position' => 34), + 'date_start_month' => array('label' => 'DateStartInMonth', 'checked' => 1, 'position' => 50), + 'date_end_month' => array('label' => 'DateEndInMonth', 'checked' => 1, 'position' => 52), + 'used_days_month' => array('label' => 'NbUseDaysCPShortInMonth', 'checked' => 1, 'position' => 54), + 'cp.description' => array('label' => 'DescCP', 'checked' => -1, 'position' => 800), ); @@ -140,7 +140,7 @@ $form = new Form($db); $formother = new FormOther($db); $holidaystatic = new Holiday($db); -$listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon")); +$listhalfday = array('morning' => $langs->trans("Morning"), "afternoon" => $langs->trans("Afternoon")); $title = $langs->trans('CPTitreMenu'); @@ -194,7 +194,7 @@ if (!empty($search_ref)) { $param .= '&search_ref='.urlencode($search_ref); } if (!empty($search_employee)) { - $param .= '&search_employee='.urlencode($search_employee); + $param .= '&search_employee='.urlencode((string) ($search_employee)); } if (!empty($search_type)) { $param .= '&search_type='.urlencode($search_type); From 68661a67e22e4edcecbda6c0df7e8fa73984f82d Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:51:40 +0100 Subject: [PATCH 0691/1862] Fix: Ensure string type for urlencode() --- htdocs/holiday/view_log.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 8aafba502ad..0820c283618 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -249,22 +249,22 @@ if (!empty($search_id)) { $param .= '&search_status='.urlencode($search_status); } if (!empty($search_month) && $search_month > 0) { - $param .= '&search_month='.urlencode($search_month); + $param .= '&search_month='.urlencode((string) ($search_month)); } if (!empty($search_year) && $search_year > 0) { - $param .= '&search_year='.urlencode($search_year); + $param .= '&search_year='.urlencode((string) ($search_year)); } if (!empty($search_validator) && $search_validator > 0) { - $param .= '&search_validator='.urlencode($search_validator); + $param .= '&search_validator='.urlencode((string) ($search_validator)); } if (!empty($search_employee) && $search_employee > 0) { - $param .= '&search_employee='.urlencode($search_employee); + $param .= '&search_employee='.urlencode((string) ($search_employee)); } if (!empty($search_description)) { $param .= '&search_description='.urlencode($search_description); } if (!empty($search_type) && $search_type > 0) { - $param .= '&search_type='.urlencode($search_type); + $param .= '&search_type='.urlencode((string) ($search_type)); } if (!empty($search_prev_solde)) { $param .= '&search_prev_solde='.urlencode($search_prev_solde); From 2d8649dfc35815bc2ebdcfd972c4490ea1b393f6 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:51:43 +0100 Subject: [PATCH 0692/1862] Fix: Ensure string type for urlencode() --- htdocs/hrm/evaluation_agenda.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index a65c659e867..4507ba5764f 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -110,7 +110,7 @@ if (!$permissiontoread) { * Actions */ -$parameters = array('id'=>$id); +$parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -186,14 +186,14 @@ if ($object->id > 0) { $objthirdparty = $object; $objcon = new stdClass(); - $out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id); + $out = '&origin='.urlencode((string) ($object->element.'@'.$object->module)).'&originid='.urlencode((string) ($object->id)); $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; $out .= '&backtopage='.urlencode($urlbacktopage); $permok = $user->hasRight('agenda', 'myactions', 'create'); if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.=' Date: Fri, 8 Mar 2024 02:51:46 +0100 Subject: [PATCH 0693/1862] Fix: Ensure string type for urlencode() --- htdocs/hrm/job_agenda.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index 074f5e008f1..6fffa6934e4 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -108,7 +108,7 @@ if (!$permissiontoread) { * Actions */ -$parameters = array('id'=>$id); +$parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -155,7 +155,7 @@ if ($object->id > 0) { $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; - $morehtmlref.= $object->label; + $morehtmlref .= $object->label; $morehtmlref .= '
'; @@ -178,14 +178,14 @@ if ($object->id > 0) { $objthirdparty = $object; $objcon = new stdClass(); - $out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id); + $out = '&origin='.urlencode((string) ($object->element.'@'.$object->module)).'&originid='.urlencode((string) ($object->id)); $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; $out .= '&backtopage='.urlencode($urlbacktopage); $permok = $user->hasRight('agenda', 'myactions', 'create'); if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.=' Date: Fri, 8 Mar 2024 02:51:49 +0100 Subject: [PATCH 0694/1862] Fix: Ensure string type for urlencode() --- htdocs/hrm/position_agenda.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index ae37771e4c2..49f269d8efa 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -111,7 +111,7 @@ if (!$permissiontoread) { * Actions */ -$parameters = array('id'=>$id); +$parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -186,14 +186,14 @@ if ($object->id > 0) { $objthirdparty = $object; $objcon = new stdClass(); - $out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id); + $out = '&origin='.urlencode((string) ($object->element.'@'.$object->module)).'&originid='.urlencode((string) ($object->id)); $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; $out .= '&backtopage='.urlencode($urlbacktopage); $permok = $user->hasRight('agenda', 'myactions', 'create'); if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.='id > 0) { $filters['search_agenda_label'] = $search_agenda_label; $filters['search_rowid'] = $search_rowid; - $object->fields['label']=array(); // Useful to get only agenda events linked to position (this object doesn't need label of ref field, but show_actions_done() needs it to work correctly) + $object->fields['label'] = array(); // Useful to get only agenda events linked to position (this object doesn't need label of ref field, but show_actions_done() needs it to work correctly) // TODO Replace this with same code than into list.php show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module); From 1691c2eff4374e6c0d1da1cf38bd29db27793803 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:51:52 +0100 Subject: [PATCH 0695/1862] Fix: Ensure string type for urlencode() --- htdocs/hrm/skill_agenda.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index 92fa94e9c4d..a469ded4cf9 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -110,7 +110,7 @@ if (!$permissiontoread) { * Actions */ -$parameters = array('id'=>$id); +$parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -157,7 +157,7 @@ if ($object->id > 0) { $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; - $morehtmlref.= $object->label; + $morehtmlref .= $object->label; $morehtmlref .= '
'; @@ -180,14 +180,14 @@ if ($object->id > 0) { $objthirdparty = $object; $objcon = new stdClass(); - $out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id); + $out = '&origin='.urlencode((string) ($object->element.'@'.$object->module)).'&originid='.urlencode((string) ($object->id)); $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; $out .= '&backtopage='.urlencode($urlbacktopage); $permok = $user->hasRight('agenda', 'myactions', 'create'); if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.=' Date: Fri, 8 Mar 2024 02:51:55 +0100 Subject: [PATCH 0696/1862] Fix: Ensure string type for urlencode() --- htdocs/intracommreport/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/intracommreport/card.php b/htdocs/intracommreport/card.php index 4bfd8068589..7adc9ea0eb7 100644 --- a/htdocs/intracommreport/card.php +++ b/htdocs/intracommreport/card.php @@ -247,7 +247,7 @@ if ($id > 0 && $action != 'edit') { ); } print $form->formconfirm( - "card.php?rowid=".urlencode($id), + "card.php?rowid=".urlencode((string) ($id)), $langs->trans("DeleteReport"), $langs->trans("ConfirmDeleteReport"), "confirm_delete", From 0b0c858af7a03111c1f1b95a603e7079c78a32ef Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:51:58 +0100 Subject: [PATCH 0697/1862] Fix: Ensure string type for urlencode() --- htdocs/knowledgemanagement/knowledgerecord_agenda.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index 77c814d60c9..4ed3b95b63b 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -98,7 +98,7 @@ $permissiontoadd = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'wr * Actions */ -$parameters = array('id'=>$id); +$parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -203,14 +203,14 @@ if ($object->id > 0) { $objthirdparty = $object; $objcon = new stdClass(); - $out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id); + $out = '&origin='.urlencode((string) ($object->element.'@'.$object->module)).'&originid='.urlencode((string) ($object->id)); $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; $out .= '&backtopage='.urlencode($urlbacktopage); $permok = $user->hasRight('agenda', 'myactions', 'create'); if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.=' Date: Fri, 8 Mar 2024 02:52:01 +0100 Subject: [PATCH 0698/1862] Fix: Ensure string type for urlencode() --- htdocs/loan/payment/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index ec20266337e..2afeb25b322 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -67,7 +67,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('loan', $result = $payment->delete($user); if ($result > 0) { $db->commit(); - header("Location: ".DOL_URL_ROOT."/loan/card.php?id=".urlencode($fk_loan)); + header("Location: ".DOL_URL_ROOT."/loan/card.php?id=".urlencode((string) ($fk_loan))); exit; } else { setEventMessages($payment->error, $payment->errors, 'errors'); From 364fcd313be46de1d6fd3dac9ceee9482e7a46e6 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:03 +0100 Subject: [PATCH 0699/1862] Fix: Ensure string type for urlencode() --- htdocs/margin/agentMargins.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 3c2fa4bca90..bd47dd65d95 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -208,22 +208,22 @@ if (!empty($agentid)) { $param .= "&agentid=".urlencode($agentid); } if (!empty($startdateday)) { - $param .= "&startdateday=".urlencode($startdateday); + $param .= "&startdateday=".urlencode((string) ($startdateday)); } if (!empty($startdatemonth)) { - $param .= "&startdatemonth=".urlencode($startdatemonth); + $param .= "&startdatemonth=".urlencode((string) ($startdatemonth)); } if (!empty($startdateyear)) { - $param .= "&startdateyear=".urlencode($startdateyear); + $param .= "&startdateyear=".urlencode((string) ($startdateyear)); } if (!empty($enddateday)) { - $param .= "&enddateday=".urlencode($enddateday); + $param .= "&enddateday=".urlencode((string) ($enddateday)); } if (!empty($enddatemonth)) { - $param .= "&enddatemonth=".urlencode($enddatemonth); + $param .= "&enddatemonth=".urlencode((string) ($enddatemonth)); } if (!empty($enddateyear)) { - $param .= "&enddateyear=".urlencode($enddateyear); + $param .= "&enddateyear=".urlencode((string) ($enddateyear)); } From 1066ee61ca6bbe8ec8a5a78a07f3fd086c9ba234 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:06 +0100 Subject: [PATCH 0700/1862] Fix: Ensure string type for urlencode() --- htdocs/modulebuilder/index.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 197f1b5e5dc..6d1a5a85d06 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2918,7 +2918,7 @@ if ($dirins && $action == "update_menu" && GETPOSTINT('menukey') && GETPOST('tab if ($result < 0) { setEventMessages($langs->trans('ErrorMenuExistValue'), null, 'errors'); //var_dump($_SESSION);exit; - header("Location: ".$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($key + 1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.($key + 1)); + header("Location: ".$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode((string) ($key + 1)).'&tab='.urlencode((string) ($tab)).'&module='.urlencode((string) ($module)).'&tabobj='.($key + 1)); exit; } @@ -4703,7 +4703,7 @@ if ($module == 'initmodule') { if ($action == 'deletedict') { $formconfirm = $form->formconfirm( - $_SERVER["PHP_SELF"].'?dictionnarykey='.urlencode(GETPOSTINT('dictionnarykey')).'&tab='.urlencode($tab).'&module='.urlencode($module), + $_SERVER["PHP_SELF"].'?dictionnarykey='.urlencode((string) (GETPOSTINT('dictionnarykey'))).'&tab='.urlencode((string) ($tab)).'&module='.urlencode((string) ($module)), $langs->trans('Delete'), $langs->trans('Confirm Delete Dictionnary', GETPOST('dictionnarykey', 'alpha')), 'confirm_deletedictionary', @@ -4915,8 +4915,8 @@ if ($module == 'initmodule') { print ''; print '
'; print ''; @@ -5071,7 +5071,7 @@ if ($module == 'initmodule') { if ($action == 'deletemenu') { $formconfirms = $form->formconfirm( - $_SERVER["PHP_SELF"].'?menukey='.urlencode(GETPOSTINT('menukey')).'&tab='.urlencode($tab).'&module='.urlencode($module), + $_SERVER["PHP_SELF"].'?menukey='.urlencode((string) (GETPOSTINT('menukey'))).'&tab='.urlencode((string) ($tab)).'&module='.urlencode((string) ($module)), $langs->trans('Delete'), ($menus[GETPOST('menukey')]['fk_menu'] === 'fk_mainmenu='.strtolower($module) ? $langs->trans('Warning: you will delete all menus linked to this one.', GETPOSTINT('menukey')) : $langs->trans('Confirm Delete Menu', GETPOSTINT('menukey'))), 'confirm_deletemenu', @@ -5387,8 +5387,8 @@ if ($module == 'initmodule') { print ''; print ''; } @@ -5503,7 +5503,7 @@ if ($module == 'initmodule') { if ($action == 'deleteright') { $formconfirm = $form->formconfirm( - $_SERVER["PHP_SELF"].'?permskey='.urlencode(GETPOSTINT('permskey')).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj), + $_SERVER["PHP_SELF"].'?permskey='.urlencode((string) (GETPOSTINT('permskey'))).'&tab='.urlencode((string) ($tab)).'&module='.urlencode((string) ($module)).'&tabobj='.urlencode((string) ($tabobj)), $langs->trans('Delete'), $langs->trans('Confirm Delete Right', GETPOST('permskey', 'alpha')), 'confirm_deleteright', @@ -5657,7 +5657,7 @@ if ($module == 'initmodule') { print ''; From 35d087c0a179d1cc2219c23617c02b8033ce2668 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:09 +0100 Subject: [PATCH 0701/1862] Fix: Ensure string type for urlencode() --- htdocs/mrp/mo_movements.php | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index b5395b9b04b..bab5f6aa68f 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -119,22 +119,22 @@ $objectlist = new MouvementStock($db); // Definition of fields for list $arrayfields = array( - 'm.rowid'=>array('label'=>"Ref", 'checked'=>1, 'position'=>1), - 'm.datem'=>array('label'=>"Date", 'checked'=>1, 'position'=>2), - 'p.ref'=>array('label'=>"ProductRef", 'checked'=>1, 'css'=>'maxwidth100', 'position'=>3), - 'p.label'=>array('label'=>"ProductLabel", 'checked'=>0, 'position'=>5), - 'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(isModEnabled('productbatch'))), - 'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(isModEnabled('productbatch'))), - 'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))), - 'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it - 'm.fk_user_author'=>array('label'=>"Author", 'checked'=>0, 'position'=>120), - 'm.inventorycode'=>array('label'=>"InventoryCodeShort", 'checked'=>1, 'position'=>130), - 'm.label'=>array('label'=>"MovementLabel", 'checked'=>1, 'position'=>140), - 'm.type_mouvement'=>array('label'=>"TypeMovement", 'checked'=>0, 'position'=>150), - 'origin'=>array('label'=>"Origin", 'checked'=>1, 'position'=>155), - 'm.fk_projet'=>array('label'=>'Project', 'checked'=>0, 'position'=>180), - 'm.value'=>array('label'=>"Qty", 'checked'=>1, 'position'=>200), - 'm.price'=>array('label'=>"UnitPurchaseValue", 'checked'=>0, 'position'=>210) + 'm.rowid' => array('label' => "Ref", 'checked' => 1, 'position' => 1), + 'm.datem' => array('label' => "Date", 'checked' => 1, 'position' => 2), + 'p.ref' => array('label' => "ProductRef", 'checked' => 1, 'css' => 'maxwidth100', 'position' => 3), + 'p.label' => array('label' => "ProductLabel", 'checked' => 0, 'position' => 5), + 'm.batch' => array('label' => "BatchNumberShort", 'checked' => 1, 'position' => 8, 'enabled' => (isModEnabled('productbatch'))), + 'pl.eatby' => array('label' => "EatByDate", 'checked' => 0, 'position' => 9, 'enabled' => (isModEnabled('productbatch'))), + 'pl.sellby' => array('label' => "SellByDate", 'checked' => 0, 'position' => 10, 'enabled' => (isModEnabled('productbatch'))), + 'e.ref' => array('label' => "Warehouse", 'checked' => 1, 'position' => 100, 'enabled' => (!($id > 0))), // If we are on specific warehouse, we hide it + 'm.fk_user_author' => array('label' => "Author", 'checked' => 0, 'position' => 120), + 'm.inventorycode' => array('label' => "InventoryCodeShort", 'checked' => 1, 'position' => 130), + 'm.label' => array('label' => "MovementLabel", 'checked' => 1, 'position' => 140), + 'm.type_mouvement' => array('label' => "TypeMovement", 'checked' => 0, 'position' => 150), + 'origin' => array('label' => "Origin", 'checked' => 1, 'position' => 155), + 'm.fk_projet' => array('label' => 'Project', 'checked' => 0, 'position' => 180), + 'm.value' => array('label' => "Qty", 'checked' => 1, 'position' => 200), + 'm.price' => array('label' => "UnitPurchaseValue", 'checked' => 0, 'position' => 210) //'m.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), //'m.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500) ); @@ -521,7 +521,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $param .= '&limit='.((int) $limit); } if ($id > 0) { - $param .= '&id='.urlencode($id); + $param .= '&id='.urlencode((string) ($id)); } if ($search_movement) { $param .= '&search_movement='.urlencode($search_movement); @@ -728,7 +728,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields); + $parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1010,7 +1010,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (!empty($arrayfields['m.value']['checked'])) { // Qty print ''; } @@ -785,7 +785,7 @@ if ($managedfor == 'member') { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -833,7 +833,7 @@ if ($managedfor == 'member') { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -897,7 +897,7 @@ while ($i < $imaxinloop) { $selected = 1; } } - print $object->getKanbanView('', array('thirdparty'=>$object->thirdparty, 'selected' => $selected)); + print $object->getKanbanView('', array('thirdparty' => $object->thirdparty, 'selected' => $selected)); if ($i == ($imaxinloop - 1)) { print ''; print ''; @@ -999,7 +999,7 @@ while ($i < $imaxinloop) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -1047,7 +1047,7 @@ if ($num == 0) { $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From 4d83ffd7db59fd4aac88a44e547a0fb4eec50d51 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:18 +0100 Subject: [PATCH 0704/1862] Fix: Ensure string type for urlencode() --- htdocs/paypal/lib/paypal.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index cd9bda1e9f3..41be7d6a956 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -233,16 +233,16 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $paymentType = 'Sale'; } - $nvpstr = $nvpstr."&AMT=".urlencode($paymentAmount); // Total for all elements + $nvpstr = $nvpstr."&AMT=".urlencode((string) ($paymentAmount)); // Total for all elements $nvpstr = $nvpstr."&".$paypalprefix."INVNUM=".urlencode($tag); - $nvpstr = $nvpstr."&".$paypalprefix."AMT=".urlencode($paymentAmount); // AMT deprecated by paypal -> PAYMENTREQUEST_n_AMT - $nvpstr = $nvpstr."&".$paypalprefix."ITEMAMT=".urlencode($paymentAmount); // AMT deprecated by paypal -> PAYMENTREQUEST_n_AMT + $nvpstr = $nvpstr."&".$paypalprefix."AMT=".urlencode((string) ($paymentAmount)); // AMT deprecated by paypal -> PAYMENTREQUEST_n_AMT + $nvpstr = $nvpstr."&".$paypalprefix."ITEMAMT=".urlencode((string) ($paymentAmount)); // AMT deprecated by paypal -> PAYMENTREQUEST_n_AMT $nvpstr = $nvpstr."&".$paypalprefix."PAYMENTACTION=".urlencode($paymentType); // PAYMENTACTION deprecated by paypal -> PAYMENTREQUEST_n_PAYMENTACTION $nvpstr = $nvpstr."&".$paypalprefix."CURRENCYCODE=".urlencode($currencyCodeType); // CURRENCYCODE deprecated by paypal -> PAYMENTREQUEST_n_CURRENCYCODE $nvpstr = $nvpstr."&".$paypalprefix."L_PAYMENTREQUEST_0_QTY0=1"; - $nvpstr = $nvpstr."&".$paypalprefix."L_PAYMENTREQUEST_0_AMT0=".urlencode($paymentAmount); + $nvpstr = $nvpstr."&".$paypalprefix."L_PAYMENTREQUEST_0_AMT0=".urlencode((string) ($paymentAmount)); $nvpstr = $nvpstr."&".$paypalprefix."L_PAYMENTREQUEST_0_NAME0=".urlencode($desc); $nvpstr = $nvpstr."&".$paypalprefix."L_PAYMENTREQUEST_0_NUMBER0=0"; From 2f4108e7384cb6787751d204acd785460cce6430 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:21 +0100 Subject: [PATCH 0705/1862] Fix: Ensure string type for urlencode() --- htdocs/product/card.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index d9a95678e81..b848078cc20 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -90,7 +90,9 @@ if (isModEnabled('productbatch')) { $langs->load("productbatch"); } -$mesg = ''; $error = 0; $errors = array(); +$mesg = ''; +$error = 0; +$errors = array(); $refalreadyexists = 0; @@ -216,7 +218,7 @@ if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('barcode', $createbarcode = 0; } -$parameters = array('id'=>$id, 'ref'=>$ref, 'objcanvas'=>$objcanvas); +$parameters = array('id' => $id, 'ref' => $ref, 'objcanvas' => $objcanvas); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -1182,7 +1184,7 @@ if (empty($reshook)) { ); if ($result > 0) { - header("Location: ".DOL_URL_ROOT."/commande/card.php?id=".urlencode($commande->id)); + header("Location: ".DOL_URL_ROOT."/commande/card.php?id=".urlencode((string) ($commande->id))); exit; } } elseif (GETPOST('factureid') > 0) { @@ -1480,7 +1482,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio if (empty($fk_barcode_type) && getDolGlobalString('PRODUIT_DEFAULT_BARCODE_TYPE')) { $fk_barcode_type = getDolGlobalInt("PRODUIT_DEFAULT_BARCODE_TYPE"); } else { - $fk_barcode_type=0; + $fk_barcode_type = 0; } } require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; @@ -1666,7 +1668,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Other attributes - $parameters = array('colspan' => ' colspan="2"', 'cols'=>2); + $parameters = array('colspan' => ' colspan="2"', 'cols' => 2); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { @@ -2695,9 +2697,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print ''; print ''; // Fields from hook - $parameters = array('obj'=>$objp); + $parameters = array('obj' => $objp); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $product); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column From 318faa061b82829566f0ca19e409c9b7023d8a47 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:30 +0100 Subject: [PATCH 0708/1862] Fix: Ensure string type for urlencode() --- htdocs/product/reassortlot.php | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index d78e47d5dfe..07873e790ad 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -139,15 +139,15 @@ $result = restrictedArea($user, 'produit|service', 0, 'product&product'); // Definition of array of fields for columns $arrayfields = array( - array('type'=>'varchar', 'label'=>'Ref', 'checked'=>1, 'enabled'=>1, 'position'=>1), - array('type'=>'varchar', 'label'=>'Label', 'checked'=>1, 'enabled'=>1, 'position'=>1), - array('type'=>'int', 'label'=>'Warehouse', 'checked'=>1, 'enabled'=>1, 'position'=>1), - array('type'=>'varchar', 'label'=>'Lot', 'checked'=>1, 'enabled'=>1, 'position'=>1), - array('type'=>'varchar', 'label'=>'DLC', 'checked'=>1, 'enabled'=>1, 'position'=>1), - array('type'=>'varchar', 'label'=>'DLUO', 'checked'=>1, 'enabled'=>1, 'position'=>1), - array('type'=>'int', 'label'=>'Stock', 'checked'=>1, 'enabled'=>1, 'position'=>1), - array('type'=>'int', 'label'=>'StatusSell', 'checked'=>1, 'enabled'=>1, 'position'=>1), - array('type'=>'int', 'label'=>'StatusBuy', 'checked'=>1, 'enabled'=>1, 'position'=>1), + array('type' => 'varchar', 'label' => 'Ref', 'checked' => 1, 'enabled' => 1, 'position' => 1), + array('type' => 'varchar', 'label' => 'Label', 'checked' => 1, 'enabled' => 1, 'position' => 1), + array('type' => 'int', 'label' => 'Warehouse', 'checked' => 1, 'enabled' => 1, 'position' => 1), + array('type' => 'varchar', 'label' => 'Lot', 'checked' => 1, 'enabled' => 1, 'position' => 1), + array('type' => 'varchar', 'label' => 'DLC', 'checked' => 1, 'enabled' => 1, 'position' => 1), + array('type' => 'varchar', 'label' => 'DLUO', 'checked' => 1, 'enabled' => 1, 'position' => 1), + array('type' => 'int', 'label' => 'Stock', 'checked' => 1, 'enabled' => 1, 'position' => 1), + array('type' => 'int', 'label' => 'StatusSell', 'checked' => 1, 'enabled' => 1, 'position' => 1), + array('type' => 'int', 'label' => 'StatusBuy', 'checked' => 1, 'enabled' => 1, 'position' => 1), ); //$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right'); @@ -214,11 +214,11 @@ if (empty($reshook)) { } // Mass actions - /*$objectclass = 'MyObject'; - $objectlabel = 'MyObject'; - $uploaddir = $conf->mymodule->dir_output; - include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; - */ + /*$objectclass = 'MyObject'; + $objectlabel = 'MyObject'; + $uploaddir = $conf->mymodule->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + */ } @@ -489,10 +489,10 @@ if ($tobuy) { $param .= "&tobuy=".urlencode($tobuy); } if ($type != '') { - $param .= "&type=".urlencode($type); + $param .= "&type=".urlencode((string) ($type)); } if ($fourn_id) { - $param .= "&fourn_id=".urlencode($fourn_id); + $param .= "&fourn_id=".urlencode((string) ($fourn_id)); } if ($snom) { $param .= "&snom=".urlencode($snom); @@ -504,7 +504,7 @@ if ($search_batch) { $param .= "&search_batch=".urlencode($search_batch); } if ($sbarcode) { - $param .= "&sbarcode=".urlencode($sbarcode); + $param .= "&sbarcode=".urlencode((string) ($sbarcode)); } if ($search_warehouse) { $param .= "&search_warehouse=".urlencode($search_warehouse); @@ -519,10 +519,10 @@ if ($search_sale) { $param .= "&search_sale=".urlencode($search_sale); } if (!empty($search_categ) && $search_categ != '-1') { - $param .= "&search_categ=".urlencode($search_categ); + $param .= "&search_categ=".urlencode((string) ($search_categ)); } if (!empty($search_warehouse_categ) && $search_warehouse_categ != '-1') { - $param .= "&search_warehouse_categ=".urlencode($search_warehouse_categ); + $param .= "&search_warehouse_categ=".urlencode((string) ($search_warehouse_categ)); } if ($search_stock_physique) { $param .= '&search_stock_physique=' . urlencode($search_stock_physique); @@ -574,7 +574,7 @@ if (isModEnabled('category')) { $moreforfilter .= ''; } -$moreforfilter.=''; +$moreforfilter .= ''; if (!empty($moreforfilter)) { @@ -686,7 +686,7 @@ print_liste_field_titre(''); print_liste_field_titre("ProductStatusOnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("ProductStatusOnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'right '); // Hook fields -$parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { @@ -875,7 +875,7 @@ while ($i < $imaxinloop) { } // Fields values from hook - $parameters = array('obj'=>$objp); + $parameters = array('obj' => $objp); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $product); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From 25b0da26e04d4579beaf2560378098132a08d6b3 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:33 +0100 Subject: [PATCH 0709/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stats/bom.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stats/bom.php b/htdocs/product/stats/bom.php index b0257248690..73714afa21c 100644 --- a/htdocs/product/stats/bom.php +++ b/htdocs/product/stats/bom.php @@ -82,7 +82,7 @@ if ($id > 0 || !empty($ref)) { $object = $product; - $parameters = array('id'=>$id); + $parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $product, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -130,7 +130,7 @@ if ($id > 0 || !empty($ref)) { //Calcul total qty and amount for global if full scan list $total_qty_toconsume = 0; $total_qty_toproduce = 0; - $product_cache=array(); + $product_cache = array(); $bom_data_result = array(); //Qauntity to produce @@ -283,7 +283,7 @@ if ($id > 0 || !empty($ref)) { print_barre_liste($langs->trans("BOMs"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', count($bom_data_result), count($bom_data_result), '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { - $option .= '&page='.urlencode($page); + $option .= '&page='.urlencode((string) ($page)); } print '
'; From dbda44cf2088a5b8744940c64dc243ef33a4e430 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:35 +0100 Subject: [PATCH 0710/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stats/commande.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 315f39590d3..8c9dbd7830b 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -204,10 +204,10 @@ if ($id > 0 || !empty($ref)) { $option .= '&limit='.((int) $limit); } if (!empty($search_month)) { - $option .= '&search_month='.urlencode($search_month); + $option .= '&search_month='.urlencode((string) ($search_month)); } if (!empty($search_year)) { - $option .= '&search_year='.urlencode($search_year); + $option .= '&search_year='.urlencode((string) ($search_year)); } if ($search_status != '') { @@ -227,7 +227,7 @@ if ($id > 0 || !empty($ref)) { print_barre_liste($langs->trans("CustomersOrders"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { - $option .= '&page='.urlencode($page); + $option .= '&page='.urlencode((string) ($page)); } print '
'; From d992b55cd6e21afb1373ce17e30b529549141537 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:38 +0100 Subject: [PATCH 0711/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stats/commande_fournisseur.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index d377ae40e0a..e91555cea67 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -204,10 +204,10 @@ if ($id > 0 || !empty($ref)) { $option .= '&limit='.((int) $limit); } if (!empty($search_month)) { - $option .= '&search_month='.urlencode($search_month); + $option .= '&search_month='.urlencode((string) ($search_month)); } if (!empty($search_year)) { - $option .= '&search_year='.urlencode($search_year); + $option .= '&search_year='.urlencode((string) ($search_year)); } if ($search_status != '') { @@ -227,7 +227,7 @@ if ($id > 0 || !empty($ref)) { print_barre_liste($langs->trans("SuppliersOrders"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { - $option .= '&page='.urlencode($page); + $option .= '&page='.urlencode((string) ($page)); } print '
'; From b5bebdf657e58c2ff0895a64a756f1fcc4d8fa38 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:40 +0100 Subject: [PATCH 0712/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stats/contrat.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 870e7f81fda..6712ac33185 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -179,7 +179,7 @@ if ($id > 0 || !empty($ref)) { $option .= '&search_month='.urlencode($search_month); } if (!empty($search_year)) { - $option .= '&search_year='.urlencode($search_year); + $option .= '&search_year='.urlencode((string) ($search_year)); } print '
'."\n"; @@ -195,7 +195,7 @@ if ($id > 0 || !empty($ref)) { print_barre_liste($langs->trans("Contrats"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { - $option .= '&page='.urlencode($page); + $option .= '&page='.urlencode((string) ($page)); } $i = 0; From 11b2de835243062e341f9a552f38864bfb534bac Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:42 +0100 Subject: [PATCH 0713/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stats/facture.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index ad3e190e851..c44e95eae64 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -278,7 +278,7 @@ if ($id > 0 || !empty($ref)) { $option .= '&search_month='.urlencode($search_month); } if (!empty($search_year)) { - $option .= '&search_year='.urlencode($search_year); + $option .= '&search_year='.urlencode((string) ($search_year)); } // Add $param from extra fields @@ -301,7 +301,7 @@ if ($id > 0 || !empty($ref)) { print_barre_liste($langs->trans("CustomersInvoices"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { - $option .= '&page='.urlencode($page); + $option .= '&page='.urlencode((string) ($page)); } print '
'; From 965ec8f0769df58fcd18bd6ab755a9149e9ea7d9 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:44 +0100 Subject: [PATCH 0714/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stats/facture_fournisseur.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index faf752b71e9..2ee2e18b793 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -190,10 +190,10 @@ if ($id > 0 || !empty($ref)) { $option .= '&limit='.((int) $limit); } if (!empty($search_month)) { - $option .= '&search_month='.urlencode($search_month); + $option .= '&search_month='.urlencode((string) ($search_month)); } if (!empty($search_year)) { - $option .= '&search_year='.urlencode($search_year); + $option .= '&search_year='.urlencode((string) ($search_year)); } print ''."\n"; @@ -209,7 +209,7 @@ if ($id > 0 || !empty($ref)) { print_barre_liste($langs->trans("SuppliersInvoices"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { - $option .= '&page='.urlencode($page); + $option .= '&page='.urlencode((string) ($page)); } print '
'; From a86806298a4138d04237efd341d12f983fc0106c Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:46 +0100 Subject: [PATCH 0715/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stats/facturerec.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stats/facturerec.php b/htdocs/product/stats/facturerec.php index f25c3076b63..83d66963e51 100644 --- a/htdocs/product/stats/facturerec.php +++ b/htdocs/product/stats/facturerec.php @@ -208,10 +208,10 @@ if ($id > 0 || !empty($ref)) { $option .= '&limit='.((int) $limit); } if (!empty($search_month)) { - $option .= '&search_month='.urlencode($search_month); + $option .= '&search_month='.urlencode((string) ($search_month)); } if (!empty($search_year)) { - $option .= '&search_year='.urlencode($search_year); + $option .= '&search_year='.urlencode((string) ($search_year)); } print ''."\n"; @@ -227,7 +227,7 @@ if ($id > 0 || !empty($ref)) { print_barre_liste($langs->trans("CustomersInvoices"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { - $option .= '&page='.urlencode($page); + $option .= '&page='.urlencode((string) ($page)); } print '
'; From 2d9a426c4244fb801f4117d24062a2eb5ef6197c Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:48 +0100 Subject: [PATCH 0716/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stats/mo.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php index d6727842ead..d98a73fbc79 100644 --- a/htdocs/product/stats/mo.php +++ b/htdocs/product/stats/mo.php @@ -186,10 +186,10 @@ if ($id > 0 || !empty($ref)) { $option .= '&limit='.((int) $limit); } if (!empty($search_month)) { - $option .= '&search_month='.urlencode($search_month); + $option .= '&search_month='.urlencode((string) ($search_month)); } if (!empty($search_year)) { - $option .= '&search_year='.urlencode($search_year); + $option .= '&search_year='.urlencode((string) ($search_year)); } print ''."\n"; @@ -205,7 +205,7 @@ if ($id > 0 || !empty($ref)) { print_barre_liste($langs->trans("MOs"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { - $option .= '&page='.urlencode($page); + $option .= '&page='.urlencode((string) ($page)); } print '
'; From 6d728265ffb69b6e2ccb6fe504c859961adf60c0 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:50 +0100 Subject: [PATCH 0717/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stats/propal.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 7ac396da333..9e6084f78c5 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -192,10 +192,10 @@ if ($id > 0 || !empty($ref)) { $option .= '&limit='.((int) $limit); } if (!empty($search_month)) { - $option .= '&search_month='.urlencode($search_month); + $option .= '&search_month='.urlencode((string) ($search_month)); } if (!empty($search_year)) { - $option .= '&search_year='.urlencode($search_year); + $option .= '&search_year='.urlencode((string) ($search_year)); } print ''."\n"; @@ -211,7 +211,7 @@ if ($id > 0 || !empty($ref)) { print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { - $option .= '&page='.urlencode($page); + $option .= '&page='.urlencode((string) ($page)); } print '
'; From 31391e950abad0063707c4f63b9f53cab035340d Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:52 +0100 Subject: [PATCH 0718/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stats/supplier_proposal.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 5e162e08339..5c755024acd 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -191,10 +191,10 @@ if ($id > 0 || !empty($ref)) { $option .= '&limit='.((int) $limit); } if (!empty($search_month)) { - $option .= '&search_month='.urlencode($search_month); + $option .= '&search_month='.urlencode((string) ($search_month)); } if (!empty($search_year)) { - $option .= '&search_year='.urlencode($search_year); + $option .= '&search_year='.urlencode((string) ($search_year)); } print ''."\n"; @@ -210,7 +210,7 @@ if ($id > 0 || !empty($ref)) { print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { - $option .= '&page='.urlencode($page); + $option .= '&page='.urlencode((string) ($page)); } print '
'; From 322f85ee64b96f990c4ef3febe6c35ff91c8d3a7 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:54 +0100 Subject: [PATCH 0719/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stock/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 1a4aedaefa6..c812e507035 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -103,7 +103,7 @@ $usercandelete = (($user->hasRight('stock', 'supprimer'))); $error = 0; -$parameters = array('id'=>$id, 'ref'=>$ref); +$parameters = array('id' => $id, 'ref' => $ref); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -168,7 +168,7 @@ if (empty($reshook)) { header("Location: ".$backtopage); exit; } else { - header("Location: card.php?id=".urlencode($id)); + header("Location: card.php?id=".urlencode((string) ($id))); exit; } } else { @@ -417,7 +417,7 @@ if ($action == 'create') { // Confirm delete warehouse if ($action == 'delete') { $formquestion = array( - array('type' => 'other', 'name' => 'info', 'label' => img_warning('').$langs->trans("WarningThisWIllAlsoDeleteStock"), 'morecss'=>'warning') + array('type' => 'other', 'name' => 'info', 'label' => img_warning('').$langs->trans("WarningThisWIllAlsoDeleteStock"), 'morecss' => 'warning') ); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("DeleteAWarehouse"), $langs->trans("ConfirmDeleteWarehouse", $object->label), "confirm_delete", $formquestion, 0, 2); } @@ -659,7 +659,7 @@ if ($action == 'create') { $totalarray['nbfield']++; } // Hook fields - $parameters = array('sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray' => &$totalarray); + $parameters = array('sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print "
\n"; @@ -744,7 +744,7 @@ if ($action == 'create') { //print ''; print ''; - $parameters = array('obj'=>$objp, 'totalarray' => &$totalarray); + $parameters = array('obj' => $objp, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From 2ceaaeb2e8ecf5c77e9253e6a6f129d9f902f654 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:57 +0100 Subject: [PATCH 0720/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stock/movement_card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index 6c8671175ec..d1ae82983e4 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -689,7 +689,7 @@ if ($resql) { $param .= '&limit='.((int) $limit); } if ($id > 0) { - $param .= '&id='.urlencode($id); + $param .= '&id='.urlencode((string) ($id)); } if ($search_movement) { $param .= '&search_movement='.urlencode($search_movement); @@ -716,7 +716,7 @@ if ($resql) { $param .= '&search_user='.urlencode($search_user); } if ($idproduct > 0) { - $param .= '&idproduct='.urlencode($idproduct); + $param .= '&idproduct='.urlencode((string) ($idproduct)); } // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; From 7b74e52d3a7be2e50141799763856871c6591daa Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:00 +0100 Subject: [PATCH 0721/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stock/movement_list.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 95e7b87a203..fbc888a2793 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -1003,28 +1003,28 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); } if ($id > 0) { - $param .= '&id='.urlencode($id); + $param .= '&id='.urlencode((string) ($id)); } if ($show_files) { - $param .= '&show_files='.urlencode($show_files); + $param .= '&show_files='.urlencode((string) ($show_files)); } if ($search_date_startday) { - $param .= '&search_date_startday='.urlencode($search_date_startday); + $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); } if ($search_date_startmonth) { - $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); + $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth)); } if ($search_date_startyear) { - $param .= '&search_date_startyear='.urlencode($search_date_startyear); + $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear)); } if ($search_date_endday) { - $param .= '&search_date_endday='.urlencode($search_date_endday); + $param .= '&search_date_endday='.urlencode((string) ($search_date_endday)); } if ($search_date_endmonth) { - $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); + $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth)); } if ($search_date_endyear) { - $param .= '&search_date_endyear='.urlencode($search_date_endyear); + $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear)); } if ($search_movement) { $param .= '&search_movement='.urlencode($search_movement); @@ -1051,10 +1051,10 @@ if ($search_user) { $param .= '&search_user='.urlencode($search_user); } if ($idproduct > 0) { - $param .= '&idproduct='.urlencode($idproduct); + $param .= '&idproduct='.urlencode((string) ($idproduct)); } if ($search_fk_project != '' && $search_fk_project != '-1') { - $param .= '&search_fk_project='.urlencode($search_fk_project); + $param .= '&search_fk_project='.urlencode((string) ($search_fk_project)); } // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; From 3749abb41977bb49029a5b5a8be3d89728811c90 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:03 +0100 Subject: [PATCH 0722/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stock/replenish.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index ee51a45c4d5..febc2adf39e 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -650,23 +650,23 @@ if ($search_ref || $search_label || $sall || $salert || $draftorder || GETPOST(' $filters .= '&draftorder='.urlencode($draftorder); $filters .= '&mode='.urlencode($mode); if ($fk_supplier > 0) { - $filters .= '&fk_supplier='.urlencode($fk_supplier); + $filters .= '&fk_supplier='.urlencode((string) ($fk_supplier)); } if ($fk_entrepot > 0) { - $filters .= '&fk_entrepot='.urlencode($fk_entrepot); + $filters .= '&fk_entrepot='.urlencode((string) ($fk_entrepot)); } } else { $filters = '&search_ref='.urlencode($search_ref).'&search_label='.urlencode($search_label); - $filters .= '&fourn_id='.urlencode($fourn_id); - $filters .= (isset($type) ? '&type='.urlencode($type) : ''); + $filters .= '&fourn_id='.urlencode((string) ($fourn_id)); + $filters .= (isset($type) ? '&type='.urlencode((string) ($type)) : ''); $filters .= '&='.urlencode($salert); $filters .= '&draftorder='.urlencode($draftorder); $filters .= '&mode='.urlencode($mode); if ($fk_supplier > 0) { - $filters .= '&fk_supplier='.urlencode($fk_supplier); + $filters .= '&fk_supplier='.urlencode((string) ($fk_supplier)); } if ($fk_entrepot > 0) { - $filters .= '&fk_entrepot='.urlencode($fk_entrepot); + $filters .= '&fk_entrepot='.urlencode((string) ($fk_entrepot)); } } if ($limit > 0 && $limit != $conf->liste_limit) { @@ -679,12 +679,12 @@ if (!empty($salert)) { $filters .= '&salert='.urlencode($salert); } -$param = (isset($type) ? '&type='.urlencode($type) : ''); -$param .= '&fourn_id='.urlencode($fourn_id).'&search_label='.urlencode($search_label).'&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty).'&salert='.urlencode($salert).'&draftorder='.urlencode($draftorder); +$param = (isset($type) ? '&type='.urlencode((string) ($type)) : ''); +$param .= '&fourn_id='.urlencode((string) ($fourn_id)).'&search_label='.urlencode((string) ($search_label)).'&includeproductswithoutdesiredqty='.urlencode((string) ($includeproductswithoutdesiredqty)).'&salert='.urlencode((string) ($salert)).'&draftorder='.urlencode((string) ($draftorder)); $param .= '&search_ref='.urlencode($search_ref); $param .= '&mode='.urlencode($mode); -$param .= '&fk_supplier='.urlencode($fk_supplier); -$param .= '&fk_entrepot='.urlencode($fk_entrepot); +$param .= '&fk_supplier='.urlencode((string) ($fk_supplier)); +$param .= '&fk_entrepot='.urlencode((string) ($fk_entrepot)); if (!empty($includeproductswithoutdesiredqty)) { $param .= '&includeproductswithoutdesiredqty='.urlencode($includeproductswithoutdesiredqty); } @@ -768,7 +768,7 @@ if (getDolGlobalString('STOCK_REPLENISH_ADD_CHECKBOX_INCLUDE_DRAFT_ORDER')) { print ''; print ''; // Fields from hook -$parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -797,7 +797,7 @@ print_liste_field_titre('StockToBuy', $_SERVER["PHP_SELF"], '', $param, '', '', print_liste_field_titre('SupplierRef', $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right '); // Hook fields -$parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -959,7 +959,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { print ''; // Fields from hook - $parameters = array('objp'=>$objp, 'i'=>$i, 'tobuy'=>$tobuy); + $parameters = array('objp' => $objp, 'i' => $i, 'tobuy' => $tobuy); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -983,7 +983,7 @@ if ($num == 0) { print ''; } -$parameters = array('sql'=>$sql); +$parameters = array('sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From 6a92582727e971c2ce8dd568e375e19d37b73ebb Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:06 +0100 Subject: [PATCH 0723/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stock/replenishorders.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php index 86573d63deb..724eeed763c 100644 --- a/htdocs/product/stock/replenishorders.php +++ b/htdocs/product/stock/replenishorders.php @@ -202,13 +202,13 @@ if ($resql) { $param .= '&search_ttc='.urlencode($sttc); } if ($search_dateyear) { - $param .= '&search_dateyear='.urlencode($search_dateyear); + $param .= '&search_dateyear='.urlencode((string) ($search_dateyear)); } if ($search_datemonth) { - $param .= '&search_datemonth='.urlencode($search_datemonth); + $param .= '&search_datemonth='.urlencode((string) ($search_datemonth)); } if ($search_dateday) { - $param .= '&search_dateday='.urlencode($search_dateday); + $param .= '&search_dateday='.urlencode((string) ($search_dateday)); } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); From 564f91fc97f88518257ab4f7b9dff64f3fb2a97e Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:09 +0100 Subject: [PATCH 0724/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stock/stats/commande_fournisseur.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stock/stats/commande_fournisseur.php b/htdocs/product/stock/stats/commande_fournisseur.php index 174be7e4486..7f362de5f01 100644 --- a/htdocs/product/stock/stats/commande_fournisseur.php +++ b/htdocs/product/stock/stats/commande_fournisseur.php @@ -268,10 +268,10 @@ if ($id > 0 || !empty($ref)) { $option .= '&limit='.((int) $limit); } if (!empty($search_month)) { - $option .= '&search_month='.urlencode($search_month); + $option .= '&search_month='.urlencode((string) ($search_month)); } if (!empty($search_year)) { - $option .= '&search_year='.urlencode($search_year); + $option .= '&search_year='.urlencode((string) ($search_year)); } print ''."\n"; @@ -287,7 +287,7 @@ if ($id > 0 || !empty($ref)) { print_barre_liste($langs->trans("SuppliersOrders"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { - $option .= '&page='.urlencode($page); + $option .= '&page='.urlencode((string) ($page)); } print '
'; From c971d6d02f5513be2d065d2ef2ccf151fc0d2b1b Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:11 +0100 Subject: [PATCH 0725/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stock/stats/expedition.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stock/stats/expedition.php b/htdocs/product/stock/stats/expedition.php index cc2a10c0592..b3c30f5ce68 100644 --- a/htdocs/product/stock/stats/expedition.php +++ b/htdocs/product/stock/stats/expedition.php @@ -267,10 +267,10 @@ if ($id > 0 || !empty($ref)) { $option .= '&limit='.((int) $limit); } if (!empty($search_month)) { - $option .= '&search_month='.urlencode($search_month); + $option .= '&search_month='.urlencode((string) ($search_month)); } if (!empty($search_year)) { - $option .= '&search_year='.urlencode($search_year); + $option .= '&search_year='.urlencode((string) ($search_year)); } print ''."\n"; @@ -286,7 +286,7 @@ if ($id > 0 || !empty($ref)) { print_barre_liste($langs->trans("Shipments"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { - $option .= '&page='.urlencode($page); + $option .= '&page='.urlencode((string) ($page)); } print '
'; From b0480f82fb66a39ae029bb9f681ca165fa320d58 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:13 +0100 Subject: [PATCH 0726/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stock/stats/mo.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stock/stats/mo.php b/htdocs/product/stock/stats/mo.php index e48d44127c0..96699d17d92 100644 --- a/htdocs/product/stock/stats/mo.php +++ b/htdocs/product/stock/stats/mo.php @@ -209,10 +209,10 @@ if ($id > 0 || !empty($ref)) { $option .= '&limit='.((int) $limit); } if (!empty($search_month)) { - $option .= '&search_month='.urlencode($search_month); + $option .= '&search_month='.urlencode((string) ($search_month)); } if (!empty($search_year)) { - $option .= '&search_year='.urlencode($search_year); + $option .= '&search_year='.urlencode((string) ($search_year)); } print ''."\n"; @@ -228,7 +228,7 @@ if ($id > 0 || !empty($ref)) { print_barre_liste($langs->trans("MOs"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { - $option .= '&page='.urlencode($page); + $option .= '&page='.urlencode((string) ($page)); } print '
'; From 6cb026ef8ca71ef7dbbc441a0ac5a0cea488a562 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:15 +0100 Subject: [PATCH 0727/1862] Fix: Ensure string type for urlencode() --- htdocs/product/stock/stats/reception.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stock/stats/reception.php b/htdocs/product/stock/stats/reception.php index 08839af5749..ced528e301d 100644 --- a/htdocs/product/stock/stats/reception.php +++ b/htdocs/product/stock/stats/reception.php @@ -266,10 +266,10 @@ if ($id > 0 || !empty($ref)) { $option .= '&limit='.((int) $limit); } if (!empty($search_month)) { - $option .= '&search_month='.urlencode($search_month); + $option .= '&search_month='.urlencode((string) ($search_month)); } if (!empty($search_year)) { - $option .= '&search_year='.urlencode($search_year); + $option .= '&search_year='.urlencode((string) ($search_year)); } print ''."\n"; @@ -285,7 +285,7 @@ if ($id > 0 || !empty($ref)) { print_barre_liste($langs->trans("Receptions"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { - $option .= '&page='.urlencode($page); + $option .= '&page='.urlencode((string) ($page)); } print '
'; From f1faf390f5466b7499c1645ebed0bc51b9e6a8ca Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:17 +0100 Subject: [PATCH 0728/1862] Fix: Ensure string type for urlencode() --- htdocs/projet/activity/permonth.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 7e1e2d82ccf..82f46fa4b4a 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -326,9 +326,9 @@ if ($action == 'addtime' && $user->hasRight('projet', 'lire') && GETPOST('formfi $param = ''; $param .= ($mode ? '&mode='.urlencode($mode) : ''); - $param .= ($projectid ? 'id='.urlencode($projectid) : ''); + $param .= ($projectid ? 'id='.urlencode((string) ($projectid)) : ''); $param .= ($search_usertoprocessid ? '&search_usertoprocessid='.urlencode($search_usertoprocessid) : ''); - $param .= ($day ? '&day='.urlencode($day) : '').($month ? '&month='.urlencode($month) : '').($year ? '&year='.urlencode($year) : ''); + $param .= ($day ? '&day='.urlencode((string) ($day)) : '').($month ? '&month='.urlencode((string) ($month)) : '').($year ? '&year='.urlencode((string) ($year)) : ''); $param .= ($search_project_ref ? '&search_project_ref='.urlencode($search_project_ref) : ''); $param .= ($search_usertoprocessid > 0 ? '&search_usertoprocessid='.urlencode($search_usertoprocessid) : ''); $param .= ($search_thirdparty ? '&search_thirdparty='.urlencode($search_thirdparty) : ''); From ebebb70720415acb59247816adabb8c34bceedde Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:20 +0100 Subject: [PATCH 0729/1862] Fix: Ensure string type for urlencode() --- htdocs/projet/activity/perweek.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 97d38e4eb96..b1776078f36 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -330,9 +330,9 @@ if ($action == 'addtime' && $user->hasRight('projet', 'lire') && GETPOST('formfi $param = ''; $param .= ($mode ? '&mode='.urlencode($mode) : ''); - $param .= ($projectid ? 'id='.urlencode($projectid) : ''); + $param .= ($projectid ? 'id='.urlencode((string) ($projectid)) : ''); $param .= ($search_usertoprocessid ? '&search_usertoprocessid='.urlencode($search_usertoprocessid) : ''); - $param .= ($day ? '&day='.urlencode($day) : '').($month ? '&month='.urlencode($month) : '').($year ? '&year='.urlencode($year) : ''); + $param .= ($day ? '&day='.urlencode((string) ($day)) : '').($month ? '&month='.urlencode((string) ($month)) : '').($year ? '&year='.urlencode((string) ($year)) : ''); $param .= ($search_project_ref ? '&search_project_ref='.urlencode($search_project_ref) : ''); $param .= ($search_usertoprocessid > 0 ? '&search_usertoprocessid='.urlencode($search_usertoprocessid) : ''); $param .= ($search_thirdparty ? '&search_thirdparty='.urlencode($search_thirdparty) : ''); From dfd47dfe2c9899c0ed24e2001dbd11cae154e4d6 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:22 +0100 Subject: [PATCH 0730/1862] Fix: Ensure string type for urlencode() --- htdocs/projet/list.php | 66 +++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 4477b2ad218..4e0f40d0127 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -809,121 +809,121 @@ if ($search_all != '') { $param .= '&search_all='.urlencode($search_all); } if ($search_sday) { - $param .= '&search_sday='.urlencode($search_sday); + $param .= '&search_sday='.urlencode((string) ($search_sday)); } if ($search_smonth) { - $param .= '&search_smonth='.urlencode($search_smonth); + $param .= '&search_smonth='.urlencode((string) ($search_smonth)); } if ($search_syear) { - $param .= '&search_syear='.urlencode($search_syear); + $param .= '&search_syear='.urlencode((string) ($search_syear)); } if ($search_eday) { - $param .= '&search_eday='.urlencode($search_eday); + $param .= '&search_eday='.urlencode((string) ($search_eday)); } if ($search_emonth) { - $param .= '&search_emonth='.urlencode($search_emonth); + $param .= '&search_emonth='.urlencode((string) ($search_emonth)); } if ($search_eyear) { - $param .= '&search_eyear='.urlencode($search_eyear); + $param .= '&search_eyear='.urlencode((string) ($search_eyear)); } if ($search_date_start_startmonth) { - $param .= '&search_date_start_startmonth='.urlencode($search_date_start_startmonth); + $param .= '&search_date_start_startmonth='.urlencode((string) ($search_date_start_startmonth)); } if ($search_date_start_startyear) { - $param .= '&search_date_start_startyear='.urlencode($search_date_start_startyear); + $param .= '&search_date_start_startyear='.urlencode((string) ($search_date_start_startyear)); } if ($search_date_start_startday) { - $param .= '&search_date_start_startday='.urlencode($search_date_start_startday); + $param .= '&search_date_start_startday='.urlencode((string) ($search_date_start_startday)); } if ($search_date_start_start) { $param .= '&search_date_start_start='.urlencode($search_date_start_start); } if ($search_date_start_endmonth) { - $param .= '&search_date_start_endmonth='.urlencode($search_date_start_endmonth); + $param .= '&search_date_start_endmonth='.urlencode((string) ($search_date_start_endmonth)); } if ($search_date_start_endyear) { - $param .= '&search_date_start_endyear='.urlencode($search_date_start_endyear); + $param .= '&search_date_start_endyear='.urlencode((string) ($search_date_start_endyear)); } if ($search_date_start_endday) { - $param .= '&search_date_start_endday='.urlencode($search_date_start_endday); + $param .= '&search_date_start_endday='.urlencode((string) ($search_date_start_endday)); } if ($search_date_start_end) { $param .= '&search_date_start_end='.urlencode($search_date_start_end); } if ($search_date_end_startmonth) { - $param .= '&search_date_end_startmonth='.urlencode($search_date_end_startmonth); + $param .= '&search_date_end_startmonth='.urlencode((string) ($search_date_end_startmonth)); } if ($search_date_end_startyear) { - $param .= '&search_date_end_startyear='.urlencode($search_date_end_startyear); + $param .= '&search_date_end_startyear='.urlencode((string) ($search_date_end_startyear)); } if ($search_date_end_startday) { - $param .= '&search_date_end_startday='.urlencode($search_date_end_startday); + $param .= '&search_date_end_startday='.urlencode((string) ($search_date_end_startday)); } if ($search_date_end_start) { $param .= '&search_date_end_start='.urlencode($search_date_end_start); } if ($search_date_end_endmonth) { - $param .= '&search_date_end_endmonth='.urlencode($search_date_end_endmonth); + $param .= '&search_date_end_endmonth='.urlencode((string) ($search_date_end_endmonth)); } if ($search_date_end_endyear) { - $param .= '&search_date_end_endyear='.urlencode($search_date_end_endyear); + $param .= '&search_date_end_endyear='.urlencode((string) ($search_date_end_endyear)); } if ($search_date_end_endday) { - $param .= '&search_date_end_endday='.urlencode($search_date_end_endday); + $param .= '&search_date_end_endday='.urlencode((string) ($search_date_end_endday)); } if ($search_date_end_end) { $param .= '&search_date_end_end=' . urlencode($search_date_end_end); } if ($search_date_creation_startmonth) { - $param .= '&search_date_creation_startmonth='.urlencode($search_date_creation_startmonth); + $param .= '&search_date_creation_startmonth='.urlencode((string) ($search_date_creation_startmonth)); } if ($search_date_creation_startyear) { - $param .= '&search_date_creation_startyear='.urlencode($search_date_creation_startyear); + $param .= '&search_date_creation_startyear='.urlencode((string) ($search_date_creation_startyear)); } if ($search_date_creation_startday) { - $param .= '&search_date_creation_startday='.urlencode($search_date_creation_startday); + $param .= '&search_date_creation_startday='.urlencode((string) ($search_date_creation_startday)); } if ($search_date_creation_start) { $param .= '&search_date_creation_start='.urlencode($search_date_creation_start); } if ($search_date_creation_endmonth) { - $param .= '&search_date_creation_endmonth='.urlencode($search_date_creation_endmonth); + $param .= '&search_date_creation_endmonth='.urlencode((string) ($search_date_creation_endmonth)); } if ($search_date_creation_endyear) { - $param .= '&search_date_creation_endyear='.urlencode($search_date_creation_endyear); + $param .= '&search_date_creation_endyear='.urlencode((string) ($search_date_creation_endyear)); } if ($search_date_creation_endday) { - $param .= '&search_date_creation_endday='.urlencode($search_date_creation_endday); + $param .= '&search_date_creation_endday='.urlencode((string) ($search_date_creation_endday)); } if ($search_date_creation_end) { $param .= '&search_date_creation_end='.urlencode($search_date_creation_end); } if ($search_date_modif_startmonth) { - $param .= '&search_date_modif_startmonth='.urlencode($search_date_modif_startmonth); + $param .= '&search_date_modif_startmonth='.urlencode((string) ($search_date_modif_startmonth)); } if ($search_date_modif_startyear) { - $param .= '&search_date_modif_startyear='.urlencode($search_date_modif_startyear); + $param .= '&search_date_modif_startyear='.urlencode((string) ($search_date_modif_startyear)); } if ($search_date_modif_startday) { - $param .= '&search_date_modif_startday='.urlencode($search_date_modif_startday); + $param .= '&search_date_modif_startday='.urlencode((string) ($search_date_modif_startday)); } if ($search_date_modif_start) { $param .= '&search_date_modif_start='.urlencode($search_date_modif_start); } if ($search_date_modif_endmonth) { - $param .= '&search_date_modif_endmonth='.urlencode($search_date_modif_endmonth); + $param .= '&search_date_modif_endmonth='.urlencode((string) ($search_date_modif_endmonth)); } if ($search_date_modif_endyear) { - $param .= '&search_date_modif_endyear='.urlencode($search_date_modif_endyear); + $param .= '&search_date_modif_endyear='.urlencode((string) ($search_date_modif_endyear)); } if ($search_date_modif_endday) { - $param .= '&search_date_modif_endday='.urlencode($search_date_modif_endday); + $param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday)); } if ($search_date_modif_end) { $param .= '&search_date_modif_end=' . urlencode($search_date_modif_end); } if ($socid) { - $param .= '&socid='.urlencode($socid); + $param .= '&socid='.urlencode((string) ($socid)); } if (!empty($search_category_array)) { foreach ($search_category_array as $tmpval) { @@ -958,10 +958,10 @@ if ($search_project_user > 0) { $param .= '&search_project_user='.urlencode($search_project_user); } if ($search_project_contact > 0) { - $param .= '&search_project_contact='.urlencode($search_project_contact); + $param .= '&search_project_contact='.urlencode((string) ($search_project_contact)); } if ($search_sale > 0) { - $param .= '&search_sale='.urlencode($search_sale); + $param .= '&search_sale='.urlencode((string) ($search_sale)); } if ($search_opp_amount != '') { $param .= '&search_opp_amount='.urlencode($search_opp_amount); From a4c03e51789d9b9d7f089f9dcb35340b72bcec45 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:24 +0100 Subject: [PATCH 0731/1862] Fix: Ensure string type for urlencode() --- htdocs/projet/tasks.php | 70 ++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index c5b496273f9..23aac791656 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -36,9 +36,9 @@ if (isModEnabled('category')) { } // Load translation files required by the page -$langsLoad=array('projects', 'users', 'companies'); +$langsLoad = array('projects', 'users', 'companies'); if (isModEnabled('eventorganization')) { - $langsLoad[]='eventorganization'; + $langsLoad[] = 'eventorganization'; } $langs->loadLangs($langsLoad); @@ -152,22 +152,22 @@ $planned_workload = $planned_workloadhour * 3600 + $planned_workloadmin * 60; // Definition of fields for list $arrayfields = array( - 't.ref'=>array('label'=>"RefTask", 'checked'=>1, 'position'=>1), - 't.label'=>array('label'=>"LabelTask", 'checked'=>1, 'position'=>2), - 't.description'=>array('label'=>"Description", 'checked'=>0, 'position'=>3), - 't.dateo'=>array('label'=>"DateStart", 'checked'=>1, 'position'=>4), - 't.datee'=>array('label'=>"Deadline", 'checked'=>1, 'position'=>5), - 't.planned_workload'=>array('label'=>"PlannedWorkload", 'checked'=>1, 'position'=>6), - 't.duration_effective'=>array('label'=>"TimeSpent", 'checked'=>1, 'position'=>7), - 't.progress_calculated'=>array('label'=>"ProgressCalculated", 'checked'=>1, 'position'=>8), - 't.progress'=>array('label'=>"ProgressDeclared", 'checked'=>1, 'position'=>9), - 't.progress_summary'=>array('label'=>"TaskProgressSummary", 'checked'=>1, 'position'=>10), - 't.budget_amount'=>array('label'=>"Budget", 'checked'=>0, 'position'=>11), - 'c.assigned'=>array('label'=>"TaskRessourceLinks", 'checked'=>1, 'position'=>12), + 't.ref' => array('label' => "RefTask", 'checked' => 1, 'position' => 1), + 't.label' => array('label' => "LabelTask", 'checked' => 1, 'position' => 2), + 't.description' => array('label' => "Description", 'checked' => 0, 'position' => 3), + 't.dateo' => array('label' => "DateStart", 'checked' => 1, 'position' => 4), + 't.datee' => array('label' => "Deadline", 'checked' => 1, 'position' => 5), + 't.planned_workload' => array('label' => "PlannedWorkload", 'checked' => 1, 'position' => 6), + 't.duration_effective' => array('label' => "TimeSpent", 'checked' => 1, 'position' => 7), + 't.progress_calculated' => array('label' => "ProgressCalculated", 'checked' => 1, 'position' => 8), + 't.progress' => array('label' => "ProgressDeclared", 'checked' => 1, 'position' => 9), + 't.progress_summary' => array('label' => "TaskProgressSummary", 'checked' => 1, 'position' => 10), + 't.budget_amount' => array('label' => "Budget", 'checked' => 0, 'position' => 11), + 'c.assigned' => array('label' => "TaskRessourceLinks", 'checked' => 1, 'position' => 12), ); if ($object->usage_bill_time) { - $arrayfields['t.tobill'] = array('label'=>$langs->trans("TimeToBill"), 'checked'=>0, 'position'=>11); - $arrayfields['t.billed'] = array('label'=>$langs->trans("TimeBilled"), 'checked'=>0, 'position'=>12); + $arrayfields['t.tobill'] = array('label' => $langs->trans("TimeToBill"), 'checked' => 0, 'position' => 11); + $arrayfields['t.billed'] = array('label' => $langs->trans("TimeBilled"), 'checked' => 0, 'position' => 12); } // Extra fields @@ -192,7 +192,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('id'=>$id); +$parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -297,7 +297,7 @@ if (!empty($search_progresscalc)) { //natural_search('round(100 * $line->duration_effective / $line->planned_workload,2)', $filterprogresscalc, 1, 1).' {return 1;} else {return 0;}'; } if ($search_task_budget_amount) { - $morewherefilterarray[]= natural_search('t.budget_amount', $search_task_budget_amount, 1, 1); + $morewherefilterarray[] = natural_search('t.budget_amount', $search_task_budget_amount, 1, 1); } //var_dump($morewherefilterarray); @@ -449,7 +449,7 @@ if ($id > 0 || !empty($ref)) { $param .= '&contextpage='.urlencode($contextpage); } if ($search_user_id) { - $param .= '&search_user_id='.urlencode($search_user_id); + $param .= '&search_user_id='.urlencode((string) ($search_user_id)); } if ($search_taskref) { $param .= '&search_taskref='.urlencode($search_taskref); @@ -479,49 +479,49 @@ if ($id > 0 || !empty($ref)) { $param .= '&search_dtendyear='.urlencode($search_dtendyear); } if ($search_date_start_startmonth) { - $param .= '&search_date_start_startmonth='.urlencode($search_date_start_startmonth); + $param .= '&search_date_start_startmonth='.urlencode((string) ($search_date_start_startmonth)); } if ($search_date_start_startyear) { - $param .= '&search_date_start_startyear='.urlencode($search_date_start_startyear); + $param .= '&search_date_start_startyear='.urlencode((string) ($search_date_start_startyear)); } if ($search_date_start_startday) { - $param .= '&search_date_start_startday='.urlencode($search_date_start_startday); + $param .= '&search_date_start_startday='.urlencode((string) ($search_date_start_startday)); } if ($search_date_start_start) { $param .= '&search_date_start_start='.urlencode($search_date_start_start); } if ($search_date_start_endmonth) { - $param .= '&search_date_start_endmonth='.urlencode($search_date_start_endmonth); + $param .= '&search_date_start_endmonth='.urlencode((string) ($search_date_start_endmonth)); } if ($search_date_start_endyear) { - $param .= '&search_date_start_endyear='.urlencode($search_date_start_endyear); + $param .= '&search_date_start_endyear='.urlencode((string) ($search_date_start_endyear)); } if ($search_date_start_endday) { - $param .= '&search_date_start_endday='.urlencode($search_date_start_endday); + $param .= '&search_date_start_endday='.urlencode((string) ($search_date_start_endday)); } if ($search_date_start_end) { $param .= '&search_date_start_end='.urlencode($search_date_start_end); } if ($search_date_end_startmonth) { - $param .= '&search_date_end_startmonth='.urlencode($search_date_end_startmonth); + $param .= '&search_date_end_startmonth='.urlencode((string) ($search_date_end_startmonth)); } if ($search_date_end_startyear) { - $param .= '&search_date_end_startyear='.urlencode($search_date_end_startyear); + $param .= '&search_date_end_startyear='.urlencode((string) ($search_date_end_startyear)); } if ($search_date_end_startday) { - $param .= '&search_date_end_startday='.urlencode($search_date_end_startday); + $param .= '&search_date_end_startday='.urlencode((string) ($search_date_end_startday)); } if ($search_date_end_start) { $param .= '&search_date_end_start='.urlencode($search_date_end_start); } if ($search_date_end_endmonth) { - $param .= '&search_date_end_endmonth='.urlencode($search_date_end_endmonth); + $param .= '&search_date_end_endmonth='.urlencode((string) ($search_date_end_endmonth)); } if ($search_date_end_endyear) { - $param .= '&search_date_end_endyear='.urlencode($search_date_end_endyear); + $param .= '&search_date_end_endyear='.urlencode((string) ($search_date_end_endyear)); } if ($search_date_end_endday) { - $param .= '&search_date_end_endday='.urlencode($search_date_end_endday); + $param .= '&search_date_end_endday='.urlencode((string) ($search_date_end_endday)); } if ($search_date_end_end) { $param .= '&search_date_end_end=' . urlencode($search_date_end_end); @@ -875,8 +875,8 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object- print ''; $title = $langs->trans("ListOfTasks"); - $linktotasks = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition btnTitleSelected')); - $linktotasks .= dolGetButtonTitle($langs->trans('ViewGantt'), '', 'fa fa-stream imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss'=>'reposition marginleftonly')); + $linktotasks = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss' => 'reposition btnTitleSelected')); + $linktotasks .= dolGetButtonTitle($langs->trans('ViewGantt'), '', 'fa fa-stream imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss' => 'reposition marginleftonly')); //print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'generic', 0, '', '', 0, 1); print load_fiche_titre($title, $linktotasks.'   '.$linktocreatetask, 'projecttask', '', '', '', $massactionbutton); @@ -918,7 +918,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object- // Show the massaction checkboxes only when this page is not opend from the Extended POS if ($massactionbutton && $contextpage != 'poslist') { - $selectedfields.= $form->showCheckAddButtons('checkforselect', 1); + $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); } print '
'; @@ -1115,7 +1115,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object- $disablesortlink = 1; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields - $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); + $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
'; From 6cfd5774657c62c13a34c44d0ab81a5cd0c18241 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:27 +0100 Subject: [PATCH 0732/1862] Fix: Ensure string type for urlencode() --- htdocs/projet/tasks/list.php | 88 ++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 714371b8d44..a7a5c47d757 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -144,37 +144,37 @@ if (!$sortorder) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 't.ref'=>"Ref", - 't.label'=>"Label", - 't.description'=>"Description", - 't.note_public'=>"NotePublic", + 't.ref' => "Ref", + 't.label' => "Label", + 't.description' => "Description", + 't.note_public' => "NotePublic", ); if (empty($user->socid)) { $fieldstosearchall['t.note_private'] = "NotePrivate"; } $arrayfields = array( - 't.fk_task_parent'=>array('label'=>"RefTaskParent", 'checked'=>0, 'position'=>70), - 't.ref'=>array('label'=>"RefTask", 'checked'=>1, 'position'=>80), - 't.label'=>array('label'=>"LabelTask", 'checked'=>1, 'position'=>80), - 't.description'=>array('label'=>"Description", 'checked'=>0, 'position'=>80), - 't.dateo'=>array('label'=>"DateStart", 'checked'=>1, 'position'=>100), - 't.datee'=>array('label'=>"Deadline", 'checked'=>1, 'position'=>101), - 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>151), - 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'position'=>152), - 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'csslist'=>'tdoverflowmax125', 'position'=>200), - 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>0, 'csslist'=>'tdoverflowmax125', 'position'=>201), - 'p.fk_statut'=>array('label'=>"ProjectStatus", 'checked'=>1, 'position'=>205), - 't.planned_workload'=>array('label'=>"PlannedWorkload", 'checked'=>1, 'position'=>302), - 't.duration_effective'=>array('label'=>"TimeSpent", 'checked'=>1, 'position'=>303), - 't.progress_calculated'=>array('label'=>"ProgressCalculated", 'checked'=>1, 'position'=>304), - 't.progress'=>array('label'=>"ProgressDeclared", 'checked'=>1, 'position'=>305), - 't.progress_summary'=>array('label'=>"TaskProgressSummary", 'checked'=>1, 'position'=>306), - 't.budget_amount'=>array('label'=>"Budget", 'checked'=>0, 'position'=>307), - 't.tobill'=>array('label'=>"TimeToBill", 'checked'=>0, 'position'=>310), - 't.billed'=>array('label'=>"TimeBilled", 'checked'=>0, 'position'=>311), - 't.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), - 't.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>501), + 't.fk_task_parent' => array('label' => "RefTaskParent", 'checked' => 0, 'position' => 70), + 't.ref' => array('label' => "RefTask", 'checked' => 1, 'position' => 80), + 't.label' => array('label' => "LabelTask", 'checked' => 1, 'position' => 80), + 't.description' => array('label' => "Description", 'checked' => 0, 'position' => 80), + 't.dateo' => array('label' => "DateStart", 'checked' => 1, 'position' => 100), + 't.datee' => array('label' => "Deadline", 'checked' => 1, 'position' => 101), + 'p.ref' => array('label' => "ProjectRef", 'checked' => 1, 'position' => 151), + 'p.title' => array('label' => "ProjectLabel", 'checked' => 0, 'position' => 152), + 's.nom' => array('label' => "ThirdParty", 'checked' => 1, 'csslist' => 'tdoverflowmax125', 'position' => 200), + 's.name_alias' => array('label' => "AliasNameShort", 'checked' => 0, 'csslist' => 'tdoverflowmax125', 'position' => 201), + 'p.fk_statut' => array('label' => "ProjectStatus", 'checked' => 1, 'position' => 205), + 't.planned_workload' => array('label' => "PlannedWorkload", 'checked' => 1, 'position' => 302), + 't.duration_effective' => array('label' => "TimeSpent", 'checked' => 1, 'position' => 303), + 't.progress_calculated' => array('label' => "ProgressCalculated", 'checked' => 1, 'position' => 304), + 't.progress' => array('label' => "ProgressDeclared", 'checked' => 1, 'position' => 305), + 't.progress_summary' => array('label' => "TaskProgressSummary", 'checked' => 1, 'position' => 306), + 't.budget_amount' => array('label' => "Budget", 'checked' => 0, 'position' => 307), + 't.tobill' => array('label' => "TimeToBill", 'checked' => 0, 'position' => 310), + 't.billed' => array('label' => "TimeBilled", 'checked' => 0, 'position' => 311), + 't.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500), + 't.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 501), //'t.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), ); // Extra fields @@ -204,7 +204,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -611,40 +611,40 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); } if ($search_date_startday) { - $param .= '&search_date_startday='.urlencode($search_date_startday); + $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); } if ($search_date_startmonth) { - $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); + $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth)); } if ($search_date_startyear) { - $param .= '&search_date_startyear='.urlencode($search_date_startyear); + $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear)); } if ($search_date_endday) { - $param .= '&search_date_endday='.urlencode($search_date_endday); + $param .= '&search_date_endday='.urlencode((string) ($search_date_endday)); } if ($search_date_endmonth) { - $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); + $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth)); } if ($search_date_endyear) { - $param .= '&search_date_endyear='.urlencode($search_date_endyear); + $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear)); } if ($search_datelimit_startday) { - $param .= '&search_datelimit_startday='.urlencode($search_datelimit_startday); + $param .= '&search_datelimit_startday='.urlencode((string) ($search_datelimit_startday)); } if ($search_datelimit_startmonth) { - $param .= '&search_datelimit_startmonth='.urlencode($search_datelimit_startmonth); + $param .= '&search_datelimit_startmonth='.urlencode((string) ($search_datelimit_startmonth)); } if ($search_datelimit_startyear) { - $param .= '&search_datelimit_startyear='.urlencode($search_datelimit_startyear); + $param .= '&search_datelimit_startyear='.urlencode((string) ($search_datelimit_startyear)); } if ($search_datelimit_endday) { - $param .= '&search_datelimit_endday='.urlencode($search_datelimit_endday); + $param .= '&search_datelimit_endday='.urlencode((string) ($search_datelimit_endday)); } if ($search_datelimit_endmonth) { - $param .= '&search_datelimit_endmonth='.urlencode($search_datelimit_endmonth); + $param .= '&search_datelimit_endmonth='.urlencode((string) ($search_datelimit_endmonth)); } if ($search_datelimit_endyear) { - $param .= '&search_datelimit_endyear='.urlencode($search_datelimit_endyear); + $param .= '&search_datelimit_endyear='.urlencode((string) ($search_datelimit_endyear)); } if ($search_task_budget_amount) { $param .= '&search_task_budget_amount='.urlencode($search_task_budget_amount); @@ -689,7 +689,7 @@ if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($sea $param .= '&search_opp_status='.urlencode($search_opp_status); } if ($search_project_user != '') { - $param .= '&search_project_user='.urlencode($search_project_user); + $param .= '&search_project_user='.urlencode((string) ($search_project_user)); } if ($search_task_user > 0) { $param .= '&search_task_user='.urlencode($search_task_user); @@ -741,8 +741,8 @@ print ''; $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?action=create', '', $permissiontocreate); @@ -960,7 +960,7 @@ if (!empty($arrayfields['t.billed']['checked'])) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['t.datec']['checked'])) { @@ -1521,7 +1521,7 @@ while ($i < $imaxinloop) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1622,7 +1622,7 @@ if (isset($totalarray['totaldurationeffectivefield']) || isset($totalarray['tota $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql' => $sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From 6dbabaa5143e95cadba8b4397a69bd14aec7af33 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:30 +0100 Subject: [PATCH 0733/1862] Fix: Ensure string type for urlencode() --- htdocs/projet/tasks/time.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 32e47dcfb83..c48a6f296cc 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1297,10 +1297,10 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $param .= '&limit='.((int) $limit); } if ($search_month > 0) { - $param .= '&search_month=' . urlencode($search_month); + $param .= '&search_month=' . urlencode((string) ($search_month)); } if ($search_year > 0) { - $param .= '&search_year=' . urlencode($search_year); + $param .= '&search_year=' . urlencode((string) ($search_year)); } if (!empty($search_user)) { // We keep param if -1 because default value is forced to user id if not set $param .= '&search_user='.urlencode($search_user); @@ -1327,40 +1327,40 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $param .= '&search_note=' . urlencode($search_note); } if ($search_duration != '') { - $param .= '&search_field2=' . urlencode($search_duration); + $param .= '&search_field2=' . urlencode((string) ($search_duration)); } if ($optioncss != '') { $param .= '&optioncss=' . urlencode($optioncss); } if ($search_date_startday) { - $param .= '&search_date_startday=' . urlencode($search_date_startday); + $param .= '&search_date_startday=' . urlencode((string) ($search_date_startday)); } if ($search_date_startmonth) { - $param .= '&search_date_startmonth=' . urlencode($search_date_startmonth); + $param .= '&search_date_startmonth=' . urlencode((string) ($search_date_startmonth)); } if ($search_date_startyear) { - $param .= '&search_date_startyear=' . urlencode($search_date_startyear); + $param .= '&search_date_startyear=' . urlencode((string) ($search_date_startyear)); } if ($search_date_endday) { - $param .= '&search_date_endday=' . urlencode($search_date_endday); + $param .= '&search_date_endday=' . urlencode((string) ($search_date_endday)); } if ($search_date_endmonth) { - $param .= '&search_date_endmonth=' . urlencode($search_date_endmonth); + $param .= '&search_date_endmonth=' . urlencode((string) ($search_date_endmonth)); } if ($search_date_endyear) { - $param .= '&search_date_endyear=' . urlencode($search_date_endyear); + $param .= '&search_date_endyear=' . urlencode((string) ($search_date_endyear)); } if ($search_timespent_starthour) { - $param .= '&search_timespent_duration_starthour=' . urlencode($search_timespent_starthour); + $param .= '&search_timespent_duration_starthour=' . urlencode((string) ($search_timespent_starthour)); } if ($search_timespent_startmin) { - $param .= '&search_timespent_duration_startmin=' . urlencode($search_timespent_startmin); + $param .= '&search_timespent_duration_startmin=' . urlencode((string) ($search_timespent_startmin)); } if ($search_timespent_endhour) { - $param .= '&search_timespent_duration_endhour=' . urlencode($search_timespent_endhour); + $param .= '&search_timespent_duration_endhour=' . urlencode((string) ($search_timespent_endhour)); } if ($search_timespent_endmin) { - $param .= '&search_timespent_duration_endmin=' . urlencode($search_timespent_endmin); + $param .= '&search_timespent_duration_endmin=' . urlencode((string) ($search_timespent_endmin)); } /* @@ -1368,13 +1368,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; */ if ($id) { - $param .= '&id=' . urlencode($id); + $param .= '&id=' . urlencode((string) ($id)); } if ($projectid) { - $param .= '&projectid=' . urlencode($projectid); + $param .= '&projectid=' . urlencode((string) ($projectid)); } if ($withproject) { - $param .= '&withproject=' . urlencode($withproject); + $param .= '&withproject=' . urlencode((string) ($withproject)); } // Add $param from hooks $parameters = array(); From f12e03cdc13da52a9ec1a918a4cdb348d91ba4c6 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:33 +0100 Subject: [PATCH 0734/1862] Fix: Ensure string type for urlencode() --- htdocs/public/eventorganization/attendee_new.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index edccbf8006a..7de72eac061 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -235,7 +235,7 @@ if ($reshook < 0) { } // Action called when page is submitted -if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conference->status==2 || !empty($project->id) && $project->status == Project::STATUS_VALIDATED)) { +if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conference->status == 2 || !empty($project->id) && $project->status == Project::STATUS_VALIDATED)) { $error = 0; $urlback = ''; @@ -600,7 +600,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // Now we redirect to the payment page $sourcetouse = 'organizedeventregistration'; $reftouse = $facture->id; - $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.urlencode($sourcetouse).'&ref='.urlencode($reftouse); + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.urlencode((string) ($sourcetouse)).'&ref='.urlencode((string) ($reftouse)); if (getDolGlobalString('PAYMENT_SECURITY_TOKEN')) { if (getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) { $redirection .= '&securekey='.dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical From cc606e9e85b4f13a785e0674f6ee74d855b6d7db Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:35 +0100 Subject: [PATCH 0735/1862] Fix: Ensure string type for urlencode() --- htdocs/public/onlinesign/newonlinesign.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index f5be599fcc4..9f09c6a3f4d 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -112,8 +112,8 @@ if (!empty($SECUREKEY)) { $urlko .= 'securekey='.urlencode($SECUREKEY).'&'; } if (!empty($entity)) { - $urlok .= 'entity='.urlencode($entity).'&'; - $urlko .= 'entity='.urlencode($entity).'&'; + $urlok .= 'entity='.urlencode((string) ($entity)).'&'; + $urlko .= 'entity='.urlencode((string) ($entity)).'&'; } $urlok = preg_replace('/&$/', '', $urlok); // Remove last & $urlko = preg_replace('/&$/', '', $urlko); // Remove last & @@ -146,19 +146,19 @@ if (!dol_verifyHash($securekeyseed.$type.$ref.(isModEnabled('multicompany') ? $e if ($source == 'proposal') { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $object = new Propal($db); - $result= $object->fetch(0, $ref, '', $entity); + $result = $object->fetch(0, $ref, '', $entity); } elseif ($source == 'contract') { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $object = new Contrat($db); - $result= $object->fetch(0, $ref); + $result = $object->fetch(0, $ref); } elseif ($source == 'fichinter') { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $object = new Fichinter($db); - $result= $object->fetch(0, $ref); + $result = $object->fetch(0, $ref); } elseif ($source == 'societe_rib') { require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; $object = new CompanyBankAccount($db); - $result= $object->fetch($ref); + $result = $object->fetch($ref); } else { httponly_accessforbidden($langs->trans('ErrorBadParameters')." - Bad value for source. Value not supported.", 400, 1); } @@ -571,11 +571,11 @@ if ($source == 'proposal') { $object->setDocModel($user, $defaulttemplate); $moreparams = array( - 'use_companybankid'=>$object->id, - 'force_dir_output'=>$diroutput + 'use_companybankid' => $object->id, + 'force_dir_output' => $diroutput ); $result = $object->thirdparty->generateDocument($defaulttemplate, $langs, 0, 0, 0, $moreparams); - $object->last_main_doc=$object->thirdparty->last_main_doc; + $object->last_main_doc = $object->thirdparty->last_main_doc; } $directdownloadlink = $object->getLastMainDocLink('company'); if ($directdownloadlink) { From 5ab36a5aa9bf077b9f216f6f5e3f9e66bb5c3d51 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:38 +0100 Subject: [PATCH 0736/1862] Fix: Ensure string type for urlencode() --- htdocs/public/payment/newpayment.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index e679a3e180f..efa31e998c2 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -238,8 +238,8 @@ if (!empty($SECUREKEY)) { $urlko .= 'securekey='.urlencode($SECUREKEY).'&'; } if (!empty($entity)) { - $urlok .= 'e='.urlencode($entity).'&'; - $urlko .= 'e='.urlencode($entity).'&'; + $urlok .= 'e='.urlencode((string) ($entity)).'&'; + $urlko .= 'e='.urlencode((string) ($entity)).'&'; } if (!empty($getpostlang)) { $urlok .= 'lang='.urlencode($getpostlang).'&'; @@ -519,7 +519,7 @@ if ($action == 'charge' && isModEnabled('stripe')) { 'dol_entity' => $conf->entity, 'dol_company' => $mysoc->name, // Useful when using multicompany 'dol_tax_num' => $vatnumber, - 'ipaddress'=> getUserRemoteIP() + 'ipaddress' => getUserRemoteIP() ); if (!empty($thirdparty_id)) { @@ -1421,9 +1421,9 @@ if ($source == 'contractline') { // TODO Put this in a global method if ($contractline->product->duration_value > 1) { - $dur = array("h"=>$langs->trans("Hours"), "d"=>$langs->trans("DurationDays"), "w"=>$langs->trans("DurationWeeks"), "m"=>$langs->trans("DurationMonths"), "y"=>$langs->trans("DurationYears")); + $dur = array("h" => $langs->trans("Hours"), "d" => $langs->trans("DurationDays"), "w" => $langs->trans("DurationWeeks"), "m" => $langs->trans("DurationMonths"), "y" => $langs->trans("DurationYears")); } else { - $dur = array("h"=>$langs->trans("Hour"), "d"=>$langs->trans("DurationDay"), "w"=>$langs->trans("DurationWeek"), "m"=>$langs->trans("DurationMonth"), "y"=>$langs->trans("DurationYear")); + $dur = array("h" => $langs->trans("Hour"), "d" => $langs->trans("DurationDay"), "w" => $langs->trans("DurationWeek"), "m" => $langs->trans("DurationMonth"), "y" => $langs->trans("DurationYear")); } $duration = $contractline->product->duration_value.' '.$dur[$contractline->product->duration_unit]; } @@ -1496,7 +1496,7 @@ if ($source == 'contractline') { if ($source == 'member' || $source == 'membersubscription') { $newsource = 'member'; - $tag=""; + $tag = ""; $found = true; $langs->load("members"); @@ -2362,7 +2362,7 @@ if (preg_match('/^dopayment/', $action)) { // If we chose/clicked on the payme } $ipaddress = getUserRemoteIP(); - $metadata = array('dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>$ipaddress); + $metadata = array('dol_version' => DOL_VERSION, 'dol_entity' => $conf->entity, 'ipaddress' => $ipaddress); if (is_object($object)) { $metadata['dol_type'] = $object->element; $metadata['dol_id'] = $object->id; @@ -2372,7 +2372,7 @@ if (preg_match('/^dopayment/', $action)) { // If we chose/clicked on the payme try { $arrayforpaymentintent = array( - 'description'=>'Stripe payment: '.$FULLTAG.($ref ? ' ref='.$ref : ''), + 'description' => 'Stripe payment: '.$FULLTAG.($ref ? ' ref='.$ref : ''), "metadata" => $metadata ); if ($TAG) { From 31221fe77ac8a0be1c7e8bac02d849022f2d3dba Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:40 +0100 Subject: [PATCH 0737/1862] Fix: Ensure string type for urlencode() --- htdocs/public/ticket/list.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 11a1c5fa5c5..3267d9aef67 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -293,14 +293,14 @@ if ($action == "view_ticketlist") { // -1 value = all so no filter if ($search_fk_user_assign > 0) { $filter['t.fk_user_assign'] = $search_fk_user_assign; - $param .= '&search_fk_user_assign='.urlencode($search_fk_user_assign); + $param .= '&search_fk_user_assign='.urlencode((string) ($search_fk_user_assign)); } } if (!empty($search_fk_user_create)) { // -1 value = all so no filter if ($search_fk_user_create > 0) { $filter['t.fk_user_create'] = $search_fk_user_create; - $param .= '&search_fk_user_create='.urlencode($search_fk_user_create); + $param .= '&search_fk_user_create='.urlencode((string) ($search_fk_user_create)); } } if ((isset($search_fk_status) && $search_fk_status != '') && $search_fk_status != '-1' && $search_fk_status != 'non_closed') { @@ -432,8 +432,8 @@ if ($action == "view_ticketlist") { $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields // allow to display information before list - $parameters=array('arrayfields'=>$arrayfields); - $reshook=$hookmanager->executeHooks('printFieldListHeader', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + $parameters = array('arrayfields' => $arrayfields); + $reshook = $hookmanager->executeHooks('printFieldListHeader', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
'; @@ -501,7 +501,7 @@ if ($action == "view_ticketlist") { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields); + $parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -563,7 +563,7 @@ if ($action == "view_ticketlist") { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields - $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); + $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From 1f25fabc3457542be34f48c6913f1bbdc2a56641 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:43 +0100 Subject: [PATCH 0738/1862] Fix: Ensure string type for urlencode() --- htdocs/reception/list.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index caadc0e2af0..f6242c6ee14 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -560,7 +560,7 @@ if (empty($reshook)) { if ($nb_bills_created == 1) { $texttoshow = $langs->trans('BillXCreated', '{s1}'); - $texttoshow = str_replace('{s1}', ''.$lastref.'', $texttoshow); + $texttoshow = str_replace('{s1}', ''.$lastref.'', $texttoshow); setEventMessages($texttoshow, null, 'mesgs'); } else { setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs'); @@ -765,7 +765,7 @@ if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } if ($search_billed != '' && $search_billed >= 0) { - $param .= "&search_billed=".urlencode($search_billed); + $param .= "&search_billed=".urlencode((string) ($search_billed)); } if ($search_town) { $param .= "&search_town=".urlencode($search_town); @@ -780,46 +780,46 @@ if ($search_status != '') { $param .= "&search_status=".urlencode($search_status); } if ($search_country) { - $param .= "&search_country=".urlencode($search_country); + $param .= "&search_country=".urlencode((string) ($search_country)); } if ($search_type_thirdparty) { - $param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty); + $param .= "&search_type_thirdparty=".urlencode((string) ($search_type_thirdparty)); } if ($search_date_delivery_startday) { - $param .= '&search_date_delivery_startday='.urlencode($search_date_delivery_startday); + $param .= '&search_date_delivery_startday='.urlencode((string) ($search_date_delivery_startday)); } if ($search_date_delivery_startmonth) { - $param .= '&search_date_delivery_startmonth='.urlencode($search_date_delivery_startmonth); + $param .= '&search_date_delivery_startmonth='.urlencode((string) ($search_date_delivery_startmonth)); } if ($search_date_delivery_startyear) { - $param .= '&search_date_delivery_startyear='.urlencode($search_date_delivery_startyear); + $param .= '&search_date_delivery_startyear='.urlencode((string) ($search_date_delivery_startyear)); } if ($search_date_delivery_endday) { - $param .= '&search_date_delivery_endday='.urlencode($search_date_delivery_endday); + $param .= '&search_date_delivery_endday='.urlencode((string) ($search_date_delivery_endday)); } if ($search_date_delivery_endmonth) { - $param .= '&search_date_delivery_endmonth='.urlencode($search_date_delivery_endmonth); + $param .= '&search_date_delivery_endmonth='.urlencode((string) ($search_date_delivery_endmonth)); } if ($search_date_delivery_endyear) { - $param .= '&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear); + $param .= '&search_date_delivery_endyear='.urlencode((string) ($search_date_delivery_endyear)); } if ($search_date_create_startday) { - $param .= '&search_date_create_startday='.urlencode($search_date_create_startday); + $param .= '&search_date_create_startday='.urlencode((string) ($search_date_create_startday)); } if ($search_date_create_startmonth) { - $param .= '&search_date_create_startmonth='.urlencode($search_date_create_startmonth); + $param .= '&search_date_create_startmonth='.urlencode((string) ($search_date_create_startmonth)); } if ($search_date_create_startyear) { - $param .= '&search_date_create_startyear='.urlencode($search_date_create_startyear); + $param .= '&search_date_create_startyear='.urlencode((string) ($search_date_create_startyear)); } if ($search_date_create_endday) { - $param .= '&search_date_create_endday='.urlencode($search_date_create_endday); + $param .= '&search_date_create_endday='.urlencode((string) ($search_date_create_endday)); } if ($search_date_create_endmonth) { - $param .= '&search_date_create_endmonth='.urlencode($search_date_create_endmonth); + $param .= '&search_date_create_endmonth='.urlencode((string) ($search_date_create_endmonth)); } if ($search_date_create_endyear) { - $param .= '&search_date_create_endyear='.urlencode($search_date_create_endyear); + $param .= '&search_date_create_endyear='.urlencode((string) ($search_date_create_endyear)); } if ($search_ref_supplier) { $param .= "&search_ref_supplier=".urlencode($search_ref_supplier); From 6644897b6041541c82d6521caa2f69ee11a41be7 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:46 +0100 Subject: [PATCH 0739/1862] Fix: Ensure string type for urlencode() --- .../recruitmentcandidature_list.php | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 3284710c7eb..56c05ffdb56 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -117,11 +117,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } @@ -499,7 +499,7 @@ $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; if (!empty($id)) { - $param .= '&id='.urlencode($id); + $param .= '&id='.urlencode((string) ($id)); } if (!empty($mode)) { $param .= '&mode='.urlencode($mode); @@ -533,7 +533,7 @@ $param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( - 'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + 'validate' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), @@ -562,8 +562,8 @@ print ''; $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/recruitment/recruitmentcandidature_card.php', 1).'?action=create&fk_recruitmentjobposition='.$id, '', $permissiontoadd); @@ -662,7 +662,7 @@ foreach ($object->fields as $key => $val) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -704,7 +704,7 @@ foreach ($object->fields as $key => $val) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -761,7 +761,7 @@ while ($i < $imaxinloop) { $selected = 1; } } - print $object->getKanbanView('', array('jobpositionlink'=>$recruitment->getNomUrl(1), 'selected' => $selected)); + print $object->getKanbanView('', array('jobpositionlink' => $recruitment->getNomUrl(1), 'selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; @@ -838,7 +838,7 @@ while ($i < $imaxinloop) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -880,7 +880,7 @@ if ($num == 0) { $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From c7d1e2616d8b7ce0e9d3056347e3b1139b7eab61 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:50 +0100 Subject: [PATCH 0740/1862] Fix: Ensure string type for urlencode() --- htdocs/salaries/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 36d30fc46a2..0159b9b93a9 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -330,7 +330,7 @@ if ($action == 'add' && empty($cancel)) { if (GETPOST('saveandnew', 'alpha')) { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); - header("Location: card.php?action=create&fk_project=" . urlencode($projectid) . "&accountid=" . urlencode($accountid) . '&paymenttype=' . urlencode(GETPOSTINT('paymenttype')) . '&datepday=' . GETPOSTINT("datepday") . '&datepmonth=' . GETPOSTINT("datepmonth") . '&datepyear=' . GETPOSTINT("datepyear")); + header("Location: card.php?action=create&fk_project=" . urlencode((string) ($projectid)) . "&accountid=" . urlencode((string) ($accountid)) . '&paymenttype=' . urlencode((string) (GETPOSTINT('paymenttype'))) . '&datepday=' . GETPOSTINT("datepday") . '&datepmonth=' . GETPOSTINT("datepmonth") . '&datepyear=' . GETPOSTINT("datepyear")); exit; } else { header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $object->id); From ad99c7e2a8174833ac3b4334d8bb6df43bcdf8ab Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:53 +0100 Subject: [PATCH 0741/1862] Fix: Ensure string type for urlencode() --- htdocs/salaries/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 3b1beab890d..7af81d47d6e 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -380,7 +380,7 @@ if ($search_label) { $param .= '&search_label='.urlencode($search_label); } if ($search_account) { - $param .= '&search_account='.urlencode($search_account); + $param .= '&search_account='.urlencode((string) ($search_account)); } if ($search_status != '' && $search_status != '-1') { $param .= '&search_status='.urlencode($search_status); From a6827b7c910bef3b3875135009be284ef5d3290f Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:56 +0100 Subject: [PATCH 0742/1862] Fix: Ensure string type for urlencode() --- htdocs/salaries/payments.php | 44 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index db0865ba994..fc659db2e1b 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -140,11 +140,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1, 1, '1'); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } @@ -362,25 +362,25 @@ if ($search_label) { $param .= '&search_label='.urlencode($search_label); } if ($search_fk_bank) { - $param .= '&search_fk_bank='.urlencode($search_fk_bank); + $param .= '&search_fk_bank='.urlencode((string) ($search_fk_bank)); } if ($search_chq_number) { - $param .= '&search_chq_number='.urlencode($search_chq_number); + $param .= '&search_chq_number='.urlencode((string) ($search_chq_number)); } if ($search_account) { - $param .= '&search_account='.urlencode($search_account); + $param .= '&search_account='.urlencode((string) ($search_account)); } if ($search_date_start) { - $param .= '&search_date_startday='.urlencode(GETPOSTINT('search_date_startday')).'&search_date_startmonth='.urlencode(GETPOSTINT('search_date_startmonth')).'&search_date_startyear='.urlencode(GETPOSTINT('search_date_startyear')); + $param .= '&search_date_startday='.urlencode((string) (GETPOSTINT('search_date_startday'))).'&search_date_startmonth='.urlencode((string) (GETPOSTINT('search_date_startmonth'))).'&search_date_startyear='.urlencode((string) (GETPOSTINT('search_date_startyear'))); } if ($search_dateep_start) { - $param .= '&search_dateep_startday='.urlencode(GETPOSTINT('search_dateep_startday')).'&search_dateep_startmonth='.urlencode(GETPOSTINT('search_dateep_startmonth')).'&search_dateep_startyear='.urlencode(GETPOSTINT('search_dateep_startyear')); + $param .= '&search_dateep_startday='.urlencode((string) (GETPOSTINT('search_dateep_startday'))).'&search_dateep_startmonth='.urlencode((string) (GETPOSTINT('search_dateep_startmonth'))).'&search_dateep_startyear='.urlencode((string) (GETPOSTINT('search_dateep_startyear'))); } if ($search_date_end) { - $param .= '&search_date_endday='.urlencode(GETPOSTINT('search_date_endday')).'&search_date_endmonth='.urlencode(GETPOSTINT('search_date_endmonth')).'&search_date_endyear='.urlencode(GETPOSTINT('search_date_endyear')); + $param .= '&search_date_endday='.urlencode((string) (GETPOSTINT('search_date_endday'))).'&search_date_endmonth='.urlencode((string) (GETPOSTINT('search_date_endmonth'))).'&search_date_endyear='.urlencode((string) (GETPOSTINT('search_date_endyear'))); } if ($search_dateep_end) { - $param .= '&search_dateep_endday='.urlencode(GETPOSTINT('search_dateep_endday')).'&search_dateep_endmonth='.urlencode(GETPOSTINT('search_dateep_endmonth')).'&search_dateep_endyear='.urlencode(GETPOSTINT('search_dateep_endyear')); + $param .= '&search_dateep_endday='.urlencode((string) (GETPOSTINT('search_dateep_endday'))).'&search_dateep_endmonth='.urlencode((string) (GETPOSTINT('search_dateep_endmonth'))).'&search_dateep_endyear='.urlencode((string) (GETPOSTINT('search_dateep_endyear'))); } // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -414,8 +414,8 @@ if (!empty($socid)) { $url .= '&socid='.$socid; } $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton = dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('salaries', 'write')); @@ -454,19 +454,19 @@ print ''; // Date payment print ''; // Date value @@ -501,7 +501,7 @@ print ''; @@ -1269,7 +1269,7 @@ if ($resql) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1338,7 +1338,7 @@ if ($resql) { $db->free($resql); - $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); + $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From a00e69f96fe31c8fea232f830458ef70d525e4c3 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:54:16 +0100 Subject: [PATCH 0749/1862] Fix: Ensure string type for urlencode() --- htdocs/takepos/floors.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/floors.php b/htdocs/takepos/floors.php index 6bb4f8ae4c2..20558a484e4 100644 --- a/htdocs/takepos/floors.php +++ b/htdocs/takepos/floors.php @@ -157,7 +157,7 @@ function updateplace(idplace, left, top) { url: "", data: { action: "update", left: left, top: top, place: idplace, token: '' } }).done(function( msg ) { - window.location.href='floors.php?mode=edit&floor='; + window.location.href='floors.php?mode=edit&floor='; }); } @@ -169,7 +169,7 @@ function updatename(rowid) { url: "", data: { action: "updatename", place: rowid, newname: after, token: '' } }).done(function( msg ) { - window.location.href='floors.php?mode=edit&floor='; + window.location.href='floors.php?mode=edit&floor='; }); } @@ -232,7 +232,8 @@ $( document ).ready(function() { } ?>';"> trans("Floor")." ".$floor; ?> - + From 8bd13a17dba3c479b86b43512cd9681083486f31 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:54:18 +0100 Subject: [PATCH 0750/1862] Fix: Ensure string type for urlencode() --- htdocs/takepos/pay.php | 50 +++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index ec19ad6c74d..27fa2d103e3 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -69,7 +69,7 @@ $title = ''; $disablejs = 0; $disablehead = 0; -$head=''; +$head = ''; if (getDolGlobalInt('TAKEPOS_COLOR_THEME') == 1) { $head .= ''; } @@ -122,7 +122,7 @@ function unexpectedDisconnect() { function fetchConnectionToken() { type != $invoice::TYPE_CREDIT_NOTE) { trans('TotalTTC')."'.substring(0,20);"; - echo "line1=line1.padEnd(20);"; - echo "var line2='".price($invoice->total_ttc, 1, '', 1, -1, -1)."'.substring(0,20);"; - echo "line2=line2.padEnd(20);"; - echo "$.ajax({ + echo "var line1='".$langs->trans('TotalTTC')."'.substring(0,20);"; + echo "line1=line1.padEnd(20);"; + echo "var line2='".price($invoice->total_ttc, 1, '', 1, -1, -1)."'.substring(0,20);"; + echo "line2=line2.padEnd(20);"; + echo "$.ajax({ type: 'GET', data: { text: line1+line2 }, url: '".getDolGlobalString('TAKEPOS_PRINT_SERVER')."/display/index.php', @@ -553,7 +553,7 @@ if (isModEnabled('multicurrency') && $_SESSION["takeposcustomercurrency"] != ""
trans("Received"); ?>: multicurrency_code); + echo price(0, 1, '', 1, -1, -1, $invoice->multicurrency_code); if ($showothercurrency) { print '   (' . price(0 * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')'; } @@ -561,7 +561,7 @@ if (isModEnabled('multicurrency') && $_SESSION["takeposcustomercurrency"] != ""
trans("Change"); ?>: multicurrency_code); + echo price(0, 1, '', 1, -1, -1, $invoice->multicurrency_code); if ($showothercurrency) { print '   (' . price(0 * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')'; } @@ -583,18 +583,18 @@ if (isModEnabled('multicurrency') && $_SESSION["takeposcustomercurrency"] != ""
"reset()", - "span" => "style='font-size: 150%;'", - "text" => "C", - "class" => "poscolorblue" - ), - array( - "function" => "parent.$.colorbox.close();", - "span" => "id='printtext' style='font-weight: bold; font-size: 18pt;'", - "text" => "X", - "class" => "poscolordelete" - ), +array( + "function" => "reset()", + "span" => "style='font-size: 150%;'", + "text" => "C", + "class" => "poscolorblue" +), +array( + "function" => "parent.$.colorbox.close();", + "span" => "id='printtext' style='font-weight: bold; font-size: 18pt;'", + "text" => "X", + "class" => "poscolordelete" +), ); $numpad = getDolGlobalString('TAKEPOS_NUMPAD'); if (isModEnabled('stripe') && isset($keyforstripeterminalbank) && getDolGlobalString('STRIPE_CARD_PRESENT')) { @@ -748,7 +748,7 @@ if (getDolGlobalString('TAKEPOS_DELAYED_PAYMENT')) { executeHooks('completePayment', $parameters, $invoice); print $hookmanager->resPrint; ?> From a7c5b01ec3ecae2fc89cfa7fd88f5a9eb45555df Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:54:21 +0100 Subject: [PATCH 0751/1862] Fix: Ensure string type for urlencode() --- htdocs/ticket/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 1233793cd7d..4ccef134ea0 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -668,16 +668,16 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook $param .= $hookmanager->resPrint; if ($socid > 0) { - $param .= '&socid='.urlencode($socid); + $param .= '&socid='.urlencode((string) ($socid)); } if ($search_societe) { $param .= '&search_societe='.urlencode($search_societe); } if ($projectid > 0) { - $param .= '&projectid='.urlencode($projectid); + $param .= '&projectid='.urlencode((string) ($projectid)); } if ($contractid > 0) { - $param .= '&contractid='.urlencode($contractid); + $param .= '&contractid='.urlencode((string) ($contractid)); } if ($search_date_start) { $tmparray = dol_getdate($search_date_start); From 7fd69459dfc33e36202ef30dc6dfcea0063f51a3 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:54:24 +0100 Subject: [PATCH 0752/1862] Fix: Ensure string type for urlencode() --- htdocs/user/agenda.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/agenda.php b/htdocs/user/agenda.php index a9887cc577c..7c692bb9ba4 100644 --- a/htdocs/user/agenda.php +++ b/htdocs/user/agenda.php @@ -89,7 +89,7 @@ if (($object->id != $user->id) && !$user->hasRight('user', 'user', 'lire')) { accessforbidden(); } -$parameters = array('id'=>$userId); +$parameters = array('id' => $userId); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -185,7 +185,7 @@ if (isModEnabled('agenda')) { if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allaactions', 'read'))) { print '
'; - $param = '&id='.urlencode($id); + $param = '&id='.urlencode((string) ($id)); if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); From 41a82fe7da8f87990904374f75bcbb45c034f31d Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:54:27 +0100 Subject: [PATCH 0753/1862] Fix: Ensure string type for urlencode() --- htdocs/user/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index c7793975b0f..e55dc5ea1bc 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -606,7 +606,7 @@ if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } if ($search_categ > 0) { - $param .= '&search_categ='.urlencode($search_categ); + $param .= '&search_categ='.urlencode((string) ($search_categ)); } if ($search_warehouse > 0) { $param .= '&search_warehouse='.urlencode($search_warehouse); @@ -650,7 +650,7 @@ print ''; $url = DOL_URL_ROOT.'/user/card.php?action=create'.($contextpage == 'employeelist' ? '&search_employee=1' : '').'&leftmenu='; if (!empty($socid)) { - $url .= '&socid='.urlencode($socid); + $url .= '&socid='.urlencode((string) ($socid)); } $newcardbutton = ''; From 08424f1347cd866f86043f0b2369d21981d8a0e0 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:54:29 +0100 Subject: [PATCH 0754/1862] Fix: Ensure string type for urlencode() --- htdocs/user/messaging.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/messaging.php b/htdocs/user/messaging.php index d9db450b985..f28ee2aa0cc 100644 --- a/htdocs/user/messaging.php +++ b/htdocs/user/messaging.php @@ -99,7 +99,7 @@ $result = restrictedArea($user, 'user', $userId, '&user'); * Actions */ -$parameters = array('id'=>$socid); +$parameters = array('id' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -196,7 +196,7 @@ if (isModEnabled('agenda')) { if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allaactions', 'read'))) { print '
'; - $param = '&userid='.urlencode($userid); + $param = '&userid='.urlencode((string) ($userid)); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } From be80a14b472b0542f2aa27081c11eb02db6afa79 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:54:32 +0100 Subject: [PATCH 0755/1862] Fix: Ensure string type for urlencode() --- htdocs/user/notify/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 8112a219016..240723c47c8 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -228,11 +228,11 @@ if ($result > 0) { // Add notification form // print load_fiche_titre($langs->trans("AddNewNotification"), '', ''); - print ''; + print ''; print ''; print ''; - $param = "&id=".urlencode($id); + $param = "&id=".urlencode((string) ($id)); // Line with titles /* print '
">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
'; - print ''.img_edit().''; - print ''.img_delete().''; + print ''.img_edit().''; + print ''.img_delete().''; print '
'; if ($menu['titre'] != 'Module'.$module.'Name') { - print ''.img_edit().''; - print ''.img_delete().''; + print ''.img_edit().''; + print ''.img_delete().''; } print ''; print ''.img_edit().''; - print ''.img_delete().''; + print ''.img_delete().''; print ''; - if ($objp->qty >0) { + if ($objp->qty > 0) { print '+'.$objp->qty.''; } else { print ''.$objp->qty.''; From 8b8f1c9410796cf2f683cd670c0ab8367aae9952 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:12 +0100 Subject: [PATCH 0702/1862] Fix: Ensure string type for urlencode() --- htdocs/partnership/partnership_agenda.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index 0f0fd217047..851809edb21 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -112,7 +112,7 @@ if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') { * Actions */ -$parameters = array('id'=>$id); +$parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -217,14 +217,14 @@ if ($object->id > 0) { $objthirdparty = $object; $objcon = new stdClass(); - $out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id); + $out = '&origin='.urlencode((string) ($object->element.'@'.$object->module)).'&originid='.urlencode((string) ($object->id)); $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; $out .= '&backtopage='.urlencode($urlbacktopage); $permok = $user->hasRight('agenda', 'myactions', 'create'); if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.=' Date: Fri, 8 Mar 2024 02:52:15 +0100 Subject: [PATCH 0703/1862] Fix: Ensure string type for urlencode() --- htdocs/partnership/partnership_list.php | 38 ++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index c810e09f554..327b8e7988e 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -136,11 +136,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } @@ -598,10 +598,10 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); } if ($socid) { - $param .= '&socid='.urlencode($socid); + $param .= '&socid='.urlencode((string) ($socid)); } if ($memberid) { - $param .= '&rowid='.urlencode($memberid); + $param .= '&rowid='.urlencode((string) ($memberid)); } foreach ($search as $key => $val) { if (is_array($search[$key])) { @@ -634,11 +634,11 @@ $param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), - 'approve'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ValidateAndApprove"), - 'cancel'=>img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel"), + 'approve' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ValidateAndApprove"), + 'cancel' => img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel"), //'generate_doc'=>img_picto('', 'pdf').$langs->trans("ReGeneratePDF"), //'builddoc'=>img_picto('', 'pdf').$langs->trans("PDFMerge"), - 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendMail"), + 'presend' => img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendMail"), ); if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); @@ -669,8 +669,8 @@ if ($socid) { $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/partnership/partnership_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); @@ -710,7 +710,7 @@ if (empty($reshook)) { if (!empty($moreforfilter)) { print '
'; print $moreforfilter; - $parameters = array('type'=>$type); + $parameters = array('type' => $type); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
'; @@ -777,7 +777,7 @@ foreach ($object->fields as $key => $val) { // End of subscription date if ($managedfor == 'member') { print '
'; - $selectarray = array('-1'=>'', 'withoutsubscription'=>$langs->trans("WithoutSubscription"), 'uptodate'=>$langs->trans("UpToDate"), 'outofdate'=>$langs->trans("OutOfDate")); + $selectarray = array('-1' => '', 'withoutsubscription' => $langs->trans("WithoutSubscription"), 'uptodate' => $langs->trans("UpToDate"), 'outofdate' => $langs->trans("OutOfDate")); print $form->selectarray('search_filter', $selectarray, $search_filter); print '
'.$langs->trans("Duration").''; print $object->duration_value; if ($object->duration_value > 1) { - $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); + $dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years")); } elseif ($object->duration_value > 0) { - $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); + $dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year")); } print(!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? " ".$langs->trans($dur[$object->duration_unit])." " : ''); @@ -2882,7 +2884,7 @@ if (($action == 'clone' && (empty($conf->use_javascript_ajax) || !empty($conf->d // Define confirmation messages $formquestionclone = array( 'text' => $langs->trans("ConfirmClone"), - array('type' => 'text', 'name' => 'clone_ref', 'label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'morecss'=>'width150'), + array('type' => 'text', 'name' => 'clone_ref', 'label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'morecss' => 'width150'), array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContentProduct"), 'value' => 1), array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategoriesProduct"), 'value' => 1), ); From 4d53e828d2916f48fd7d8d7cc92d1ce5bf9f690b Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:23 +0100 Subject: [PATCH 0706/1862] Fix: Ensure string type for urlencode() --- htdocs/product/list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 92f95dad523..1fe8ae87fa5 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -748,7 +748,7 @@ if ($sall) { $param .= "&sall=".urlencode($sall); } if ($searchCategoryProductOperator == 1) { - $param .= "&search_category_product_operator=".urlencode($searchCategoryProductOperator); + $param .= "&search_category_product_operator=".urlencode((string) ($searchCategoryProductOperator)); } foreach ($searchCategoryProductList as $searchCategoryProduct) { $param .= "&search_category_product_list[]=".urlencode($searchCategoryProduct); @@ -778,22 +778,22 @@ if ($search_tobatch) { $param .= "&search_tobatch=".urlencode($search_tobatch); } if ($search_country != '') { - $param .= "&search_country=".urlencode($search_country); + $param .= "&search_country=".urlencode((string) ($search_country)); } if ($search_state != '') { - $param .= "&search_state=".urlencode($search_state); + $param .= "&search_state=".urlencode((string) ($search_state)); } if ($search_vatrate) { $param .= "&search_vatrate=".urlencode($search_vatrate); } if ($fourn_id > 0) { - $param .= "&fourn_id=".urlencode($fourn_id); + $param .= "&fourn_id=".urlencode((string) ($fourn_id)); } if ($show_childproducts) { $param .= ($show_childproducts ? "&search_show_childproducts=".urlencode($show_childproducts) : ""); } if ($type != '') { - $param .= '&type='.urlencode($type); + $param .= '&type='.urlencode((string) ($type)); } if ($search_type != '') { $param .= '&search_type='.urlencode($search_type); From ccc8b19e071fc13a25fb7b5473f0a68aa89a71aa Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:52:27 +0100 Subject: [PATCH 0707/1862] Fix: Ensure string type for urlencode() --- htdocs/product/reassort.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index a7ca019a763..32d15a43939 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -360,10 +360,10 @@ if ($resql) { $param .= "&tobuy=".urlencode($tobuy); } if ($type != '') { - $param .= "&type=".urlencode($type); + $param .= "&type=".urlencode((string) ($type)); } if ($fourn_id) { - $param .= "&fourn_id=".urlencode($fourn_id); + $param .= "&fourn_id=".urlencode((string) ($fourn_id)); } if ($snom) { $param .= "&snom=".urlencode($snom); @@ -375,13 +375,13 @@ if ($resql) { $param .= "&search_sale=".urlencode($search_sale); } if ($search_categ > 0) { - $param .= "&search_categ=".urlencode($search_categ); + $param .= "&search_categ=".urlencode((string) ($search_categ)); } if ($search_toolowstock) { $param .= "&search_toolowstock=".urlencode($search_toolowstock); } if ($sbarcode) { - $param .= "&sbarcode=".urlencode($sbarcode); + $param .= "&sbarcode=".urlencode((string) ($sbarcode)); } if ($search_stock_physique) { $param .= '&search_stock_physique=' . urlencode($search_stock_physique); @@ -519,7 +519,7 @@ if ($resql) { print_liste_field_titre("ProductStatusOnSell", $_SERVER["PHP_SELF"], "p.tosell", '', $param, "", $sortfield, $sortorder, 'right '); print_liste_field_titre("ProductStatusOnBuy", $_SERVER["PHP_SELF"], "p.tobuy", '', $param, "", $sortfield, $sortorder, 'right '); // Hook fields - $parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); + $parameters = array('param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -617,7 +617,7 @@ if ($resql) { print ''.$product->LibStatut($objp->statut, 5, 0).''.$product->LibStatut($objp->tobuy, 5, 1).'
'.dol_print_date($objp->datem).'
 
'; print '
'; - print $form->selectDate($search_dateep_start ? $search_dateep_start : -1, 'search_dateep_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); +print $form->selectDate($search_dateep_start ? $search_dateep_start : -1, 'search_dateep_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); print '
'; print '
'; - print $form->selectDate($search_dateep_end ? $search_dateep_end : -1, 'search_dateep_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); +print $form->selectDate($search_dateep_end ? $search_dateep_end : -1, 'search_dateep_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print '
'; print '
'; print '
'; - print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); +print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); print '
'; print '
'; - print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); +print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print '
'; print '
$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -551,7 +551,7 @@ $totalarray['nbfield']++; // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -763,7 +763,7 @@ while ($i < $imaxinloop) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -807,7 +807,7 @@ if ($num == 0) { $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From 837749d47164d12f7975daeb8612765d9632d566 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:53:58 +0100 Subject: [PATCH 0743/1862] Fix: Ensure string type for urlencode() --- htdocs/societe/agenda.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index cffa65d43f1..be5ed78293e 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -94,7 +94,7 @@ $result = restrictedArea($user, 'societe', $socid, '&societe'); * Actions */ -$parameters = array('id'=>$socid); +$parameters = array('id' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -194,7 +194,7 @@ if (isModEnabled('agenda')) { if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { print '
'; - $param = '&socid='.urlencode($socid); + $param = '&socid='.urlencode((string) ($socid)); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } From 7293151d829f7aa99f57f5dccf7598467ede9156 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:54:01 +0100 Subject: [PATCH 0744/1862] Fix: Ensure string type for urlencode() --- htdocs/societe/consumption.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 506810c806d..5877e3c9d11 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -412,7 +412,7 @@ if ($sql_select) { $num = $db->num_rows($resql); - $param = "&socid=".urlencode($socid)."&type_element=".urlencode($type_element); + $param = "&socid=".urlencode((string) ($socid))."&type_element=".urlencode((string) ($type_element)); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } @@ -426,10 +426,10 @@ if ($sql_select) { $param .= "&sref=".urlencode($sref); } if ($month) { - $param .= "&month=".urlencode($month); + $param .= "&month=".urlencode((string) ($month)); } if ($year) { - $param .= "&year=".urlencode($year); + $param .= "&year=".urlencode((string) ($year)); } if ($optioncss) { $param .= '&optioncss='.urlencode($optioncss); From 5f025a87e1acdd9f3e0af88966477d4cee01a561 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:54:04 +0100 Subject: [PATCH 0745/1862] Fix: Ensure string type for urlencode() --- htdocs/societe/list.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index c0baeb41882..1d780599f2d 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -897,16 +897,16 @@ if ($search_all != '') { $param = "&search_all=".urlencode($search_all); } if ($search_categ_cus > 0) { - $param .= '&search_categ_cus='.urlencode($search_categ_cus); + $param .= '&search_categ_cus='.urlencode((string) ($search_categ_cus)); } if ($search_categ_sup > 0) { - $param .= '&search_categ_sup='.urlencode($search_categ_sup); + $param .= '&search_categ_sup='.urlencode((string) ($search_categ_sup)); } if ($searchCategoryCustomerOperator == 1) { - $param .= "&search_category_customer_operator=".urlencode($searchCategoryCustomerOperator); + $param .= "&search_category_customer_operator=".urlencode((string) ($searchCategoryCustomerOperator)); } if ($searchCategorySupplierOperator == 1) { - $param .= "&search_category_supplier_operator=".urlencode($searchCategorySupplierOperator); + $param .= "&search_category_supplier_operator=".urlencode((string) ($searchCategorySupplierOperator)); } foreach ($searchCategoryCustomerList as $searchCategoryCustomer) { $param .= "&search_category_customer_list[]=".urlencode($searchCategoryCustomer); @@ -915,7 +915,7 @@ foreach ($searchCategorySupplierList as $searchCategorySupplier) { $param .= "&search_category_supplier_list[]=".urlencode($searchCategorySupplier); } if ($search_sale > 0) { - $param .= '&search_sale='.urlencode($search_sale); + $param .= '&search_sale='.urlencode((string) ($search_sale)); } if ($search_id > 0) { $param .= "&search_id=".urlencode($search_id); @@ -999,13 +999,13 @@ if ($search_price_level != '') { $param .= '&search_price_level='.urlencode($search_price_level); } if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { - $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); + $param .= '&search_type_thirdparty='.urlencode((string) ($search_type_thirdparty)); } if ($search_type != '') { $param .= '&search_type='.urlencode($search_type); } if ($search_status != '') { - $param .= '&search_status='.urlencode($search_status); + $param .= '&search_status='.urlencode((string) ($search_status)); } if (is_array($search_level) && count($search_level)) { foreach ($search_level as $slevel) { @@ -1027,49 +1027,49 @@ if ($type != '') { $param .= '&type='.urlencode($type); } if ($search_date_creation_startmonth) { - $param .= '&search_date_creation_startmonth='.urlencode($search_date_creation_startmonth); + $param .= '&search_date_creation_startmonth='.urlencode((string) ($search_date_creation_startmonth)); } if ($search_date_creation_startyear) { - $param .= '&search_date_creation_startyear='.urlencode($search_date_creation_startyear); + $param .= '&search_date_creation_startyear='.urlencode((string) ($search_date_creation_startyear)); } if ($search_date_creation_startday) { - $param .= '&search_date_creation_startday='.urlencode($search_date_creation_startday); + $param .= '&search_date_creation_startday='.urlencode((string) ($search_date_creation_startday)); } if ($search_date_creation_start) { $param .= '&search_date_creation_start='.urlencode($search_date_creation_start); } if ($search_date_creation_endmonth) { - $param .= '&search_date_creation_endmonth='.urlencode($search_date_creation_endmonth); + $param .= '&search_date_creation_endmonth='.urlencode((string) ($search_date_creation_endmonth)); } if ($search_date_creation_endyear) { - $param .= '&search_date_creation_endyear='.urlencode($search_date_creation_endyear); + $param .= '&search_date_creation_endyear='.urlencode((string) ($search_date_creation_endyear)); } if ($search_date_creation_endday) { - $param .= '&search_date_creation_endday='.urlencode($search_date_creation_endday); + $param .= '&search_date_creation_endday='.urlencode((string) ($search_date_creation_endday)); } if ($search_date_creation_end) { $param .= '&search_date_creation_end='.urlencode($search_date_creation_end); } if ($search_date_modif_startmonth) { - $param .= '&search_date_modif_startmonth='.urlencode($search_date_modif_startmonth); + $param .= '&search_date_modif_startmonth='.urlencode((string) ($search_date_modif_startmonth)); } if ($search_date_modif_startyear) { - $param .= '&search_date_modif_startyear='.urlencode($search_date_modif_startyear); + $param .= '&search_date_modif_startyear='.urlencode((string) ($search_date_modif_startyear)); } if ($search_date_modif_startday) { - $param .= '&search_date_modif_startday='.urlencode($search_date_modif_startday); + $param .= '&search_date_modif_startday='.urlencode((string) ($search_date_modif_startday)); } if ($search_date_modif_start) { $param .= '&search_date_modif_start='.urlencode($search_date_modif_start); } if ($search_date_modif_endmonth) { - $param .= '&search_date_modif_endmonth='.urlencode($search_date_modif_endmonth); + $param .= '&search_date_modif_endmonth='.urlencode((string) ($search_date_modif_endmonth)); } if ($search_date_modif_endyear) { - $param .= '&search_date_modif_endyear='.urlencode($search_date_modif_endyear); + $param .= '&search_date_modif_endyear='.urlencode((string) ($search_date_modif_endyear)); } if ($search_date_modif_endday) { - $param .= '&search_date_modif_endday='.urlencode($search_date_modif_endday); + $param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday)); } if ($search_date_modif_end) { $param .= '&search_date_modif_end=' . urlencode($search_date_modif_end); From 68ab7bac14b3d607cf21fdaf4717c101e18b99da Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:54:07 +0100 Subject: [PATCH 0746/1862] Fix: Ensure string type for urlencode() --- htdocs/societe/messaging.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/messaging.php b/htdocs/societe/messaging.php index 01791b4a188..b1275bfcdfe 100644 --- a/htdocs/societe/messaging.php +++ b/htdocs/societe/messaging.php @@ -94,7 +94,7 @@ $result = restrictedArea($user, 'societe', $socid, '&societe'); * Actions */ -$parameters = array('id'=>$socid); +$parameters = array('id' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -192,7 +192,7 @@ if (isModEnabled('agenda')) { if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { print '
'; - $param = '&socid='.urlencode($socid); + $param = '&socid='.urlencode((string) ($socid)); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } From 6f7e11126b6e17d3976456f0ddf89a7d3d95c1b6 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:54:10 +0100 Subject: [PATCH 0747/1862] Fix: Ensure string type for urlencode() --- htdocs/societe/website.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 1557332ec18..29484d9773d 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -108,7 +108,7 @@ $arrayfields = array(); foreach ($objectwebsiteaccount->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>$val['enabled']); + $arrayfields['t.'.$key] = array('label' => $val['label'], 'checked' => (($val['visible'] < 0) ? 0 : 1), 'enabled' => $val['enabled']); } } @@ -134,7 +134,7 @@ $result = restrictedArea($user, 'societe', $object->id, '&societe'); * Actions */ -$parameters = array('id'=>$id); +$parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -192,7 +192,7 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } if ($id > 0) { - $param .= '&id='.urlencode($id); + $param .= '&id='.urlencode((string) ($id)); } if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); @@ -454,7 +454,7 @@ foreach ($objectwebsiteaccount->fields as $key => $val) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $objectwebsiteaccount); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -499,7 +499,7 @@ foreach ($objectwebsiteaccount->fields as $key => $val) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $objectwebsiteaccount); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -600,7 +600,7 @@ while ($i < min($num, $limit)) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objectwebsiteaccount); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -641,7 +641,7 @@ if ($num == 0) { $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $objectwebsiteaccount); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From 14843e808aac414541759cb7fd3047497340f6ac Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:54:13 +0100 Subject: [PATCH 0748/1862] Fix: Ensure string type for urlencode() --- htdocs/supplier_proposal/list.php | 102 +++++++++++++++--------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index b2934afcb1a..c34a60b581b 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -158,10 +158,10 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'sp.ref'=>'Ref', - 's.nom'=>'Supplier', - 'pd.description'=>'Description', - 'sp.note_public'=>'NotePublic', + 'sp.ref' => 'Ref', + 's.nom' => 'Supplier', + 'pd.description' => 'Description', + 'sp.note_public' => 'NotePublic', ); if (empty($user->socid)) { $fieldstosearchall["p.note_private"] = "NotePrivate"; @@ -169,28 +169,28 @@ if (empty($user->socid)) { $checkedtypetiers = 0; $arrayfields = array( - 'sp.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), - 's.nom'=>array('label'=>$langs->trans("Supplier"), 'checked'=>1), - 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>0), - 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1), - 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1), - 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0), - 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0), - 'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers), - 'sp.date_valid'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1), - 'sp.date_livraison'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1), - 'sp.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1), - 'sp.total_tva'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0), - 'sp.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0), - 'sp.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'sp.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'sp.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'sp.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'sp.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'u.login'=>array('label'=>$langs->trans("Author"), 'checked'=>1, 'position'=>10), - 'sp.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'sp.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - 'sp.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + 'sp.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1), + 's.nom' => array('label' => $langs->trans("Supplier"), 'checked' => 1), + 's.name_alias' => array('label' => "AliasNameShort", 'checked' => 0), + 's.town' => array('label' => $langs->trans("Town"), 'checked' => 1), + 's.zip' => array('label' => $langs->trans("Zip"), 'checked' => 1), + 'state.nom' => array('label' => $langs->trans("StateShort"), 'checked' => 0), + 'country.code_iso' => array('label' => $langs->trans("Country"), 'checked' => 0), + 'typent.code' => array('label' => $langs->trans("ThirdPartyType"), 'checked' => $checkedtypetiers), + 'sp.date_valid' => array('label' => $langs->trans("DateValidation"), 'checked' => 1), + 'sp.date_livraison' => array('label' => $langs->trans("DateEnd"), 'checked' => 1), + 'sp.total_ht' => array('label' => $langs->trans("AmountHT"), 'checked' => 1), + 'sp.total_tva' => array('label' => $langs->trans("AmountVAT"), 'checked' => 0), + 'sp.total_ttc' => array('label' => $langs->trans("AmountTTC"), 'checked' => 0), + 'sp.multicurrency_code' => array('label' => 'Currency', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'sp.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'sp.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'sp.multicurrency_total_vat' => array('label' => 'MulticurrencyAmountVAT', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'sp.multicurrency_total_ttc' => array('label' => 'MulticurrencyAmountTTC', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'u.login' => array('label' => $langs->trans("Author"), 'checked' => 1, 'position' => 10), + 'sp.datec' => array('label' => $langs->trans("DateCreation"), 'checked' => 0, 'position' => 500), + 'sp.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => 0, 'position' => 500), + 'sp.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => 1, 'position' => 1000), ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -220,7 +220,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -533,40 +533,40 @@ if ($resql) { $param .= '&sall='.urlencode($sall); } if ($search_date_startday) { - $param .= '&search_date_startday='.urlencode($search_date_startday); + $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); } if ($search_date_startmonth) { - $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); + $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth)); } if ($search_date_startyear) { - $param .= '&search_date_startyear='.urlencode($search_date_startyear); + $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear)); } if ($search_date_endday) { - $param .= '&search_date_endday='.urlencode($search_date_endday); + $param .= '&search_date_endday='.urlencode((string) ($search_date_endday)); } if ($search_date_endmonth) { - $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); + $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth)); } if ($search_date_endyear) { - $param .= '&search_date_endyear='.urlencode($search_date_endyear); + $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear)); } if ($search_date_valid_startday) { - $param .= '&search_date_valid_startday='.urlencode($search_date_valid_startday); + $param .= '&search_date_valid_startday='.urlencode((string) ($search_date_valid_startday)); } if ($search_date_valid_startmonth) { - $param .= '&search_date_valid_startmonth='.urlencode($search_date_valid_startmonth); + $param .= '&search_date_valid_startmonth='.urlencode((string) ($search_date_valid_startmonth)); } if ($search_date_valid_startyear) { - $param .= '&search_date_valid_startyear='.urlencode($search_date_valid_startyear); + $param .= '&search_date_valid_startyear='.urlencode((string) ($search_date_valid_startyear)); } if ($search_date_valid_endday) { - $param .= '&search_date_valid_endday='.urlencode($search_date_valid_endday); + $param .= '&search_date_valid_endday='.urlencode((string) ($search_date_valid_endday)); } if ($search_date_valid_endmonth) { - $param .= '&search_date_valid_endmonth='.urlencode($search_date_valid_endmonth); + $param .= '&search_date_valid_endmonth='.urlencode((string) ($search_date_valid_endmonth)); } if ($search_date_valid_endyear) { - $param .= '&search_date_valid_endyear='.urlencode($search_date_valid_endyear); + $param .= '&search_date_valid_endyear='.urlencode((string) ($search_date_valid_endyear)); } if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); @@ -578,7 +578,7 @@ if ($resql) { $param .= '&search_societe_alias='.urlencode($search_societe_alias); } if ($search_user > 0) { - $param .= '&search_user='.urlencode($search_user); + $param .= '&search_user='.urlencode((string) ($search_user)); } if ($search_sale > 0) { $param .= '&search_sale='.urlencode($search_sale); @@ -611,7 +611,7 @@ if ($resql) { $param .= '&search_zip='.urlencode($search_zip); } if ($socid > 0) { - $param .= '&socid='.urlencode($socid); + $param .= '&socid='.urlencode((string) ($socid)); } if ($search_status != '') { $param .= '&search_status='.urlencode($search_status); @@ -620,15 +620,15 @@ if ($resql) { $param .= '&optioncss='.urlencode($optioncss); } if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { - $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); + $param .= '&search_type_thirdparty='.urlencode((string) ($search_type_thirdparty)); } // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( - 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), - 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + 'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + 'builddoc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($user->hasRight('supplier_proposal', 'supprimer')) { @@ -644,8 +644,8 @@ if ($resql) { $url .= '&socid='.$socid; } $newcardbutton = ''; - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewAskPrice'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('supplier_proposal', 'creer')); @@ -854,7 +854,7 @@ if ($resql) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields); + $parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -971,7 +971,7 @@ if ($resql) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields - $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); + $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['sp.datec']['checked'])) { @@ -1031,7 +1031,7 @@ if ($resql) { // TODO Use a cache on user $userstatic->fetch($obj->fk_user_author); $objectstatic->delivery_date = $obj->dp; - print $objectstatic->getKanbanView('', array('thirdparty'=>$companystatic, 'userauthor'=>$userstatic, 'selected' => in_array($obj->id, $arrayofselected))); + print $objectstatic->getKanbanView('', array('thirdparty' => $companystatic, 'userauthor' => $userstatic, 'selected' => in_array($obj->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print ''; print '
'; From ed507b7df2d5974334b559ffb27be22a21487919 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:54:34 +0100 Subject: [PATCH 0756/1862] Fix: Ensure string type for urlencode() --- htdocs/variants/combinations.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index e34cf104d40..905e915dfbb 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -117,7 +117,7 @@ if ($action == 'create' && GETPOST('selectvariant', 'alpha')) { // We click on s $action = 'add'; $attribute_id = GETPOSTINT('attribute'); $attribute_value_id = GETPOSTINT('value'); - if ($attribute_id> 0 && $attribute_value_id > 0) { + if ($attribute_id > 0 && $attribute_value_id > 0) { $feature = $attribute_id . '-' . $attribute_value_id; $selectedvariant[$feature] = $feature; $_SESSION['addvariant_'.$object->id] = $selectedvariant; @@ -792,11 +792,11 @@ if (!empty($id) || !empty($ref)) { $prodstatic->fetch($prodcomb->fk_product_child); print $form->formconfirm( - "combinations.php?id=".urlencode($id)."&valueid=".urlencode($valueid), + "combinations.php?id=".urlencode((string) ($id))."&valueid=".urlencode((string) ($valueid)), $langs->trans('Delete'), $langs->trans('ProductCombinationDeleteDialog', $prodstatic->ref), "confirm_deletecombination", - array(array('label'=> $langs->trans('DeleteLinkedProduct'), 'type'=> 'checkbox', 'name' => 'delete_product', 'value' => false)), + array(array('label' => $langs->trans('DeleteLinkedProduct'), 'type' => 'checkbox', 'name' => 'delete_product', 'value' => false)), 0, 1 ); From 7d84a5ecf31bbba1c632b47c96a874557e6fd858 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:54:37 +0100 Subject: [PATCH 0757/1862] Fix: Ensure string type for urlencode() --- htdocs/workstation/workstation_agenda.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index cf25d186ae8..4e6853596bc 100644 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -100,7 +100,7 @@ restrictedArea($user, $object->element, $object->id, $object->table_element, 'wo * Actions */ -$parameters = array('id'=>$id); +$parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -206,14 +206,14 @@ if ($object->id > 0) { $objthirdparty = $object; $objcon = new stdClass(); - $out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id); + $out = '&origin='.urlencode((string) ($object->element.'@'.$object->module)).'&originid='.urlencode((string) ($object->id)); $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; $out .= '&backtopage='.urlencode($urlbacktopage); $permok = $user->hasRight('agenda', 'myactions', 'create'); if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.=' Date: Fri, 8 Mar 2024 02:55:38 +0100 Subject: [PATCH 0758/1862] Fix: Ensure string type for urlencode() --- htdocs/commande/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 003fdda6d09..b8009477a39 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -655,7 +655,7 @@ if (empty($reshook)) { $param .= '&search_user='.urlencode((string) ($search_user)); } if ($search_sale > 0) { - $param .= '&search_sale='.urlencode($search_sale); + $param .= '&search_sale='.urlencode((string) ($search_sale)); } if ($search_total_ht != '') { $param .= '&search_total_ht='.urlencode($search_total_ht); @@ -1245,7 +1245,7 @@ if ($search_user > 0) { $param .= '&search_user='.urlencode((string) ($search_user)); } if ($search_sale > 0) { - $param .= '&search_sale='.urlencode($search_sale); + $param .= '&search_sale='.urlencode((string) ($search_sale)); } if ($search_total_ht != '') { $param .= '&search_total_ht='.urlencode($search_total_ht); From 4fa993fe8a2355fcf4a53790e38cf883af5cc704 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 23:22:15 +0100 Subject: [PATCH 0759/1862] Fix: Ensure string type for urlencode() --- htdocs/comm/propal/list.php | 2812 ++++++++++++++++++----------------- 1 file changed, 1407 insertions(+), 1405 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 2bc33b37f3f..5e8b4f60de1 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -77,7 +77,9 @@ $mode = GETPOST('mode', 'alpha'); // Search Fields $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_user = GETPOSTINT('search_user'); -if ($search_user==-1) $search_user=0; +if ($search_user == -1) { + $search_user = 0; +} $search_sale = GETPOSTINT('search_sale'); $search_ref = GETPOST('sf_ref') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_refcustomer = GETPOST('search_refcustomer', 'alpha'); @@ -190,14 +192,14 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'p.ref'=>'Ref', - 'p.ref_client'=>'RefCustomer', - 'pd.description'=>'Description', - 's.nom'=>"ThirdParty", - 's.name_alias'=>"AliasNameShort", - 's.zip'=>"Zip", - 's.town'=>"Town", - 'p.note_public'=>'NotePublic', + 'p.ref' => 'Ref', + 'p.ref_client' => 'RefCustomer', + 'pd.description' => 'Description', + 's.nom' => "ThirdParty", + 's.name_alias' => "AliasNameShort", + 's.zip' => "Zip", + 's.town' => "Town", + 'p.note_public' => 'NotePublic', ); if (empty($user->socid)) { $fieldstosearchall["p.note_private"] = "NotePrivate"; @@ -206,50 +208,50 @@ if (empty($user->socid)) { $checkedtypetiers = 0; $arrayfields = array( - 'p.ref'=>array('label'=>"Ref", 'checked'=>1), - 'p.ref_client'=>array('label'=>"RefCustomer", 'checked'=>-1), - 'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(isModEnabled('project') ? 1 : 0)), - 'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(isModEnabled('project') ? 1 : 0)), - 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1), - 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1), - 's.town'=>array('label'=>"Town", 'checked'=>-1), - 's.zip'=>array('label'=>"Zip", 'checked'=>-1), - 'state.nom'=>array('label'=>"StateShort", 'checked'=>0), - 'country.code_iso'=>array('label'=>"Country", 'checked'=>0), - 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers), - 'p.date'=>array('label'=>"DatePropal", 'checked'=>1), - 'p.fin_validite'=>array('label'=>"DateEnd", 'checked'=>1), - 'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0), - 'p.date_signature'=>array('label'=>"DateSigning", 'checked'=>0), - 'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0), - 'p.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'enabled'=>isModEnabled("delivery_note")), - 'p.fk_input_reason'=>array('label'=>"Origin", 'checked'=>0, 'enabled'=>1), - 'p.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0), - 'p.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0), - 'p.total_ht'=>array('label'=>"AmountHT", 'checked'=>1), - 'p.total_tva'=>array('label'=>"AmountVAT", 'checked'=>0), - 'p.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0), - 'p.total_ht_invoiced'=>array('label'=>"AmountInvoicedHT", 'checked'=>0, 'enabled'=>getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT')), - 'p.total_invoiced'=>array('label'=>"AmountInvoicedTTC", 'checked'=>0, 'enabled'=>getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT')), - 'p.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'p.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'p.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'p.multicurrency_total_tva'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'p.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'p.multicurrency_total_ht_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedHT', 'checked'=>0, 'enabled'=>isModEnabled("multicurrency") && getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT')), - 'p.multicurrency_total_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedTTC', 'checked'=>0, 'enabled'=>isModEnabled("multicurrency") && getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT')), - 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10), - 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>-1), + 'p.ref' => array('label' => "Ref", 'checked' => 1), + 'p.ref_client' => array('label' => "RefCustomer", 'checked' => -1), + 'pr.ref' => array('label' => "ProjectRef", 'checked' => 1, 'enabled' => (isModEnabled('project') ? 1 : 0)), + 'pr.title' => array('label' => "ProjectLabel", 'checked' => 0, 'enabled' => (isModEnabled('project') ? 1 : 0)), + 's.nom' => array('label' => "ThirdParty", 'checked' => 1), + 's.name_alias' => array('label' => "AliasNameShort", 'checked' => -1), + 's.town' => array('label' => "Town", 'checked' => -1), + 's.zip' => array('label' => "Zip", 'checked' => -1), + 'state.nom' => array('label' => "StateShort", 'checked' => 0), + 'country.code_iso' => array('label' => "Country", 'checked' => 0), + 'typent.code' => array('label' => "ThirdPartyType", 'checked' => $checkedtypetiers), + 'p.date' => array('label' => "DatePropal", 'checked' => 1), + 'p.fin_validite' => array('label' => "DateEnd", 'checked' => 1), + 'p.date_livraison' => array('label' => "DeliveryDate", 'checked' => 0), + 'p.date_signature' => array('label' => "DateSigning", 'checked' => 0), + 'ava.rowid' => array('label' => "AvailabilityPeriod", 'checked' => 0), + 'p.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => 0, 'enabled' => isModEnabled("delivery_note")), + 'p.fk_input_reason' => array('label' => "Origin", 'checked' => 0, 'enabled' => 1), + 'p.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => 0), + 'p.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => 0), + 'p.total_ht' => array('label' => "AmountHT", 'checked' => 1), + 'p.total_tva' => array('label' => "AmountVAT", 'checked' => 0), + 'p.total_ttc' => array('label' => "AmountTTC", 'checked' => 0), + 'p.total_ht_invoiced' => array('label' => "AmountInvoicedHT", 'checked' => 0, 'enabled' => getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT')), + 'p.total_invoiced' => array('label' => "AmountInvoicedTTC", 'checked' => 0, 'enabled' => getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT')), + 'p.multicurrency_code' => array('label' => 'Currency', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'p.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'p.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'p.multicurrency_total_tva' => array('label' => 'MulticurrencyAmountVAT', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'p.multicurrency_total_ttc' => array('label' => 'MulticurrencyAmountTTC', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'p.multicurrency_total_ht_invoiced' => array('label' => 'MulticurrencyAmountInvoicedHT', 'checked' => 0, 'enabled' => isModEnabled("multicurrency") && getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT')), + 'p.multicurrency_total_invoiced' => array('label' => 'MulticurrencyAmountInvoicedTTC', 'checked' => 0, 'enabled' => isModEnabled("multicurrency") && getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT')), + 'u.login' => array('label' => "Author", 'checked' => 1, 'position' => 10), + 'sale_representative' => array('label' => "SaleRepresentativesOfThirdParty", 'checked' => -1), 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') ? 0 : 1)), 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') ? 0 : 1)), 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') || !getDolGlobalString('DISPLAY_MARGIN_RATES') ? 0 : 1)), 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') || !getDolGlobalString('DISPLAY_MARK_RATES') ? 0 : 1)), - 'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), - 'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), - 'p.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500), - 'p.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), - 'p.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), - 'p.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), + 'p.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500), + 'p.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 500), + 'p.date_cloture' => array('label' => "DateClosing", 'checked' => 0, 'position' => 500), + 'p.note_public' => array('label' => 'NotePublic', 'checked' => 0, 'position' => 510, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), + 'p.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'position' => 511, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), + 'p.fk_statut' => array('label' => "Status", 'checked' => 1, 'position' => 1000), ); // List of fields to search into when doing a "search in all" @@ -310,7 +312,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid, 'arrayfields'=>&$arrayfields); +$parameters = array('socid' => $socid, 'arrayfields' => &$arrayfields); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -843,8 +845,8 @@ if (!$resql) { exit; } - $objectstatic = new Propal($db); - $userstatic = new User($db); +$objectstatic = new Propal($db); +$userstatic = new User($db); if ($socid > 0) { $soc = new Societe($db); @@ -857,9 +859,9 @@ if ($socid > 0) { $title = $langs->trans('Proposals'); } - $num = $db->num_rows($resql); +$num = $db->num_rows($resql); - $arrayofselected = is_array($toselect) ? $toselect : array(); +$arrayofselected = is_array($toselect) ? $toselect : array(); if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all) { $obj = $db->fetch_object($resql); @@ -870,10 +872,10 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s exit; } - $help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'; - llxHeader('', $title, $help_url); +$help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'; +llxHeader('', $title, $help_url); - $param = '&search_status='.urlencode($search_status); +$param = '&search_status='.urlencode($search_status); if (!empty($mode)) { $param .= '&mode='.urlencode($mode); } @@ -887,58 +889,58 @@ if ($search_all) { $param .= '&search_all='.urlencode($search_all); } if ($search_date_startday) { - $param .= '&search_date_startday='.urlencode($search_date_startday); + $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); } if ($search_date_startmonth) { - $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); + $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth)); } if ($search_date_startyear) { - $param .= '&search_date_startyear='.urlencode($search_date_startyear); + $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear)); } if ($search_date_endday) { - $param .= '&search_date_endday='.urlencode($search_date_endday); + $param .= '&search_date_endday='.urlencode((string) ($search_date_endday)); } if ($search_date_endmonth) { - $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); + $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth)); } if ($search_date_endyear) { - $param .= '&search_date_endyear='.urlencode($search_date_endyear); + $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear)); } if ($search_date_end_startday) { - $param .= '&search_date_end_startday='.urlencode($search_date_end_startday); + $param .= '&search_date_end_startday='.urlencode((string) ($search_date_end_startday)); } if ($search_date_end_startmonth) { - $param .= '&search_date_end_startmonth='.urlencode($search_date_end_startmonth); + $param .= '&search_date_end_startmonth='.urlencode((string) ($search_date_end_startmonth)); } if ($search_date_end_startyear) { - $param .= '&search_date_end_startyear='.urlencode($search_date_end_startyear); + $param .= '&search_date_end_startyear='.urlencode((string) ($search_date_end_startyear)); } if ($search_date_end_endday) { - $param .= '&search_date_end_endday='.urlencode($search_date_end_endday); + $param .= '&search_date_end_endday='.urlencode((string) ($search_date_end_endday)); } if ($search_date_end_endmonth) { - $param .= '&search_date_end_endmonth='.urlencode($search_date_end_endmonth); + $param .= '&search_date_end_endmonth='.urlencode((string) ($search_date_end_endmonth)); } if ($search_date_end_endyear) { - $param .= '&search_date_end_endyear='.urlencode($search_date_end_endyear); + $param .= '&search_date_end_endyear='.urlencode((string) ($search_date_end_endyear)); } if ($search_date_delivery_startday) { - $param .= '&search_date_delivery_startday='.urlencode($search_date_delivery_startday); + $param .= '&search_date_delivery_startday='.urlencode((string) ($search_date_delivery_startday)); } if ($search_date_delivery_startmonth) { - $param .= '&search_date_delivery_startmonth='.urlencode($search_date_delivery_startmonth); + $param .= '&search_date_delivery_startmonth='.urlencode((string) ($search_date_delivery_startmonth)); } if ($search_date_delivery_startyear) { - $param .= '&search_date_delivery_startyear='.urlencode($search_date_delivery_startyear); + $param .= '&search_date_delivery_startyear='.urlencode((string) ($search_date_delivery_startyear)); } if ($search_date_delivery_endday) { - $param .= '&search_date_delivery_endday='.urlencode($search_date_delivery_endday); + $param .= '&search_date_delivery_endday='.urlencode((string) ($search_date_delivery_endday)); } if ($search_date_delivery_endmonth) { - $param .= '&search_date_delivery_endmonth='.urlencode($search_date_delivery_endmonth); + $param .= '&search_date_delivery_endmonth='.urlencode((string) ($search_date_delivery_endmonth)); } if ($search_date_delivery_endyear) { - $param .= '&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear); + $param .= '&search_date_delivery_endyear='.urlencode((string) ($search_date_delivery_endyear)); } if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); @@ -956,7 +958,7 @@ if ($search_societe_alias) { $param .= '&search_societe_alias='.urlencode($search_societe_alias); } if ($search_user > 0) { - $param .= '&search_user='.urlencode($search_user); + $param .= '&search_user='.urlencode((string) ($search_user)); } if ($search_sale > 0) { $param .= '&search_sale='.urlencode($search_sale); @@ -989,31 +991,31 @@ if ($search_zip) { $param .= '&search_zip='.urlencode($search_zip); } if ($socid > 0) { - $param .= '&socid='.urlencode($socid); + $param .= '&socid='.urlencode((string) ($socid)); } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } if ($search_categ_cus > 0) { - $param .= '&search_categ_cus='.urlencode($search_categ_cus); + $param .= '&search_categ_cus='.urlencode((string) ($search_categ_cus)); } if ($search_product_category != '') { - $param .= '&search_product_category='.urlencode($search_product_category); + $param .= '&search_product_category='.urlencode((string) ($search_product_category)); } if ($search_fk_cond_reglement > 0) { - $param .= '&search_fk_cond_reglement='.urlencode($search_fk_cond_reglement); + $param .= '&search_fk_cond_reglement='.urlencode((string) ($search_fk_cond_reglement)); } if ($search_fk_shipping_method > 0) { - $param .= '&search_fk_shipping_method='.urlencode($search_fk_shipping_method); + $param .= '&search_fk_shipping_method='.urlencode((string) ($search_fk_shipping_method)); } if ($search_fk_input_reason > 0) { - $param .= '&search_fk_input_reason='.urlencode($search_fk_input_reason); + $param .= '&search_fk_input_reason='.urlencode((string) ($search_fk_input_reason)); } if ($search_fk_mode_reglement > 0) { - $param .= '&search_fk_mode_reglement='.urlencode($search_fk_mode_reglement); + $param .= '&search_fk_mode_reglement='.urlencode((string) ($search_fk_mode_reglement)); } if ($search_type_thirdparty > 0) { - $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); + $param .= '&search_type_thirdparty='.urlencode((string) ($search_type_thirdparty)); } if ($search_town) { $param .= '&search_town='.urlencode($search_town); @@ -1028,1383 +1030,1383 @@ if ($search_town) { $param .= '&search_town='.urlencode($search_town); } if ($search_country) { - $param .= '&search_country='.urlencode($search_country); + $param .= '&search_country='.urlencode((string) ($search_country)); } if ($search_date_signature_startday) { - $param .= '&search_date_signature_startday='.urlencode($search_date_signature_startday); + $param .= '&search_date_signature_startday='.urlencode((string) ($search_date_signature_startday)); } if ($search_date_signature_startmonth) { - $param .= '&search_date_signature_startmonth='.urlencode($search_date_signature_startmonth); + $param .= '&search_date_signature_startmonth='.urlencode((string) ($search_date_signature_startmonth)); } if ($search_date_signature_startyear) { - $param .= '&search_date_signature_startyear='.urlencode($search_date_signature_startyear); + $param .= '&search_date_signature_startyear='.urlencode((string) ($search_date_signature_startyear)); } if ($search_date_signature_endday) { - $param .= '&search_date_signature_endday='.urlencode($search_date_signature_endday); + $param .= '&search_date_signature_endday='.urlencode((string) ($search_date_signature_endday)); } if ($search_date_signature_endmonth) { - $param .= '&search_date_signature_endmonth='.urlencode($search_date_signature_endmonth); + $param .= '&search_date_signature_endmonth='.urlencode((string) ($search_date_signature_endmonth)); } if ($search_date_signature_endyear) { - $param .= '&search_date_signature_endyear='.urlencode($search_date_signature_endyear); + $param .= '&search_date_signature_endyear='.urlencode((string) ($search_date_signature_endyear)); } - // Add $param from extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; - // Add $param from hooks - $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - $param .= $hookmanager->resPrint; +// Add $param from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; - // List of mass actions available - $arrayofmassactions = array( - 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), - 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), - ); - if ($permissiontosendbymail) { - $arrayofmassactions['presend']=img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"); +// List of mass actions available +$arrayofmassactions = array( + 'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + 'builddoc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), +); +if ($permissiontosendbymail) { + $arrayofmassactions['presend'] = img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"); +} +if ($permissiontovalidate) { + $arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"); +} +if ($permissiontoclose) { + $arrayofmassactions['presign'] = img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans("Sign"); + $arrayofmassactions['nopresign'] = img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans("NoSign"); + $arrayofmassactions['setbilled'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("ClassifyBilled"); +} +if ($permissiontodelete) { + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); +} + +if (in_array($massaction, array('presend', 'predelete', 'closed'))) { + $arrayofmassactions = array(); +} +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); + +$url = DOL_URL_ROOT.'/comm/propal/card.php?action=create'; +if (!empty($socid)) { + $url .= '&socid='.$socid; +} +$newcardbutton = ''; +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitleSeparator(); +$newcardbutton .= dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('propal', 'creer')); + +// Fields title search +print ''; +if ($optioncss != '') { + print ''; +} +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'propal', 0, $newcardbutton, '', $limit, 0, 0, 1); + +$topicmail = "SendPropalRef"; +$modelmail = "propal_send"; +$objecttmp = new Propal($db); +$trackid = 'pro'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + +if ($massaction == 'prevalidate') { + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassValidation"), $langs->trans("ConfirmMassValidationQuestion"), "validate", null, '', 0, 200, 500, 1); +} + +if ($massaction == 'presign') { + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassSignature"), $langs->trans("ConfirmMassSignatureQuestion"), "sign", null, '', 0, 200, 500, 1); +} + +if ($massaction == 'nopresign') { + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassNoSignature"), $langs->trans("ConfirmMassNoSignatureQuestion"), "nosign", null, '', 0, 200, 500, 1); +} + +if ($search_all) { + foreach ($fieldstosearchall as $key => $val) { + $fieldstosearchall[$key] = $langs->trans($val); } - if ($permissiontovalidate) { - $arrayofmassactions['prevalidate']=img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"); - } - if ($permissiontoclose) { - $arrayofmassactions['presign']=img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans("Sign"); - $arrayofmassactions['nopresign']=img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans("NoSign"); - $arrayofmassactions['setbilled'] =img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("ClassifyBilled"); - } - if ($permissiontodelete) { - $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); + print '
'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'
'; +} + +$i = 0; + +$moreforfilter = ''; + +// If the user can view prospects other than his' +if ($user->hasRight('user', 'user', 'lire')) { + $langs->load("commercial"); + $moreforfilter .= '
'; + $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth250 widthcentpercentminusx', 1); + $moreforfilter .= '
'; +} +// If the user can view prospects other than his' +if ($user->hasRight('user', 'user', 'lire')) { + $moreforfilter .= '
'; + $tmptitle = $langs->trans('LinkedToSpecificUsers'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers((empty($search_user) ? -2 : 0), 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx'); + $moreforfilter .= '
'; +} +// If the user can view products +if (isModEnabled('category') && $user->hasRight('categorie', 'read') && ($user->hasRight('product', 'read') || $user->hasRight('service', 'read'))) { + $searchCategoryProductOperator = -1; + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $tmptitle = $langs->trans('IncludingProductWithTag'); + $formcategory = new FormCategory($db); + $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, array($search_product_category), 'maxwidth300', $searchCategoryProductOperator, 0, 0, $tmptitle); +} +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $moreforfilter .= '
'; + $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300 widthcentpercentminusx' : 'maxwidth250 widthcentpercentminusx')); + $moreforfilter .= '
'; +} +if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) { + require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; + $formproduct = new FormProduct($db); + $moreforfilter .= '
'; + $tmptitle = $langs->trans('Warehouse'); + $moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', $tmptitle, 0, 0, $tmptitle); + $moreforfilter .= '
'; +} +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; +} else { + $moreforfilter = $hookmanager->resPrint; +} + +if (!empty($moreforfilter)) { + print '
'; + print $moreforfilter; + print '
'; +} + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields +$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + +print '
'; +print '
'."\n"; + +print ''; + +// Action column +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; +} + +if (!empty($arrayfields['p.ref']['checked'])) { + print ''; +} +if (!empty($arrayfields['p.ref_client']['checked'])) { + print ''; +} +if (!empty($arrayfields['pr.ref']['checked'])) { + print ''; +} +if (!empty($arrayfields['pr.title']['checked'])) { + print ''; +} +if (!empty($arrayfields['s.nom']['checked'])) { + print ''; +} +if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; +} +if (!empty($arrayfields['s.town']['checked'])) { + print ''; +} +if (!empty($arrayfields['s.zip']['checked'])) { + print ''; +} +// State +if (!empty($arrayfields['state.nom']['checked'])) { + print ''; +} +// Country +if (!empty($arrayfields['country.code_iso']['checked'])) { + print ''; +} +// Company type +if (!empty($arrayfields['typent.code']['checked'])) { + print ''; +} +// Date +if (!empty($arrayfields['p.date']['checked'])) { + print ''; +} +// Date end +if (!empty($arrayfields['p.fin_validite']['checked'])) { + print ''; +} +// Date delivery +if (!empty($arrayfields['p.date_livraison']['checked'])) { + print ''; +} +// Date Signature +if (!empty($arrayfields['p.date_signature']['checked'])) { + print ''; +} +// Availability +if (!empty($arrayfields['ava.rowid']['checked'])) { + print ''; +} +// Shipping Method +if (!empty($arrayfields['p.fk_shipping_method']['checked'])) { + print ''; +} +// Source - Input reason +if (!empty($arrayfields['p.fk_input_reason']['checked'])) { + print ''; +} +// Payment term +if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) { + print ''; +} +// Payment mode +if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) { + print ''; +} +if (!empty($arrayfields['p.total_ht']['checked'])) { + // Amount + print ''; +} +if (!empty($arrayfields['p.total_tva']['checked'])) { + // Amount + print ''; +} +if (!empty($arrayfields['p.total_ttc']['checked'])) { + // Amount + print ''; +} +if (!empty($arrayfields['p.total_ht_invoiced']['checked'])) { + // Amount invoiced + print ''; +} +if (!empty($arrayfields['p.total_invoiced']['checked'])) { + // Amount invoiced + print ''; +} +if (!empty($arrayfields['p.multicurrency_code']['checked'])) { + // Currency + print ''; +} +if (!empty($arrayfields['p.multicurrency_tx']['checked'])) { + // Currency rate + print ''; +} +if (!empty($arrayfields['p.multicurrency_total_ht']['checked'])) { + // Amount + print ''; +} +if (!empty($arrayfields['p.multicurrency_total_tva']['checked'])) { + // Amount + print ''; +} +if (!empty($arrayfields['p.multicurrency_total_ttc']['checked'])) { + // Amount + print ''; +} +if (!empty($arrayfields['p.multicurrency_total_ht_invoiced']['checked'])) { + // Amount invoiced + print ''; +} +if (!empty($arrayfields['p.multicurrency_total_invoiced']['checked'])) { + // Amount invoiced + print ''; +} +if (!empty($arrayfields['u.login']['checked'])) { + // Author + print ''; +} +if (!empty($arrayfields['sale_representative']['checked'])) { + print ''; +} +if (!empty($arrayfields['total_pa']['checked'])) { + print ''; +} +if (!empty($arrayfields['total_margin']['checked'])) { + print ''; +} +if (!empty($arrayfields['total_margin_rate']['checked'])) { + print ''; +} +if (!empty($arrayfields['total_mark_rate']['checked'])) { + print ''; +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + +// Fields from hook +$parameters = array('arrayfields' => $arrayfields); +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Date creation +if (!empty($arrayfields['p.datec']['checked'])) { + print ''; +} +// Date modification +if (!empty($arrayfields['p.tms']['checked'])) { + print ''; +} +// Date cloture +if (!empty($arrayfields['p.date_cloture']['checked'])) { + print ''; +} +if (!empty($arrayfields['p.note_public']['checked'])) { + // Note public + print ''; +} +if (!empty($arrayfields['p.note_private']['checked'])) { + // Note private + print ''; +} +// Status +if (!empty($arrayfields['p.fk_statut']['checked'])) { + print ''; +} +// Action column +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; +} +print "\n"; + +$totalarray = array( + 'nbfield' => 0, + 'val' => array( + 'p.total_ht' => 0, + 'p.total_tva' => 0, + 'p.total_ttc' => 0, + ), +); + +// Fields title +print ''; +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.ref']['checked'])) { + print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.ref_client']['checked'])) { + print_liste_field_titre($arrayfields['p.ref_client']['label'], $_SERVER["PHP_SELF"], 'p.ref_client', '', $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['pr.ref']['checked'])) { + print_liste_field_titre($arrayfields['pr.ref']['label'], $_SERVER["PHP_SELF"], 'pr.ref', '', $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['pr.title']['checked'])) { + print_liste_field_titre($arrayfields['pr.title']['label'], $_SERVER["PHP_SELF"], 'pr.title', '', $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['s.nom']['checked'])) { + print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['s.name_alias']['checked'])) { + print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], 's.name_alias', '', $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['s.town']['checked'])) { + print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['s.zip']['checked'])) { + print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['state.nom']['checked'])) { + print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['country.code_iso']['checked'])) { + print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'class="center"', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['typent.code']['checked'])) { + print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'class="center"', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.date']['checked'])) { + print_liste_field_titre($arrayfields['p.date']['label'], $_SERVER["PHP_SELF"], 'p.datep', '', $param, 'class="center"', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.fin_validite']['checked'])) { + print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, 'class="center"', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.date_livraison']['checked'])) { + print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'p.date_livraison', '', $param, 'class="center"', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.date_signature']['checked'])) { + print_liste_field_titre($arrayfields['p.date_signature']['label'], $_SERVER["PHP_SELF"], 'p.date_signature', '', $param, 'class="center"', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['ava.rowid']['checked'])) { + print_liste_field_titre($arrayfields['ava.rowid']['label'], $_SERVER["PHP_SELF"], 'availability', '', $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.fk_shipping_method']['checked'])) { + print_liste_field_titre($arrayfields['p.fk_shipping_method']['label'], $_SERVER["PHP_SELF"], "p.fk_shipping_method", "", $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.fk_input_reason']['checked'])) { + print_liste_field_titre($arrayfields['p.fk_input_reason']['label'], $_SERVER["PHP_SELF"], "p.fk_input_reason", "", $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) { + print_liste_field_titre($arrayfields['p.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "p.fk_cond_reglement", "", $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) { + print_liste_field_titre($arrayfields['p.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "p.fk_mode_reglement", "", $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.total_ht']['checked'])) { + print_liste_field_titre($arrayfields['p.total_ht']['label'], $_SERVER["PHP_SELF"], 'p.total_ht', '', $param, '', $sortfield, $sortorder, 'right '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.total_tva']['checked'])) { + print_liste_field_titre($arrayfields['p.total_tva']['label'], $_SERVER["PHP_SELF"], 'p.total_tva', '', $param, '', $sortfield, $sortorder, 'right '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.total_ttc']['checked'])) { + print_liste_field_titre($arrayfields['p.total_ttc']['label'], $_SERVER["PHP_SELF"], 'p.total_ttc', '', $param, '', $sortfield, $sortorder, 'right '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.total_ht_invoiced']['checked'])) { + print_liste_field_titre($arrayfields['p.total_ht_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.total_invoiced']['checked'])) { + print_liste_field_titre($arrayfields['p.total_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.multicurrency_code']['checked'])) { + print_liste_field_titre($arrayfields['p.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_code', '', $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.multicurrency_tx']['checked'])) { + print_liste_field_titre($arrayfields['p.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_tx', '', $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.multicurrency_total_ht']['checked'])) { + print_liste_field_titre($arrayfields['p.multicurrency_total_ht']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_total_ht', '', $param, '', $sortfield, $sortorder, 'right '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.multicurrency_total_tva']['checked'])) { + print_liste_field_titre($arrayfields['p.multicurrency_total_tva']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_total_tva', '', $param, '', $sortfield, $sortorder, 'right '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.multicurrency_total_ttc']['checked'])) { + print_liste_field_titre($arrayfields['p.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_total_ttc', '', $param, '', $sortfield, $sortorder, 'right '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.multicurrency_total_ht_invoiced']['checked'])) { + print_liste_field_titre($arrayfields['p.multicurrency_total_ht_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.multicurrency_total_invoiced']['checked'])) { + print_liste_field_titre($arrayfields['p.multicurrency_total_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['u.login']['checked'])) { + print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['sale_representative']['checked'])) { + print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['total_pa']['checked'])) { + print_liste_field_titre($arrayfields['total_pa']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['total_margin']['checked'])) { + print_liste_field_titre($arrayfields['total_margin']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['total_margin_rate']['checked'])) { + print_liste_field_titre($arrayfields['total_margin_rate']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['total_mark_rate']['checked'])) { + print_liste_field_titre($arrayfields['total_mark_rate']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); + $totalarray['nbfield']++; +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; +// Hook fields +$parameters = array( + 'arrayfields' => $arrayfields, + 'param' => $param, + 'sortfield' => $sortfield, + 'sortorder' => $sortorder, + 'totalarray' => &$totalarray, +); + +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + +print $hookmanager->resPrint; +if (!empty($arrayfields['p.datec']['checked'])) { + print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center nowraponall '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.tms']['checked'])) { + print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, '', $sortfield, $sortorder, 'center nowraponall '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.date_cloture']['checked'])) { + print_liste_field_titre($arrayfields['p.date_cloture']['label'], $_SERVER["PHP_SELF"], "p.date_cloture", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.note_public']['checked'])) { + print_liste_field_titre($arrayfields['p.note_public']['label'], $_SERVER["PHP_SELF"], "p.note_public", "", $param, '', $sortfield, $sortorder, 'center nowrap '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.note_private']['checked'])) { + print_liste_field_titre($arrayfields['p.note_private']['label'], $_SERVER["PHP_SELF"], "p.note_private", "", $param, '', $sortfield, $sortorder, 'center nowrap '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['p.fk_statut']['checked'])) { + print_liste_field_titre($arrayfields['p.fk_statut']['label'], $_SERVER["PHP_SELF"], "p.fk_statut", "", $param, '', $sortfield, $sortorder, 'center '); + $totalarray['nbfield']++; +} +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); + $totalarray['nbfield']++; +} +print ''."\n"; + +// Loop on record +// -------------------------------------------------------------------- +$typenArray = null; +$now = dol_now(); + +$with_margin_info = false; +if (isModEnabled('margin') && ( + !empty($arrayfields['total_pa']['checked']) + || !empty($arrayfields['total_margin']['checked']) + || !empty($arrayfields['total_margin_rate']['checked']) + || !empty($arrayfields['total_mark_rate']['checked']) +) +) { + $with_margin_info = true; +} +$total_ht = 0; +$total_margin = 0; + +$i = 0; +$savnbfield = $totalarray['nbfield']; +$totalarray = array(); +$totalarray['nbfield'] = 0; +$imaxinloop = ($limit ? min($num, $limit) : $num); +while ($i < $imaxinloop) { + $obj = $db->fetch_object($resql); + if (empty($obj)) { + break; // Should not happen } - if (in_array($massaction, array('presend', 'predelete', 'closed'))) { - $arrayofmassactions = array(); - } - $massactionbutton = $form->selectMassAction('', $arrayofmassactions); + $objectstatic->id = $obj->rowid; + $objectstatic->ref = $obj->ref; + $objectstatic->ref_client = $obj->ref_client; + $objectstatic->note_public = $obj->note_public; + $objectstatic->note_private = $obj->note_private; + $objectstatic->statut = $obj->status; + $objectstatic->status = $obj->status; - $url = DOL_URL_ROOT.'/comm/propal/card.php?action=create'; - if (!empty($socid)) { - $url .= '&socid='.$socid; - } - $newcardbutton = ''; - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); - $newcardbutton .= dolGetButtonTitleSeparator(); - $newcardbutton .= dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('propal', 'creer')); + $companystatic->id = $obj->socid; + $companystatic->name = $obj->name; + $companystatic->name_alias = $obj->alias; + $companystatic->client = $obj->client; + $companystatic->fournisseur = $obj->fournisseur; + $companystatic->code_client = $obj->code_client; + $companystatic->email = $obj->email; + $companystatic->phone = $obj->phone; + $companystatic->address = $obj->address; + $companystatic->zip = $obj->zip; + $companystatic->town = $obj->town; + $companystatic->country_code = $obj->country_code; - // Fields title search - print ''; - if ($optioncss != '') { - print ''; - } - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + $projectstatic->id = $obj->project_id; + $projectstatic->ref = $obj->project_ref; + $projectstatic->title = $obj->project_label; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'propal', 0, $newcardbutton, '', $limit, 0, 0, 1); + $totalInvoicedHT = 0; + $totalInvoicedTTC = 0; + $multicurrency_totalInvoicedHT = 0; + $multicurrency_totalInvoicedTTC = 0; - $topicmail = "SendPropalRef"; - $modelmail = "propal_send"; - $objecttmp = new Propal($db); - $trackid = 'pro'.$object->id; - include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + $TInvoiceData = $objectstatic->InvoiceArrayList($obj->rowid); - if ($massaction == 'prevalidate') { - print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassValidation"), $langs->trans("ConfirmMassValidationQuestion"), "validate", null, '', 0, 200, 500, 1); - } + if (!empty($TInvoiceData)) { + foreach ($TInvoiceData as $invoiceData) { + $invoice = new Facture($db); + $invoice->fetch($invoiceData->facid); - if ($massaction == 'presign') { - print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassSignature"), $langs->trans("ConfirmMassSignatureQuestion"), "sign", null, '', 0, 200, 500, 1); - } + if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS') && $invoice->type == Facture::TYPE_DEPOSIT) { + continue; + } - if ($massaction == 'nopresign') { - print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassNoSignature"), $langs->trans("ConfirmMassNoSignatureQuestion"), "nosign", null, '', 0, 200, 500, 1); - } - - if ($search_all) { - foreach ($fieldstosearchall as $key => $val) { - $fieldstosearchall[$key] = $langs->trans($val); + $totalInvoicedHT += $invoice->total_ht; + $totalInvoicedTTC += $invoice->total_ttc; + $multicurrency_totalInvoicedHT += $invoice->multicurrency_total_ht; + $multicurrency_totalInvoicedTTC += $invoice->multicurrency_total_ttc; } - print '
'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'
'; } - $i = 0; + $marginInfo = array(); + if ($with_margin_info === true) { + $objectstatic->fetch_lines(); + $marginInfo = $formmargin->getMarginInfosArray($objectstatic); + $total_ht += $obj->total_ht; + $total_margin += $marginInfo['total_margin']; + } - $moreforfilter = ''; - - // If the user can view prospects other than his' - if ($user->hasRight('user', 'user', 'lire')) { - $langs->load("commercial"); - $moreforfilter .= '
'; - $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth250 widthcentpercentminusx', 1); - $moreforfilter .= '
'; - } - // If the user can view prospects other than his' - if ($user->hasRight('user', 'user', 'lire')) { - $moreforfilter .= '
'; - $tmptitle = $langs->trans('LinkedToSpecificUsers'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers((empty($search_user)?-2:0), 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx'); - $moreforfilter .= '
'; - } - // If the user can view products - if (isModEnabled('category') && $user->hasRight('categorie', 'read') && ($user->hasRight('product', 'read') || $user->hasRight('service', 'read'))) { - $searchCategoryProductOperator = -1; - include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - $tmptitle = $langs->trans('IncludingProductWithTag'); - $formcategory = new FormCategory($db); - $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, array($search_product_category), 'maxwidth300', $searchCategoryProductOperator, 0, 0, $tmptitle); - } - if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - $moreforfilter .= '
'; - $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300 widthcentpercentminusx' : 'maxwidth250 widthcentpercentminusx')); - $moreforfilter .= '
'; - } - if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) { - require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; - $formproduct = new FormProduct($db); - $moreforfilter .= '
'; - $tmptitle = $langs->trans('Warehouse'); - $moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', $tmptitle, 0, 0, $tmptitle); - $moreforfilter .= '
'; - } - $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) { - $moreforfilter .= $hookmanager->resPrint; + if ($mode == 'kanban') { + if ($i == 0) { + print '
'; + } } else { - $moreforfilter = $hookmanager->resPrint; - } + print ''; - if (!empty($moreforfilter)) { - print '
'; - print $moreforfilter; - print '
'; - } + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print '
'; + if (!$i) { + $totalarray['nbfield']++; + } + } - $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields - $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + if (!empty($arrayfields['p.ref']['checked'])) { + print ''; + print "\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } - // Action column - if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; - } + if (!empty($arrayfields['p.ref_client']['checked'])) { + // Customer ref + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } - if (!empty($arrayfields['p.ref']['checked'])) { - print ''; - } - if (!empty($arrayfields['p.ref_client']['checked'])) { - print ''; - } - if (!empty($arrayfields['pr.ref']['checked'])) { - print ''; - } - if (!empty($arrayfields['pr.title']['checked'])) { - print ''; - } - if (!empty($arrayfields['s.nom']['checked'])) { - print ''; - } - if (!empty($arrayfields['s.name_alias']['checked'])) { - print ''; - } - if (!empty($arrayfields['s.town']['checked'])) { - print ''; - } - if (!empty($arrayfields['s.zip']['checked'])) { - print ''; - } - // State - if (!empty($arrayfields['state.nom']['checked'])) { - print ''; - } - // Country - if (!empty($arrayfields['country.code_iso']['checked'])) { - print ''; - } - // Company type - if (!empty($arrayfields['typent.code']['checked'])) { - print ''; - } - // Date - if (!empty($arrayfields['p.date']['checked'])) { - print ''; - } - // Date end - if (!empty($arrayfields['p.fin_validite']['checked'])) { - print ''; - } - // Date delivery - if (!empty($arrayfields['p.date_livraison']['checked'])) { - print ''; - } - // Date Signature - if (!empty($arrayfields['p.date_signature']['checked'])) { - print ''; - } - // Availability - if (!empty($arrayfields['ava.rowid']['checked'])) { - print ''; - } - // Shipping Method - if (!empty($arrayfields['p.fk_shipping_method']['checked'])) { - print ''; - } - // Source - Input reason - if (!empty($arrayfields['p.fk_input_reason']['checked'])) { - print ''; - } - // Payment term - if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) { - print ''; - } - // Payment mode - if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) { - print ''; - } - if (!empty($arrayfields['p.total_ht']['checked'])) { - // Amount - print ''; - } - if (!empty($arrayfields['p.total_tva']['checked'])) { - // Amount - print ''; - } - if (!empty($arrayfields['p.total_ttc']['checked'])) { - // Amount - print ''; - } - if (!empty($arrayfields['p.total_ht_invoiced']['checked'])) { - // Amount invoiced - print ''; - } - if (!empty($arrayfields['p.total_invoiced']['checked'])) { - // Amount invoiced - print ''; - } - if (!empty($arrayfields['p.multicurrency_code']['checked'])) { + if (!empty($arrayfields['pr.ref']['checked'])) { + // Project ref + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['pr.title']['checked'])) { + // Project label + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Thirdparty + if (!empty($arrayfields['s.nom']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Alias + if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Town + if (!empty($arrayfields['s.town']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Zip + if (!empty($arrayfields['s.zip']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // State + if (!empty($arrayfields['state.nom']['checked'])) { + print "\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Country + if (!empty($arrayfields['country.code_iso']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Type ent + if (!empty($arrayfields['typent.code']['checked'])) { + if (!is_array($typenArray) || empty($typenArray)) { + $typenArray = $formcompany->typent_array(1); + } + + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Date proposal + if (!empty($arrayfields['p.date']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Date end validity + if (!empty($arrayfields['p.fin_validite']['checked'])) { + if ($obj->dfv) { + print ''; + } else { + print ''; + } + if (!$i) { + $totalarray['nbfield']++; + } + } + // Date delivery + if (!empty($arrayfields['p.date_livraison']['checked'])) { + if ($obj->ddelivery) { + print ''; + } else { + print ''; + } + if (!$i) { + $totalarray['nbfield']++; + } + } + // Date Signature + if (!empty($arrayfields['p.date_signature']['checked'])) { + if ($obj->dsignature) { + print ''; + } else { + print ''; + } + if (!$i) { + $totalarray['nbfield']++; + } + } + // Availability + if (!empty($arrayfields['ava.rowid']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Shipping Method + if (!empty($arrayfields['p.fk_shipping_method']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Source - input reason + if (!empty($arrayfields['p.fk_input_reason']['checked'])) { + $labelInputReason = ''; + if ($obj->fk_input_reason > 0) { + $labelInputReason = $form->cache_demand_reason[$obj->fk_input_reason]['label']; + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Payment terms + if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Payment mode + if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Amount HT + if (!empty($arrayfields['p.total_ht']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ht'; + } + if (empty($totalarray['val']['p.total_ht'])) { + $totalarray['val']['p.total_ht'] = $obj->total_ht; + } else { + $totalarray['val']['p.total_ht'] += $obj->total_ht; + } + } + // Amount VAT + if (!empty($arrayfields['p.total_tva']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'p.total_tva'; + } + if (empty($totalarray['val']['p.total_tva'])) { + $totalarray['val']['p.total_tva'] = $obj->total_tva; + } else { + $totalarray['val']['p.total_tva'] += $obj->total_tva; + } + } + // Amount TTC + if (!empty($arrayfields['p.total_ttc']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ttc'; + } + if (empty($totalarray['val']['p.total_ttc'])) { + $totalarray['val']['p.total_ttc'] = $obj->total_ttc; + } else { + $totalarray['val']['p.total_ttc'] += $obj->total_ttc; + } + } + // Amount invoiced HT + if (!empty($arrayfields['p.total_ht_invoiced']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ht_invoiced'; + } + if (empty($totalarray['val']['p.total_ht_invoiced'])) { + $totalarray['val']['p.total_ht_invoiced'] = $totalInvoicedHT; + } else { + $totalarray['val']['p.total_ht_invoiced'] += $totalInvoicedHT; + } + } + // Amount invoiced TTC + if (!empty($arrayfields['p.total_invoiced']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'p.total_invoiced'; + } + if (empty($totalarray['val']['p.total_invoiced'])) { + $totalarray['val']['p.total_invoiced'] = $totalInvoicedTTC; + } else { + $totalarray['val']['p.total_invoiced'] += $totalInvoicedTTC; + } + } // Currency - print ''; - } - if (!empty($arrayfields['p.multicurrency_tx']['checked'])) { + if (!empty($arrayfields['p.multicurrency_code']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Currency rate - print ''; - } - if (!empty($arrayfields['p.multicurrency_total_ht']['checked'])) { - // Amount - print ''; - } - if (!empty($arrayfields['p.multicurrency_total_tva']['checked'])) { - // Amount - print ''; - } - if (!empty($arrayfields['p.multicurrency_total_ttc']['checked'])) { - // Amount - print ''; - } - if (!empty($arrayfields['p.multicurrency_total_ht_invoiced']['checked'])) { + if (!empty($arrayfields['p.multicurrency_tx']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Amount HT + if (!empty($arrayfields['p.multicurrency_total_ht']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Amount VAT + if (!empty($arrayfields['p.multicurrency_total_tva']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Amount TTC + if (!empty($arrayfields['p.multicurrency_total_ttc']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } // Amount invoiced - print ''; - } - if (!empty($arrayfields['p.multicurrency_total_invoiced']['checked'])) { + if (!empty($arrayfields['p.multicurrency_total_ht_invoiced']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } // Amount invoiced - print ''; - } - if (!empty($arrayfields['u.login']['checked'])) { + if (!empty($arrayfields['p.multicurrency_total_invoiced']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + + $userstatic->id = $obj->fk_user_author; + $userstatic->login = $obj->login; + $userstatic->lastname = $obj->lastname; + $userstatic->firstname = $obj->firstname; + $userstatic->email = $obj->user_email; + $userstatic->statut = $obj->user_statut; + $userstatic->entity = $obj->user_entity; + $userstatic->photo = $obj->photo; + $userstatic->office_phone = $obj->office_phone; + $userstatic->office_fax = $obj->office_fax; + $userstatic->user_mobile = $obj->user_mobile; + $userstatic->job = $obj->job; + $userstatic->gender = $obj->gender; + // Author - print ''; - } - if (!empty($arrayfields['sale_representative']['checked'])) { - print ''; - } - if (!empty($arrayfields['total_pa']['checked'])) { - print ''; - } - if (!empty($arrayfields['total_margin']['checked'])) { - print ''; - } - if (!empty($arrayfields['total_margin_rate']['checked'])) { - print ''; - } - if (!empty($arrayfields['total_mark_rate']['checked'])) { - print ''; - } - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; - - // Fields from hook - $parameters = array('arrayfields'=>$arrayfields); - $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (!empty($arrayfields['p.datec']['checked'])) { - print ''; - } - // Date modification - if (!empty($arrayfields['p.tms']['checked'])) { - print ''; - } - // Date cloture - if (!empty($arrayfields['p.date_cloture']['checked'])) { - print ''; - } - if (!empty($arrayfields['p.note_public']['checked'])) { - // Note public - print ''; - } - if (!empty($arrayfields['p.note_private']['checked'])) { - // Note private - print ''; - } - // Status - if (!empty($arrayfields['p.fk_statut']['checked'])) { - print ''; - } - // Action column - if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; - } - print "\n"; - - $totalarray = array( - 'nbfield' => 0, - 'val' => array( - 'p.total_ht' => 0, - 'p.total_tva' => 0, - 'p.total_ttc' => 0, - ), - ); - - // Fields title - print ''; - if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.ref']['checked'])) { - print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.ref_client']['checked'])) { - print_liste_field_titre($arrayfields['p.ref_client']['label'], $_SERVER["PHP_SELF"], 'p.ref_client', '', $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['pr.ref']['checked'])) { - print_liste_field_titre($arrayfields['pr.ref']['label'], $_SERVER["PHP_SELF"], 'pr.ref', '', $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['pr.title']['checked'])) { - print_liste_field_titre($arrayfields['pr.title']['label'], $_SERVER["PHP_SELF"], 'pr.title', '', $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['s.nom']['checked'])) { - print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['s.name_alias']['checked'])) { - print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], 's.name_alias', '', $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['s.town']['checked'])) { - print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['s.zip']['checked'])) { - print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['state.nom']['checked'])) { - print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['country.code_iso']['checked'])) { - print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'class="center"', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['typent.code']['checked'])) { - print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'class="center"', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.date']['checked'])) { - print_liste_field_titre($arrayfields['p.date']['label'], $_SERVER["PHP_SELF"], 'p.datep', '', $param, 'class="center"', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.fin_validite']['checked'])) { - print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, 'class="center"', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.date_livraison']['checked'])) { - print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'p.date_livraison', '', $param, 'class="center"', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.date_signature']['checked'])) { - print_liste_field_titre($arrayfields['p.date_signature']['label'], $_SERVER["PHP_SELF"], 'p.date_signature', '', $param, 'class="center"', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['ava.rowid']['checked'])) { - print_liste_field_titre($arrayfields['ava.rowid']['label'], $_SERVER["PHP_SELF"], 'availability', '', $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.fk_shipping_method']['checked'])) { - print_liste_field_titre($arrayfields['p.fk_shipping_method']['label'], $_SERVER["PHP_SELF"], "p.fk_shipping_method", "", $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.fk_input_reason']['checked'])) { - print_liste_field_titre($arrayfields['p.fk_input_reason']['label'], $_SERVER["PHP_SELF"], "p.fk_input_reason", "", $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) { - print_liste_field_titre($arrayfields['p.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "p.fk_cond_reglement", "", $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) { - print_liste_field_titre($arrayfields['p.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "p.fk_mode_reglement", "", $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.total_ht']['checked'])) { - print_liste_field_titre($arrayfields['p.total_ht']['label'], $_SERVER["PHP_SELF"], 'p.total_ht', '', $param, '', $sortfield, $sortorder, 'right '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.total_tva']['checked'])) { - print_liste_field_titre($arrayfields['p.total_tva']['label'], $_SERVER["PHP_SELF"], 'p.total_tva', '', $param, '', $sortfield, $sortorder, 'right '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.total_ttc']['checked'])) { - print_liste_field_titre($arrayfields['p.total_ttc']['label'], $_SERVER["PHP_SELF"], 'p.total_ttc', '', $param, '', $sortfield, $sortorder, 'right '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.total_ht_invoiced']['checked'])) { - print_liste_field_titre($arrayfields['p.total_ht_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.total_invoiced']['checked'])) { - print_liste_field_titre($arrayfields['p.total_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.multicurrency_code']['checked'])) { - print_liste_field_titre($arrayfields['p.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_code', '', $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.multicurrency_tx']['checked'])) { - print_liste_field_titre($arrayfields['p.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_tx', '', $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.multicurrency_total_ht']['checked'])) { - print_liste_field_titre($arrayfields['p.multicurrency_total_ht']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_total_ht', '', $param, '', $sortfield, $sortorder, 'right '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.multicurrency_total_tva']['checked'])) { - print_liste_field_titre($arrayfields['p.multicurrency_total_tva']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_total_tva', '', $param, '', $sortfield, $sortorder, 'right '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.multicurrency_total_ttc']['checked'])) { - print_liste_field_titre($arrayfields['p.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_total_ttc', '', $param, '', $sortfield, $sortorder, 'right '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.multicurrency_total_ht_invoiced']['checked'])) { - print_liste_field_titre($arrayfields['p.multicurrency_total_ht_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.multicurrency_total_invoiced']['checked'])) { - print_liste_field_titre($arrayfields['p.multicurrency_total_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['u.login']['checked'])) { - print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['sale_representative']['checked'])) { - print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['total_pa']['checked'])) { - print_liste_field_titre($arrayfields['total_pa']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['total_margin']['checked'])) { - print_liste_field_titre($arrayfields['total_margin']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['total_margin_rate']['checked'])) { - print_liste_field_titre($arrayfields['total_margin_rate']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['total_mark_rate']['checked'])) { - print_liste_field_titre($arrayfields['total_mark_rate']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); - $totalarray['nbfield']++; - } - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; - // Hook fields - $parameters = array( - 'arrayfields' => $arrayfields, - 'param' => $param, - 'sortfield' => $sortfield, - 'sortorder' => $sortorder, - 'totalarray' => &$totalarray, - ); - - $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - - print $hookmanager->resPrint; - if (!empty($arrayfields['p.datec']['checked'])) { - print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center nowraponall '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.tms']['checked'])) { - print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, '', $sortfield, $sortorder, 'center nowraponall '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.date_cloture']['checked'])) { - print_liste_field_titre($arrayfields['p.date_cloture']['label'], $_SERVER["PHP_SELF"], "p.date_cloture", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.note_public']['checked'])) { - print_liste_field_titre($arrayfields['p.note_public']['label'], $_SERVER["PHP_SELF"], "p.note_public", "", $param, '', $sortfield, $sortorder, 'center nowrap '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.note_private']['checked'])) { - print_liste_field_titre($arrayfields['p.note_private']['label'], $_SERVER["PHP_SELF"], "p.note_private", "", $param, '', $sortfield, $sortorder, 'center nowrap '); - $totalarray['nbfield']++; - } - if (!empty($arrayfields['p.fk_statut']['checked'])) { - print_liste_field_titre($arrayfields['p.fk_statut']['label'], $_SERVER["PHP_SELF"], "p.fk_statut", "", $param, '', $sortfield, $sortorder, 'center '); - $totalarray['nbfield']++; - } - if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); - $totalarray['nbfield']++; - } - print ''."\n"; - - // Loop on record - // -------------------------------------------------------------------- - $typenArray = null; - $now = dol_now(); - - $with_margin_info = false; - if (isModEnabled('margin') && ( - !empty($arrayfields['total_pa']['checked']) - || !empty($arrayfields['total_margin']['checked']) - || !empty($arrayfields['total_margin_rate']['checked']) - || !empty($arrayfields['total_mark_rate']['checked']) - ) - ) { - $with_margin_info = true; - } - $total_ht = 0; - $total_margin = 0; - - $i = 0; - $savnbfield = $totalarray['nbfield']; - $totalarray = array(); - $totalarray['nbfield'] = 0; - $imaxinloop = ($limit ? min($num, $limit) : $num); - while ($i < $imaxinloop) { - $obj = $db->fetch_object($resql); - if (empty($obj)) { - break; // Should not happen - } - - $objectstatic->id = $obj->rowid; - $objectstatic->ref = $obj->ref; - $objectstatic->ref_client = $obj->ref_client; - $objectstatic->note_public = $obj->note_public; - $objectstatic->note_private = $obj->note_private; - $objectstatic->statut = $obj->status; - $objectstatic->status = $obj->status; - - $companystatic->id = $obj->socid; - $companystatic->name = $obj->name; - $companystatic->name_alias = $obj->alias; - $companystatic->client = $obj->client; - $companystatic->fournisseur = $obj->fournisseur; - $companystatic->code_client = $obj->code_client; - $companystatic->email = $obj->email; - $companystatic->phone = $obj->phone; - $companystatic->address = $obj->address; - $companystatic->zip = $obj->zip; - $companystatic->town = $obj->town; - $companystatic->country_code = $obj->country_code; - - $projectstatic->id = $obj->project_id; - $projectstatic->ref = $obj->project_ref; - $projectstatic->title = $obj->project_label; - - $totalInvoicedHT = 0; - $totalInvoicedTTC = 0; - $multicurrency_totalInvoicedHT = 0; - $multicurrency_totalInvoicedTTC = 0; - - $TInvoiceData = $objectstatic->InvoiceArrayList($obj->rowid); - - if (!empty($TInvoiceData)) { - foreach ($TInvoiceData as $invoiceData) { - $invoice = new Facture($db); - $invoice->fetch($invoiceData->facid); - - if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS') && $invoice->type == Facture::TYPE_DEPOSIT) { - continue; - } - - $totalInvoicedHT += $invoice->total_ht; - $totalInvoicedTTC += $invoice->total_ttc; - $multicurrency_totalInvoicedHT += $invoice->multicurrency_total_ht; - $multicurrency_totalInvoicedTTC += $invoice->multicurrency_total_ttc; + if (!empty($arrayfields['u.login']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; } } - $marginInfo = array(); - if ($with_margin_info === true) { - $objectstatic->fetch_lines(); - $marginInfo = $formmargin->getMarginInfosArray($objectstatic); - $total_ht += $obj->total_ht; - $total_margin += $marginInfo['total_margin']; - } - - if ($mode == 'kanban') { - if ($i == 0) { - print ''; - } - } else { - print ''; - - // Action column - if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - if (!empty($arrayfields['p.ref']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - - if (!empty($arrayfields['p.ref_client']['checked'])) { - // Customer ref - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - if (!empty($arrayfields['pr.ref']['checked'])) { - // Project ref - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - if (!empty($arrayfields['pr.title']['checked'])) { - // Project label - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Thirdparty - if (!empty($arrayfields['s.nom']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Alias - if (!empty($arrayfields['s.name_alias']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Town - if (!empty($arrayfields['s.town']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Zip - if (!empty($arrayfields['s.zip']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // State - if (!empty($arrayfields['state.nom']['checked'])) { - print "\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Country - if (!empty($arrayfields['country.code_iso']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Type ent - if (!empty($arrayfields['typent.code']['checked'])) { - if (!is_array($typenArray) || empty($typenArray)) { - $typenArray = $formcompany->typent_array(1); - } - - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Date proposal - if (!empty($arrayfields['p.date']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Date end validity - if (!empty($arrayfields['p.fin_validite']['checked'])) { - if ($obj->dfv) { - print ''; - } else { - print ''; - } - if (!$i) { - $totalarray['nbfield']++; - } - } - // Date delivery - if (!empty($arrayfields['p.date_livraison']['checked'])) { - if ($obj->ddelivery) { - print ''; - } else { - print ''; - } - if (!$i) { - $totalarray['nbfield']++; - } - } - // Date Signature - if (!empty($arrayfields['p.date_signature']['checked'])) { - if ($obj->dsignature) { - print ''; - } else { - print ''; - } - if (!$i) { - $totalarray['nbfield']++; - } - } - // Availability - if (!empty($arrayfields['ava.rowid']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Shipping Method - if (!empty($arrayfields['p.fk_shipping_method']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Source - input reason - if (!empty($arrayfields['p.fk_input_reason']['checked'])) { - $labelInputReason = ''; - if ($obj->fk_input_reason > 0) { - $labelInputReason = $form->cache_demand_reason[$obj->fk_input_reason]['label']; - } - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Payment terms - if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Payment mode - if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Amount HT - if (!empty($arrayfields['p.total_ht']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ht'; - } - if (empty($totalarray['val']['p.total_ht'])) { - $totalarray['val']['p.total_ht'] = $obj->total_ht; - } else { - $totalarray['val']['p.total_ht'] += $obj->total_ht; - } - } - // Amount VAT - if (!empty($arrayfields['p.total_tva']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'p.total_tva'; - } - if (empty($totalarray['val']['p.total_tva'])) { - $totalarray['val']['p.total_tva'] = $obj->total_tva; - } else { - $totalarray['val']['p.total_tva'] += $obj->total_tva; - } - } - // Amount TTC - if (!empty($arrayfields['p.total_ttc']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ttc'; - } - if (empty($totalarray['val']['p.total_ttc'])) { - $totalarray['val']['p.total_ttc'] = $obj->total_ttc; - } else { - $totalarray['val']['p.total_ttc'] += $obj->total_ttc; - } - } - // Amount invoiced HT - if (!empty($arrayfields['p.total_ht_invoiced']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ht_invoiced'; - } - if (empty($totalarray['val']['p.total_ht_invoiced'])) { - $totalarray['val']['p.total_ht_invoiced'] = $totalInvoicedHT; - } else { - $totalarray['val']['p.total_ht_invoiced'] += $totalInvoicedHT; - } - } - // Amount invoiced TTC - if (!empty($arrayfields['p.total_invoiced']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'p.total_invoiced'; - } - if (empty($totalarray['val']['p.total_invoiced'])) { - $totalarray['val']['p.total_invoiced'] = $totalInvoicedTTC; - } else { - $totalarray['val']['p.total_invoiced'] += $totalInvoicedTTC; - } - } - // Currency - if (!empty($arrayfields['p.multicurrency_code']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Currency rate - if (!empty($arrayfields['p.multicurrency_tx']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Amount HT - if (!empty($arrayfields['p.multicurrency_total_ht']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Amount VAT - if (!empty($arrayfields['p.multicurrency_total_tva']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Amount TTC - if (!empty($arrayfields['p.multicurrency_total_ttc']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Amount invoiced - if (!empty($arrayfields['p.multicurrency_total_ht_invoiced']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Amount invoiced - if (!empty($arrayfields['p.multicurrency_total_invoiced']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - - $userstatic->id = $obj->fk_user_author; - $userstatic->login = $obj->login; - $userstatic->lastname = $obj->lastname; - $userstatic->firstname = $obj->firstname; - $userstatic->email = $obj->user_email; - $userstatic->statut = $obj->user_statut; - $userstatic->entity = $obj->user_entity; - $userstatic->photo = $obj->photo; - $userstatic->office_phone = $obj->office_phone; - $userstatic->office_fax = $obj->office_fax; - $userstatic->user_mobile = $obj->user_mobile; - $userstatic->job = $obj->job; - $userstatic->gender = $obj->gender; - - // Author - if (!empty($arrayfields['u.login']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - - if (!empty($arrayfields['sale_representative']['checked'])) { - // Sales representatives - print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Total buying or cost price + if (!empty($arrayfields['total_pa']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Total margin + if (!empty($arrayfields['total_margin']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'total_margin'; + } + $totalarray['val']['total_margin'] = $total_margin; + } + // Total margin rate + if (!empty($arrayfields['total_margin_rate']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Total mark rate + if (!empty($arrayfields['total_mark_rate']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'total_mark_rate'; + } + if ($i >= $imaxinloop - 1) { + if (!empty($total_ht)) { + $totalarray['val']['total_mark_rate'] = price2num($total_margin * 100 / $total_ht, 'MT'); } else { - print ' '; - } - print ''; - if (!$i) { - $totalarray['nbfield']++; + $totalarray['val']['total_mark_rate'] = ''; } } - - // Total buying or cost price - if (!empty($arrayfields['total_pa']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Total margin - if (!empty($arrayfields['total_margin']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'total_margin'; - } - $totalarray['val']['total_margin'] = $total_margin; - } - // Total margin rate - if (!empty($arrayfields['total_margin_rate']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Total mark rate - if (!empty($arrayfields['total_mark_rate']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'total_mark_rate'; - } - if ($i >= $imaxinloop - 1) { - if (!empty($total_ht)) { - $totalarray['val']['total_mark_rate'] = price2num($total_margin * 100 / $total_ht, 'MT'); - } else { - $totalarray['val']['total_mark_rate'] = ''; - } - } - } - - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; - // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (!empty($arrayfields['p.datec']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Date modification - if (!empty($arrayfields['p.tms']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Date cloture - if (!empty($arrayfields['p.date_cloture']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Note public - if (!empty($arrayfields['p.note_public']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Note private - if (!empty($arrayfields['p.note_private']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Status - if (!empty($arrayfields['p.fk_statut']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Action column - if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - - print ''."\n"; } - $i++; - } - - // Show total line - include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; - - // If no record found - if ($num == 0) { - $colspan = 1; - foreach ($arrayfields as $key => $val) { - if (!empty($val['checked'])) { - $colspan++; + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (!empty($arrayfields['p.datec']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; } } - print ''; - } - - $db->free($resql); - - $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); - $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print '
'; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100'); + print ''; + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (!getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1); + print ajax_combobox('search_type_thirdparty'); + print ''; + print '
'; + print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
'; + print '
'; + print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
'; + print '
'; + print '
'; + print $form->selectDate($search_date_end_start ? $search_date_end_start : -1, 'search_date_end_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
'; + print '
'; + print $form->selectDate($search_date_end_end ? $search_date_end_end : -1, 'search_date_end_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
'; + print '
'; + print '
'; + print $form->selectDate($search_date_delivery_start ? $search_date_delivery_start : -1, 'search_date_delivery_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
'; + print '
'; + print $form->selectDate($search_date_delivery_end ? $search_date_delivery_end : -1, 'search_date_delivery_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
'; + print '
'; + print '
'; + print $form->selectDate($search_date_signature_start ? $search_date_signature_start : -1, 'search_date_signature_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
'; + print '
'; + print $form->selectDate($search_date_signature_end ? $search_date_signature_end : -1, 'search_date_signature_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
'; + print '
'; + $form->selectAvailabilityDelay($search_availability, 'search_availability', '', 1); + print ajax_combobox('search_availability'); + print ''; + $form->selectShippingMethod($search_fk_shipping_method, 'search_fk_shipping_method', '', 1, '', 1); + print ''; + $form->selectInputReason($search_fk_input_reason, 'search_fk_input_reason', '', 1, 'maxwidth125', 1); + print ''; + print $form->getSelectConditionsPaiements($search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1); + print ''; + print $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1, '', 1); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $formpropal->selectProposalStatus($search_status, 1, 0, 1, 'customer', 'search_status', 'search_status width100 onrightofpage'); + print ''; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print '
'; + print '
'; + } + // Output Kanban + $userstatic->fetch($obj->fk_user_author); + $arrayofparams = array('selected' => in_array($object->id, $arrayofselected), 'authorlink' => $userstatic->getNomUrl(-2), 'projectlink' => $projectstatic->getNomUrl(2)); + print $objectstatic->getKanbanView('', $arrayofparams); + if ($i == ($imaxinloop - 1)) { + print '
'; + print '
'; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($obj->rowid, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print ''; - print '
'; - print ''."\n"; + print '
'; + // Picto + Ref + print ''; + // Warning + $warnornote = ''; + if ($obj->status == Propal::STATUS_VALIDATED && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) { + $warnornote .= img_warning($langs->trans("Late")); + } + if ($warnornote) { + print ''; + } + // Other picto tool + print '
'; + print $objectstatic->getNomUrl(1, '', '', 0, 1, (isset($conf->global->PROPAL_LIST_SHOW_NOTES) ? $conf->global->PROPAL_LIST_SHOW_NOTES : 1)); + print ''; + print $warnornote; + print ''; + $filename = dol_sanitizeFileName($obj->ref); + $filedir = $conf->propal->multidir_output[$obj->propal_entity].'/'.dol_sanitizeFileName($obj->ref); + $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; + print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); + print '
'; - print '
'; - $searchpicto = $form->showFilterButtons('left'); - print $searchpicto; - print ''; + print dol_escape_htmltag($obj->ref_client); + print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100'); - print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (!getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1); - print ajax_combobox('search_type_thirdparty'); - print ''; - print '
'; - print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); - print '
'; - print '
'; - print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); - print '
'; - print '
'; - print '
'; - print $form->selectDate($search_date_end_start ? $search_date_end_start : -1, 'search_date_end_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); - print '
'; - print '
'; - print $form->selectDate($search_date_end_end ? $search_date_end_end : -1, 'search_date_end_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); - print '
'; - print '
'; - print '
'; - print $form->selectDate($search_date_delivery_start ? $search_date_delivery_start : -1, 'search_date_delivery_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); - print '
'; - print '
'; - print $form->selectDate($search_date_delivery_end ? $search_date_delivery_end : -1, 'search_date_delivery_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); - print '
'; - print '
'; - print '
'; - print $form->selectDate($search_date_signature_start ? $search_date_signature_start : -1, 'search_date_signature_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); - print '
'; - print '
'; - print $form->selectDate($search_date_signature_end ? $search_date_signature_end : -1, 'search_date_signature_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); - print '
'; - print '
'; - $form->selectAvailabilityDelay($search_availability, 'search_availability', '', 1); - print ajax_combobox('search_availability'); - print ''; - $form->selectShippingMethod($search_fk_shipping_method, 'search_fk_shipping_method', '', 1, '', 1); - print ''; - $form->selectInputReason($search_fk_input_reason, 'search_fk_input_reason', '', 1, 'maxwidth125', 1); - print ''; - print $form->getSelectConditionsPaiements($search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1); - print ''; - print $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1, '', 1); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + if ($obj->project_id > 0) { + print $projectstatic->getNomUrl(1); + } + print ''; + if ($obj->project_id > 0) { + print dol_escape_htmltag($projectstatic->title); + } + print ''; + print $companystatic->getNomUrl(1, 'customer', 0, 0, 1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); + print ''; + print $obj->alias; + print ''; + print dol_escape_htmltag($obj->town); + print ''; + print $obj->zip; + print '".$obj->state_name."'; + $tmparray = getCountry($obj->fk_pays, 'all'); + print $tmparray['label']; + print ''; + if (!empty($obj->typent_code)) { + print $typenArray[$obj->typent_code]; + } + print ''; + print dol_print_date($db->jdate($obj->dp), 'day'); + print "'.dol_print_date($db->jdate($obj->dfv), 'day'); + print ' '.dol_print_date($db->jdate($obj->ddelivery), 'day'); + print ' '.dol_print_date($db->jdate($obj->dsignature), 'day'); + print ' '; + $form->form_availability('', $obj->availability, 'none', 1); + print ''; + $form->formSelectShippingMethod('', $obj->fk_shipping_method, 'none', 1); + print ''; + print dol_escape_htmltag($labelInputReason); + print ''; + $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 0, '', 1, $obj->deposit_percent); + print ''; + $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); + print ''.price($obj->total_ht)."'.price($obj->total_tva)."'.price($obj->total_ttc)."'.price($totalInvoicedHT)."'.price($totalInvoicedTTC)."'; - print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1); - print ''.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code); + print "'.price($obj->multicurrency_total_ht)."'.price($obj->multicurrency_total_tva)."'.price($obj->multicurrency_total_ttc)."'; - print ''.price($multicurrency_totalInvoicedHT)."'; - print ''.price($multicurrency_totalInvoicedTTC)."'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - $formpropal->selectProposalStatus($search_status, 1, 0, 1, 'customer', 'search_status', 'search_status width100 onrightofpage'); - print ''; - $searchpicto = $form->showFilterButtons(); - print $searchpicto; - print '
'; + if ($userstatic->id) { + print $userstatic->getNomUrl(-1); + } + print "
'; - print '
'; - } - // Output Kanban - $userstatic->fetch($obj->fk_user_author); - $arrayofparams = array('selected' => in_array($object->id, $arrayofselected), 'authorlink' => $userstatic->getNomUrl(-2), 'projectlink' => $projectstatic->getNomUrl(2)); - print $objectstatic->getKanbanView('', $arrayofparams); - if ($i == ($imaxinloop - 1)) { - print '
'; - print '
'; - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($obj->rowid, $arrayofselected)) { - $selected = 1; - } - print ''; + if (!empty($arrayfields['sale_representative']['checked'])) { + // Sales representatives + print ''; + if ($obj->socid > 0) { + $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user); + if ($listsalesrepresentatives < 0) { + dol_print_error($db); } - print ''; - - print ''; - // Picto + Ref - print ''; - // Warning - $warnornote = ''; - if ($obj->status == Propal::STATUS_VALIDATED && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) { - $warnornote .= img_warning($langs->trans("Late")); - } - if ($warnornote) { - print ''; - } - // Other picto tool - print '
'; - print $objectstatic->getNomUrl(1, '', '', 0, 1, (isset($conf->global->PROPAL_LIST_SHOW_NOTES) ? $conf->global->PROPAL_LIST_SHOW_NOTES : 1)); - print ''; - print $warnornote; - print ''; - $filename = dol_sanitizeFileName($obj->ref); - $filedir = $conf->propal->multidir_output[$obj->propal_entity].'/'.dol_sanitizeFileName($obj->ref); - $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; - print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); - print '
'; - - print "
'; - print dol_escape_htmltag($obj->ref_client); - print ''; - if ($obj->project_id > 0) { - print $projectstatic->getNomUrl(1); - } - print ''; - if ($obj->project_id > 0) { - print dol_escape_htmltag($projectstatic->title); - } - print ''; - print $companystatic->getNomUrl(1, 'customer', 0, 0, 1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); - print ''; - print $obj->alias; - print ''; - print dol_escape_htmltag($obj->town); - print ''; - print $obj->zip; - print '".$obj->state_name."'; - $tmparray = getCountry($obj->fk_pays, 'all'); - print $tmparray['label']; - print ''; - if (!empty($obj->typent_code)) { - print $typenArray[$obj->typent_code]; - } - print ''; - print dol_print_date($db->jdate($obj->dp), 'day'); - print "'.dol_print_date($db->jdate($obj->dfv), 'day'); - print ' '.dol_print_date($db->jdate($obj->ddelivery), 'day'); - print ' '.dol_print_date($db->jdate($obj->dsignature), 'day'); - print ' '; - $form->form_availability('', $obj->availability, 'none', 1); - print ''; - $form->formSelectShippingMethod('', $obj->fk_shipping_method, 'none', 1); - print ''; - print dol_escape_htmltag($labelInputReason); - print ''; - $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 0, '', 1, $obj->deposit_percent); - print ''; - $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); - print ''.price($obj->total_ht)."'.price($obj->total_tva)."'.price($obj->total_ttc)."'.price($totalInvoicedHT)."'.price($totalInvoicedTTC)."'.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."'; - $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code); - print "'.price($obj->multicurrency_total_ht)."'.price($obj->multicurrency_total_tva)."'.price($obj->multicurrency_total_ttc)."'.price($multicurrency_totalInvoicedHT)."'.price($multicurrency_totalInvoicedTTC)."'; - if ($userstatic->id) { - print $userstatic->getNomUrl(-1); - } - print "'; - if ($obj->socid > 0) { - $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user); - if ($listsalesrepresentatives < 0) { - dol_print_error($db); - } - $nbofsalesrepresentative = count($listsalesrepresentatives); - if ($nbofsalesrepresentative > 6) { - // We print only number - print $nbofsalesrepresentative; - } elseif ($nbofsalesrepresentative > 0) { - $userstatic = new User($db); - $j = 0; - foreach ($listsalesrepresentatives as $val) { - $userstatic->id = $val['id']; - $userstatic->lastname = $val['lastname']; - $userstatic->firstname = $val['firstname']; - $userstatic->email = $val['email']; - $userstatic->statut = $val['statut']; - $userstatic->entity = $val['entity']; - $userstatic->photo = $val['photo']; - $userstatic->login = $val['login']; - $userstatic->office_phone = $val['office_phone']; - $userstatic->office_fax = $val['office_fax']; - $userstatic->user_mobile = $val['user_mobile']; - $userstatic->job = $val['job']; - $userstatic->gender = $val['gender']; - //print '
': - print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2); - $j++; - if ($j < $nbofsalesrepresentative) { - print ' '; - } - //print '
'; + $nbofsalesrepresentative = count($listsalesrepresentatives); + if ($nbofsalesrepresentative > 6) { + // We print only number + print $nbofsalesrepresentative; + } elseif ($nbofsalesrepresentative > 0) { + $userstatic = new User($db); + $j = 0; + foreach ($listsalesrepresentatives as $val) { + $userstatic->id = $val['id']; + $userstatic->lastname = $val['lastname']; + $userstatic->firstname = $val['firstname']; + $userstatic->email = $val['email']; + $userstatic->statut = $val['statut']; + $userstatic->entity = $val['entity']; + $userstatic->photo = $val['photo']; + $userstatic->login = $val['login']; + $userstatic->office_phone = $val['office_phone']; + $userstatic->office_fax = $val['office_fax']; + $userstatic->user_mobile = $val['user_mobile']; + $userstatic->job = $val['job']; + $userstatic->gender = $val['gender']; + //print '
': + print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2); + $j++; + if ($j < $nbofsalesrepresentative) { + print ' '; } + //print '
'; } - //else print $langs->trans("NoSalesRepresentativeAffected"); + } + //else print $langs->trans("NoSalesRepresentativeAffected"); + } else { + print ' '; + } + print '
'.price($marginInfo['pa_total']).''.price($marginInfo['total_margin']).''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, null, null, null, 2).'%').''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, null, null, null, 2).'%').''.price($marginInfo['pa_total']).''.price($marginInfo['total_margin']).''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, null, null, null, 2).'%').''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, null, null, null, 2).'%').''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); - print ''; - print dol_print_date($db->jdate($obj->date_modification), 'dayhour', 'tzuser'); - print ''; - print dol_print_date($db->jdate($obj->date_cloture), 'dayhour', 'tzuser'); - print ''; - print dol_string_nohtmltag($obj->note_public); - print ''; - print dol_string_nohtmltag($obj->note_private); - print ''.$objectstatic->getLibStatut(5).''; - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($obj->rowid, $arrayofselected)) { - $selected = 1; - } - print ''; - } - print '
'; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); + print '
'.$langs->trans("NoRecordFound").'
'."\n"; - print ''."\n"; - - print ''."\n"; - - if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { - $hidegeneratedfilelistifempty = 1; - if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { - $hidegeneratedfilelistifempty = 0; + // Date modification + if (!empty($arrayfields['p.tms']['checked'])) { + print '
'; + print dol_print_date($db->jdate($obj->date_modification), 'dayhour', 'tzuser'); + print ''; + print dol_print_date($db->jdate($obj->date_cloture), 'dayhour', 'tzuser'); + print ''; + print dol_string_nohtmltag($obj->note_public); + print ''; + print dol_string_nohtmltag($obj->note_private); + print ''.$objectstatic->getLibStatut(5).''; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($obj->rowid, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
'.$langs->trans("NoRecordFound").'
'."\n"; +print ''."\n"; + +print ''."\n"; + +if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + $hidegeneratedfilelistifempty = 1; + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { + $hidegeneratedfilelistifempty = 0; + } + + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + $formfile = new FormFile($db); + + // Show list of available documents + $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; + $urlsource .= str_replace('&', '&', $param); + + $filedir = $diroutputmassaction; + $genallowed = $permissiontoread; + $delallowed = $permissiontoadd; + + print $formfile->showdocuments('massfilesarea_proposals', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); +} + +// End of page +llxFooter(); +$db->close(); From 1c2f6533c2eddd37199cdc98d47e3dc3fee02d82 Mon Sep 17 00:00:00 2001 From: AWeerWolf Date: Sat, 9 Mar 2024 18:43:41 +0100 Subject: [PATCH 0760/1862] Adding Hooks in bookkeeping card --- htdocs/accountancy/bookkeeping/card.php | 1163 ++++++++++++----------- 1 file changed, 589 insertions(+), 574 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 66838b8c2e2..075b30174b3 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -94,34 +94,90 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) { /* * Actions */ - -if ($cancel) { - header("Location: ".DOL_URL_ROOT.'/accountancy/bookkeeping/list.php'); - exit; -} - -if ($action == "confirm_update") { - $error = 0; - - if (((float) $debit != 0.0) && ((float) $credit != 0.0)) { - $error++; - setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors'); - $action = 'update'; - } - if (empty($accountingaccount_number) || $accountingaccount_number == '-1') { - $error++; - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors'); - $action = 'update'; +$parameters = array(); //***HOOK +$reshook_onBeforeActions = $hookmanager->executeHooks('onBeforeActions', $parameters, $object, $action); //***HOOK Note that $action and $object may have been modified by some hooks +if ($reshook_onBeforeActions < 0) { //***HOOK + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); //***HOOK +} //***HOOK +if (empty($reshook_onBeforeActions)) { //***HOOK + if ($cancel) { + header("Location: ".DOL_URL_ROOT.'/accountancy/bookkeeping/list.php'); + exit; } + + if ($action == "confirm_update") { + $error = 0; - if (!$error) { - $object = new BookKeeping($db); - - $result = $object->fetch($id, null, $mode); - if ($result < 0) { + if (((float) $debit != 0.0) && ((float) $credit != 0.0)) { $error++; - setEventMessages($object->error, $object->errors, 'errors'); - } else { + setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors'); + $action = 'update'; + } + if (empty($accountingaccount_number) || $accountingaccount_number == '-1') { + $error++; + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors'); + $action = 'update'; + } + + if (!$error) { + $object = new BookKeeping($db); + + $result = $object->fetch($id, null, $mode); + if ($result < 0) { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } else { + $object->numero_compte = $accountingaccount_number; + $object->subledger_account = $subledger_account; + $object->subledger_label = $subledger_label; + $object->label_compte = $accountingaccount_label; + $object->label_operation = $label_operation; + $object->debit = $debit; + $object->credit = $credit; + + if ((float) $debit != 0.0) { + $object->montant = $debit; // deprecated + $object->amount = $debit; + $object->sens = 'D'; + } + if ((float) $credit != 0.0) { + $object->montant = $credit; // deprecated + $object->amount = $credit; + $object->sens = 'C'; + } + + $result = $object->update($user, false, $mode); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } else { + if ($mode != '_tmp') { + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + } + + $debit = 0; + $credit = 0; + + $action = ''; + } + } + } + } elseif ($action == "add") { + $error = 0; + + if (((float) $debit != 0.0) && ((float) $credit != 0.0)) { + $error++; + setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors'); + $action = ''; + } + if (empty($accountingaccount_number) || $accountingaccount_number == '-1') { + $error++; + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors'); + $action = ''; + } + + if (!$error) { + $object = new BookKeeping($db); + $object->numero_compte = $accountingaccount_number; $object->subledger_account = $subledger_account; $object->subledger_label = $subledger_label; @@ -129,19 +185,28 @@ if ($action == "confirm_update") { $object->label_operation = $label_operation; $object->debit = $debit; $object->credit = $credit; + $object->doc_date = (string) GETPOST('doc_date', 'alpha'); + $object->doc_type = (string) GETPOST('doc_type', 'alpha'); + $object->piece_num = $piece_num; + $object->doc_ref = (string) GETPOST('doc_ref', 'alpha'); + $object->code_journal = $journal_code; + $object->journal_label = $journal_label; + $object->fk_doc = GETPOSTINT('fk_doc'); + $object->fk_docdet = GETPOSTINT('fk_docdet'); if ((float) $debit != 0.0) { $object->montant = $debit; // deprecated $object->amount = $debit; $object->sens = 'D'; } + if ((float) $credit != 0.0) { $object->montant = $credit; // deprecated $object->amount = $credit; $object->sens = 'C'; } - $result = $object->update($user, false, $mode); + $result = $object->createStd($user, false, $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -155,113 +220,70 @@ if ($action == "confirm_update") { $action = ''; } } - } -} elseif ($action == "add") { - $error = 0; - - if (((float) $debit != 0.0) && ((float) $credit != 0.0)) { - $error++; - setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors'); - $action = ''; - } - if (empty($accountingaccount_number) || $accountingaccount_number == '-1') { - $error++; - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors'); - $action = ''; - } - - if (!$error) { + } elseif ($action == "confirm_delete") { $object = new BookKeeping($db); - $object->numero_compte = $accountingaccount_number; - $object->subledger_account = $subledger_account; - $object->subledger_label = $subledger_label; - $object->label_compte = $accountingaccount_label; - $object->label_operation = $label_operation; - $object->debit = $debit; - $object->credit = $credit; - $object->doc_date = (string) GETPOST('doc_date', 'alpha'); - $object->doc_type = (string) GETPOST('doc_type', 'alpha'); - $object->piece_num = $piece_num; - $object->doc_ref = (string) GETPOST('doc_ref', 'alpha'); - $object->code_journal = $journal_code; - $object->journal_label = $journal_label; - $object->fk_doc = GETPOSTINT('fk_doc'); - $object->fk_docdet = GETPOSTINT('fk_docdet'); + $result = $object->fetch($id, null, $mode); + $piece_num = $object->piece_num; - if ((float) $debit != 0.0) { - $object->montant = $debit; // deprecated - $object->amount = $debit; - $object->sens = 'D'; - } - - if ((float) $credit != 0.0) { - $object->montant = $credit; // deprecated - $object->amount = $credit; - $object->sens = 'C'; - } - - $result = $object->createStd($user, false, $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { - if ($mode != '_tmp') { - setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + $result = $object->delete($user, false, $mode); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); } + } + $action = ''; + } elseif ($action == "confirm_create") { + $error = 0; - $debit = 0; - $credit = 0; + $object = new BookKeeping($db); - $action = ''; + if (!$journal_code || $journal_code == '-1') { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Journal")), null, 'errors'); + $action = 'create'; + $error++; + } + if (!GETPOST('doc_ref', 'alpha')) { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Piece")), null, 'errors'); + $action = 'create'; + $error++; + } + + if (!$error) { + $object->label_compte = ''; + $object->debit = 0; + $object->credit = 0; + $object->doc_date = $date_start = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); + $object->doc_type = GETPOST('doc_type', 'alpha'); + $object->piece_num = GETPOSTINT('next_num_mvt'); + $object->doc_ref = GETPOST('doc_ref', 'alpha'); + $object->code_journal = $journal_code; + $object->journal_label = $journal_label; + $object->fk_doc = 0; + $object->fk_docdet = 0; + $object->montant = 0; // deprecated + $object->amount = 0; + + $result = $object->createStd($user, 0, $mode); + $reshook = $hookmanager->executeHooks('onConfirmCreate_onAfterCreateEmptyLine', $parameters, $object, $action); //***HOOK Note that $action and $object may have been modified by some hooks + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } else { + if ($mode != '_tmp') { + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + } + $action = ''; + $id = $object->id; + $piece_num = $object->piece_num; + } } } -} elseif ($action == "confirm_delete") { - $object = new BookKeeping($db); - $result = $object->fetch($id, null, $mode); - $piece_num = $object->piece_num; - - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } else { - $result = $object->delete($user, false, $mode); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } - } - $action = ''; -} elseif ($action == "confirm_create") { - $error = 0; - - $object = new BookKeeping($db); - - if (!$journal_code || $journal_code == '-1') { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Journal")), null, 'errors'); - $action = 'create'; - $error++; - } - if (!GETPOST('doc_ref', 'alpha')) { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Piece")), null, 'errors'); - $action = 'create'; - $error++; - } - - if (!$error) { - $object->label_compte = ''; - $object->debit = 0; - $object->credit = 0; - $object->doc_date = $date_start = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); - $object->doc_type = GETPOST('doc_type', 'alpha'); - $object->piece_num = GETPOSTINT('next_num_mvt'); - $object->doc_ref = GETPOST('doc_ref', 'alpha'); - $object->code_journal = $journal_code; - $object->journal_label = $journal_label; - $object->fk_doc = 0; - $object->fk_docdet = 0; - $object->montant = 0; // deprecated - $object->amount = 0; - - $result = $object->createStd($user, 0, $mode); + if ($action == 'setdate') { + $datedoc = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); + $result = $object->updateByMvt($piece_num, 'doc_date', $db->idate($datedoc), $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -269,440 +291,405 @@ if ($action == "confirm_update") { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } $action = ''; - $id = $object->id; - $piece_num = $object->piece_num; } } -} -if ($action == 'setdate') { - $datedoc = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); - $result = $object->updateByMvt($piece_num, 'doc_date', $db->idate($datedoc), $mode); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } else { - if ($mode != '_tmp') { - setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + if ($action == 'setjournal') { + $result = $object->updateByMvt($piece_num, 'code_journal', $journal_code, $mode); + $result = $object->updateByMvt($piece_num, 'journal_label', $journal_label, $mode); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } else { + if ($mode != '_tmp') { + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + } + $action = ''; } - $action = ''; } -} -if ($action == 'setjournal') { - $result = $object->updateByMvt($piece_num, 'code_journal', $journal_code, $mode); - $result = $object->updateByMvt($piece_num, 'journal_label', $journal_label, $mode); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } else { - if ($mode != '_tmp') { - setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + if ($action == 'setdocref') { + $refdoc = GETPOST('doc_ref', 'alpha'); + $result = $object->updateByMvt($piece_num, 'doc_ref', $refdoc, $mode); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } else { + if ($mode != '_tmp') { + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + } + $action = ''; } - $action = ''; } -} -if ($action == 'setdocref') { - $refdoc = GETPOST('doc_ref', 'alpha'); - $result = $object->updateByMvt($piece_num, 'doc_ref', $refdoc, $mode); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } else { - if ($mode != '_tmp') { - setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + // Validate transaction + if ($action == 'valid') { + $result = $object->transformTransaction(0, $piece_num); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } else { + header("Location: list.php?sortfield=t.piece_num&sortorder=asc"); + exit; } - $action = ''; } -} - -// Validate transaction -if ($action == 'valid') { - $result = $object->transformTransaction(0, $piece_num); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } else { - header("Location: list.php?sortfield=t.piece_num&sortorder=asc"); - exit; - } -} +} //***HOOK +$reshook_onAfterActions = $hookmanager->executeHooks('onAfterActions', $parameters, $object, $action); ///***HOOK Note that $action and $object may have been modified by some hooks /* * View */ +$reshook_onBeforeView = $hookmanager->executeHooks('onBeforeView', $parameters, $object, $action); //***HOOK Note that $action and $object may have been modified by some hooks +if ($reshook_onBeforeView < 0) { //***HOOK + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); //***HOOK Error +} //***HOOK +if (empty($reshook_onBeforeView)) { //***HOOK Return 0 so execute the standard prog. + $form = new Form($db); + $formaccounting = new FormAccounting($db); -$form = new Form($db); -$formaccounting = new FormAccounting($db); + $title = $langs->trans("CreateMvts"); + $help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double'; + llxHeader('', $title, $help_url); -$title = $langs->trans("CreateMvts"); -$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double'; -llxHeader('', $title, $help_url); - -// Confirmation to delete the command -if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$id.'&mode='.$mode, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'confirm_delete', '', 0, 1); - print $formconfirm; -} - -if ($action == 'create') { - print load_fiche_titre($title); - - $object = new BookKeeping($db); - $next_num_mvt = $object->getNextNumMvt('_tmp'); - - if (empty($next_num_mvt)) { - dol_print_error(null, 'Failed to get next piece number'); + // Confirmation to delete the command + if ($action == 'delete') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$id.'&mode='.$mode, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'confirm_delete', '', 0, 1); + print $formconfirm; } - print '
'; - if ($optioncss != '') { - print ''; - } - print ''; - print ''."\n"; - print ''."\n"; - print ''."\n"; + if ($action == 'create') { + print load_fiche_titre($title); - print dol_get_fiche_head(); + $object = new BookKeeping($db); + $next_num_mvt = $object->getNextNumMvt('_tmp'); - print ''; - - /*print ''; - print ''; - print ''; - print '';*/ - - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - - /* - print ''; - print ''; - print ''; - print ''; - */ - - print '
' . $langs->trans("NumPiece") . '' . $next_num_mvt . '
'.$langs->trans("Docdate").''; - print $form->selectDate('', 'doc_date', 0, 0, 0, "create_mvt", 1, 1); - print '
'.$langs->trans("Codejournal").''.$formaccounting->select_journal($journal_code, 'code_journal', 0, 0, 1, 1).'
'.$langs->trans("Piece").'
' . $langs->trans("Doctype") . '
'; - - print dol_get_fiche_end(); - - print $form->buttonsSaveCancel("Create"); - - print '
'; -} else { - $object = new BookKeeping($db); - $result = $object->fetchPerMvt($piece_num, $mode); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } - - if (!empty($object->piece_num)) { - $backlink = ''.$langs->trans('BackToList').''; - - if ($mode == '_tmp') { - print load_fiche_titre($langs->trans("CreateMvts"), $backlink); - } else { - print load_fiche_titre($langs->trans("UpdateMvts"), $backlink); + if (empty($next_num_mvt)) { + dol_print_error(null, 'Failed to get next piece number'); } - $head = array(); - $h = 0; - $head[$h][0] = $_SERVER['PHP_SELF'].'?piece_num='.$object->piece_num.($mode ? '&mode='.$mode : ''); - $head[$h][1] = $langs->trans("Transaction"); - $head[$h][2] = 'transaction'; - $h++; + print '
'; + if ($optioncss != '') { + print ''; + } + print ''; + print ''."\n"; + print ''."\n"; + print ''."\n"; - print dol_get_fiche_head($head, 'transaction', '', -1); + print dol_get_fiche_head(); - //dol_banner_tab($object, '', $backlink); + print ''; - print '
'; - print '
'; + /*print '
'; + print ''; + print ''; + print '';*/ - print '
'; - print '
' . $langs->trans("NumPiece") . '' . $next_num_mvt . '
'; - - // Account movement print ''; - print ''; - print ''; - print ''; - - // Date - print ''; + print ''; print ''; - // Journal - print ''; + print ''; + print ''; + print ''; print ''; - // Ref document - print ''; + print ''; + print ''; + print ''; print ''; + /* + print ''; + print ''; + print ''; + print ''; + */ + $reshook_onCreate_onAfterShowFields = $hookmanager->executeHooks('onCreate_onAfterShowFields', $parameters, $object, $action); //***HOOK Note that $action and $object may have been modified by some hooks + print '
'.$langs->trans("NumMvts").''.($mode == '_tmp' ? ''.$langs->trans("Draft").'' : $object->piece_num).'
'; - print ''; - if ($action != 'editdate') { - print ''; - } - print '
'; - print $langs->trans('Docdate'); - print 'piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'
'; - print '
'; - if ($action == 'editdate') { - print ''; - if ($optioncss != '') { - print ''; - } - print ''; - print ''; - print ''; - print $form->selectDate($object->doc_date ? $object->doc_date : - 1, 'doc_date', 0, 0, 0, "setdate"); - print ''; - print ''; - } else { - print $object->doc_date ? dol_print_date($object->doc_date, 'day') : ' '; - } + print ''.$langs->trans("Docdate").''; + print $form->selectDate('', 'doc_date', 0, 0, 0, "create_mvt", 1, 1); print '
'; - print ''; - if ($action != 'editjournal') { - print ''; - } - print '
'; - print $langs->trans('Codejournal'); - print 'piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'
'; - print '
'; - if ($action == 'editjournal') { - print '
'; - if ($optioncss != '') { - print ''; - } - print ''; - print ''; - print ''; - print $formaccounting->select_journal($object->code_journal, 'code_journal', 0, 0, array(), 1, 1); - print ''; - print '
'; - } else { - print $object->code_journal; - } - print '
'.$langs->trans("Codejournal").''.$formaccounting->select_journal($journal_code, 'code_journal', 0, 0, 1, 1).'
'; - print ''; - if ($action != 'editdocref') { - print ''; - } - print '
'; - print $langs->trans('Piece'); - print 'piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'
'; - print '
'; - if ($action == 'editdocref') { - print '
'; - if ($optioncss != '') { - print ''; - } - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'; - } else { - print $object->doc_ref; - } - print '
'.$langs->trans("Piece").'
' . $langs->trans("Doctype") . '
'; - print ''; - - print '
'; - - print '
'; - print ''; - - // Doc type - if (!empty($object->doc_type)) { - print ''; - print ''; - print ''; - print ''; - } - - // Date document creation - print ''; - print ''; - print ''; - print ''; - - // Don't show in tmp mode, inevitably empty - if ($mode != "_tmp") { - // Date document export - print ''; - print ''; - print ''; - print ''; - - // Date document validation - print ''; - print ''; - print ''; - print ''; - } - - // Validate - /* - print ''; - print ''; - print ''; - print ''; - */ - - // check data - /* - print ''; - print ''; - if ($object->doc_type == 'customer_invoice') - { - $sqlmid = 'SELECT rowid as ref'; - $sqlmid .= " FROM ".MAIN_DB_PREFIX."facture as fac"; - $sqlmid .= " WHERE fac.rowid=" . ((int) $object->fk_doc); - dol_syslog("accountancy/bookkeeping/card.php::sqlmid=" . $sqlmid, LOG_DEBUG); - $resultmid = $db->query($sqlmid); - if ($resultmid) { - $objmid = $db->fetch_object($resultmid); - $invoicestatic = new Facture($db); - $invoicestatic->fetch($objmid->ref); - $ref=$langs->trans("Invoice").' '.$invoicestatic->getNomUrl(1); - } - else dol_print_error($db); - } - print ''; - print ''; - */ - print "
'.$langs->trans("Doctype").''.$object->doc_type.'
'.$langs->trans("DateCreation").''; - print $object->date_creation ? dol_print_date($object->date_creation, 'day') : ' '; - print '
' . $langs->trans("DateExport") . ''; - print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' '; - print '
' . $langs->trans("DateValidation") . ''; - print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' '; - print '
' . $langs->trans("Status") . ''; - if (empty($object->validated)) { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - } else { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } - print '
' . $langs->trans("Control") . '' . $ref .'
\n"; - - print '
'; - print dol_get_fiche_end(); - print '
'; - - print '
'; - - $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt + print $form->buttonsSaveCancel("Create"); + print ''; + } else { + $object = new BookKeeping($db); + $result = $object->fetchPerMvt($piece_num, $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); - } else { - // List of movements - print load_fiche_titre($langs->trans("ListeMvts"), '', ''); + } - print '
'; - if ($optioncss != '') { - print ''; + if (!empty($object->piece_num)) { + $backlink = ''.$langs->trans('BackToList').''; + + if ($mode == '_tmp') { + print load_fiche_titre($langs->trans("CreateMvts"), $backlink); + } else { + print load_fiche_titre($langs->trans("UpdateMvts"), $backlink); } - print ''; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - if (count($object->linesmvt) > 0) { - print '
'; - print ''; + $head = array(); + $h = 0; + $head[$h][0] = $_SERVER['PHP_SELF'].'?piece_num='.$object->piece_num.($mode ? '&mode='.$mode : ''); + $head[$h][1] = $langs->trans("Transaction"); + $head[$h][2] = 'transaction'; + $h++; - $total_debit = 0; - $total_credit = 0; + print dol_get_fiche_head($head, 'transaction', '', -1); - print ''; + //dol_banner_tab($object, '', $backlink); - print_liste_field_titre("AccountAccountingShort"); - print_liste_field_titre("SubledgerAccount"); - print_liste_field_titre("LabelOperation"); - print_liste_field_titre("AccountingDebit", "", "", "", "", 'class="right"'); - print_liste_field_titre("AccountingCredit", "", "", "", "", 'class="right"'); - if (empty($object->date_validation)) { - print_liste_field_titre("Action", "", "", "", "", 'width="60"', "", "", 'center '); + print '
'; + print '
'; + + print '
'; + print '
'; + + // Account movement + print ''; + print ''; + print ''; + print ''; + + // Date + print ''; + print ''; + + // Journal + print ''; + print ''; + + // Ref document + print ''; + print ''; + + print '
'.$langs->trans("NumMvts").''.($mode == '_tmp' ? ''.$langs->trans("Draft").'' : $object->piece_num).'
'; + print ''; + if ($action != 'editdate') { + print ''; + } + print '
'; + print $langs->trans('Docdate'); + print 'piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'
'; + print '
'; + if ($action == 'editdate') { + print ''; + if ($optioncss != '') { + print ''; + } + print ''; + print ''; + print ''; + print $form->selectDate($object->doc_date ? $object->doc_date : - 1, 'doc_date', 0, 0, 0, "setdate"); + print ''; + print ''; + } else { + print $object->doc_date ? dol_print_date($object->doc_date, 'day') : ' '; + } + print '
'; + print ''; + if ($action != 'editjournal') { + print ''; + } + print '
'; + print $langs->trans('Codejournal'); + print 'piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'
'; + print '
'; + if ($action == 'editjournal') { + print '
'; + if ($optioncss != '') { + print ''; + } + print ''; + print ''; + print ''; + print $formaccounting->select_journal($object->code_journal, 'code_journal', 0, 0, array(), 1, 1); + print ''; + print '
'; + } else { + print $object->code_journal; + } + print '
'; + print ''; + if ($action != 'editdocref') { + print ''; + } + print '
'; + print $langs->trans('Piece'); + print 'piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'
'; + print '
'; + if ($action == 'editdocref') { + print '
'; + if ($optioncss != '') { + print ''; + } + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + } else { + print $object->doc_ref; + } + print '
'; + + print '
'; + + print '
'; + + print '
'; + print ''; + + // Doc type + if (!empty($object->doc_type)) { + print ''; + print ''; + print ''; + print ''; + } + + // Date document creation + print ''; + print ''; + print ''; + print ''; + + // Don't show in tmp mode, inevitably empty + if ($mode != "_tmp") { + // Date document export + print ''; + print ''; + print ''; + print ''; + + // Date document validation + print ''; + print ''; + print ''; + print ''; + } + + // Validate + /* + print ''; + print ''; + print ''; + print ''; + */ - print "\n"; + // check data + /* + print ''; + print ''; + if ($object->doc_type == 'customer_invoice') + { + $sqlmid = 'SELECT rowid as ref'; + $sqlmid .= " FROM ".MAIN_DB_PREFIX."facture as fac"; + $sqlmid .= " WHERE fac.rowid=" . ((int) $object->fk_doc); + dol_syslog("accountancy/bookkeeping/card.php::sqlmid=" . $sqlmid, LOG_DEBUG); + $resultmid = $db->query($sqlmid); + if ($resultmid) { + $objmid = $db->fetch_object($resultmid); + $invoicestatic = new Facture($db); + $invoicestatic->fetch($objmid->ref); + $ref=$langs->trans("Invoice").' '.$invoicestatic->getNomUrl(1); + } + else dol_print_error($db); + } + print ''; + print ''; + */ + print "
'.$langs->trans("Doctype").''.$object->doc_type.'
'.$langs->trans("DateCreation").''; + print $object->date_creation ? dol_print_date($object->date_creation, 'day') : ' '; + print '
' . $langs->trans("DateExport") . ''; + print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' '; + print '
' . $langs->trans("DateValidation") . ''; + print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' '; + print '
' . $langs->trans("Status") . ''; + if (empty($object->validated)) { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; } else { - print_liste_field_titre(""); + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; } + print '
' . $langs->trans("Control") . '' . $ref .'
\n"; - // Add an empty line if there is not yet - if (!empty($object->linesmvt[0])) { - $tmpline = $object->linesmvt[0]; - if (!empty($tmpline->numero_compte)) { - $line = new BookKeepingLine($db); - $object->linesmvt[] = $line; + print '
'; + + print dol_get_fiche_end(); + + print '
'; + + print '
'; + + $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt + + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } else { + // List of movements + print load_fiche_titre($langs->trans("ListeMvts"), '', ''); + + print '
'; + if ($optioncss != '') { + print ''; + } + print ''; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + + if (count($object->linesmvt) > 0) { + print '
'; + print ''; + + $total_debit = 0; + $total_credit = 0; + + print ''; + + print_liste_field_titre("AccountAccountingShort"); + print_liste_field_titre("SubledgerAccount"); + print_liste_field_titre("LabelOperation"); + print_liste_field_titre("AccountingDebit", "", "", "", "", 'class="right"'); + print_liste_field_titre("AccountingCredit", "", "", "", "", 'class="right"'); + if (empty($object->date_validation)) { + print_liste_field_titre("Action", "", "", "", "", 'width="60"', "", "", 'center '); + } else { + print_liste_field_titre(""); } - } - foreach ($object->linesmvt as $line) { - print ''; - $total_debit += $line->debit; - $total_credit += $line->credit; + print "\n"; - if ($action == 'update' && $line->id == $id) { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - } elseif (empty($line->numero_compte) || (empty($line->debit) && empty($line->credit))) { - if ($action == "" || $action == 'add') { - print ''; + } + + foreach ($object->linesmvt as $line) { + print ''; + $total_debit += $line->debit; + $total_credit += $line->credit; + + if ($action == 'update' && $line->id == $id) { + print ''; print ''; print ''; - print ''; - print ''; - print ''; - print ''; - } - } else { - print ''; - $resultfetch = $accountingaccount->fetch(null, $line->numero_compte, true); - print ''; + print ''; + print ''; + print ''; + } elseif (empty($line->numero_compte) || (empty($line->debit) && empty($line->credit))) { + if ($action == "" || $action == 'add') { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } } else { - print $line->numero_compte.' ('.$langs->trans("AccountRemovedFromCurrentChartOfAccount").')'; - } - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + $resultfetch = $accountingaccount->fetch(null, $line->numero_compte, true); + print ''; + print ''; + print ''; + print ''; + print ''; - print ''; + } + print "\n"; + } + + $total_debit = price2num($total_debit, 'MT'); + $total_credit = price2num($total_credit, 'MT'); + + if ($total_debit != $total_credit) { + setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings'); + } + + print '
'; - print $formaccounting->select_account((GETPOSTISSET("accountingaccount_number") ? GETPOST("accountingaccount_number", "alpha") : $line->numero_compte), 'accountingaccount_number', 1, array(), 1, 1, 'minwidth200 maxwidth500'); - print ''; - // TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because: - // It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases. - // Also, it is not possible to use a value that is not in the list. - // Also, the label is not automatically filled when a value is selected. - if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) { - print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); - } else { - print 'subledger_account).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">'; + // Add an empty line if there is not yet + if (!empty($object->linesmvt[0])) { + $tmpline = $object->linesmvt[0]; + if (!empty($tmpline->numero_compte)) { + $line = new BookKeepingLine($db); + $object->linesmvt[] = $line; } - // Add also input for subledger label - print '
subledger_label).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">'; - print '
label_operation).'">debit)).'">credit)).'">'; - print ''."\n"; - print ''; - print '
'; - print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, 'minwidth200 maxwidth500'); + print $formaccounting->select_account((GETPOSTISSET("accountingaccount_number") ? GETPOST("accountingaccount_number", "alpha") : $line->numero_compte), 'accountingaccount_number', 1, array(), 1, 1, 'minwidth200 maxwidth500'); print ''; // TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because: @@ -710,99 +697,127 @@ if ($action == 'create') { // Also, it is not possible to use a value that is not in the list. // Also, the label is not automatically filled when a value is selected. if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) { - print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); + print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); } else { - print ''; + print 'subledger_account).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">'; } - print '
'; + // Add also input for subledger label + print '
subledger_label).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">'; print '
'; - if ($resultfetch > 0) { - print $accountingaccount->getNomUrl(0, 1, 1, '', 0); + print 'label_operation).'">debit)).'">credit)).'">'; + print ''."\n"; + print ''; + print ''; + print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, 'minwidth200 maxwidth500'); + print ''; + // TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because: + // It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases. + // Also, it is not possible to use a value that is not in the list. + // Also, the label is not automatically filled when a value is selected. + if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) { + print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); + } else { + print ''; + } + print '
'; + print '
'.length_accounta($line->subledger_account); - if ($line->subledger_label) { - print ' - '.$line->subledger_label.''; - } - print ''.$line->label_operation.''.($line->debit != 0 ? price($line->debit) : '').''.($line->credit != 0 ? price($line->credit) : '').''; + if ($resultfetch > 0) { + print $accountingaccount->getNomUrl(0, 1, 1, '', 0); + } else { + print $line->numero_compte.' ('.$langs->trans("AccountRemovedFromCurrentChartOfAccount").')'; + } + print ''.length_accounta($line->subledger_account); + if ($line->subledger_label) { + print ' - '.$line->subledger_label.''; + } + print ''.$line->label_operation.''.($line->debit != 0 ? price($line->debit) : '').''.($line->credit != 0 ? price($line->credit) : '').''; - if (empty($line->date_export) && empty($line->date_validation)) { - print 'id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">'; - print img_edit('', 0, 'class="marginrightonly"'); - print '  '; - } else { - print ''; - print img_edit($langs->trans("ForbiddenTransactionAlreadyExported"), 0, 'class="marginrightonly"'); - print '  '; - } - - if (empty($line->date_validation)) { - $actiontodelete = 'delete'; - if ($mode == '_tmp' || $action != 'delmouv') { - $actiontodelete = 'confirm_delete'; + print ''; + if (empty($line->date_export) && empty($line->date_validation)) { + print 'id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">'; + print img_edit('', 0, 'class="marginrightonly"'); + print '  '; + } else { + print ''; + print img_edit($langs->trans("ForbiddenTransactionAlreadyExported"), 0, 'class="marginrightonly"'); + print '  '; } - print ''; - print img_delete(); - print ''; + if (empty($line->date_validation)) { + $actiontodelete = 'delete'; + if ($mode == '_tmp' || $action != 'delmouv') { + $actiontodelete = 'confirm_delete'; + } + + print ''; + print img_delete(); + print ''; + } else { + print ''; + print img_delete($langs->trans("ForbiddenTransactionAlreadyValidated")); + print ''; + } + + print '
'; + print '
'; + + if ($mode == '_tmp' && $action == '') { + print '
'; + print '
'; + if ($total_debit == $total_credit) { + print ''.$langs->trans("ValidTransaction").''; } else { - print ''; - print img_delete($langs->trans("ForbiddenTransactionAlreadyValidated")); - print ''; + print ''; } - print '
'; - print ''; - - if ($mode == '_tmp' && $action == '') { - print '
'; - print '
'; - if ($total_debit == $total_credit) { - print ''.$langs->trans("ValidTransaction").''; - } else { - print ''; - } - - print '   '; - print ''.$langs->trans("Cancel").''; - - print "
"; - } + print ''; } - - print ''; + } else { + print load_fiche_titre($langs->trans("NoRecords")); } - } else { - print load_fiche_titre($langs->trans("NoRecords")); } -} +} //***HOOK +$reshook_onAfterView = $hookmanager->executeHooks('onAfterView', $parameters, $object, $action); //***HOOK Note that $action and $object may have been modified by some hooks print dol_get_fiche_end(); From 0c91e3fe068af441c38b38796a6914f35eff19b1 Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Sat, 9 Mar 2024 22:01:30 +0100 Subject: [PATCH 0761/1862] attempt at fixing #28645 --- htdocs/compta/bank/class/api_bankaccounts.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index 2f5f532e746..5dcb390ace3 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -187,6 +187,7 @@ class BankAccounts extends DolibarrApi * @param string $description Description of the internal wire transfer {@from body}{@required true} * @param float $amount Amount to transfer from the source to the destination BankAccount {@from body}{@required true} * @param float $amount_to Amount to transfer to the destination BankAccount (only when accounts does not share the same currency) {@from body}{@required false} + * @param string $cheque_number Cheque numero {@from body} * * @url POST /transfer * @@ -199,7 +200,7 @@ class BankAccounts extends DolibarrApi * @throws RestException 422 Unprocessable Entity: Refer to detailed exception message for the cause * @throws RestException 500 Internal Server Error: Error(s) returned by the RDBMS */ - public function transfer($bankaccount_from_id = 0, $bankaccount_to_id = 0, $date = null, $description = "", $amount = 0.0, $amount_to = 0.0) + public function transfer($bankaccount_from_id = 0, $bankaccount_to_id = 0, $date = null, $description = "", $amount = 0.0, $amount_to = 0.0, $cheque_number = "" ) { if (!DolibarrApiAccess::$user->hasRight('banque', 'configurer')) { throw new RestException(403); @@ -257,21 +258,21 @@ class BankAccounts extends DolibarrApi // Clean data $description = sanitizeVal($description, 'alphanohtml'); - + $cheque_number = sanitizeVal($cheque_number); /** * Creating bank line records */ if (!$error) { - $bank_line_id_from = $accountfrom->addline($date, $typefrom, $description, -1 * price2num($amount), '', '', $user); + $bank_line_id_from = $accountfrom->addline($date, $typefrom, $description, -1 * price2num($amount), '', '', $user, $cheque_number); } if (!($bank_line_id_from > 0)) { $error++; } if (!$error) { - $bank_line_id_to = $accountto->addline($date, $typeto, $description, price2num($amount_to), '', '', $user); + $bank_line_id_to = $accountto->addline($date, $typeto, $description, price2num($amount_to), '', '', $user, $cheque_number); } if (!($bank_line_id_to > 0)) { $error++; From 95d644615c71c4cf8a34712274fb6fa2756919c2 Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Sat, 9 Mar 2024 22:14:02 +0100 Subject: [PATCH 0762/1862] remove trailing whitespace --- htdocs/compta/bank/class/api_bankaccounts.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index 5dcb390ace3..47eb9bf84a6 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -200,7 +200,7 @@ class BankAccounts extends DolibarrApi * @throws RestException 422 Unprocessable Entity: Refer to detailed exception message for the cause * @throws RestException 500 Internal Server Error: Error(s) returned by the RDBMS */ - public function transfer($bankaccount_from_id = 0, $bankaccount_to_id = 0, $date = null, $description = "", $amount = 0.0, $amount_to = 0.0, $cheque_number = "" ) + public function transfer($bankaccount_from_id = 0, $bankaccount_to_id = 0, $date = null, $description = "", $amount = 0.0, $amount_to = 0.0, $cheque_number = "") { if (!DolibarrApiAccess::$user->hasRight('banque', 'configurer')) { throw new RestException(403); From 668d2fa6e88b0cfdcd9e71efeb54b41f197cdf7f Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Sat, 9 Mar 2024 22:43:53 +0100 Subject: [PATCH 0763/1862] making param string cheque_number line up and conform better with previous code --- htdocs/compta/bank/class/api_bankaccounts.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index 47eb9bf84a6..c2f57b76056 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -187,7 +187,7 @@ class BankAccounts extends DolibarrApi * @param string $description Description of the internal wire transfer {@from body}{@required true} * @param float $amount Amount to transfer from the source to the destination BankAccount {@from body}{@required true} * @param float $amount_to Amount to transfer to the destination BankAccount (only when accounts does not share the same currency) {@from body}{@required false} - * @param string $cheque_number Cheque numero {@from body} + * @param string $cheque_number Cheque numero {@from body}{@required false} * * @url POST /transfer * From f1715a5209a5ddb4d8fa3e17093542d985027b3b Mon Sep 17 00:00:00 2001 From: AWeerWolf Date: Sat, 9 Mar 2024 22:44:39 +0100 Subject: [PATCH 0764/1862] Suppressing White soace at end of lines --- htdocs/accountancy/bookkeeping/card.php | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 075b30174b3..ffd10c4ccff 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -94,12 +94,12 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) { /* * Actions */ -$parameters = array(); //***HOOK -$reshook_onBeforeActions = $hookmanager->executeHooks('onBeforeActions', $parameters, $object, $action); //***HOOK Note that $action and $object may have been modified by some hooks -if ($reshook_onBeforeActions < 0) { //***HOOK - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); //***HOOK -} //***HOOK -if (empty($reshook_onBeforeActions)) { //***HOOK +$parameters = array(); +$reshook_onBeforeActions = $hookmanager->executeHooks('onBeforeActions', $parameters, $object, $action); +if ($reshook_onBeforeActions < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook_onBeforeActions)) { if ($cancel) { header("Location: ".DOL_URL_ROOT.'/accountancy/bookkeeping/list.php'); exit; @@ -267,7 +267,7 @@ if (empty($reshook_onBeforeActions)) { //***HOOK $object->amount = 0; $result = $object->createStd($user, 0, $mode); - $reshook = $hookmanager->executeHooks('onConfirmCreate_onAfterCreateEmptyLine', $parameters, $object, $action); //***HOOK Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('onConfirmCreate_onAfterCreateEmptyLine', $parameters, $object, $action); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -330,18 +330,18 @@ if (empty($reshook_onBeforeActions)) { //***HOOK exit; } } -} //***HOOK -$reshook_onAfterActions = $hookmanager->executeHooks('onAfterActions', $parameters, $object, $action); ///***HOOK Note that $action and $object may have been modified by some hooks +} +$reshook_onAfterActions = $hookmanager->executeHooks('onAfterActions', $parameters, $object, $action); /* * View */ -$reshook_onBeforeView = $hookmanager->executeHooks('onBeforeView', $parameters, $object, $action); //***HOOK Note that $action and $object may have been modified by some hooks -if ($reshook_onBeforeView < 0) { //***HOOK - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); //***HOOK Error -} //***HOOK -if (empty($reshook_onBeforeView)) { //***HOOK Return 0 so execute the standard prog. +$reshook_onBeforeView = $hookmanager->executeHooks('onBeforeView', $parameters, $object, $action); +if ($reshook_onBeforeView < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook_onBeforeView)) { $form = new Form($db); $formaccounting = new FormAccounting($db); @@ -406,7 +406,7 @@ if (empty($reshook_onBeforeView)) { //***HOOK Return 0 so execute the standard p print '
'; @@ -816,8 +816,8 @@ if (empty($reshook_onBeforeView)) { //***HOOK Return 0 so execute the standard p print load_fiche_titre($langs->trans("NoRecords")); } } -} //***HOOK -$reshook_onAfterView = $hookmanager->executeHooks('onAfterView', $parameters, $object, $action); //***HOOK Note that $action and $object may have been modified by some hooks +} +$reshook_onAfterView = $hookmanager->executeHooks('onAfterView', $parameters, $object, $action); print dol_get_fiche_end(); From 8906d734dbc3154e77d1f0f9dcc87e03ddd43abb Mon Sep 17 00:00:00 2001 From: AWeerWolf Date: Sat, 9 Mar 2024 22:49:06 +0100 Subject: [PATCH 0765/1862] Still some White Spaces --- htdocs/accountancy/bookkeeping/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index ffd10c4ccff..30702e44717 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -104,7 +104,7 @@ if (empty($reshook_onBeforeActions)) { header("Location: ".DOL_URL_ROOT.'/accountancy/bookkeeping/list.php'); exit; } - + if ($action == "confirm_update") { $error = 0; From 96eb651f954b1fef6db581ca35c1d12ab8a98545 Mon Sep 17 00:00:00 2001 From: AWeerWolf Date: Sat, 9 Mar 2024 22:53:16 +0100 Subject: [PATCH 0766/1862] White spaces is hell --- htdocs/accountancy/bookkeeping/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 30702e44717..8449bc8028b 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -407,7 +407,7 @@ if (empty($reshook_onBeforeView)) { print '
'; print dol_get_fiche_end(); From e6a6ec737ed8b07b81ed963b90667ed40d20087a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Mar 2024 23:20:43 +0100 Subject: [PATCH 0767/1862] Clean code to edit a menu entry --- htdocs/admin/menus/edit.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 42892fbb8b6..74925b34aca 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -100,7 +100,7 @@ if ($action == 'add') { $error++; } if (!$error && !GETPOST('type')) { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Position")), null, 'errors'); $action = 'create'; $error++; } @@ -274,7 +274,8 @@ if ($action == 'create') { print load_fiche_titre($langs->trans("NewMenu"), '', 'title_setup'); - print '
'; + print ''; + print ''; print ''; print dol_get_fiche_head(); @@ -346,7 +347,7 @@ if ($action == 'create') { print '
'.$langs->trans('MenuIdParent').'
'.$langs->trans('MenuIdParent').''.$parent_rowid.''.$langs->trans('DetailTitre').'
'.$langs->trans('Image').'
'.$langs->trans('Image').''.$langs->trans('Example').': fa-global
'; + // Title print ''; + // URL print ''; } + if (!isset($sommes[$code])) { + $sommes[$code] = array(); + } // Year N $code = $cat['code']; // code of categorie ('VTE', 'MAR', ...) if (empty($sommes[$code]['NP'])) { @@ -438,6 +441,9 @@ if ($modecompta == 'CREANCES-DETTES') { foreach ($months as $k => $v) { $totCat['M'][$k] = 0; } + if (!isset($sommes[$code])) { + $sommes[$code] = array(); + } // Set $cpts with array of accounts in the category/group $cpts = $AccCat->getCptsCat($cat['rowid']); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ff537ee7891..b4cf054717a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -138,8 +138,9 @@ abstract class CommonObject */ public $array_options = array(); + /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); @@ -775,7 +776,7 @@ abstract class CommonObject public $extraparams = array(); /** - * @var array List of child tables. To test if we can delete object. + * @var array List of child tables. To test if we can delete object. */ protected $childtables = array(); diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index ba63bba320e..9e32529e9b1 100644 --- a/htdocs/core/class/commonstickergenerator.class.php +++ b/htdocs/core/class/commonstickergenerator.class.php @@ -296,7 +296,7 @@ abstract class CommonStickerGenerator extends CommonDocGenerator * protected Set format * * @param TCPDF $pdf PDF reference - * @param string $format Format + * @param array{metric:string,name:string,code:string,marginLeft:float,marginTip:float,SpaceX:float,SpaceY:float,NX:int,NY:int,width:float,height:float,font-size:float} $format Format * @return void */ protected function _Set_Format(&$pdf, $format) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index a7b6cc9ac22..deb021bb0bc 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -44,12 +44,12 @@ class ExtraFields public $db; /** - * @var array New array to store extrafields definition + * @var array,type:array,size:array,default:array,computed:array,unique:array,required:array,param:array,perms:array,list:array,totalizable:array,help:array,printable:array,enabled:array,langfile:array,css:array,csslist:array,hidden:array,mandatoryfieldsofotherentities:array,isameasure?:array}> New array to store extrafields definition */ public $attributes; /** - * @var array Array with boolean of status of groups + * @var array Array with boolean of status of groups */ public $expand_display; @@ -69,25 +69,25 @@ class ExtraFields public $errno; /** - * @var array Array of type to label + * @var array Array of type to label */ public static $type2label = array( - 'varchar'=>'String1Line', - 'text'=>'TextLongNLines', - 'html'=>'HtmlText', - 'int'=>'Int', - 'double'=>'Float', - 'date'=>'Date', - 'datetime'=>'DateAndTime', + 'varchar' => 'String1Line', + 'text' => 'TextLongNLines', + 'html' => 'HtmlText', + 'int' => 'Int', + 'double' => 'Float', + 'date' => 'Date', + 'datetime' => 'DateAndTime', //'datetimegmt'=>'DateAndTimeUTC', - 'boolean'=>'Boolean', - 'price'=>'ExtrafieldPrice', - 'pricecy'=>'ExtrafieldPriceWithCurrency', - 'phone'=>'ExtrafieldPhone', - 'mail'=>'ExtrafieldMail', - 'url'=>'ExtrafieldUrl', - 'ip'=>'ExtrafieldIP', - 'icon'=>'Icon', + 'boolean' => 'Boolean', + 'price' => 'ExtrafieldPrice', + 'pricecy' => 'ExtrafieldPriceWithCurrency', + 'phone' => 'ExtrafieldPhone', + 'mail' => 'ExtrafieldMail', + 'url' => 'ExtrafieldUrl', + 'ip' => 'ExtrafieldIP', + 'icon' => 'Icon', 'password' => 'ExtrafieldPassword', 'select' => 'ExtrafieldSelect', 'sellist' => 'ExtrafieldSelectList', @@ -253,9 +253,9 @@ class ExtraFields } } $field_desc = array( - 'type'=>$typedb, - 'value'=>$lengthdb, - 'null'=>($required ? 'NOT NULL' : 'NULL'), + 'type' => $typedb, + 'value' => $lengthdb, + 'null' => ($required ? 'NOT NULL' : 'NULL'), 'default' => $default_value ); @@ -602,11 +602,11 @@ class ExtraFields $typedb = $type; $lengthdb = $length; } - $field_desc = array('type'=>$typedb, 'value'=>$lengthdb, 'null'=>($required ? 'NOT NULL' : 'NULL'), 'default'=>$default); + $field_desc = array('type' => $typedb, 'value' => $lengthdb, 'null' => ($required ? 'NOT NULL' : 'NULL'), 'default' => $default); if (is_object($hookmanager)) { $hookmanager->initHooks(array('extrafieldsdao')); - $parameters = array('field_desc'=>&$field_desc, 'table'=>$table, 'attr_name'=>$attrname, 'label'=>$label, 'type'=>$type, 'length'=>$length, 'unique'=>$unique, 'required'=>$required, 'pos'=>$pos, 'param'=>$param, 'alwayseditable'=>$alwayseditable, 'perms'=>$perms, 'list'=>$list, 'help'=>$help, 'default'=>$default, 'computed'=>$computed, 'entity'=>$entity, 'langfile'=>$langfile, 'enabled'=>$enabled, 'totalizable'=>$totalizable, 'printable'=>$printable); + $parameters = array('field_desc' => &$field_desc, 'table' => $table, 'attr_name' => $attrname, 'label' => $label, 'type' => $type, 'length' => $length, 'unique' => $unique, 'required' => $required, 'pos' => $pos, 'param' => $param, 'alwayseditable' => $alwayseditable, 'perms' => $perms, 'list' => $list, 'help' => $help, 'default' => $default, 'computed' => $computed, 'entity' => $entity, 'langfile' => $langfile, 'enabled' => $enabled, 'totalizable' => $totalizable, 'printable' => $printable); $reshook = $hookmanager->executeHooks('updateExtrafields', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -1078,24 +1078,24 @@ class ExtraFields $out =''; $out.=''; */ - $out.= ''; + $out .= ''; if (getDolGlobalInt('MAIN_ADD_ICONPICKER_JS')) { - $out.=''; + $options .= "footer: '
',"; + $options .= "search: 'trans("TypeToFilter")."\" />',"; + $options .= "popover: '
"; + $options .= "
"; + $options .= "
"; + $options .= "
"; + $options .= "
'}}"; + $out .= "$('#".$keyprefix.$key.$keysuffix."').iconpicker(".$options.");"; + $out .= ''; } } elseif ($type == 'text') { if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field @@ -1598,7 +1598,7 @@ class ExtraFields $element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element if ($element == 'socpeople') { $element = 'contact'; - } elseif ( $element == 'projet' ) { + } elseif ($element == 'projet') { $element = 'project'; } @@ -2029,13 +2029,13 @@ class ExtraFields { global $conf, $langs; - $tagtype='tr'; - $tagtype_dyn='td'; + $tagtype = 'tr'; + $tagtype_dyn = 'td'; - if ($display_type=='line') { - $tagtype='div'; - $tagtype_dyn='span'; - $colspan=0; + if ($display_type == 'line') { + $tagtype = 'div'; + $tagtype_dyn = 'span'; + $colspan = 0; } $extrafield_param = $this->attributes[$object->table_element]['param'][$key]; diff --git a/htdocs/core/class/menu.class.php b/htdocs/core/class/menu.class.php index 6b93331127e..f87766fff94 100644 --- a/htdocs/core/class/menu.class.php +++ b/htdocs/core/class/menu.class.php @@ -28,6 +28,11 @@ */ class Menu { + /** + * List of menu items + * + * @var array,target:string,mainmenu:string,leftmenu:string,position:int,id:string,idsel:string,classname:string,prefix:string}> + */ public $liste; /** @@ -67,7 +72,7 @@ class Menu */ public function add($url, $titre, $level = 0, $enabled = 1, $target = '', $mainmenu = '', $leftmenu = '', $position = 0, $id = '', $idsel = '', $classname = '', $prefix = '') { - $this->liste[] = array('url'=>$url, 'titre'=>$titre, 'level'=>$level, 'enabled'=>$enabled, 'target'=>$target, 'mainmenu'=>$mainmenu, 'leftmenu'=>$leftmenu, 'position'=>$position, 'id'=>$id, 'idsel'=>$idsel, 'classname'=>$classname, 'prefix'=>$prefix); + $this->liste[] = array('url' => $url, 'titre' => $titre, 'level' => $level, 'enabled' => $enabled, 'target' => $target, 'mainmenu' => $mainmenu, 'leftmenu' => $leftmenu, 'position' => $position, 'id' => $id, 'idsel' => $idsel, 'classname' => $classname, 'prefix' => $prefix); } /** @@ -91,7 +96,7 @@ class Menu public function insert($idafter, $url, $titre, $level = 0, $enabled = 1, $target = '', $mainmenu = '', $leftmenu = '', $position = 0, $id = '', $idsel = '', $classname = '', $prefix = '') { $array_start = array_slice($this->liste, 0, ($idafter + 1)); - $array_new = array(0=>array('url'=>$url, 'titre'=>$titre, 'level'=>$level, 'enabled'=>$enabled, 'target'=>$target, 'mainmenu'=>$mainmenu, 'leftmenu'=>$leftmenu, 'position'=>$position, 'id'=>$id, 'idsel'=>$idsel, 'classname'=>$classname, 'prefix'=>$prefix)); + $array_new = array(0 => array('url' => $url, 'titre' => $titre, 'level' => $level, 'enabled' => $enabled, 'target' => $target, 'mainmenu' => $mainmenu, 'leftmenu' => $leftmenu, 'position' => $position, 'id' => $id, 'idsel' => $idsel, 'classname' => $classname, 'prefix' => $prefix)); $array_end = array_slice($this->liste, ($idafter + 1)); $this->liste = array_merge($array_start, $array_new, $array_end); } diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 138417df261..150414b3c4d 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -100,7 +100,7 @@ class SMTPs /** * Message Content * - * @var array $_msgContent Array of messages + * @var array{html?:array{mimeType:string,data:string,dataText:string,md5?:string},plain?:array{mimeType:string,data:string,dataText:string,md5?:string},image:array,attachment:array} $msgContent Array of messages */ private $_msgContent = array(); diff --git a/htdocs/core/lib/customreports.lib.php b/htdocs/core/lib/customreports.lib.php index 1359fae99a1..b4011bf0c0e 100644 --- a/htdocs/core/lib/customreports.lib.php +++ b/htdocs/core/lib/customreports.lib.php @@ -101,6 +101,7 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu if (!empty($object->isextrafieldmanaged) && isset($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || (int) dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { + // @phan-suppress-next-line PhanTypeMismatchDimAssignment $position = (!empty($val['position']) ? $val['position'] : 0); $arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-sum'] = array( 'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Sum").')', diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6c8152bd228..e9c2a555d63 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -682,7 +682,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null { global $mysoc, $user, $conf; - if (empty($paramname)) { + if (empty($paramname)) { // Explicit test for null for phan. return 'BadFirstParameterForGETPOST'; } if (empty($check)) { @@ -874,6 +874,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null // Substitution variables for GETPOST (used to get final url with variable parameters or final default value, when using variable parameters __XXX__ in the GET URL) // Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOMPANY_COUNTRY_ID__, __USER_ID__, ... // We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text. + '@phan-var-force string $paramname'; if (!is_array($out) && empty($_POST[$paramname]) && empty($noreplace)) { $reg = array(); $maxloop = 20; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index d98127a6e59..9b273e4f1b4 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -69,7 +69,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it public $family; /** - * @var array Custom family information + * @var array Custom family information * @see $family * * e.g.: @@ -140,7 +140,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it public $menu = array(); /** - * @var array Module parts + * @var array{triggers:int,login:int,substitutions:int,menus:int,theme:int,tpl:int,barcode:int,models:int,css:string,js:string,hooks:string[]} Module parts * array( * // Set this to 1 if module has its own trigger directory (/mymodule/core/triggers) * 'triggers' => 0, @@ -691,7 +691,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; - $content=''; + $content = ''; $pathoffile = $this->getDescLongReadmeFound(); if ($pathoffile) { // Mostly for external modules @@ -801,7 +801,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if ((float) DOL_VERSION >= 6.0) { @include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php'; - $content = dolMd2Html($content, 'parsedown', array('doc/'=>dol_buildpath(strtolower($this->name).'/doc/', 1))); + $content = dolMd2Html($content, 'parsedown', array('doc/' => dol_buildpath(strtolower($this->name).'/doc/', 1))); } else { $content = nl2br($content); } @@ -2493,7 +2493,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) { $versionTitle = $langs->trans("Version").' '.$this->getVersion(1); if ($this->needUpdate) { - $versionTitle.= '
'.$langs->trans('ModuleUpdateAvailable').' : '.$this->lastVersion; + $versionTitle .= '
'.$langs->trans('ModuleUpdateAvailable').' : '.$this->lastVersion; } $return .= ''; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index eb5675e23be..763382fd70c 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -2184,6 +2184,7 @@ class Project extends CommonObject $date = explode('-', $obj->element_date); $week_number = getWeekNumber($date[2], $date[1], $date[0]); } + '@phan-var-force int $week_number'; // Needed because phan considers it might be null if (empty($weekalreadyfound[$week_number])) { $this->monthWorkLoad[$week_number] = $obj->element_duration; $this->monthWorkLoadPerTask[$week_number][$obj->fk_element] = $obj->element_duration; diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index 6dd506f02a7..750db8b0484 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -174,9 +174,6 @@ if (GETPOST('lang', 'aZ09')) { $langs->setDefaultLang('auto'); } -$bc[false] = ' class="bg1"'; -$bc[true] = ' class="bg2"'; - /** * Load conf file (file must exists) From d524e9713738c5d7a118ac79ea8b9257edcecedd Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 10 Mar 2024 01:54:34 +0100 Subject: [PATCH 0777/1862] Qual: Fix & enable PhanPluginRedundantAssignmentInLoop (#28733) # Qual: Fix & enable PhanPluginRedundantAssignmentInLoop Fixes the occurences that generated this notice & enable the report for PhanPluginRedundantAssignmentInLoop --- dev/tools/phan/config.php | 2 +- htdocs/comm/action/pertype.php | 4 ++-- htdocs/comm/action/peruser.php | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 14a8c313670..57d96e657b0 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -488,7 +488,7 @@ return [ 'PhanPluginPHPDocInWrongComment', 'PhanRedefineClassInternal', // 'PhanTypeInvalidThrowsIsInterface', - 'PhanPluginRedundantAssignmentInLoop', + // 'PhanPluginRedundantAssignmentInLoop', // 'PhanInvalidCommentForDeclarationType', //'PhanParamSignatureMismatchInternal', // 'PhanPluginEmptyStatementForeachLoop', diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index f93373fc0f7..9bbdd243f12 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -1211,7 +1211,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s if (count($cases1[$h]) > 1) { $title1 .= count($cases1[$h]).' '.(count($cases1[$h]) == 1 ? $langs->trans("Event") : $langs->trans("Events")); } - $string1 = ' '; + if (!getDolGlobalString('AGENDA_NO_TRANSPARENT_ON_NOT_BUSY')) { $style1 = 'peruser_notbusy'; } else { @@ -1228,7 +1228,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s if (count($cases2[$h]) > 1) { $title2 .= count($cases2[$h]).' '.(count($cases2[$h]) == 1 ? $langs->trans("Event") : $langs->trans("Events")); } - $string2 = ' '; + if (!getDolGlobalString('AGENDA_NO_TRANSPARENT_ON_NOT_BUSY')) { $style2 = 'peruser_notbusy'; } else { diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 70b325ed45f..76025723dde 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -1503,7 +1503,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & if (count($cases1[$h]) > 1) { $title1 .= count($cases1[$h]).' '.(count($cases1[$h]) == 1 ? $langs->trans("Event") : $langs->trans("Events")); } - $string1 = ' '; + if (!getDolGlobalString('AGENDA_NO_TRANSPARENT_ON_NOT_BUSY')) { $style1 = 'peruser_notbusy'; } else { @@ -1520,7 +1520,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & if (count($cases2[$h]) > 1) { $title2 .= count($cases2[$h]).' '.(count($cases2[$h]) == 1 ? $langs->trans("Event") : $langs->trans("Events")); } - $string2 = ' '; + if (!getDolGlobalString('AGENDA_NO_TRANSPARENT_ON_NOT_BUSY')) { $style2 = 'peruser_notbusy'; } else { @@ -1537,7 +1537,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & if (count($cases3[$h]) > 1) { $title3 .= count($cases3[$h]).' '.(count($cases3[$h]) == 1 ? $langs->trans("Event") : $langs->trans("Events")); } - $string3 = ' '; + if (!getDolGlobalString('AGENDA_NO_TRANSPARENT_ON_NOT_BUSY')) { $style3 = 'peruser_notbusy'; } else { @@ -1554,7 +1554,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & if (count($cases4[$h]) > 1) { $title4 .= count($cases4[$h]).' '.(count($cases4[$h]) == 1 ? $langs->trans("Event") : $langs->trans("Events")); } - $string4 = ' '; + if (!getDolGlobalString('AGENDA_NO_TRANSPARENT_ON_NOT_BUSY')) { $style4 = 'peruser_notbusy'; } else { From 6d9e7b8144697fc0d272b289f526a7bac2096216 Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 10 Mar 2024 01:55:56 +0100 Subject: [PATCH 0778/1862] Qual: Fix PhanTypeMismatchArgumentInternalProbablyReal (#28732) * Fix: False positive for PhanTypeMismatchArgumentInternalProbablyReal * Qual: phan: suppress false positive on ssl_set * Qual: Enable PhanTypeMismatchArgumentInternalProbablyReal # Qual: Enable PhanTypeMismatchArgumentInternalProbablyReal PhanTypeMismatchArgumentInternalProbablyReal are fixed and reporting can be enabled. * Qual: Fix PhanTypeMismatchArgumentInternalProbablyReal by improving typing * Qual: Rewrite/optimize to fix PhanTypeMismatchArgumentInternalProbablyReal # Qual: Rewrite/optimize to fix PhanTypeMismatchArgumentInternalProbablyReal False positive detecting that is not an int, rewriting to check impact --- dev/tools/phan/config.php | 14 +- .../core/class/commondocgenerator.class.php | 381 +++++++++--------- htdocs/core/class/commonobject.class.php | 6 +- htdocs/core/class/rssparser.class.php | 1 + htdocs/core/db/mysqli.class.php | 1 + 5 files changed, 208 insertions(+), 195 deletions(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 57d96e657b0..ee9cde2603f 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -474,11 +474,11 @@ return [ // 'PhanParamSpecial1', 'PhanPluginInlineHTMLLeading', 'PhanPluginUseReturnValueInternalKnown', - //'PhanRedefinedInheritedInterface', - //'PhanTypeComparisonToArray', + // 'PhanRedefinedInheritedInterface', + // 'PhanTypeComparisonToArray', 'PhanTypeConversionFromArray', // 'PhanTypeInvalidLeftOperandOfIntegerOp', - 'PhanTypeMismatchArgumentInternalProbablyReal', + // 'PhanTypeMismatchArgumentInternalProbablyReal', 'PhanTypeMismatchBitwiseBinaryOperands', 'PhanTypeMismatchDimEmpty', 'PhanTypeSuspiciousEcho', @@ -548,9 +548,9 @@ return [ 'PhanTypeMismatchReturnProbablyReal', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgument', - //'PhanPluginUnreachableCode', - //'PhanTypeMismatchArgumentInternal', - //'PhanPluginAlwaysReturnMethod', + // 'PhanPluginUnreachableCode', + // 'PhanTypeMismatchArgumentInternal', + // 'PhanPluginAlwaysReturnMethod', 'PhanUndeclaredClassMethod', 'PhanUndeclaredMethod', 'PhanTypeMismatchArgumentProbablyReal', @@ -566,7 +566,7 @@ return [ // 'PhanUndeclaredClassAttribute', 'PhanNonClassMethodCall', // 'PhanPluginNoAssert', - 'PhanTypeMismatchReturnSuperType', + // 'PhanTypeMismatchReturnSuperType', 'PhanTypeMismatchArgumentSuperType', 'PhanPluginDuplicateConditionalTernaryDuplication', ], diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 75b45b1850a..b80ce304f94 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -111,7 +111,18 @@ abstract class CommonDocGenerator public $tva; public $tva_array; + /** + * Local tax rates Array[tax_type][tax_rate] + * + * @var array> + */ public $localtax1; + + /** + * Local tax rates Array[tax_type][tax_rate] + * + * @var array> + */ public $localtax2; /** @@ -196,28 +207,28 @@ abstract class CommonDocGenerator $logotouse = $conf->user->dir_output . '/' . get_exdir(0, 0, 0, 0, $user, 'user') . 'photos/' . getImageFileNameForSize($user->photo, '_small'); $array_user = array( - 'myuser_lastname'=>$user->lastname, - 'myuser_firstname'=>$user->firstname, - 'myuser_fullname'=>$user->getFullName($outputlangs, 1), - 'myuser_login'=>$user->login, - 'myuser_phone'=>$user->office_phone, - 'myuser_address'=>$user->address, - 'myuser_zip'=>$user->zip, - 'myuser_town'=>$user->town, - 'myuser_country'=>$user->country, - 'myuser_country_code'=>$user->country_code, - 'myuser_state'=>$user->state, - 'myuser_state_code'=>$user->state_code, - 'myuser_fax'=>$user->office_fax, - 'myuser_mobile'=>$user->user_mobile, - 'myuser_email'=>$user->email, - 'myuser_logo'=>$logotouse, - 'myuser_job'=>$user->job, - 'myuser_web'=>'', // url not exist in $user object - 'myuser_birth'=>dol_print_date($user->birth, 'day', 'gmt'), - 'myuser_dateemployment'=>dol_print_date($user->dateemployment, 'day', 'tzuser'), - 'myuser_dateemploymentend'=>dol_print_date($user->dateemploymentend, 'day', 'tzuser'), - 'myuser_gender'=>$user->gender, + 'myuser_lastname' => $user->lastname, + 'myuser_firstname' => $user->firstname, + 'myuser_fullname' => $user->getFullName($outputlangs, 1), + 'myuser_login' => $user->login, + 'myuser_phone' => $user->office_phone, + 'myuser_address' => $user->address, + 'myuser_zip' => $user->zip, + 'myuser_town' => $user->town, + 'myuser_country' => $user->country, + 'myuser_country_code' => $user->country_code, + 'myuser_state' => $user->state, + 'myuser_state_code' => $user->state_code, + 'myuser_fax' => $user->office_fax, + 'myuser_mobile' => $user->user_mobile, + 'myuser_email' => $user->email, + 'myuser_logo' => $logotouse, + 'myuser_job' => $user->job, + 'myuser_web' => '', // url not exist in $user object + 'myuser_birth' => dol_print_date($user->birth, 'day', 'gmt'), + 'myuser_dateemployment' => dol_print_date($user->dateemployment, 'day', 'tzuser'), + 'myuser_dateemploymentend' => dol_print_date($user->dateemploymentend, 'day', 'tzuser'), + 'myuser_gender' => $user->gender, ); // Retrieve extrafields if (is_array($user->array_options) && count($user->array_options)) { @@ -299,32 +310,32 @@ abstract class CommonDocGenerator $logotouse = $conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small; return array( - 'mycompany_logo'=>$logotouse, - 'mycompany_name'=>$mysoc->name, - 'mycompany_email'=>$mysoc->email, - 'mycompany_phone'=>$mysoc->phone, - 'mycompany_fax'=>$mysoc->fax, - 'mycompany_address'=>$mysoc->address, - 'mycompany_zip'=>$mysoc->zip, - 'mycompany_town'=>$mysoc->town, - 'mycompany_country'=>$mysoc->country, - 'mycompany_country_code'=>$mysoc->country_code, - 'mycompany_state'=>$mysoc->state, - 'mycompany_state_code'=>$mysoc->state_code, - 'mycompany_web'=>$mysoc->url, - 'mycompany_juridicalstatus'=>$mysoc->forme_juridique, - 'mycompany_managers'=>$mysoc->managers, - 'mycompany_capital'=>$mysoc->capital, - 'mycompany_barcode'=>$mysoc->barcode, - 'mycompany_idprof1'=>$mysoc->idprof1, - 'mycompany_idprof2'=>$mysoc->idprof2, - 'mycompany_idprof3'=>$mysoc->idprof3, - 'mycompany_idprof4'=>$mysoc->idprof4, - 'mycompany_idprof5'=>$mysoc->idprof5, - 'mycompany_idprof6'=>$mysoc->idprof6, - 'mycompany_vatnumber'=>$mysoc->tva_intra, - 'mycompany_socialobject'=>$mysoc->socialobject, - 'mycompany_note_private'=>$mysoc->note_private, + 'mycompany_logo' => $logotouse, + 'mycompany_name' => $mysoc->name, + 'mycompany_email' => $mysoc->email, + 'mycompany_phone' => $mysoc->phone, + 'mycompany_fax' => $mysoc->fax, + 'mycompany_address' => $mysoc->address, + 'mycompany_zip' => $mysoc->zip, + 'mycompany_town' => $mysoc->town, + 'mycompany_country' => $mysoc->country, + 'mycompany_country_code' => $mysoc->country_code, + 'mycompany_state' => $mysoc->state, + 'mycompany_state_code' => $mysoc->state_code, + 'mycompany_web' => $mysoc->url, + 'mycompany_juridicalstatus' => $mysoc->forme_juridique, + 'mycompany_managers' => $mysoc->managers, + 'mycompany_capital' => $mysoc->capital, + 'mycompany_barcode' => $mysoc->barcode, + 'mycompany_idprof1' => $mysoc->idprof1, + 'mycompany_idprof2' => $mysoc->idprof2, + 'mycompany_idprof3' => $mysoc->idprof3, + 'mycompany_idprof4' => $mysoc->idprof4, + 'mycompany_idprof5' => $mysoc->idprof5, + 'mycompany_idprof6' => $mysoc->idprof6, + 'mycompany_vatnumber' => $mysoc->tva_intra, + 'mycompany_socialobject' => $mysoc->socialobject, + 'mycompany_note_private' => $mysoc->note_private, //'mycompany_note_public'=>$mysoc->note_public, // Only private not exists for "mysoc" but both for thirdparties ); } @@ -353,38 +364,38 @@ abstract class CommonDocGenerator } $array_thirdparty = array( - 'company_name'=>$object->name, + 'company_name' => $object->name, 'company_name_alias' => $object->name_alias, - 'company_email'=>$object->email, - 'company_phone'=>$object->phone, - 'company_fax'=>$object->fax, - 'company_address'=>$object->address, - 'company_zip'=>$object->zip, - 'company_town'=>$object->town, - 'company_country'=>$object->country, - 'company_country_code'=>$object->country_code, - 'company_state'=>$object->state, - 'company_state_code'=>$object->state_code, - 'company_web'=>$object->url, - 'company_barcode'=>$object->barcode, - 'company_vatnumber'=>$object->tva_intra, - 'company_customercode'=>$object->code_client, - 'company_suppliercode'=>$object->code_fournisseur, - 'company_customeraccountancycode'=>$object->code_compta, - 'company_supplieraccountancycode'=>$object->code_compta_fournisseur, - 'company_juridicalstatus'=>$object->forme_juridique, - 'company_outstanding_limit'=>$object->outstanding_limit, - 'company_capital'=>$object->capital, - 'company_idprof1'=>$object->idprof1, - 'company_idprof2'=>$object->idprof2, - 'company_idprof3'=>$object->idprof3, - 'company_idprof4'=>$object->idprof4, - 'company_idprof5'=>$object->idprof5, - 'company_idprof6'=>$object->idprof6, - 'company_note_public'=>$object->note_public, - 'company_note_private'=>$object->note_private, - 'company_default_bank_iban'=>(is_object($object->bank_account) ? $object->bank_account->iban : ''), - 'company_default_bank_bic'=>(is_object($object->bank_account) ? $object->bank_account->bic : '') + 'company_email' => $object->email, + 'company_phone' => $object->phone, + 'company_fax' => $object->fax, + 'company_address' => $object->address, + 'company_zip' => $object->zip, + 'company_town' => $object->town, + 'company_country' => $object->country, + 'company_country_code' => $object->country_code, + 'company_state' => $object->state, + 'company_state_code' => $object->state_code, + 'company_web' => $object->url, + 'company_barcode' => $object->barcode, + 'company_vatnumber' => $object->tva_intra, + 'company_customercode' => $object->code_client, + 'company_suppliercode' => $object->code_fournisseur, + 'company_customeraccountancycode' => $object->code_compta, + 'company_supplieraccountancycode' => $object->code_compta_fournisseur, + 'company_juridicalstatus' => $object->forme_juridique, + 'company_outstanding_limit' => $object->outstanding_limit, + 'company_capital' => $object->capital, + 'company_idprof1' => $object->idprof1, + 'company_idprof2' => $object->idprof2, + 'company_idprof3' => $object->idprof3, + 'company_idprof4' => $object->idprof4, + 'company_idprof5' => $object->idprof5, + 'company_idprof6' => $object->idprof6, + 'company_note_public' => $object->note_public, + 'company_note_private' => $object->note_private, + 'company_default_bank_iban' => (is_object($object->bank_account) ? $object->bank_account->iban : ''), + 'company_default_bank_bic' => (is_object($object->bank_account) ? $object->bank_account->bic : '') ); // Retrieve extrafields @@ -471,15 +482,15 @@ abstract class CommonDocGenerator $now = dol_now('gmt'); // gmt $array_other = array( // Date in default language - 'current_date'=>dol_print_date($now, 'day', 'tzuser'), - 'current_datehour'=>dol_print_date($now, 'dayhour', 'tzuser'), - 'current_server_date'=>dol_print_date($now, 'day', 'tzserver'), - 'current_server_datehour'=>dol_print_date($now, 'dayhour', 'tzserver'), + 'current_date' => dol_print_date($now, 'day', 'tzuser'), + 'current_datehour' => dol_print_date($now, 'dayhour', 'tzuser'), + 'current_server_date' => dol_print_date($now, 'day', 'tzserver'), + 'current_server_datehour' => dol_print_date($now, 'dayhour', 'tzserver'), // Date in requested output language - 'current_date_locale'=>dol_print_date($now, 'day', 'tzuser', $outputlangs), - 'current_datehour_locale'=>dol_print_date($now, 'dayhour', 'tzuser', $outputlangs), - 'current_server_date_locale'=>dol_print_date($now, 'day', 'tzserver', $outputlangs), - 'current_server_datehour_locale'=>dol_print_date($now, 'dayhour', 'tzserver', $outputlangs), + 'current_date_locale' => dol_print_date($now, 'day', 'tzuser', $outputlangs), + 'current_datehour_locale' => dol_print_date($now, 'dayhour', 'tzuser', $outputlangs), + 'current_server_date_locale' => dol_print_date($now, 'day', 'tzserver', $outputlangs), + 'current_server_datehour_locale' => dol_print_date($now, 'dayhour', 'tzserver', $outputlangs), ); @@ -534,45 +545,45 @@ abstract class CommonDocGenerator $object->date_commande = $object->date; } $resarray = array( - $array_key.'_id'=>$object->id, + $array_key.'_id' => $object->id, $array_key.'_ref' => (property_exists($object, 'ref') ? $object->ref : ''), $array_key.'_label' => (property_exists($object, 'label') ? $object->label : ''), $array_key.'_ref_ext' => (property_exists($object, 'ref_ext') ? $object->ref_ext : ''), - $array_key.'_ref_customer'=>(!empty($object->ref_client) ? $object->ref_client : (empty($object->ref_customer) ? '' : $object->ref_customer)), - $array_key.'_ref_supplier'=>(!empty($object->ref_fournisseur) ? $object->ref_fournisseur : (empty($object->ref_supplier) ? '' : $object->ref_supplier)), - $array_key.'_source_invoice_ref'=>((empty($invoice_source) || empty($invoice_source->ref)) ? '' : $invoice_source->ref), + $array_key.'_ref_customer' => (!empty($object->ref_client) ? $object->ref_client : (empty($object->ref_customer) ? '' : $object->ref_customer)), + $array_key.'_ref_supplier' => (!empty($object->ref_fournisseur) ? $object->ref_fournisseur : (empty($object->ref_supplier) ? '' : $object->ref_supplier)), + $array_key.'_source_invoice_ref' => ((empty($invoice_source) || empty($invoice_source->ref)) ? '' : $invoice_source->ref), // Dates - $array_key.'_hour'=>dol_print_date($date, 'hour'), - $array_key.'_date'=>dol_print_date($date, 'day'), - $array_key.'_date_rfc'=>dol_print_date($date, 'dayrfc'), - $array_key.'_date_limit'=>(!empty($object->date_lim_reglement) ? dol_print_date($object->date_lim_reglement, 'day') : ''), - $array_key.'_date_limit_rfc'=>(!empty($object->date_lim_reglement) ? dol_print_date($object->date_lim_reglement, 'dayrfc') : ''), - $array_key.'_date_end'=>(!empty($object->fin_validite) ? dol_print_date($object->fin_validite, 'day') : ''), - $array_key.'_date_creation'=>dol_print_date($object->date_creation, 'day'), - $array_key.'_date_modification'=>(!empty($object->date_modification) ? dol_print_date($object->date_modification, 'day') : ''), - $array_key.'_date_validation'=>(!empty($object->date_validation) ? dol_print_date($object->date_validation, 'dayhour') : ''), - $array_key.'_date_approve'=>(!empty($object->date_approve) ? dol_print_date($object->date_approve, 'day') : ''), - $array_key.'_date_delivery_planed'=>(!empty($object->delivery_date) ? dol_print_date($object->delivery_date, 'day') : ''), - $array_key.'_date_close'=>(!empty($object->date_cloture) ? dol_print_date($object->date_cloture, 'dayhour') : ''), + $array_key.'_hour' => dol_print_date($date, 'hour'), + $array_key.'_date' => dol_print_date($date, 'day'), + $array_key.'_date_rfc' => dol_print_date($date, 'dayrfc'), + $array_key.'_date_limit' => (!empty($object->date_lim_reglement) ? dol_print_date($object->date_lim_reglement, 'day') : ''), + $array_key.'_date_limit_rfc' => (!empty($object->date_lim_reglement) ? dol_print_date($object->date_lim_reglement, 'dayrfc') : ''), + $array_key.'_date_end' => (!empty($object->fin_validite) ? dol_print_date($object->fin_validite, 'day') : ''), + $array_key.'_date_creation' => dol_print_date($object->date_creation, 'day'), + $array_key.'_date_modification' => (!empty($object->date_modification) ? dol_print_date($object->date_modification, 'day') : ''), + $array_key.'_date_validation' => (!empty($object->date_validation) ? dol_print_date($object->date_validation, 'dayhour') : ''), + $array_key.'_date_approve' => (!empty($object->date_approve) ? dol_print_date($object->date_approve, 'day') : ''), + $array_key.'_date_delivery_planed' => (!empty($object->delivery_date) ? dol_print_date($object->delivery_date, 'day') : ''), + $array_key.'_date_close' => (!empty($object->date_cloture) ? dol_print_date($object->date_cloture, 'dayhour') : ''), - $array_key.'_payment_mode_code'=>$object->mode_reglement_code, - $array_key.'_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code) : $object->mode_reglement), - $array_key.'_payment_term_code'=>$object->cond_reglement_code, - $array_key.'_payment_term'=>($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) : ($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement)), + $array_key.'_payment_mode_code' => $object->mode_reglement_code, + $array_key.'_payment_mode' => ($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code) : $object->mode_reglement), + $array_key.'_payment_term_code' => $object->cond_reglement_code, + $array_key.'_payment_term' => ($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) : ($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement)), $array_key.'_incoterms' => (method_exists($object, 'display_incoterms') ? $object->display_incoterms() : ''), - $array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs), - $array_key.'_total_vat_locale'=>(!empty($object->total_vat) ? price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)), - $array_key.'_total_localtax1_locale'=>price($object->total_localtax1, 0, $outputlangs), - $array_key.'_total_localtax2_locale'=>price($object->total_localtax2, 0, $outputlangs), - $array_key.'_total_ttc_locale'=>price($object->total_ttc, 0, $outputlangs), + $array_key.'_total_ht_locale' => price($object->total_ht, 0, $outputlangs), + $array_key.'_total_vat_locale' => (!empty($object->total_vat) ? price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)), + $array_key.'_total_localtax1_locale' => price($object->total_localtax1, 0, $outputlangs), + $array_key.'_total_localtax2_locale' => price($object->total_localtax2, 0, $outputlangs), + $array_key.'_total_ttc_locale' => price($object->total_ttc, 0, $outputlangs), - $array_key.'_total_ht'=>price2num($object->total_ht), - $array_key.'_total_vat'=>(!empty($object->total_vat) ? price2num($object->total_vat) : price2num($object->total_tva)), - $array_key.'_total_localtax1'=>price2num($object->total_localtax1), - $array_key.'_total_localtax2'=>price2num($object->total_localtax2), - $array_key.'_total_ttc'=>price2num($object->total_ttc), + $array_key.'_total_ht' => price2num($object->total_ht), + $array_key.'_total_vat' => (!empty($object->total_vat) ? price2num($object->total_vat) : price2num($object->total_tva)), + $array_key.'_total_localtax1' => price2num($object->total_localtax1), + $array_key.'_total_localtax2' => price2num($object->total_localtax2), + $array_key.'_total_ttc' => price2num($object->total_ttc), $array_key.'_multicurrency_code' => $object->multicurrency_code, $array_key.'_multicurrency_tx' => price2num($object->multicurrency_tx), @@ -583,24 +594,24 @@ abstract class CommonDocGenerator $array_key.'_multicurrency_total_tva_locale' => price($object->multicurrency_total_tva, 0, $outputlangs), $array_key.'_multicurrency_total_ttc_locale' => price($object->multicurrency_total_ttc, 0, $outputlangs), - $array_key.'_note_private'=>$object->note_private, - $array_key.'_note_public'=>$object->note_public, - $array_key.'_note'=>$object->note_public, // For backward compatibility + $array_key.'_note_private' => $object->note_private, + $array_key.'_note_public' => $object->note_public, + $array_key.'_note' => $object->note_public, // For backward compatibility // Payments - $array_key.'_already_payed_locale'=>price($sumpayed, 0, $outputlangs), - $array_key.'_already_payed'=>price2num($sumpayed), - $array_key.'_already_deposit_locale'=>price($sumdeposit, 0, $outputlangs), - $array_key.'_already_deposit'=>price2num($sumdeposit), - $array_key.'_already_creditnote_locale'=>price($sumcreditnote, 0, $outputlangs), - $array_key.'_already_creditnote'=>price2num($sumcreditnote), + $array_key.'_already_payed_locale' => price($sumpayed, 0, $outputlangs), + $array_key.'_already_payed' => price2num($sumpayed), + $array_key.'_already_deposit_locale' => price($sumdeposit, 0, $outputlangs), + $array_key.'_already_deposit' => price2num($sumdeposit), + $array_key.'_already_creditnote_locale' => price($sumcreditnote, 0, $outputlangs), + $array_key.'_already_creditnote' => price2num($sumcreditnote), - $array_key.'_already_payed_all_locale'=>price(price2num($already_payed_all, 'MT'), 0, $outputlangs), - $array_key.'_already_payed_all'=> price2num($already_payed_all, 'MT'), + $array_key.'_already_payed_all_locale' => price(price2num($already_payed_all, 'MT'), 0, $outputlangs), + $array_key.'_already_payed_all' => price2num($already_payed_all, 'MT'), // Remain to pay with all known information (except open direct debit requests) - $array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $already_payed_all, 'MT'), 0, $outputlangs), - $array_key.'_remain_to_pay'=>price2num($object->total_ttc - $already_payed_all, 'MT') + $array_key.'_remain_to_pay_locale' => price(price2num($object->total_ttc - $already_payed_all, 'MT'), 0, $outputlangs), + $array_key.'_remain_to_pay' => price2num($object->total_ttc - $already_payed_all, 'MT') ); if (in_array($object->element, array('facture', 'invoice', 'supplier_invoice', 'facture_fournisseur'))) { @@ -616,10 +627,10 @@ abstract class CommonDocGenerator $resarray[$array_key.'_bank_bic'] = (empty($bank_account) ? '' : $bank_account->bic); $resarray[$array_key.'_bank_label'] = (empty($bank_account) ? '' : $bank_account->label); $resarray[$array_key.'_bank_number'] = (empty($bank_account) ? '' : $bank_account->number); - $resarray[$array_key.'_bank_proprio'] =(empty($bank_account) ? '' : $bank_account->proprio); - $resarray[$array_key.'_bank_address'] =(empty($bank_account) ? '' : $bank_account->address); - $resarray[$array_key.'_bank_state'] =(empty($bank_account) ? '' : $bank_account->state); - $resarray[$array_key.'_bank_country'] =(empty($bank_account) ? '' : $bank_account->country); + $resarray[$array_key.'_bank_proprio'] = (empty($bank_account) ? '' : $bank_account->proprio); + $resarray[$array_key.'_bank_address'] = (empty($bank_account) ? '' : $bank_account->address); + $resarray[$array_key.'_bank_state'] = (empty($bank_account) ? '' : $bank_account->state); + $resarray[$array_key.'_bank_country'] = (empty($bank_account) ? '' : $bank_account->country); } if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Propal', 'Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) { @@ -642,7 +653,7 @@ abstract class CommonDocGenerator $resarray[$array_key.'_project_date_start'] = dol_print_date($object->project->date_start, 'day'); $resarray[$array_key.'_project_date_end'] = dol_print_date($object->project->date_end, 'day'); } else { // empty replacement - $resarray[$array_key.'_project_ref'] =''; + $resarray[$array_key.'_project_ref'] = ''; $resarray[$array_key.'_project_title'] = ''; $resarray[$array_key.'_project_description'] = ''; $resarray[$array_key.'_project_date_start'] = ''; @@ -714,38 +725,38 @@ abstract class CommonDocGenerator // phpcs:enable $resarray = array( 'line_pos' => $linenumber, - 'line_fulldesc'=>doc_getlinedesc($line, $outputlangs), + 'line_fulldesc' => doc_getlinedesc($line, $outputlangs), - 'line_product_ref'=>(empty($line->product_ref) ? '' : $line->product_ref), - 'line_product_ref_fourn'=>(empty($line->ref_fourn) ? '' : $line->ref_fourn), // for supplier doc lines - 'line_product_label'=>(empty($line->product_label) ? '' : $line->product_label), - 'line_product_type'=>(empty($line->product_type) ? '' : $line->product_type), - 'line_product_barcode'=>(empty($line->product_barcode) ? '' : $line->product_barcode), - 'line_product_desc'=>(empty($line->product_desc) ? '' : $line->product_desc), + 'line_product_ref' => (empty($line->product_ref) ? '' : $line->product_ref), + 'line_product_ref_fourn' => (empty($line->ref_fourn) ? '' : $line->ref_fourn), // for supplier doc lines + 'line_product_label' => (empty($line->product_label) ? '' : $line->product_label), + 'line_product_type' => (empty($line->product_type) ? '' : $line->product_type), + 'line_product_barcode' => (empty($line->product_barcode) ? '' : $line->product_barcode), + 'line_product_desc' => (empty($line->product_desc) ? '' : $line->product_desc), - 'line_desc'=>$line->desc, - 'line_vatrate'=>vatrate($line->tva_tx, true, $line->info_bits), - 'line_localtax1_rate'=>vatrate($line->localtax1_tx), - 'line_localtax2_rate'=>vatrate($line->localtax1_tx), - 'line_up'=>price2num($line->subprice), - 'line_up_locale'=>price($line->subprice, 0, $outputlangs), - 'line_total_up'=>price2num($line->subprice * $line->qty), - 'line_total_up_locale'=>price($line->subprice * $line->qty, 0, $outputlangs), - 'line_qty'=>$line->qty, - 'line_discount_percent'=>($line->remise_percent ? $line->remise_percent.'%' : ''), - 'line_price_ht'=>price2num($line->total_ht), - 'line_price_ttc'=>price2num($line->total_ttc), - 'line_price_vat'=>price2num($line->total_tva), - 'line_price_ht_locale'=>price($line->total_ht, 0, $outputlangs), - 'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs), - 'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs), + 'line_desc' => $line->desc, + 'line_vatrate' => vatrate($line->tva_tx, true, $line->info_bits), + 'line_localtax1_rate' => vatrate($line->localtax1_tx), + 'line_localtax2_rate' => vatrate($line->localtax1_tx), + 'line_up' => price2num($line->subprice), + 'line_up_locale' => price($line->subprice, 0, $outputlangs), + 'line_total_up' => price2num($line->subprice * $line->qty), + 'line_total_up_locale' => price($line->subprice * $line->qty, 0, $outputlangs), + 'line_qty' => $line->qty, + 'line_discount_percent' => ($line->remise_percent ? $line->remise_percent.'%' : ''), + 'line_price_ht' => price2num($line->total_ht), + 'line_price_ttc' => price2num($line->total_ttc), + 'line_price_vat' => price2num($line->total_tva), + 'line_price_ht_locale' => price($line->total_ht, 0, $outputlangs), + 'line_price_ttc_locale' => price($line->total_ttc, 0, $outputlangs), + 'line_price_vat_locale' => price($line->total_tva, 0, $outputlangs), // Dates - 'line_date_start'=>dol_print_date($line->date_start, 'day'), - 'line_date_start_locale'=>dol_print_date($line->date_start, 'day', 'tzserver', $outputlangs), - 'line_date_start_rfc'=>dol_print_date($line->date_start, 'dayrfc'), - 'line_date_end'=>dol_print_date($line->date_end, 'day'), - 'line_date_end_locale'=>dol_print_date($line->date_end, 'day', 'tzserver', $outputlangs), - 'line_date_end_rfc'=>dol_print_date($line->date_end, 'dayrfc'), + 'line_date_start' => dol_print_date($line->date_start, 'day'), + 'line_date_start_locale' => dol_print_date($line->date_start, 'day', 'tzserver', $outputlangs), + 'line_date_start_rfc' => dol_print_date($line->date_start, 'dayrfc'), + 'line_date_end' => dol_print_date($line->date_end, 'day'), + 'line_date_end_locale' => dol_print_date($line->date_end, 'day', 'tzserver', $outputlangs), + 'line_date_end_rfc' => dol_print_date($line->date_end, 'dayrfc'), 'line_multicurrency_code' => price2num($line->multicurrency_code), 'line_multicurrency_subprice' => price2num($line->multicurrency_subprice), @@ -844,27 +855,27 @@ abstract class CommonDocGenerator $calculatedVolume = ($object->trueWidth * $object->trueHeight * $object->trueDepth); $array_shipment = array( - $array_key.'_id'=>$object->id, - $array_key.'_ref'=>$object->ref, - $array_key.'_ref_ext'=>$object->ref_ext, - $array_key.'_ref_customer'=>$object->ref_customer, - $array_key.'_date_delivery'=>dol_print_date($object->date_delivery, 'day'), - $array_key.'_hour_delivery'=>dol_print_date($object->date_delivery, 'hour'), - $array_key.'_date_creation'=>dol_print_date($object->date_creation, 'day'), - $array_key.'_total_ht'=>price($object->total_ht), - $array_key.'_total_vat'=>price($object->total_tva), - $array_key.'_total_ttc'=>price($object->total_ttc), + $array_key.'_id' => $object->id, + $array_key.'_ref' => $object->ref, + $array_key.'_ref_ext' => $object->ref_ext, + $array_key.'_ref_customer' => $object->ref_customer, + $array_key.'_date_delivery' => dol_print_date($object->date_delivery, 'day'), + $array_key.'_hour_delivery' => dol_print_date($object->date_delivery, 'hour'), + $array_key.'_date_creation' => dol_print_date($object->date_creation, 'day'), + $array_key.'_total_ht' => price($object->total_ht), + $array_key.'_total_vat' => price($object->total_tva), + $array_key.'_total_ttc' => price($object->total_ttc), $array_key.'_total_discount_ht' => price($object->getTotalDiscount()), - $array_key.'_note_private'=>$object->note_private, - $array_key.'_note'=>$object->note_public, - $array_key.'_tracking_number'=>$object->tracking_number, - $array_key.'_tracking_url'=>$object->tracking_url, - $array_key.'_shipping_method'=>$object->listmeths[0]['libelle'], - $array_key.'_weight'=>$object->trueWeight.' '.measuringUnitString(0, 'weight', $object->weight_units), - $array_key.'_width'=>$object->trueWidth.' '.measuringUnitString(0, 'size', $object->width_units), - $array_key.'_height'=>$object->trueHeight.' '.measuringUnitString(0, 'size', $object->height_units), - $array_key.'_depth'=>$object->trueDepth.' '.measuringUnitString(0, 'size', $object->depth_units), - $array_key.'_size'=>$calculatedVolume.' '.measuringUnitString(0, 'volume'), + $array_key.'_note_private' => $object->note_private, + $array_key.'_note' => $object->note_public, + $array_key.'_tracking_number' => $object->tracking_number, + $array_key.'_tracking_url' => $object->tracking_url, + $array_key.'_shipping_method' => $object->listmeths[0]['libelle'], + $array_key.'_weight' => $object->trueWeight.' '.measuringUnitString(0, 'weight', $object->weight_units), + $array_key.'_width' => $object->trueWidth.' '.measuringUnitString(0, 'size', $object->width_units), + $array_key.'_height' => $object->trueHeight.' '.measuringUnitString(0, 'size', $object->height_units), + $array_key.'_depth' => $object->trueDepth.' '.measuringUnitString(0, 'size', $object->depth_units), + $array_key.'_size' => $calculatedVolume.' '.measuringUnitString(0, 'volume'), ); // Add vat by rates @@ -1367,7 +1378,7 @@ abstract class CommonDocGenerator 'object' => $object, 'extrafields' => $extrafields, 'extrafieldKey' => $extrafieldKey, - 'extrafieldOutputContent' =>& $extrafieldOutputContent + 'extrafieldOutputContent' => & $extrafieldOutputContent ); $reshook = $hookmanager->executeHooks('getPDFExtrafieldContent', $parameters, $this); // Note that $action and $object may have been modified by hook if ($reshook < 0) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b4cf054717a..a140bf1e4b7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8621,7 +8621,7 @@ abstract class CommonObject } $visibility = 1; - if ($visibility && isset($extrafields->attributes[$this->table_element]['list'][$key])) { + if (isset($extrafields->attributes[$this->table_element]['list'][$key])) { $visibility = (int) dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '2'); } @@ -8630,9 +8630,9 @@ abstract class CommonObject $perms = (int) dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '2'); } - if (($mode == 'create') && abs($visibility) != 1 && abs($visibility) != 3) { + if (($mode == 'create') && !in_array(abs($visibility), array(1, 3))) { continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list - } elseif (($mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3 && abs($visibility) != 4) { + } elseif (($mode == 'edit') && !in_array(abs($visibility), array(1, 3, 4))) { continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation } elseif ($mode == 'view' && empty($visibility)) { continue; diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index c16cc2d3007..cf824fea339 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -272,6 +272,7 @@ class RssParser } try { + // @phan-suppress-next-line PhanTypeMismatchArgumentInternalProbablyReal $xmlparser = xml_parser_create(null); xml_parser_set_option($xmlparser, XML_OPTION_CASE_FOLDING, 0); diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index d07b4261ce5..a8bad027e59 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -1297,6 +1297,7 @@ class mysqliDoli extends mysqli if (strpos($host, 'ssl://') === 0) { $host = substr($host, 6); parent::options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, false); + // Suppress false positive @phan-suppress-next-line PhanTypeMismatchArgumentInternalProbablyReal parent::ssl_set(null, null, "", null, null); $flags = MYSQLI_CLIENT_SSL; } From ce30ccb004085c1709b8091cc502196afb23966d Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 9 Mar 2024 18:56:36 -0600 Subject: [PATCH 0779/1862] Update ticket.class.php #28721 - Default for Ticket fk_statut in "update" function (#28731) Correcting the default value for Ticket fk_statut to zero(0) instead of null based on the prescription from the create function. --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 73d1d86ba48..4edfc31a598 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1071,7 +1071,7 @@ class Ticket extends CommonObject $sql .= " fk_user_assign=".(isset($this->fk_user_assign) ? $this->fk_user_assign : "null").","; $sql .= " subject=".(isset($this->subject) ? "'".$this->db->escape($this->subject)."'" : "null").","; $sql .= " message=".(isset($this->message) ? "'".$this->db->escape($this->message)."'" : "null").","; - $sql .= " fk_statut=".(isset($this->fk_statut) ? $this->fk_statut : "null").","; + $sql .= " fk_statut=".(isset($this->fk_statut) ? $this->fk_statut : "0").","; $sql .= " resolution=".(isset($this->resolution) ? $this->resolution : "null").","; $sql .= " progress=".(isset($this->progress) ? "'".$this->db->escape($this->progress)."'" : "null").","; $sql .= " timing=".(isset($this->timing) ? "'".$this->db->escape($this->timing)."'" : "null").","; From e5dc0f97d0fae4230c1d735c85a93ecf48a93b7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Mar 2024 01:59:42 +0100 Subject: [PATCH 0780/1862] Fix cast --- htdocs/ticket/class/ticket.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 4edfc31a598..4980565b264 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1062,17 +1062,17 @@ class Ticket extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."ticket SET"; $sql .= " ref=".(isset($this->ref) ? "'".$this->db->escape($this->ref)."'" : "").","; $sql .= " track_id=".(isset($this->track_id) ? "'".$this->db->escape($this->track_id)."'" : "null").","; - $sql .= " fk_soc=".(isset($this->fk_soc) ? "'".$this->db->escape($this->fk_soc)."'" : "null").","; - $sql .= " fk_project=".(isset($this->fk_project) ? "'".$this->db->escape($this->fk_project)."'" : "null").","; - $sql .= " fk_contract=".(isset($this->fk_contract) ? "'".$this->db->escape($this->fk_contract)."'" : "null").","; + $sql .= " fk_soc=".(isset($this->fk_soc) ? (int) $this->fk_soc : "null").","; + $sql .= " fk_project=".(isset($this->fk_project) ? (int) $this->fk_project : "null").","; + $sql .= " fk_contract=".(isset($this->fk_contract) ? (int) $this->fk_contract : "null").","; $sql .= " origin_email=".(isset($this->origin_email) ? "'".$this->db->escape($this->origin_email)."'" : "null").","; - $sql .= " origin_email=".(isset($this->origin_replyto) ? "'".$this->db->escape($this->origin_replyto)."'" : "null").","; - $sql .= " fk_user_create=".(isset($this->fk_user_create) ? $this->fk_user_create : "null").","; - $sql .= " fk_user_assign=".(isset($this->fk_user_assign) ? $this->fk_user_assign : "null").","; + $sql .= " origin_replyto=".(isset($this->origin_replyto) ? "'".$this->db->escape($this->origin_replyto)."'" : "null").","; + $sql .= " fk_user_create=".(isset($this->fk_user_create) ? (int) $this->fk_user_create : "null").","; + $sql .= " fk_user_assign=".(isset($this->fk_user_assign) ? (int) $this->fk_user_assign : "null").","; $sql .= " subject=".(isset($this->subject) ? "'".$this->db->escape($this->subject)."'" : "null").","; $sql .= " message=".(isset($this->message) ? "'".$this->db->escape($this->message)."'" : "null").","; - $sql .= " fk_statut=".(isset($this->fk_statut) ? $this->fk_statut : "0").","; - $sql .= " resolution=".(isset($this->resolution) ? $this->resolution : "null").","; + $sql .= " fk_statut=".(isset($this->fk_statut) ? (int) $this->fk_statut : "0").","; + $sql .= " resolution=".(isset($this->resolution) ? (int) $this->resolution : "null").","; $sql .= " progress=".(isset($this->progress) ? "'".$this->db->escape($this->progress)."'" : "null").","; $sql .= " timing=".(isset($this->timing) ? "'".$this->db->escape($this->timing)."'" : "null").","; $sql .= " type_code=".(isset($this->type_code) ? "'".$this->db->escape($this->type_code)."'" : "null").","; From 4c442de1a2c6cc8b8dfc7d6227734dd14af35f21 Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 10 Mar 2024 02:00:41 +0100 Subject: [PATCH 0781/1862] Qual: Add phan stub files to phpstan configuration (#28730) * Qual: Add phan stub files to phpstan configuration * Provide log as artifact (for debug), improve CACHE_KEY --- .github/workflows/phpstan.yml | 14 ++++++++++---- phpstan.neon | 7 +++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 156da172ac7..967d16ab04e 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -9,9 +9,8 @@ concurrency: cancel-in-progress: true env: - CACHE_KEY_PART: > - ${{ ( github.event_name == 'pull_request' ) && github.base_ref - }}${{ ( github.event_name == 'pull_request' ) && '-' }}${{ github.head_ref }} + CACHE_KEY_PART: ${{ github.event_name == 'pull_request' && format('{0}-{1}', +github.base_ref, github.head_ref) || github.ref_name }} GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -58,7 +57,7 @@ jobs: # Run PHPStan - name: Run PHPStan id: phpstan - run: phpstan -vvv analyse --error-format=checkstyle --memory-limit 4G -a build/phpstan/bootstrap_action.php -c phpstan.neon | cs2pr --graceful-warnings + run: phpstan -vvv analyse --error-format=checkstyle --memory-limit 4G -a build/phpstan/bootstrap_action.php -c phpstan.neon | tee _stan.xml | cs2pr --graceful-warnings # continue-on-error: true # Save cache @@ -68,3 +67,10 @@ jobs: with: path: ./.github/tmp key: phpstan-cache-${{ matrix.php-version }}-${{ env.CACHE_KEY_PART }}-${{ github.run_id }} + - name: Provide phpstan log as artifact + uses: actions/upload-artifact@v4 + if: ${{ always() }} + with: + name: phpstan-srcrt + path: ${{ github.workspace }}/_stan.xml + retention-days: 2 diff --git a/phpstan.neon b/phpstan.neon index a4ddc377751..8951e8ddaa2 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -13,6 +13,13 @@ parameters: paths: - htdocs - scripts + stubFiles: + # - dev/tools/phan/stubs/GeoIP2.php + # - dev/tools/phan/stubs/geoip_inc.php + - dev/tools/phan/stubs/module_numberwords.php + - dev/tools/phan/stubs/restler.php + - dev/tools/phan/stubs/stripe.php + - dev/tools/phan/stubs/swiss-qr-bill.php excludePaths: analyseAndScan: - htdocs/custom/* From c6fa4e49453e9e90a7f0411c93701ba231b900cd Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 9 Mar 2024 20:44:47 +0100 Subject: [PATCH 0782/1862] Qual: Enable reporting PhanTypeMismatchDimAssignment --- dev/tools/phan/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index ee9cde2603f..f2fe12ea94c 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -448,7 +448,7 @@ return [ 'PhanRedefineClass', 'PhanRedefineFunction', 'PhanTypeInvalidLeftOperandOfBitwiseOp', - 'PhanTypeMismatchDimAssignment', + // 'PhanTypeMismatchDimAssignment', // 'PhanPluginDescriptionlessCommentOnProtectedMethod', 'PhanPluginPrintfIncompatibleArgumentTypeWeak', 'PhanUndeclaredVariableAssignOp', From 5f30dffa595a61f58ef1cd2cd48d0d85c327d46f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 10 Mar 2024 08:54:51 +0100 Subject: [PATCH 0783/1862] test --- phpstan.neon | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index e51200a24d1..5271aeffa07 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -16,10 +16,10 @@ parameters: stubFiles: # - dev/tools/phan/stubs/GeoIP2.php # - dev/tools/phan/stubs/geoip_inc.php - - dev/tools/phan/stubs/module_numberwords.php - - dev/tools/phan/stubs/restler.php - - dev/tools/phan/stubs/stripe.php - - dev/tools/phan/stubs/swiss-qr-bill.php + #- dev/tools/phan/stubs/module_numberwords.php + #- dev/tools/phan/stubs/restler.php + #- dev/tools/phan/stubs/stripe.php + #- dev/tools/phan/stubs/swiss-qr-bill.php excludePaths: analyseAndScan: - htdocs/custom/* From 8cbd159d503528b59b8fe4906866826104c0ca16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 10 Mar 2024 08:58:09 +0100 Subject: [PATCH 0784/1862] test --- .github/workflows/phpstan.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 967d16ab04e..84e84499807 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -9,8 +9,7 @@ concurrency: cancel-in-progress: true env: - CACHE_KEY_PART: ${{ github.event_name == 'pull_request' && format('{0}-{1}', -github.base_ref, github.head_ref) || github.ref_name }} + CACHE_KEY_PART: ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }} GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -57,7 +56,7 @@ jobs: # Run PHPStan - name: Run PHPStan id: phpstan - run: phpstan -vvv analyse --error-format=checkstyle --memory-limit 4G -a build/phpstan/bootstrap_action.php -c phpstan.neon | tee _stan.xml | cs2pr --graceful-warnings + run: phpstan -vvv analyse --error-format=checkstyle --memory-limit 6G -a build/phpstan/bootstrap_action.php -c phpstan.neon | tee _stan.xml | cs2pr --graceful-warnings # continue-on-error: true # Save cache From 101d56a2c1ae4c919a20381d2a796e9a5acfcb32 Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 10 Mar 2024 15:17:58 +0100 Subject: [PATCH 0785/1862] Fix: Ob buffer cleanup on exception # Fix: Ob buffer cleanup on exception The OB buffer capture was incorrectly cleaned up on exception. This fixes that. Also modified the SecurityTest to enable running it standalone --- htdocs/core/lib/functions.lib.php | 10 ++++++++++ test/phpunit/CommonClassTest.class.php | 5 +++++ test/phpunit/SecurityTest.php | 7 ++++--- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c43dd851c78..57f785261ea 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9839,6 +9839,7 @@ function dol_eval($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1' global $object; global $obj; // To get $obj used into list when dol_eval() is used for computed fields and $obj is not yet $object + $isObBufferActive = false; // When true, the ObBuffer must be cleaned in the exception handler if (!in_array($onlysimplestring, array('0', '1', '2'))) { return "Bad call of dol_eval. Parameter onlysimplestring must be '0' (deprecated), '1' or '2'"; } @@ -9957,16 +9958,20 @@ function dol_eval($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1' if ($returnvalue) { if ($hideerrors) { ob_start(); // An evaluation has no reason to output data + $isObBufferActive = true; $tmps = @eval('return '.$s.';'); $tmpo = ob_get_clean(); + $isObBufferActive = false; if ($tmpo) { print 'Bad string syntax to evaluate. Some data were output when it should not when evaluating: '.$s; } return $tmps; } else { ob_start(); // An evaluation has no reason to output data + $isObBufferActive = true; $tmps = eval('return '.$s.';'); $tmpo = ob_get_clean(); + $isObBufferActive = false; if ($tmpo) { print 'Bad string syntax to evaluate. Some data were output when it should not when evaluating: '.$s; } @@ -9981,6 +9986,11 @@ function dol_eval($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1' } } } catch (Error $e) { + if ($isObBufferActive) { + // Clean up buffer which was left behind due to exception. + $tmpo = ob_get_clean(); + $isObBufferActive = false; + } $error = 'dol_eval try/catch error : '; $error .= $e->getMessage(); dol_syslog($error, LOG_WARNING); diff --git a/test/phpunit/CommonClassTest.class.php b/test/phpunit/CommonClassTest.class.php index 2be3f58362f..a7c793ed9bf 100644 --- a/test/phpunit/CommonClassTest.class.php +++ b/test/phpunit/CommonClassTest.class.php @@ -26,11 +26,16 @@ * \remarks Class that extends all PHPunit tests. To share similare code between each test. */ +// Workaround for false security issue with main.inc.php in tests: +$_SERVER['PHP_SELF'] = "phpunit"; + global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver //require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; + + if (empty($user->id)) { print "Load permissions for admin user nb 1\n"; $user->fetch(1); diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 8a154897acb..42455c49cef 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -53,10 +53,11 @@ if (! defined("NOSESSION")) { define("NOSESSION", '1'); } -require_once dirname(__FILE__).'/../../htdocs/main.inc.php'; +// Implements workaround for PHP_SELF & includes common files: +require_once dirname(__FILE__).'/CommonClassTest.class.php'; + require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php'; -require_once dirname(__FILE__).'/CommonClassTest.class.php'; if (empty($user->id)) { print "Load permissions for admin user nb 1\n"; @@ -988,7 +989,7 @@ class SecurityTest extends CommonClassTest include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; - $result=dol_eval('1==1', 1, 0); + $result = dol_eval('1==1', 1, 0); print "result1 = ".$result."\n"; $this->assertTrue($result); From 5a5fa9293fb2cfdf9e957860134b55d9c721b48d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Mar 2024 15:42:38 +0100 Subject: [PATCH 0786/1862] FIX: upload odt files should not start/end with space --- htdocs/admin/facture.php | 2 ++ htdocs/core/lib/files.lib.php | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 3721646d950..75b5d0daa47 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -50,6 +50,8 @@ $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'invoice'; +$error = 0; + /* * Actions diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 9d7b2222040..245b5943b5d 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1840,6 +1840,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess // var_dump($result);exit; if ($result >= 0) { $TFile = $_FILES[$varfiles]; + // Convert value of $TFile if (!is_array($TFile['name'])) { foreach ($TFile as $key => &$val) { $val = array($val); @@ -1854,13 +1855,13 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess } // Define $destfull (path to file including filename) and $destfile (only filename) - $destfull = $upload_dir."/".$TFile['name'][$i]; - $destfile = $TFile['name'][$i]; + $destfile = trim($TFile['name'][$i]); + $destfull = $upload_dir."/".$destfile; $destfilewithoutext = preg_replace('/\.[^\.]+$/', '', $destfile); if ($savingdocmask && strpos($savingdocmask, $destfilewithoutext) !== 0) { - $destfull = $upload_dir."/".preg_replace('/__file__/', $TFile['name'][$i], $savingdocmask); - $destfile = preg_replace('/__file__/', $TFile['name'][$i], $savingdocmask); + $destfile = trim(preg_replace('/__file__/', $TFile['name'][$i], $savingdocmask)); + $destfull = $upload_dir."/".$destfile; } $filenameto = basename($destfile); @@ -1869,7 +1870,6 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess setEventMessages($langs->trans("ErrorFilenameCantStartWithDot", $filenameto), null, 'errors'); break; } - // dol_sanitizeFileName the file name and lowercase extension $info = pathinfo($destfull); $destfull = $info['dirname'].'/'.dol_sanitizeFileName($info['filename'].($info['extension'] != '' ? ('.'.strtolower($info['extension'])) : '')); From ec1b8284c91fbb689c59dddfce5afefc08454b31 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Mar 2024 15:52:29 +0100 Subject: [PATCH 0787/1862] Rename files to use an english name --- htdocs/admin/{facture.php => invoice.php} | 2 +- .../{facture_situation.php => invoice_situation.php} | 2 +- ..._extrafields.php => invoice_cust_extrafields.php} | 2 +- ...rafields.php => invoice_rec_cust_extrafields.php} | 2 +- ...trafields.php => invoicedet_cust_extrafields.php} | 2 +- ...ields.php => invoicedet_rec_cust_extrafields.php} | 2 +- htdocs/core/lib/invoice.lib.php | 12 ++++++------ htdocs/core/modules/modFacture.class.php | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) rename htdocs/admin/{facture.php => invoice.php} (99%) rename htdocs/admin/{facture_situation.php => invoice_situation.php} (99%) rename htdocs/compta/facture/admin/{facture_cust_extrafields.php => invoice_cust_extrafields.php} (97%) rename htdocs/compta/facture/admin/{facture_rec_cust_extrafields.php => invoice_rec_cust_extrafields.php} (97%) rename htdocs/compta/facture/admin/{facturedet_cust_extrafields.php => invoicedet_cust_extrafields.php} (97%) rename htdocs/compta/facture/admin/{facturedet_rec_cust_extrafields.php => invoicedet_rec_cust_extrafields.php} (97%) diff --git a/htdocs/admin/facture.php b/htdocs/admin/invoice.php similarity index 99% rename from htdocs/admin/facture.php rename to htdocs/admin/invoice.php index 75b5d0daa47..fe290ea6f80 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/invoice.php @@ -23,7 +23,7 @@ */ /** - * \file htdocs/admin/facture.php + * \file htdocs/admin/invoice.php * \ingroup facture * \brief Page to setup invoice module */ diff --git a/htdocs/admin/facture_situation.php b/htdocs/admin/invoice_situation.php similarity index 99% rename from htdocs/admin/facture_situation.php rename to htdocs/admin/invoice_situation.php index b514ef81721..d1a557f183d 100644 --- a/htdocs/admin/facture_situation.php +++ b/htdocs/admin/invoice_situation.php @@ -22,7 +22,7 @@ */ /** - * \file htdocs/admin/facture.php + * \file htdocs/admin/invoice_situation.php * \ingroup facture * \brief Page to setup invoice module */ diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/invoice_cust_extrafields.php similarity index 97% rename from htdocs/compta/facture/admin/facture_cust_extrafields.php rename to htdocs/compta/facture/admin/invoice_cust_extrafields.php index 67f3becb6b5..6b8581c9399 100644 --- a/htdocs/compta/facture/admin/facture_cust_extrafields.php +++ b/htdocs/compta/facture/admin/invoice_cust_extrafields.php @@ -20,7 +20,7 @@ */ /** -* \file htdocs/compta/facture/admin/facture_cust_extrafields.php +* \file htdocs/compta/facture/admin/invoice_cust_extrafields.php * \ingroup invoice * \brief Page to setup extra fields of customer invoice */ diff --git a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php b/htdocs/compta/facture/admin/invoice_rec_cust_extrafields.php similarity index 97% rename from htdocs/compta/facture/admin/facture_rec_cust_extrafields.php rename to htdocs/compta/facture/admin/invoice_rec_cust_extrafields.php index fb5282352fc..00fb625271c 100644 --- a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/invoice_rec_cust_extrafields.php @@ -21,7 +21,7 @@ */ /** -* \file htdocs/compta/facture/admin/facture_cust_extrafields.php +* \file htdocs/compta/facture/admin/invoice_cust_extrafields.php * \ingroup invoice * \brief Page to setup extra fields of customer invoice */ diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/invoicedet_cust_extrafields.php similarity index 97% rename from htdocs/compta/facture/admin/facturedet_cust_extrafields.php rename to htdocs/compta/facture/admin/invoicedet_cust_extrafields.php index 5bd66c4f0f7..61eabbac825 100644 --- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/invoicedet_cust_extrafields.php @@ -21,7 +21,7 @@ */ /** -* \file htdocs/compta/facture/admin/facture_cust_extrafields.php +* \file htdocs/compta/facture/admin/invoice_cust_extrafields.php * \ingroup invoice * \brief Page to setup extra fields of customer invoice */ diff --git a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php b/htdocs/compta/facture/admin/invoicedet_rec_cust_extrafields.php similarity index 97% rename from htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php rename to htdocs/compta/facture/admin/invoicedet_rec_cust_extrafields.php index 01c6abc310a..ed9a8d5d280 100644 --- a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/invoicedet_rec_cust_extrafields.php @@ -21,7 +21,7 @@ */ /** -* \file htdocs/compta/facture/admin/facture_cust_extrafields.php +* \file htdocs/compta/facture/admin/invoice_cust_extrafields.php * \ingroup invoice * \brief Page to setup extra fields of customer invoice */ diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 9e6a39c63f9..faf5068d403 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -177,7 +177,7 @@ function invoice_admin_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/admin/facture.php'; + $head[$h][0] = DOL_URL_ROOT.'/admin/invoice.php'; $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $h++; @@ -193,7 +193,7 @@ function invoice_admin_prepare_head() // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'invoice_admin'); - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php'; + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/invoice_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices"); $nbExtrafields = $extrafields->attributes['facture']['count']; if ($nbExtrafields > 0) { @@ -202,7 +202,7 @@ function invoice_admin_prepare_head() $head[$h][2] = 'attributes'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_cust_extrafields.php'; + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/invoicedet_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); $nbExtrafields = $extrafields->attributes['facturedet']['count']; if ($nbExtrafields > 0) { @@ -211,7 +211,7 @@ function invoice_admin_prepare_head() $head[$h][2] = 'attributeslines'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php'; + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/invoice_rec_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec"); $nbExtrafields = $extrafields->attributes['facture_rec']['count']; if ($nbExtrafields > 0) { @@ -220,7 +220,7 @@ function invoice_admin_prepare_head() $head[$h][2] = 'attributesrec'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php'; + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/invoicedet_rec_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLinesRec"); $nbExtrafields = $extrafields->attributes['facturedet_rec']['count']; if ($nbExtrafields > 0) { @@ -230,7 +230,7 @@ function invoice_admin_prepare_head() $h++; if (getDolGlobalInt('INVOICE_USE_SITUATION') > 0) { // Warning, implementation with value 1 is seriously bugged and a new one not compatible is expected to become stable - $head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php'; + $head[$h][0] = DOL_URL_ROOT.'/admin/invoice_situation.php'; $head[$h][1] = $langs->trans("InvoiceSituation"); $head[$h][2] = 'situation'; $h++; diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 4d90ba8252b..7cd9dacaefa 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -73,7 +73,7 @@ class modFacture extends DolibarrModules $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='text') // Config pages - $this->config_page_url = array("facture.php"); + $this->config_page_url = array("invoice.php"); // Constants $this->const = array(); From 453eb9c242c3f75d96e1cadc0cfa4f70345f3317 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Mar 2024 15:42:38 +0100 Subject: [PATCH 0788/1862] FIX: upload odt files should not start/end with space --- htdocs/admin/facture.php | 2 ++ htdocs/core/lib/files.lib.php | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 3384a0d31d6..19f1182e608 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -50,6 +50,8 @@ $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'invoice'; +$error = 0; + /* * Actions diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 7152e2778bb..b170c4fc177 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1777,6 +1777,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess // var_dump($result);exit; if ($result >= 0) { $TFile = $_FILES[$varfiles]; + // Convert value of $TFile if (!is_array($TFile['name'])) { foreach ($TFile as $key => &$val) { $val = array($val); @@ -1791,13 +1792,13 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess } // Define $destfull (path to file including filename) and $destfile (only filename) - $destfull = $upload_dir."/".$TFile['name'][$i]; - $destfile = $TFile['name'][$i]; + $destfile = trim($TFile['name'][$i]); + $destfull = $upload_dir."/".$destfile; $destfilewithoutext = preg_replace('/\.[^\.]+$/', '', $destfile); if ($savingdocmask && strpos($savingdocmask, $destfilewithoutext) !== 0) { - $destfull = $upload_dir."/".preg_replace('/__file__/', $TFile['name'][$i], $savingdocmask); - $destfile = preg_replace('/__file__/', $TFile['name'][$i], $savingdocmask); + $destfile = trim(preg_replace('/__file__/', $TFile['name'][$i], $savingdocmask)); + $destfull = $upload_dir."/".$destfile; } $filenameto = basename($destfile); @@ -1806,7 +1807,6 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess setEventMessages($langs->trans("ErrorFilenameCantStartWithDot", $filenameto), null, 'errors'); break; } - // dol_sanitizeFileName the file name and lowercase extension $info = pathinfo($destfull); $destfull = $info['dirname'].'/'.dol_sanitizeFileName($info['filename'].($info['extension'] != '' ? ('.'.strtolower($info['extension'])) : '')); From c23794a23cbf2c6d5aaba1b05cda38c89f6bd29d Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 22 Jan 2024 02:57:10 +0100 Subject: [PATCH 0789/1862] NEW: Script for fast identification of missing/unused/duplicate translations # NEW: Script for fast identification of missing/unused/duplicate translations Fast analysis of files to identify missing, unused and duplicate translations. Fast = less than 3 seconds when there are no exceptions (on my development machine). --- .pre-commit-config.yaml | 11 +- .../duplicate_translation_keys.lst | 265 ++ dev/translation/dynamic_translation_keys.lst | 3687 +++++++++++++++++ dev/translation/ignore_translation_keys.lst | 1183 ++++++ .../sanity_check_trans_missing_unused.sh | 212 + pyproject.toml | 2 +- 6 files changed, 5358 insertions(+), 2 deletions(-) create mode 100644 dev/translation/duplicate_translation_keys.lst create mode 100644 dev/translation/dynamic_translation_keys.lst create mode 100644 dev/translation/ignore_translation_keys.lst create mode 100755 dev/translation/sanity_check_trans_missing_unused.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 45f51d5c5db..814f144508c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -62,7 +62,9 @@ repos: rev: v6.2.1 hooks: - id: beautysh - exclude: (?x)^(dev/setup/git/hooks/pre-commit)$ + exclude: | + (?x)^(dev/setup/git/hooks/pre-commit + )$ args: [--tab] # Run local script @@ -77,6 +79,13 @@ repos: # ``` - repo: local hooks: + - name: Find missing/unused/duplicate language keys + id: check-translations + files: (?x)^(htdocs/langs/en_US/.*\.lang) + language: script + entry: ./dev/translation/sanity_check_trans_missing_unused.sh + pass_filenames: false + args: [list] - id: local-precommit-script name: Run local script before commit if it exists language: system diff --git a/dev/translation/duplicate_translation_keys.lst b/dev/translation/duplicate_translation_keys.lst new file mode 100644 index 00000000000..4e2c4f3b7a8 --- /dev/null +++ b/dev/translation/duplicate_translation_keys.lst @@ -0,0 +1,265 @@ +# File with duplicate translation keys that are ignored for +# reporting duplicates. +# FYI: Headers generated on https://manytools.org/hacker-tools/ascii-banner/ - DOS Rebel or ANSI Shadow +# Can also use 'figlet' tool (installable with `apt-get install figlet`) +# +# ██████████ +# ░░███░░░░░█ +# ░███ █ ░ █████ █████ ████████ ██████ ████████ █████ ██████ █████ +# ░██████ ░░███ ░░███ ░░███░░███ ███░░███░░███░░███ ███░░ ███░░███ ███░░ +# ░███░░█ ░░░█████░ ░███ ░███░███████ ░███ ░███ ░░█████ ░███████ ░░█████ +# ░███ ░ █ ███░░░███ ░███ ░███░███░░░ ░███ ░███ ░░░░███░███░░░ ░░░░███ +# ██████████ █████ █████ ░███████ ░░██████ ████ █████ ██████ ░░██████ ██████ +# ░░░░░░░░░░ ░░░░░ ░░░░░ ░███░░░ ░░░░░░ ░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░░░░ +# ░███ +# █████ +# ░░░░░ +# Expenses and trips overlap quite a bit, which is by design +# +AUTHOR +AUTHORPAIEMENT +AddTrip +AllExpenseReport +AllExpenseReports +AnyOtherInThisListCanValidate +AttachTheNewLineToTheDocument +AucuneLigne +BrouillonnerTrip +CANCEL_USER +CarCategory +ClassifyRefunded +CompanyVisited +ConfirmBrouillonnerTrip +ConfirmCancelTrip +ConfirmCloneExpenseReport +ConfirmDeleteTrip +ConfirmPaidTrip +ConfirmRefuseTrip +ConfirmSaveTrip +ConfirmValideTrip +DATE_CANCEL +DATE_PAIEMENT +DATE_REFUS +DATE_SAVE +DefaultCategoryCar +DefaultRangeNumber +DeleteTrip +EX_BRE +EX_CAM +EX_CAM_VP +EX_CAR +EX_CUR +EX_DOC +EX_EMM +EX_FUE +EX_FUE_VP +EX_GUM +EX_HOT +EX_IND +EX_KME +EX_OTR +EX_PAR +EX_PAR_VP +EX_POS +EX_SUM +EX_SUO +EX_TAX +EX_TOL +EX_TOL_VP +ErrorBadValueForParameter +ErrorDoubleDeclaration +ErrorRecordNotFound +Error_EXPENSEREPORT_ADDON_NotDefined +ExpenseRangeOffset +ExpenseReportApplyTo +ExpenseReportApproved +ExpenseReportApprovedMessage +ExpenseReportCanceled +ExpenseReportCanceledMessage +ExpenseReportConstraintViolationError +ExpenseReportConstraintViolationWarning +ExpenseReportDateEnd +ExpenseReportDateStart +ExpenseReportDomain +ExpenseReportIkDesc +ExpenseReportLimitAmount +ExpenseReportLimitOn +ExpenseReportLine +ExpenseReportPaid +ExpenseReportPaidMessage +ExpenseReportPayment +ExpenseReportRef +ExpenseReportRefused +ExpenseReportRefusedMessage +ExpenseReportRestrictive +ExpenseReportRuleErrorOnSave +ExpenseReportRuleSave +ExpenseReportRulesDesc +ExpenseReportWaitingForApproval +ExpenseReportWaitingForApprovalMessage +ExpenseReportWaitingForReApproval +ExpenseReportWaitingForReApprovalMessage +ExpenseReportsIk +ExpenseReportsRules +ExpenseReportsToApprove +ExpenseReportsToPay +ExpensesArea +FeesKilometersOrAmout +LastExpenseReports +ListOfFees +ListOfTrips +ListToApprove +ListTripsAndExpenses +MOTIF_CANCEL +MOTIF_REFUS +ModePaiement +NOT_AUTHOR +NewTrip +NoTripsToExportCSV +OnExpense +PDFStandardExpenseReports +PaidTrip +REFUSEUR +RangeIk +RangeNum +SaveTrip +ShowExpenseReport +ShowTrip +TF_BUS +TF_CAR +TF_ESSENCE +TF_HOTEL +TF_LUNCH +TF_METRO +TF_OTHER +TF_PEAGE +TF_TAXI +TF_TRAIN +TF_TRIP +TripCard +TripId +TripNDF +TripSociete +Trips +TripsAndExpenses +TripsAndExpensesStatistics +TypeFees +UploadANewFileNow +VALIDATOR +VALIDOR +ValidateAndSubmit +ValidatedWaitingApproval +ValideTrip +byEX_DAY +byEX_EXP +byEX_MON +byEX_YEA +expenseReportCatDisabled +expenseReportCoef +expenseReportCoefUndefined +expenseReportOffset +expenseReportPrintExample +expenseReportRangeDisabled +expenseReportRangeFromTo +expenseReportRangeMoreThan +expenseReportTotalForFive +nolimitbyEX_DAY +nolimitbyEX_EXP +nolimitbyEX_MON +nolimitbyEX_YEA +# +# █████████ █████ ███ +# ███░░░░░███ ░░███ ░░░ +# ░███ ░░░ ███████ ████████ ████ ████████ ██████ +# ░░█████████ ░░░███░ ░░███░░███░░███ ░░███░░███ ███░░███ +# ░░░░░░░░███ ░███ ░███ ░░░ ░███ ░███ ░███░███████ +# ███ ░███ ░███ ███ ░███ ░███ ░███ ░███░███░░░ +# ░░█████████ ░░█████ █████ █████ ░███████ ░░██████ +# ░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░███░░░ ░░░░░░ +# ░███ +# █████ +# ░░░░░ +# Stripe is similar to Paybox and has some keys in common +# +AccountParameter +CSSUrlForPaymentForm +Continue +Creditor +FollowingUrlAreAvailableToMakePayments +InformationToFindParameters +PaymentCode +PaymentForm +ThisIsInformationOnPayment +ThisScreenAllowsYouToPay +ToComplete +UsageParameter +WelcomeOnPaymentPage +YourEMail + + + +############################################################# +############################################################# +AccountancyCode +AffectedTo +AvailableFormats +BIC +BankTransferAmount +Buy +ByDefaultInList +ByYear +CashDesk +ChooseFileToImport +ConfirmCloneAsk +ContractSigned +ContractStatusClosed +CreateUser +CreatedBy +Customer +CustomerInvoicePayment +DatabaseName +DatabaseServer +DeleteFromCat +DeleteType +DriverType +ExportableDatas +ExportsArea +History +IBAN +IdModule +InterventionSentByEMail +InvoiceRef +InvoiceSubtype +LanguageFile +LineId +ListOfStockMovements +Location +MinimumAmount +Movements +NewSubscription +NewUser +NoSupplierOrder +NoticePeriod +OrderWaiting +PriceFormatInCurrentLanguage +Prospect +Prospect +ReOpen +ReceptionClassifyClosedInDolibarr +Rejects +Salaries +Sell +Server +ShowCompany +ShowTask +ShowTypeCard +StatusInterInvoiced +StatusToPay +Stock +Stocks +SubscriptionPayment +Suppliers +Type +Unit +Upgrade +WithdrawalReceipt diff --git a/dev/translation/dynamic_translation_keys.lst b/dev/translation/dynamic_translation_keys.lst new file mode 100644 index 00000000000..5e1df8fb25f --- /dev/null +++ b/dev/translation/dynamic_translation_keys.lst @@ -0,0 +1,3687 @@ +# Dynamic Translations - Could be ($key) in code. +# Purpose: do not list these keys as unused. +# +# Note: organise the keys in alphabetical order, +# keeping the module section in alphabetical +# order as well, except for "Others" which +# is kept last. + +# Ai +AiDescription +AiDescriptionLong +AiSetup +AI_API_CHATGPT_ENDPOINT +AI_API_CHATGPT_KEY +AI_KEY_API_CHATGPT + +# datapolicy +DATAPOLICY_ADHERENT +DATAPOLICY_CONTACT_CLIENT +DATAPOLICY_CONTACT_FOURNISSEUR +DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT +DATAPOLICY_CONTACT_PROSPECT +DATAPOLICY_CONTACT_PROSPECT_CLIENT +DATAPOLICY_TIERS_CLIENT +DATAPOLICY_TIERS_FOURNISSEUR +DATAPOLICY_TIERS_NIPROSPECT_NICLIENT +DATAPOLICY_TIERS_PROSPECT +DATAPOLICY_TIERS_PROSPECT_CLIENT + +# fournisseur +CodePaymentTerm +IdPaymentTerm +LabelPaymentTerm + +# ticket +TicketAnswered + +# website_template +Message +Map +Reservation + +# Others +ACCOUNTING_ACCOUNT_CUSTOMER +ACCOUNTING_ACCOUNT_CUSTOMER_Desc +ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY +ACCOUNTING_ACCOUNT_SUPPLIER +ACCOUNTING_ACCOUNT_SUPPLIER_Desc +ACCOUNTING_ACCOUNT_SUSPENSE +ACCOUNTING_ACCOUNT_TRANSFER_CASH +ACCOUNTING_BANK_JOURNAL +ACCOUNTING_DATE_START_BINDING +ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER +ACCOUNTING_EXPENSEREPORT_JOURNAL +ACCOUNTING_EXPORT_AMOUNT +ACCOUNTING_EXPORT_DATE +ACCOUNTING_EXPORT_DEVISE +ACCOUNTING_EXPORT_ENDLINE +ACCOUNTING_EXPORT_FORMAT +ACCOUNTING_EXPORT_GLOBAL_ACCOUNT +ACCOUNTING_EXPORT_LABEL +ACCOUNTING_EXPORT_PIECE +ACCOUNTING_EXPORT_PREFIX_SPEC +ACCOUNTING_EXPORT_SEPARATORCSV +ACCOUNTING_HAS_NEW_JOURNAL +ACCOUNTING_INVENTORY_JOURNAL +ACCOUNTING_LENGTH_AACCOUNT +ACCOUNTING_LENGTH_DESCRIPTION +ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT +ACCOUNTING_LENGTH_GACCOUNT +ACCOUNTING_LIMIT_LIST_VENTILATION +ACCOUNTING_LIST_SORT_VENTILATION_DONE +ACCOUNTING_LIST_SORT_VENTILATION_TODO +ACCOUNTING_MISCELLANEOUS_JOURNAL +ACCOUNTING_PRODUCT_BUY_ACCOUNT +ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT +ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT +ACCOUNTING_PRODUCT_SOLD_ACCOUNT +ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT +ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT +ACCOUNTING_PURCHASE_JOURNAL +ACCOUNTING_RESULT_LOSS +ACCOUNTING_RESULT_PROFIT +ACCOUNTING_REVENUESTAMP_BUY_ACCOUNT +ACCOUNTING_REVENUESTAMP_SOLD_ACCOUNT +ACCOUNTING_SELL_JOURNAL +ACCOUNTING_SERVICE_BUY_ACCOUNT +ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT +ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT +ACCOUNTING_SERVICE_SOLD_ACCOUNT +ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT +ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT +ACCOUNTING_SOCIAL_JOURNAL +ACCOUNTING_VAT_BUY_ACCOUNT +ACCOUNTING_VAT_BUY_REVERSE_CHARGES_CREDIT +ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT +ACCOUNTING_VAT_PAY_ACCOUNT +ACCOUNTING_VAT_SOLD_ACCOUNT +ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT +AGENDA_EVENT_CURRENT_COLOR +AGENDA_EVENT_FUTURE_COLOR +AGENDA_EVENT_PAST_COLOR +AGENDA_SHOW_LINKED_OBJECT +APPROVEDInDolibarr +ASSET_ACCOUNTANCY_CATEGORY +AbandonmentComment +AccountAccountingSuggest +AccountCard +AccountLabel +AccountRef +AccountancyAreaDescDonation +AccountancyAreaDescLoan +AccountancyAreaDescSal +AccountancyAreaDescSubscription +AccountancyCodeAsset +AccountancyCodeDepreciationAsset +AccountancyCodeDepreciationExpense +AccountancyErrorMismatchLetterCode +AccountancyHome +AccountancyTreasuryArea +AccountingCategoriesDesc +AccountingJournal +AccountingPeriodCard +AccountsArea +AccountsCategoriesShort +AchatTelechargement +ActionAC_CLO +ActionAC_COM +ActionAC_EMAIL +ActionAC_EMAILING +ActionAC_EMAIL_IN +ActionAC_EVENTORGANIZATION +ActionAC_FAC +ActionAC_FAX +ActionAC_INT +ActionAC_OTH +ActionAC_OTH_AUTO +ActionAC_OTH_AUTOShort +ActionAC_PROP +ActionAC_RDV +ActionAC_REL +ActionAC_SHIP +ActionAC_SUP_INV +ActionAC_SUP_ORD +ActionAC_TEL +ActionByCP +ActionRunningNotStarted +ActionsOnReception +ActionsOnShipping +ActionsOnSupplierProposal +ActionsOwnedByShort +ActivateOn +ActivateService +ActiveOn +AddAddress +AddAll +AddCompteFromBK +AddDiscount +AddElement +AddEventToUserOkCP +AddFiles +AddInventoryProduct +AddLink +AddLoan +AddRelativeDiscount +AddResource +AddSalary +AddSalaryPayment +AddSocialContribution +AddSupplierOrder +AddThisArticle +AddVariousPayment +AddressesForCompany +AdminLoginAlreadyExists +Agendas +AllAgreementSend +AllExportedMovementsWereRecordedAsExported +AllProductServicePrices +AllProducts +AllRIB +AllReceptions +AllSms +AllWidgetsWereEnabled +AllowCommentOnProject +AllowCommentOnTask +AllowUnknownPeopleSuggestBooth +AllowUnknownPeopleSuggestConf +AlreadyRead +Always +AmountByMonth +AmountIn +AmountInvoiced +AmountInvoicedHT +AmountInvoicedTTC +AmountLT1 +AmountLT1ES +AmountLT2 +AmountLT2ES +AmountOfRegistrationPaid +AmountPaymentDistributedOnInvoice +AmountRequested +AmountSalary +AmountToTransfer +AnalyticCode +AnnualByCompanies +AnnualByCompaniesDueDebtMode +AnnualByCompaniesInputOutputMode +AnnualSummaryDueDebtMode +AnnualSummaryInputOutputMode +AnotherContainer +AnswerCandidature +Answered +ApplicantIpAddress +ApplicantOrVisitor +ApplyMassCategories +ApplyPMP +AppointmentDuration +ApproveSms +ApprovedBy2 +Article +AskPrice +AssetAccountancyCodeAcceleratedDepreciation +AssetAccountancyCodeAsset +AssetAccountancyCodeDepreciationAcceleratedDepreciation +AssetAccountancyCodeDepreciationAsset +AssetAccountancyCodeDepreciationEconomic +AssetAccountancyCodeDepreciationExpense +AssetAccountancyCodeEndowmentAcceleratedDepreciation +AssetAccountancyCodeProceedsFromSales +AssetAccountancyCodeProvisionAcceleratedDepreciation +AssetAccountancyCodeReceivableOnAssignment +AssetAccountancyCodeValueAssetSold +AssetAccountancyCodeVatCollected +AssetAccountancyCodeVatDeductible +AssetAcquisitionType +AssetAcquisitionTypeNew +AssetAcquisitionTypeOccasion +AssetAcquisitionValueHT +AssetDateAcquisition +AssetDateStart +AssetDepreciationOptionAcceleratedDepreciation +AssetDepreciationOptionAmountBaseDeductibleHT +AssetDepreciationOptionAmountBaseDepreciationHT +AssetDepreciationOptionDegressiveRate +AssetDepreciationOptionDepreciationType +AssetDepreciationOptionDepreciationTypeDegressive +AssetDepreciationOptionDepreciationTypeExceptional +AssetDepreciationOptionDepreciationTypeLinear +AssetDepreciationOptionDuration +AssetDepreciationOptionDurationType +AssetDepreciationOptionDurationTypeAnnual +AssetDepreciationOptionDurationTypeDaily +AssetDepreciationOptionDurationTypeMonthly +AssetDepreciationOptionEconomic +AssetDepreciationOptionRate +AssetDepreciationOptionTotalAmountLastDepreciationHT +AssetNotDepreciated +AssetNumber +AssetRecorded +AssetRecoveredVAT +AssetReversalAmountHT +AssetReversalDate +AssetType +AssetTypeFinancial +AssetTypeInProgress +AssetTypeIntangible +AssetTypeTangible +AssetsLines +AssetsType +AssetsTypeId +AssetsTypeLabel +AssetsTypes +AssignDedicatedAccountingAccount +AssignTask +Assigned +AssociatedProductsNumber +AttachJoinedDocumentsToObject +AucuneLigne +AutoFillFormFieldBeforeSubmit +AutomaticClosing +Automation +AvailabilityTypeAV_1M +AvailabilityTypeAV_1W +AvailabilityTypeAV_2W +AvailabilityTypeAV_3W +AvailabilityTypeAV_NOW +BICNumber +BILL_DELETEInDolibarr +BILL_SUPPLIER_DELETEInDolibarr +BOMLine +BOM_CLOSEInDolibarr +BOM_DELETEInDolibarr +BOM_REOPENInDolibarr +BOM_UNVALIDATEInDolibarr +BOM_VALIDATEInDolibarr +BOOKCAL_PUBLIC_INTERFACE_TOPIC +BackOffice +BackToChartofaccounts +BackToHelpCenter +BackToHomePage +Balancing +BankAccountNumberKey +BankCode +BankColorizeMovementName1 +BankColorizeMovementName2 +BankDetails +BankLineNotReconciled +BankToPay +BankTransactionForCategory +BankTransferPayment +BankTransferRequestsDone +BankTransfers +Banner +BarcodeDescC128 +BarcodeDescC39 +BarcodeDescDATAMATRIX +BarcodeDescEAN13 +BarcodeDescEAN8 +BarcodeDescISBN +BarcodeDescQRCODE +BarcodeDescUPC +BasedOnTwoFirstLettersOfVATNumberBeingDifferentFromYourCompanyCountry +BasedOnTwoFirstLettersOfVATNumberBeingTheSameAsYourCompanyCountry +BillAddress +BillOfMaterialsLines +BillShortStatusClosedPaidPartially +BillShortStatusClosedUnpaid +BillShortStatusConverted +BillShortStatusNotRefunded +BillShortStatusPaidBackOrConverted +BillShortStatusStarted +BillStatus +BillStatusNotRefunded +BillsAndSalaries +BillsCustomer +BillsCustomersUnpaidForCompany +BillsLate +BillsSuppliersUnpaidForCompany +BlockedLogActivatedBecauseRequiredByYourCountryLegislation +BlockedLogAreRequiredByYourCountryLegislation +BlockedLogBillDownload +BlockedLogBillPreview +BlockedlogInfoDialog +BlogPost +BodyNotIn +BomAndBomLines +BookCalAbout +BookCalAboutPage +BookcalLabelAvailabilityHelp +BookeppingLineAlreayExists +Booking +BookmarksMenuShortCut +Boolean +Bottom +BoxCurrentAccounts +BoxCustomersOutstandingBillReached +BoxDolibarrStateBoard +BoxFicheInter +BoxGlobalActivity +BoxGoodCustomers +BoxLastActions +BoxLastContacts +BoxLastContracts +BoxLastCustomerBills +BoxLastCustomerOrders +BoxLastCustomerShipments +BoxLastCustomers +BoxLastKnowledgerecordModifiedContent +BoxLastManualEntries +BoxLastMembers +BoxLastMembersSubscriptions +BoxLastModifiedMembers +BoxLastProducts +BoxLastProposals +BoxLastProspects +BoxLastRssInfos +BoxLastSupplierBills +BoxLastSuppliers +BoxLatestSupplierOrders +BoxLatestSupplierOrdersAwaitingReception +BoxOldestActions +BoxOldestExpiredServices +BoxOldestUnpaidCustomerBills +BoxOldestUnpaidSupplierBills +BoxProductsAlertStock +BoxSuspenseAccount +BoxTicketLastXDayswidget +BoxTitleLastActionsToDo +BoxTitleLastCustomersOrProspects +BoxTitleLastModifiedCustomerBills +BoxTitleLastModifiedCustomerOrders +BoxTitleLastModifiedPropals +BoxTitleLastModifiedSupplierBills +BoxTitleLatestModifiedSupplierOrders +BoxesActivated +BoxesAvailable +BrowserMethodDescription +BugTracker +Build +BulkActions +BuyingPriceNumShort +ByAccounts +ByCountry +ByDate +ByDay +ByDefaultInList +ByExpenseIncome +ByMonth +BySalesRepresentative +ByTown +CANCELInDolibarr +COMPANY_DELETEInDolibarr +CONTACT_DELETEInDolibarr +CONTRACT_DELETEInDolibarr +CREATEInDolibarr +CREATE_NEW_SALARY_WITHOUT_AUTO_PAYMENT +CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT +CRUDCreateWrite +CRUDRead +CalcModeEngagement +CalcModeLT1 +CalcModeLT1Debt +CalcModeLT1Rec +CalcModeLT2 +CalcModeLT2Rec +CalcModeVATDebt +CalcModeVATEngagement +CancelPartnershipForExpiredMembers +CancelUpdate +CancelUpload +CanceledById +CanceledByLogin +CannotRemoveDirectoryContainsFiles +CannotRemoveDirectoryContainsFilesOrDirs +CantSuggest +CardBill +CardContent +CardProduct0 +CardProduct1 +Cards +CashAccounts +CashDeskBankCB +CashDeskBankCash +CashDeskBankCheque +CashDeskMenu +CashDeskOn +CashDeskProducts +CashDeskStock +CashDeskThirdParty +CashDeskWarehouse +CashDeskYouDidNotDisableStockDecease +CashFence +CatContactList +CatContactsLinks +CatCusLinks +CatCusList +CatList +CatListAll +CatMemberList +CatMembersLinks +CatProdLinks +CatProdList +CatProjectsLinks +CatProjectsList +CatSupLinks +CatSupList +CatUsersLinks +CatUsersList +CategId +CategTypeNotFound +CategoryDeleted +ChartofaccountsId +CheckBank +ChequeBordereau +ChequesReceipts +Choose +ChooseCategory +ChooseProduct/Service +ChooseYourDemoProfilMore +CivilityCode +CivilityDR +CivilityMLE +CivilityMME +CivilityMMEShort +CivilityMR +CivilityMRShort +CivilityMTRE +ClassCreditedConfirm +ClassNotFoundIntoPathWarning +Classify +ClassifyBill +ClassifyClosed +ClassifyUnbilled +CleanFixHistory +CleanHistory +CleanUnfinishedCronjob +CleanUnfinishedCronjobShort +ClickToRefresh +CloneCombinationsProduct +CloseBill +CloseEtablishment +CloseFiscalYear +CloseProcessedOrdersAutomatically +CloseService +Closed2 +ClosedById +ClosedByLogin +Closing +CodeLastResult +CodePaymentMode +Codemulticurrency +CollapseBOMHelp +ColumnNewPMP +Commercial +CommercialProposal +CommercialProposalsShort +CompanyHasCreditNote +CompanyHasDownPaymentOrCommercialDiscount +CompanyHasNoCategory +CompanyIsInCustomersCategories +CompanyIsInSuppliersCategories +CompatibleAfterUpdate +CompatibleUpTo +Completed +CompressSyslogs +Conciliated +Conciliation +ConfAttendeeSubscriptionConfirmation +ConferenceAttendeeFee +ConferenceOrBoothInformation +ConfirmActivateService +ConfirmClassifyPaidPartiallyReasonAvoir +ConfirmClassifyPaidPartiallyReasonAvoirDesc +ConfirmClassifyPaidPartiallyReasonDiscountNoVat +ConfirmClassifyPaidPartiallyReasonDiscountNoVatDesc +ConfirmClassifyPaidPartiallyReasonDiscountVat +ConfirmClassifyPaidPartiallyReasonOther +ConfirmClassifyPaidPartiallyReasonOtherDesc +ConfirmClassifyPaidPartiallyReasonProductReturned +ConfirmClassifyPaidPartiallyReasonProductReturnedDesc +ConfirmClonePage +ConfirmCloseService +ConfirmDeleteAsset +ConfirmDeleteAssetType +ConfirmDeleteCptCategory +ConfirmDeleteMvtPartial +ConfirmFlushInventory +ConfirmMassCloneQuestion +ConfirmMassCloneToOneProject +ConfirmPasswordReset +ConfirmSendCardByMail +ConfirmValidSms +ConsumptionEfficiency +ContactCreatedByEmailCollector +ContactDefault_agenda +ContactDefault_commande +ContactDefault_contrat +ContactDefault_facture +ContactDefault_fichinter +ContactDefault_invoice_supplier +ContactDefault_order_supplier +ContactDefault_project +ContactDefault_project_task +ContactDefault_propal +ContactDefault_supplier_proposal +ContactDefault_ticket +ContactHasNoCategory +ContactId +ContactIsInCategories +ContentsNotVisibleByAllShort +ContentsVisibleByAllShort +Continue +ContractEndDate +ContractLines +ContractStartDate +ContractsAndLine +Copy +CorporateHomePage +CountLastUrlCheckError +CountryCode +CreateAccount +CreateBanque +CreateBookmark +CreateCalcSchedule +CreateCandidature +CreateDraft +CreateDraftIntervention +CreateGuichet +CreateLeadAndThirdParty +CreateMailing +CreateSms +CreateTicketAndThirdParty +CreatedById +CreatedByLogin +CreditTransferFile +CronAdd +CronId +CurentlyUsingPhysicalStock +CurentlyUsingVirtualStock +CurrencyAUD +CurrencyCAD +CurrencyCHF +CurrencyCentEUR +CurrencyCentINR +CurrencyCentSingEUR +CurrencyCentSingINR +CurrencyCode +CurrencyCodeId +CurrencyEUR +CurrencyFRF +CurrencyGBP +CurrencyINR +CurrencyMAD +CurrencyMGA +CurrencyMUR +CurrencyNOK +CurrencyPrice +CurrencySingAUD +CurrencySingCAD +CurrencySingCHF +CurrencySingEUR +CurrencySingFRF +CurrencySingGBP +CurrencySingINR +CurrencySingMAD +CurrencySingMGA +CurrencySingMUR +CurrencySingNOK +CurrencySingTND +CurrencySingUAH +CurrencySingUSD +CurrencySingXAF +CurrencySingXOF +CurrencySingXPF +CurrencyTND +CurrencyThousandthSingTND +CurrencyUAH +CurrencyUSD +CurrencyUnitPrice +CurrencyXAF +CurrencyXOF +CurrencyXPF +Currencyeuros +CurrentAccounts +CurrentDedicatedAccountingAccount +CurrentPA +CurrentProductPrice +CurrentSalary +CurrentStock +CurrentTranslationString +CurrentValue +CustomReceipt +CustomerCard +CustomerCodeShort +CustomerIBAN +CustomerInvoicePayment +CustomerInvoicePaymentBack +CustomersInvoicesAndInvoiceLines +CustomersInvoicesAndPayments +CustomersOrdersAndOrdersLines +Cut +DATAPOLICYJob +DATAPOLICYReturn +DATAPOLICY_ADHERENT +DATAPOLICY_BLOCKCHECKBOX +DATAPOLICY_CONTACT_CLIENT +DATAPOLICY_CONTACT_FOURNISSEUR +DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT +DATAPOLICY_CONTACT_PROSPECT +DATAPOLICY_CONTACT_PROSPECT_CLIENT +DATAPOLICY_PORTABILITE +DATAPOLICY_TIERS_CLIENT +DATAPOLICY_TIERS_FOURNISSEUR +DATAPOLICY_TIERS_NIPROSPECT_NICLIENT +DATAPOLICY_TIERS_PROSPECT +DATAPOLICY_TIERS_PROSPECT_CLIENT +DAV_ALLOW_ECM_DIR +DAV_ALLOW_ECM_DIRTooltip +DAV_ALLOW_PRIVATE_DIR +DAV_ALLOW_PRIVATE_DIRTooltip +DAV_ALLOW_PUBLIC_DIR +DAV_ALLOW_PUBLIC_DIRTooltip +DELETEInDolibarr +DOL_ACTIVATE_BUZZER +DOL_ALIGN_CENTER +DOL_ALIGN_LEFT +DOL_ALIGN_RIGHT +DOL_BEEP +DOL_BEEP_ALTERNATIVE +DOL_BOLD +DOL_BOLD_DISABLED +DOL_CUT_PAPER_FULL +DOL_CUT_PAPER_PARTIAL +DOL_DEFAULT_HEIGHT_WIDTH +DOL_DOUBLE_HEIGHT +DOL_DOUBLE_WIDTH +DOL_LINE_FEED +DOL_LINE_FEED_REVERSE +DOL_PRINT_BARCODE +DOL_PRINT_BARCODE_CUSTOMER_ID +DOL_PRINT_CURR_DATE +DOL_PRINT_LOGO +DOL_PRINT_LOGO_OLD +DOL_PRINT_OBJECT_LINES +DOL_PRINT_QRCODE +DOL_PRINT_TEXT +DOL_UNDERLINE +DOL_UNDERLINE_DISABLED +DOL_USE_FONT_A +DOL_USE_FONT_B +DOL_USE_FONT_C +DOL_VALUE_CUSTOMER_ACCOUNT_BALANCE +DOL_VALUE_CUSTOMER_FIRSTNAME +DOL_VALUE_CUSTOMER_LASTNAME +DOL_VALUE_CUSTOMER_MAIL +DOL_VALUE_CUSTOMER_MOBILE +DOL_VALUE_CUSTOMER_PHONE +DOL_VALUE_CUSTOMER_POINTS +DOL_VALUE_CUSTOMER_SKYPE +DOL_VALUE_CUSTOMER_TAX_NUMBER +DOL_VALUE_DAY +DOL_VALUE_DAY_LETTERS +DOL_VALUE_MONTH +DOL_VALUE_MONTH_LETTERS +DOL_VALUE_MYSOC_NAME +DOL_VALUE_OBJECT_POINTS +DONATION_ACCOUNTINGACCOUNT +DataCodeIDSourceIsInsertedInto +DataComeFromNoWhere +DataIDSourceIsInsertedInto +DataIsInsertedInto +DataUsedToSuggestAccount +DateActionBegin +DateAndHour +DateAndTime +DateEmploymentEnd +DateEmploymentStart +DateEndEvent +DateEndInMonth +DateEndPlannedMo +DateFormatYYYYMM +DateFormatYYYYMMDD +DateFormatYYYYMMDDHHMM +DateInvoiceWithTime +DateLastCollectResult +DateLastGenerationShort +DateLastLogin +DateLastcollectResultOk +DateLimit +DateMovement +DateMustBeAfterThan +DateMustBeBeforeThan +DateOfLine +DatePartnershipEnd +DatePartnershipStart +DatePreviousLogin +DateSending +DateStartEvent +DateStartInMonth +DateStartPlannedMo +DebugBarDesc +Deductible +DefaultCategoryCar +DefaultPaymentConditionsRetainedWarranty +DefaultPrice +DefaultPrinter +DefaultPuttingDescUpToDate +DefaultPuttingPricesUpToDate +DefaultRIB +DefaultRangeNumber +Defaultfortype +DefineEventUserCP +Delays_MAIN_DELAY_ACTIONS_TODO +Delays_MAIN_DELAY_CHEQUES_TO_DEPOSIT +Delays_MAIN_DELAY_CUSTOMER_BILLS_UNPAYED +Delays_MAIN_DELAY_EXPENSEREPORTS +Delays_MAIN_DELAY_HOLIDAYS +Delays_MAIN_DELAY_MEMBERS +Delays_MAIN_DELAY_NOT_ACTIVATED_SERVICES +Delays_MAIN_DELAY_ORDERS_TO_PROCESS +Delays_MAIN_DELAY_PROJECT_TO_CLOSE +Delays_MAIN_DELAY_PROPALS_TO_BILL +Delays_MAIN_DELAY_PROPALS_TO_CLOSE +Delays_MAIN_DELAY_RUNNING_SERVICES +Delays_MAIN_DELAY_SUPPLIER_BILLS_TO_PAY +Delays_MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS +Delays_MAIN_DELAY_TASKS_TODO +Delays_MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE +DeleteASms +DeleteAnAssetType +DeleteArticle +DeleteCptCategory +DeleteSms +DemandReasonTypeSRC_CAMP_EMAIL +DemandReasonTypeSRC_CAMP_FAX +DemandReasonTypeSRC_CAMP_MAIL +DemandReasonTypeSRC_CAMP_PHO +DemandReasonTypeSRC_COMM +DemandReasonTypeSRC_EMPLOYEE +DemandReasonTypeSRC_INTE +DemandReasonTypeSRC_PARTNER +DemandReasonTypeSRC_SHOP +DemandReasonTypeSRC_SPONSORING +DemandReasonTypeSRC_SRC_CUSTOMER +DemandReasonTypeSRC_WOM +DemoCompanyAll +DemoCompanyManufacturing +DemoCompanyProductAndStocks +DemoCompanyServiceOnly +DemoCompanyShopWithCashDesk +DemoFundation +DemoFundation2 +Denied +DepositGenerated +DepositId +Deposits +DescADHERENT_AUTOREGISTER_NOTIF_MAIL +DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT +DescADHERENT_CC_MAIL_FROM +DescADHERENT_EMAIL_TEMPLATE_AUTOREGISTER +DescADHERENT_EMAIL_TEMPLATE_CANCELATION +DescADHERENT_EMAIL_TEMPLATE_EXCLUSION +DescADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION +DescADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION +DescADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION +DescADHERENT_MAILMAN_ADMIN_PASSWORD +DescADHERENT_MAILMAN_LISTS +DescADHERENT_MAILMAN_UNSUB_URL +DescADHERENT_MAILMAN_URL +DescADHERENT_MAIL_FROM +DescADHERENT_SPIP_DB +DescADHERENT_SPIP_PASS +DescADHERENT_SPIP_SERVEUR +DescADHERENT_SPIP_USER +DescThirdPartyReport +DescWareHouse +DescriptionLong +DescriptionOfLine +DeskCode +DetailByAccount +DictionaryAccountancyJournal +DictionaryAccountancysystem +DictionaryActions +DictionaryAssetDisposalType +DictionaryAvailability +DictionaryBatchStatus +DictionaryCanton +DictionaryCivility +DictionaryCompanyJuridicalType +DictionaryCompanyType +DictionaryCountry +DictionaryCurrency +DictionaryDepartment +DictionaryEMailTemplates +DictionaryEcotaxe +DictionaryExpenseTaxCat +DictionaryExpenseTaxRange +DictionaryFees +DictionaryFormatCards +DictionaryFunction +DictionaryHolidayTypes +DictionaryInvoiceSubtype +DictionaryMeasuringUnits +DictionaryOpportunityStatus +DictionaryOrderMethods +DictionaryPaymentConditions +DictionaryPaymentModes +DictionaryProductNature +DictionaryProspectContactLevel +DictionaryProspectContactStatus +DictionaryProspectLevel +DictionaryProspectStatus +DictionaryPublicHolidays +DictionaryRegion +DictionaryResourceType +DictionarySendingMethods +DictionarySocialContributions +DictionarySocialNetworks +DictionarySource +DictionaryStaff +DictionaryTransportMode +DictionaryTypeContact +DictionaryTypeOfContainer +DictionaryUnits +Difference +DirectPrint +Disassemble +Dispatch +DispatchVerb +DoCreditTransferBeforePayments3 +DoNotAutofillButAutoConcat +DoNotRemovePreviousCombinations +DoNotShowMyTasksOnly +DoNotUseDescriptionOfProdut +DoNotUseInProduction +DoTest +Docref +DocumentModelStandard +Documents2 +DolibarrReceiptPrinter +DontForgetCreateTokenOauthMod +DraftInvoiceDeleted +DraftPropals +DraftSuppliersOrders +Drafts +DurationEffective +DurationOfLine +DurationOfRange +Dynamiccontent +EMailHostPort +EMailRecipient +EMailTextProposalClosedRefusedWeb +EMailTextProposalClosedSignedWeb +ENABLEDISABLEInDolibarr +EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH +EVENTORGANIZATION_CATEG_THIRDPARTY_CONF +EVENTORGANIZATION_FILTERATTENDEES_CAT +EVENTORGANIZATION_FILTERATTENDEES_TYPE +EVENTORGANIZATION_SECUREKEY +EVENTORGANIZATION_TASK_LABEL +EVENTORGANIZATION_TASK_LABELTooltip +EVENTORGANIZATION_TASK_LABELTooltip2 +EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH +EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT +EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH +EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF +EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES +EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER +EXPENSE_REPORT_APPROVEInDolibarr +EXPENSE_REPORT_CREATEInDolibarr +EXPENSE_REPORT_DELETEInDolibarr +EXPENSE_REPORT_REFUSEDInDolibarr +EXPENSE_REPORT_VALIDATEInDolibarr +EX_BRE +EX_CAM +EX_CAM_VP +EX_CAR +EX_CUR +EX_DOC +EX_EMM +EX_FUE +EX_FUE_VP +EX_GUM +EX_HOT +EX_IND +EX_KME +EX_OTR +EX_PAR +EX_PAR_VP +EX_POS +EX_SUM +EX_SUO +EX_TAX +EX_TOL +EX_TOL_VP +EarlyClosingComment +EarlyClosingReason +EditMailing +EditMedias +EditMenu +EditPassword +EditProductCombinations +EditSms +EmailCollectorDescription +EmailCollectorExampleToCollectAnswersFromExternalEmailSoftwareDesc +EmailCollectorTargetDir +EmailRecruiter +EmployeeFirstname +EmployeeLastname +EmployeeSkillsUpdated +EmployeesInThisPosition +EmptyPage +EnableFeatureFor +EnabledAndDisabled +EndPointFor +EndSubscription +ErrNoSkillSelected +ErrUnzipFails +ErrorAVirtualProductCantBeUsedIntoABomOrMo +ErrorAccountingJournalIsAlreadyUse +ErrorActionCommPropertyUserowneridNotDefined +ErrorAddEventToUserCP +ErrorBadBarCodeSyntax +ErrorBadCustomerCodeSyntax +ErrorBadDefinitionOfMenuArrayInModuleDescriptor +ErrorBadMaskBadRazMonth +ErrorBadMaskFailedToLocatePosOfSequence +ErrorBadSupplierCodeSyntax +ErrorBadThirdPartyName +ErrorBadValueForParamNotAString +ErrorBankReceiptAlreadyExists +ErrorBarCodeAlreadyUsed +ErrorBarCodeRequired +ErrorBillNotFound +ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder +ErrorCannotAddThisParentWarehouse +ErrorCantDeletePaymentReconciliated +ErrorCantDeletePaymentSharedWithPayedInvoice +ErrorCantSaveADoneUserWithZeroPercentage +ErrorCantSetReceptionToTotalDoneWithReceptionDenied +ErrorCantSetReceptionToTotalDoneWithReceptionToApprove +ErrorCantUseRazIfNoYearInMask +ErrorCantUseRazInStartedYearIfNoYearMonthInMask +ErrorCounterMustHaveMoreThan3Digits +ErrorCreateBankAccount +ErrorCreatingProductAttributeValue +ErrorCustomerCodeAlreadyUsed +ErrorCustomerCodeRequired +ErrorDeleteLineNotAllowedByObjectStatus +ErrorDeleteNotPossibleLineIsConsolidated +ErrorDeletePaymentLinkedToAClosedInvoiceNotPossible +ErrorDeletingGeneratedProducts +ErrorDescRequiredForFreeProductLines +ErrorDirNotWritable +ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice +ErrorEqualModule +ErrorFailedToLoadRSSFile +ErrorFeatureNeedJavascript +ErrorFicheinterCompanyDoesNotExist +ErrorFieldMustHaveXChar +ErrorFileAlreadyExists +ErrorInvalidSubtype +ErrorInvoiceLoadThirdParty +ErrorInvoiceLoadThirdPartyKey +ErrorLanguageMandatoryIfPageSetAsTranslationOfAnother +ErrorLanguageOfTranslatedPageIsSameThanThisPage +ErrorLoginDisabled +ErrorLoginDoesNotExists +ErrorLoginHasNoEmail +ErrorMandatoryParametersNotProvided +ErrorMaxNumberReachForThisMask +ErrorNewRefIsAlreadyUsed +ErrorNoImagickReadimage +ErrorNoTmpDir +ErrorPROJECTLEADERRoleMissingRestoreIt +ErrorPartialFile +ErrorPaymentConditionsNotEligibleToDepositCreation +ErrorPrefixRequired +ErrorPriceCantBeLowerThanMinPrice +ErrorPriceExpression1 +ErrorPriceExpression10 +ErrorPriceExpression11 +ErrorPriceExpression14 +ErrorPriceExpression17 +ErrorPriceExpression19 +ErrorPriceExpression2 +ErrorPriceExpression20 +ErrorPriceExpression21 +ErrorPriceExpression22 +ErrorPriceExpression23 +ErrorPriceExpression24 +ErrorPriceExpression3 +ErrorPriceExpression4 +ErrorPriceExpression5 +ErrorPriceExpression6 +ErrorPriceExpression8 +ErrorPriceExpression9 +ErrorPropalNotFound +ErrorRecordAlreadyInAccountingDeletionNotPossible +ErrorRecordIsUsedCantDelete +ErrorReplaceStringEmpty +ErrorSmsRecipientIsEmpty +ErrorSubjectIsRequired +ErrorSupplierCodeAlreadyUsed +ErrorSupplierCodeRequired +ErrorThereIsSomeDeliveries +ErrorThirdpartiesMerge +ErrorThirpdartyOrMemberidIsMandatory +ErrorThisPartOrAnotherIsAlreadyUsedSoDiscountSerieCantBeRemoved +ErrorThisPaymentModeIsNotSepa +ErrorTicketRefRequired +ErrorTitleAlreadyExists +ErrorUpdateRate +ErrorUploadBlockedByAddon +ErrorUploadFileDragDrop +ErrorUploadFileDragDropPermissionDenied +ErrorVATIntraNotConfigured +ErrorWebServerUserHasNotPermission +Error_COMMANDE_SUPPLIER_ADDON_NotDefined +Error_EXPENSEREPORT_ADDON_NotDefined +Error_OrderNotChecked +Errors +EscompteOffered +EstimatedDuration +EstimatedDurationDesc +EstimatedStockValue +EstimatedStockValueSell +EvenUnsubscribeDesc +EventOrganizationConferenceOrBoothMenuLeft +EventOrganizationDescription +EventOrganizationEmailAskBooth +EventOrganizationEmailAskConf +EventOrganizationEmailBoothPayment +EventOrganizationEmailRegistrationPayment +EventOrganizationMassEmailAttendees +EventOrganizationMassEmailSpeakers +EventOrganizationMenuLeft +EventOrganizationSetup +EventType +EventUserModified +EvntOrgCancelled +EvntOrgConfirmed +EvntOrgDone +EvntOrgDraft +EvntOrgDuration +EvntOrgNotQualified +EvntOrgRegistrationBoothHelpMessage +EvntOrgRegistrationBoothWelcomeMessage +EvntOrgRegistrationConfHelpMessage +EvntOrgRegistrationConfWelcomeMessage +EvntOrgSuggested +Excel95FormatDesc +ExcessPaidMulticurrency +ExcessReceivedMulticurrency +ExitEditMode +ExpAuto10CV +ExpAuto10PCV +ExpAuto11CV +ExpAuto11PCV +ExpAuto12CV +ExpAuto12PCV +ExpAuto13PCV +ExpAuto3CV +ExpAuto3PCV +ExpAuto4CV +ExpAuto4PCV +ExpAuto5CV +ExpAuto5PCV +ExpAuto6CV +ExpAuto6PCV +ExpAuto7CV +ExpAuto7PCV +ExpAuto8CV +ExpAuto8PCV +ExpAuto9CV +ExpAuto9PCV +ExpAutoCat +ExpCyclo +ExpCycloCat +ExpMoto12CV +ExpMoto345CV +ExpMoto5PCV +ExpMotoCat +ExpenseRangeOffset +ExpenseReportJournal +ExpenseReportLine +ExpenseReportRuleErrorOnSave +ExpenseReportsJournal +ExpenseReportsRulesSetup +ExportCardToFormat +ExportDataset_banque_1 +ExportDataset_banque_2 +ExportDataset_company_1 +ExportDataset_company_2 +ExportDataset_event1 +ExportDataset_fournisseur_1 +ExportDataset_fournisseur_2 +ExportDataset_fournisseur_3 +ExportDataset_invoice_1 +ExportDataset_invoice_2 +ExportDataset_member_1 +ExportDataset_produit_1 +ExportDataset_service_1 +ExportDataset_tax_1 +ExportDataset_ticket_1 +ExportDataset_user_1 +ExportNotSupported +ExportSetup +Exports +ExternalRef +ExternalURLMustStartWithHttp +ExternalWarehouse +ExtraInfos +ExtrafieldCheckBox +ExtrafieldCheckBoxFromList +ExtrafieldIP +ExtrafieldLink +ExtrafieldMail +ExtrafieldParamHelpcheckbox +ExtrafieldParamHelpradio +ExtrafieldPassword +ExtrafieldPhone +ExtrafieldPrice +ExtrafieldPriceWithCurrency +ExtrafieldRadio +ExtrafieldSelect +ExtrafieldSelectList +ExtrafieldSeparator +ExtrafieldUrl +FCKeditorForCompany +FCKeditorForMail +FCKeditorForMailing +FCKeditorForNotePrivate +FCKeditorForNotePublic +FCKeditorForProductDetails +FCKeditorForTicket +FCKeditorForUserSignature +FECFormatCredit +FECFormatDebit +FECFormatEntryDate +FECFormatEntryNum +FECFormatGeneralAccountLabel +FECFormatGeneralAccountNumber +FECFormatJournalCode +FECFormatJournalLabel +FECFormatLabelOperation +FECFormatMulticurrencyAmount +FECFormatMulticurrencyCode +FECFormatPieceDate +FECFormatPieceRef +FECFormatReconcilableCode +FECFormatReconcilableDate +FECFormatSubledgerAccountLabel +FECFormatSubledgerAccountNumber +FECFormatValidateDate +FailedToAddCodeIntoDescriptor +Feature +FeatureIsSupportedInInOutModeOnly +Features +FichinterNoContractLinked +FieldNeedSource +FieldTarget +FieldTitle +FileFormat +FileIsTooBig +FileUploaded +FileWithDataToImport +Filehtpasswd +FilesUpdated +FillAndSaveAccountIdAndSecret +FilterRefOrLabelOrBC +FinanceJournal +FindYourSEPAMandate +Fingerprints +Float +FlushInventory +FormCreateRate +FormUpdateRate +FormatedExportDesc2 +FormatedExportDesc3 +FormatedImportDesc2 +FreeModule +FrequencyPer_d +FrequencyPer_m +FrequencyPer_y +FrequencyUnit +FrontOffice +FullPhoneNumber +FunctionTest +FutureManager +FutureTransaction +GanttView +Gb +GeneralOptions +GigaBytes +GlobalVariableUpdaterHelp0 +GlobalVariableUpdaterHelp1 +GlobalVariableUpdaterHelpFormat0 +GlobalVariableUpdaterHelpFormat1 +GlobalVariableUpdaterType0 +GlobalVariableUpdaterType1 +Go +GoToHelpPage +GoToListOfTimeConsumed +GoToWikiHelpPage +GoodBye +GoogleAuthConfigured +GoogleAuthNotConfigured +GroupCard +GroupDeleted +HOLIDAY_APPROVEInDolibarr +HOLIDAY_CREATEInDolibarr +HOLIDAY_DELETEInDolibarr +HOLIDAY_MODIFYInDolibarr +HOLIDAY_VALIDATEInDolibarr +HR +HRM_DEFAULT_SKILL_DESCRIPTION +HRM_EMAIL_EXTERNAL_SERVICE +HRM_MAXRANK +HTPasswordExport +HalfDay +HasAbsoluteDiscountFromSupplier +HasCreditNoteFromSupplier +HasDownPaymentOrCommercialDiscountFromSupplier +HasNoAbsoluteDiscountFromSupplier +HasNoRelativeDiscountFromSupplier +HasRelativeDiscountFromSupplier +HeightUnits +HelpWarehouseStockTransferDestination +HelpWarehouseStockTransferSource +HideChildProducts +HideOpeningBalance +HolidayBalanceMonthlyUpdate +HostCharset +HtmlText +Human +HumanMachine +IBANNumber +IDCountry +INCVATONLY +INTRACOMMREPORT_NUM_AGREMENT +INTRACOMMREPORT_NUM_DECLARATION +INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT +IPCreation +IPLastLogin +IPModification +IPOfApplicant +IPPreviousLogin +IdAgenda +IdCompany +IdContact +IdPaymentMode +IdProduct +IdProposal +IdRecord +IdResource +IdSocialContribution +IdTaskTime +IdThirdParty +IdTransaction +IdWarehouse +Identification +IfJobIsLocatedAtAPartner +IfModuleEnabled +IfZeroItIsNotAVirtualProduct +IfZeroItIsNotUsedByVirtualProduct +ImapEncryption +ImapEncryptionHelp +ImportAccountingEntries +ImportAccountingEntriesFECFormat +ImportDatasetProjects +ImportDatasetTasks +ImportDataset_company_1 +ImportDataset_company_2 +ImportDataset_company_3 +ImportDataset_company_4 +ImportDataset_member_1 +ImportDataset_produit_1 +ImportDataset_resource_1 +ImportDataset_service_1 +ImportDataset_tax_contrib +ImportDataset_tax_vat +ImportDataset_user_1 +ImportSetup +InWorkingOrder +IncludeClosedAccount +IncludeDocsAlreadyExported +IncludePath +IndependantSubProductStock +InfosWorkflowCP +InitAccountancy +InputDetail +Int +InterDateCreation +InterDuration +InterId +InterLine +InterLineDate +InterLineDesc +InterLineDuration +InterLineId +InterNote +InterStatus +InternalWarehouse +InterventionCardsAndInterventionLines +IntoAccount +IntracommReportAbout +IntracommReportDownload +IntracommReportNumber +IntracommReportPeriod +IntracommReportTypeDeclaration +IntracommunityVATNumber +InventoryDate +InventoryFlushed +InventoryForASpecificProduct +InventoryForASpecificWarehouse +InvoiceAutoValidate +InvoiceDateCreation +InvoiceDeleted +InvoiceDepositAsk +InvoiceDiscount +InvoiceID +InvoiceLabel +InvoiceLine +InvoiceLinesToDispatch +InvoiceNotChecked +InvoiceNote +InvoicePaidCompletely +InvoicePaidCompletelyHelp +InvoiceProFormaAsk +InvoiceProFormaDesc +InvoiceReplacementShort +InvoiceSituationLast +InvoiceStandardShort +InvoiceStatus +InvoiceValidatedInDolibarrFromPos +IsAnAnswer +IsNotADraft +IsNotAnAnswer +ItemsCount +JSOnPaimentBill +JobCard +JobLabel +JournalFinancial +JournalLabel +JuridicalStatus200 +KeepDefaultValuesDeb +KeepDefaultValuesMamp +KeepDefaultValuesProxmox +KeepDefaultValuesWamp +KeepEmptyForAsap +KnowledgeManagementAbout +KnowledgeManagementAboutPage +KnowledgeManagementSetup +KnowledgemanagementsCategoriesArea +LDAPFieldSkype +LDAPFieldSkypeExample +LEAVE_OTHER +LEAVE_PAID +LEAVE_PAID_FR +LEAVE_SICK +LOAN_ACCOUNTING_ACCOUNT_CAPITAL +LOAN_ACCOUNTING_ACCOUNT_INSURANCE +LOAN_ACCOUNTING_ACCOUNT_INTEREST +LT1 +LT1Customer +LT1CustomerES +LT1CustomerIN +LT1ES +LT1GC +LT1IN +LT1Paid +LT1PaidES +LT1PaidIN +LT1Payment +LT1PaymentES +LT1Payments +LT1PaymentsES +LT1ReportByCustomers +LT1ReportByCustomersES +LT1ReportByMonth +LT1ReportByQuarters +LT1ReportByQuartersES +LT1Summary +LT1SummaryES +LT1SummaryIN +LT1Supplier +LT1SupplierES +LT1SupplierIN +LT1Type +LT2 +LT2Customer +LT2CustomerES +LT2CustomerIN +LT2ES +LT2IN +LT2Paid +LT2PaidES +LT2PaidIN +LT2Payment +LT2PaymentES +LT2Payments +LT2PaymentsES +LT2ReportByCustomers +LT2ReportByCustomersES +LT2ReportByMonth +LT2ReportByQuarters +LT2ReportByQuartersES +LT2Summary +LT2SummaryES +LT2SummaryIN +LT2Supplier +LT2SupplierES +LT2SupplierIN +LT2Type +LabelContrib +LabelPaymentMode +LabelRIB +Language_en_US_es_MX_etc +LastBills +LastCheckBacklink +LastMembersModified +LastOrders +LastPA +LastPasswordChangeDate +LastResult +LatestProjects +LatestSupplierTemplateInvoices +LatestTemplateInvoices +LawApplicationPart1 +LawApplicationPart2 +LawApplicationPart3 +LawApplicationPart4 +Lead +LeadOrProject +LeadTimeForWarning +LeaveId +LeaveRequestCreationBlockedBecauseBalanceIsNegative +LengthUnitcm +LengthUnitdm +LengthUnitm +LengthUnitmm +LengthUnits +Library +License +LieuWareHouse +Limit +LimitedLiabilityCompanyCapital +Limits +LineAlreadyDispatched +LineBuyPriceHT +LineDescription +LineDiscount +LineID +LineLabel +LineQty +LineTotalHT +LineTotalTTC +LineTotalVAT +LineUnitPrice +LineVATRate +LinkToAContract +LinkToContract +LinkToExpedition +LinkToGoldMember +LinkToIntervention +LinkToInvoice +LinkToMo +LinkToOrder +LinkToParentMenu +LinkToProposal +LinkToSupplierInvoice +LinkToSupplierOrder +LinkToSupplierProposal +LinkToTemplateInvoice +LinkToTicket +LinkedFichinter +LinkedOrder +ListActionsAssociatedProject +ListBankTransactions +ListContractAssociatedProject +ListCurrencyRate +ListDonationsAssociatedProject +ListExpenseReportsAssociatedProject +ListFichinterAssociatedProject +ListInventory +ListInvoicesAssociatedProject +ListKnowledgeRecord +ListLoanAssociatedProject +ListMOAssociatedProject +ListMouvementStockProject +ListOfAvailableAPIs +ListOfCandidatures +ListOfContracts +ListOfCustomers +ListOfEMailings +ListOfEmployees +ListOfEvents +ListOfFees +ListOfInterventions +ListOfInventories +ListOfNotificationsPerUser +ListOfNotificationsPerUserOrContact +ListOfOrders +ListOfPartnerships +ListOfPositionsToBeFilled +ListOfPreviousSituationInvoices +ListOfProductsWithoutAccountingAccount +ListOfProposals +ListOfProspects +ListOfSms +ListOfSubscriptions +ListOfSupplierOrders +ListOfSuppliers +ListOfThirdParties +ListOfTrips +ListOfWarehouses +ListOrdersAssociatedProject +ListPredefinedInvoicesAssociatedProject +ListProposalsAssociatedProject +ListSalariesAssociatedProject +ListShippingAssociatedProject +ListSocialContributionAssociatedProject +ListSupplierInvoicesAssociatedProject +ListSupplierOrdersAssociatedProject +ListSupplierProposalsAssociatedProject +ListToApprove +ListVariousPaymentsAssociatedProject +ListWarehouseAssociatedProject +LoadContactFromEmailOrCreate +LocalID +LocalTax1IsNotUsed +LocalTax1IsNotUsedDesc +LocalTax1IsNotUsedDescES +LocalTax1IsNotUsedES +LocalTax1IsNotUsedExample +LocalTax1IsNotUsedExampleES +LocalTax1IsUsed +LocalTax1IsUsedDesc +LocalTax1IsUsedDescES +LocalTax1IsUsedExample +LocalTax1IsUsedExampleES +LocalTax1ManagementES +LocalTax2IsNotUsed +LocalTax2IsNotUsedDesc +LocalTax2IsNotUsedDescES +LocalTax2IsNotUsedES +LocalTax2IsNotUsedExample +LocalTax2IsNotUsedExampleES +LocalTax2IsUsed +LocalTax2IsUsedDesc +LocalTax2IsUsedDescES +LocalTax2IsUsedExample +LocalTax2IsUsedExampleES +LocalTax2ManagementES +LoginEmail +LoginOrEmail +LogoDesc +LogoSquarredDesc +LogsLinesNumber +MAIN_DOCUMENTS_WITH_PICTURE_WIDTH +MOAndLines +MOChild +MODIFYInDolibarr +MRPDescription +MRP_MO_CANCELInDolibarr +MRP_MO_DELETEInDolibarr +MRP_MO_PRODUCEDInDolibarr +MRP_MO_UNVALIDATEInDolibarr +MRP_MO_VALIDATEInDolibarr +Machine +MailboxTargetDirectory +MailingModuleDescContactsByCategory +MailingModuleDescContactsByCompanyCategory +MailingModuleDescContactsByFunction +MailingModuleDescContactsWithThirdpartyFilter +MailingModuleDescDolibarrUsers +MailingModuleDescEmailsFromFile +MailingModuleDescEmailsFromUser +MailingModuleDescThirdPartiesByCategories +MailingStatusDraft +MailingStatusReadAndUnsubscribe +MailingStatusSentCompletely +MailingStatusSentPartialy +MailingStatusValidated +MainAccountForSubscriptionPaymentNotDefined +MainAccountForVatPaymentNotDefined +MainDefaultWarehouseUser +MainDefaultWarehouseUserDesc +MakeLocalDatabaseDump +MakeLocalDatabaseDumpShort +MakeSendLocalDatabaseDump +ManagePartnership +ManualTokenGeneration +Manufactured +Manufacturing +MarkAsRead +MaxEmailCollectPerCollect +Mb +MeasuringUnitTypeDesc +MegaBytes +MemberFirstname +MemberHasNoCategory +MemberIsInCategories +MemberLastname +MemberRef +MemberStatusActive +MemberTypeId +MemberTypeLabel +MembersAndSubscriptions +MembersCategoryShort +MembersHome +MentionCategoryOfOperations0 +MentionCategoryOfOperations1 +MentionCategoryOfOperations2 +MenuAWStats +MenuAccountancyValidationMovements +MenuAddedSuccessfuly +MenuAgendaGoogle +MenuBookcalIndex +MenuCheques +MenuChequesReceipts +MenuDirectPrinting +MenuDoneActions +MenuDoneMyActions +MenuECM +MenuKnowledgeRecord +MenuKnowledgeRecordShort +MenuLoanAccounts +MenuMembers +MenuResourceIndex +MenuSpecialExpenses +MenuTaxAndDividends +MenuTicketMyAssign +MenuTicketMyAssignNonClosed +MenuToDoActions +MenuToDoMyActions +MergingPDFTool +MessageSuccessfullyAdded +MinPriceHT +MinPriceTTC +MoChildsDeleted +ModeRCUR +ModelModulesProduct +Modelcsv_normal +ModifiedById +ModifiedByLogin +ModifyMarginRates +Module0Desc +Module0Name +Module10000Desc +Module10000Name +Module100Name +Module105Desc +Module105Name +Module10Name +Module1120Desc +Module1120Name +Module1200Desc +Module1200Name +Module1520Desc +Module1520Name +Module1780Desc +Module1780Name +Module1Desc +Module1Name +Module20000Desc +Module20000Name +Module2000Desc +Module2000Name +Module200Desc +Module200Name +Module20Desc +Module20Name +Module210Desc +Module210Name +Module2200Desc +Module2200Name +Module22Desc +Module22Name +Module2300Desc +Module23Desc +Module23Name +Module2400Desc +Module240Desc +Module240Name +Module2430Desc +Module2430Name +Module2500Desc +Module2500Name +Module250Desc +Module250Name +Module25Desc +Module2600Desc +Module2600Name +Module2610Desc +Module2610Name +Module2660Desc +Module2660Name +Module2700Desc +Module2700Name +Module27130Desc +Module27130Name +Module2800Desc +Module2900Desc +Module2900Name +Module2Desc +Module2Name +Module30Desc +Module310Desc +Module3200Desc +Module3200Name +Module320Desc +Module320Name +Module3300Desc +Module3300Name +Module330Desc +Module330Name +Module3400Desc +Module3400Name +Module39000Desc +Module39000Name +Module40000Desc +Module40000Name +Module4000Desc +Module4000Name +Module400Desc +Module400Name +Module40Desc +Module4100Desc +Module4100Name +Module410Desc +Module410Name +Module42Desc +Module42Name +Module43Desc +Module43Name +Module49Desc +Module49Name +Module50000Desc +Module50000Name +Module5000Desc +Module5000Name +Module500Desc +Module500Name +Module50100Desc +Module50100Name +Module50150Desc +Module50150Name +Module50200Desc +Module50200Name +Module50300Desc +Module50300Name +Module50400Desc +Module50400Name +Module50Desc +Module50Name +Module510Desc +Module510Name +Module51Desc +Module51Name +Module520Desc +Module520Name +Module52Desc +Module52Name +Module53Desc +Module53Name +Module54000Desc +Module54000Name +Module54Desc +Module54Name +Module55000Desc +Module55000Name +Module55Desc +Module55Name +Module56000Desc +Module56Desc +Module56Name +Module57Desc +Module57Name +Module58Desc +Module59000Desc +Module59000Name +Module60000Desc +Module60000Name +Module6000Desc +Module6000Name +Module600Desc +Module600Long +Module60Desc +Module60Name +Module610Desc +Module62000Desc +Module62000Name +Module63000Desc +Module63000Name +Module64000Desc +Module650Desc +Module650Name +Module66000Desc +Module66000Name +Module660Desc +Module660Name +Module68000Desc +Module68000Name +Module700Desc +Module700Name +Module70Desc +Module70Name +Module75Desc +Module75Name +Module770Desc +Module770Name +Module80Desc +Module85Desc +Module94160Name +ModuleAssetsDesc +ModuleAssetsName +ModuleBookCalDesc +ModuleBookCalName +ModuleBuilderDescbuildpackage +ModuleBuilderDescdescription +ModuleBuilderDeschooks +ModuleBuilderDescmenus +ModuleBuilderDescobjects +ModuleBuilderDescpermissions +ModuleBuilderDescspecifications +ModuleBuilderDesctriggers +ModuleBuilderDescwidgets +ModuleBuilderNotAllowed +ModuleCompanyCodeCustomerAquarium +ModuleCompanyCodeCustomerDigitaria +ModuleCompanyCodeDigitaria +ModuleCompanyCodePanicum +ModuleCompanyCodeSupplierAquarium +ModuleCompanyCodeSupplierDigitaria +ModuleEventOrganizationName +ModuleFamilyExperimental +ModuleInitialized +ModuleKnowledgeManagementDesc +ModulePartnershipName +ModuleReceiptPrinterMustBeEnabled +ModuleRecruitmentDesc +ModuleRecruitmentName +ModuleWebhookDesc +ModuleWebhookName +ModuleZapierForDolibarrDesc +ModuleZapierForDolibarrName +MonthOfDay +MotifCP +MovementId +Mrp +MultiCompanySetup +MultiCurrency +MultiCurrencySetup +MulticurrencyCurrency +MulticurrencySubPrice +MulticurrencyUsed +MutltiCurrencyAutoUpdateCurrencies +MyContainerTitle +MyProjects +MySqlExportParameters +MyTimeSpent +MyWebsitePages +NOT_AUTHOR +NameOrCompany +NameSlashCompany +NbCheque +NbOfGenerationDoneShort +NbOfInvoiceToWithdrawWithInfo +NbOfLines +NbOfObjects +NbOfPayments +NbOfQtyInOrders +NbOfQtyInProposals +NbOfSms +NbOfUniqueSms +NbOfUsers +NbOfVoters +NbOperatorsRequired +NbUseDaysCPShortInMonth +NbVotes +NeedBusinessTravels +NeedMoreInformation +NeedMoreInformationShort +NetToBePaid +NewAccountingJournal +NewAsset +NewAvailabilities +NewCalendar +NewCheckReceipt +NewGroupCreated +NewPayboxPaymentFailed +NewPayboxPaymentReceived +NewPayment +NewProductAttribute +NewProductAttributeValue +NewProductCombinations +NewSell +NewSms +NewSoldeCP +NewStripePaymentFailed +NewStripePaymentReceived +NewSupplier +NewUserPassword +NextDateToExecutionShort +NextDateToIntervention +NoAccount +NoArticle +NoArticlesFoundForTheCategory +NoCLIFile +NoContactDefined +NoContactDefinedForThirdParty +NoDefaultPrinterDefined +NoDraftBills +NoError +NoIntervention +NoLimit +NoLogForThisTicket +NoModueToManageStockIncrease +NoOtherDraftBills +NoProductFound +NoProposal +NoRSH +NoRSHHelp +NoRecordedUsers +NoResults +NoTicketsFound +NoTrigger +NoTripsToExportCSV +NoVAT +NoneOrSeveral +NotActiveModCP +NotAllExportedMovementsCouldBeRecordedAsExported +NotCompatible +NotImportedFields +NotMatch +NotRead +NotUsedFields +NotUsedForThisCustomer +NotUsedForThisVendor +NoteSomeFeaturesAreDisabled +NothingProcessed +Notify_ACTION_CREATE +Notify_BILL_CANCEL +Notify_BILL_PAYED +Notify_BILL_SENTBYMAIL +Notify_BILL_SUPPLIER_CANCELED +Notify_BILL_SUPPLIER_PAYED +Notify_BILL_SUPPLIER_SENTBYMAIL +Notify_BILL_SUPPLIER_VALIDATE +Notify_BILL_UNVALIDATE +Notify_BILL_VALIDATE +Notify_COMPANY_CREATE +Notify_COMPANY_SENTBYMAIL +Notify_CONTRACT_VALIDATE +Notify_EXPENSE_REPORT_APPROVE +Notify_EXPENSE_REPORT_VALIDATE +Notify_FICHINTER_ADD_CONTACT +Notify_FICHINTER_CLOSE +Notify_FICHINTER_SENTBYMAIL +Notify_FICHINTER_VALIDATE +Notify_HOLIDAY_APPROVE +Notify_HOLIDAY_VALIDATE +Notify_MEMBER_DELETE +Notify_MEMBER_MODIFY +Notify_MEMBER_RESILIATE +Notify_MEMBER_SUBSCRIPTION +Notify_MEMBER_VALIDATE +Notify_ORDER_CLOSE +Notify_ORDER_SENTBYMAIL +Notify_ORDER_SUPPLIER_APPROVE +Notify_ORDER_SUPPLIER_REFUSE +Notify_ORDER_SUPPLIER_SENTBYMAIL +Notify_ORDER_SUPPLIER_SUBMIT +Notify_ORDER_SUPPLIER_VALIDATE +Notify_ORDER_VALIDATE +Notify_PROJECT_CREATE +Notify_PROPAL_CLOSE_REFUSED +Notify_PROPAL_CLOSE_SIGNED +Notify_PROPAL_SENTBYMAIL +Notify_PROPAL_VALIDATE +Notify_SHIPPING_SENTBYMAIL +Notify_SHIPPING_VALIDATE +Notify_TASK_CREATE +Notify_TASK_DELETE +Notify_TASK_MODIFY +Notify_TICKET_SENTBYMAIL +Notify_WITHDRAW_CREDIT +Notify_WITHDRAW_EMIT +Notify_WITHDRAW_TRANSMIT +NumberOf +NumberOfUnits +NumberOfUnitsMos +NumeroNationalEmetter +OAUTH_GITHUB_ID +OAUTH_GITHUB_NAME +OAUTH_GITHUB_SECRET +OAUTH_GOOGLE_ID +OAUTH_GOOGLE_NAME +OAUTH_GOOGLE_SECRET +OAUTH_STRIPE_LIVE_ID +OAUTH_STRIPE_LIVE_NAME +OAUTH_STRIPE_TEST_ID +OAUTH_STRIPE_TEST_NAME +ONLINE_PAYMENT_CSS_URL +ONLINE_PAYMENT_WAREHOUSE +ORDER_SUPPLIER_DELETEInDolibarr +Of +OnHold +OneLinePerPeriod +OneLinePerTask +OneLinePerTimeSpentLine +OneLinePerUser +OnlineHelp +OnlyActiveElementsAreExposed +OnlyNonValid +OnlyOpenedAccount +OnlyProdsInStock +OpenAnyMovement +OpenEtablishment +OpenFiscalYear +OpenInternal +OpenVerb +OpenedProjectsByThirdparties +OpeningBalance +OppStatusLOST +OppStatusNEGO +OppStatusPENDING +OppStatusPROPO +OppStatusPROSP +OppStatusQUAL +OppStatusWON +OpportunitiesStatusForProjects +OptionModeProductBuyExportDesc +OptionModeProductBuyIntraDesc +OptionVatInfoModuleComptabilite +OrProductsWithCategories +OrderByDateAsc +OrderByDateDesc +OrderByEMail +OrderByFax +OrderByMail +OrderByPhone +OrderByWWW +OrderCreation +OrderDateShort +OrderDeleted +OrderId +OrderLine +OrderShowDetail +OrdersInProcess +OrdersOpened +OrganizationEvenLabelName +OrganizationEventBoothRequestWasReceived +OrganizationEventBulkMailToAttendees +OrganizationEventBulkMailToSpeakers +OrganizationEventConfRequestWasReceived +OrganizationEventLinkToThirdParty +OriginEmail +OtherCountriesCustomersReport +OtherReceptionsForSameOrder +OutOfEurope +OutOfOrder +OutOfProject +PAIDInDolibarr +PASSWORDInDolibarr +PAYBOX_PAYONLINE_SENDEMAIL +PAYPAL_API_SANDBOX +PDFCrevetteDescription +PDFCrevetteSituationInvoiceLine +PDFCrevetteSituationInvoiceLineDecompte +PDFCrevetteSituationInvoiceTitle +PDFCrevetteSituationNumber +PDFEdisonDescription +PDF_USE_1A +PL_HIGH +PL_LOW +PL_MEDIUM +PL_NONE +PL_UNKNOWN +POSModule +POSTerminal +PRINTGCP_AUTHLINK +PRINTGCP_INFO +PRINTGCP_TOKEN_ACCESS +PRINTIPP_HOST +PRINTIPP_PASSWORD +PRINTIPP_PORT +PRINTIPP_USER +PRODUCT_CREATEInDolibarr +PRODUCT_DELETEInDolibarr +PRODUCT_MODIFYInDolibarr +PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE +PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help +PROJECT_CREATEInDolibarr +PROJECT_DELETEInDolibarr +PROJECT_MODIFYInDolibarr +PROPOSAL_PDF_HIDE_PAYMENTMODE +PROPOSAL_PDF_HIDE_PAYMENTTERM +PageContent +Param +ParentCategoryID +ParentCategoryLabel +ParentLine +ParentPageId +ParentProductOfVariant +ParentProductsNumber +PartnershipAbout +PartnershipAboutPage +PartnershipAccepted +PartnershipAlreadyExist +PartnershipCanceled +PartnershipCheckBacklink +PartnershipDedicatedToThisThirdParty +PartnershipDescription +PartnershipDescriptionLong +PartnershipDraft +PartnershipManagedFor +PartnershipRefused +PassEncoding +PassedInOpenStatus +PassedInShippedStatus +PasswordChangeRequest +PasswordChangeRequestSent +Paste +PaymentBack +PaymentByChequeOrderedToShort +PaymentCondition10D +PaymentCondition10DENDMONTH +PaymentCondition14D +PaymentCondition14DENDMONTH +PaymentCondition30D +PaymentCondition30DENDMONTH +PaymentCondition60D +PaymentCondition60DENDMONTH +PaymentConditionDEP30PCTDEL +PaymentConditionPT_5050 +PaymentConditionPT_DELIVERY +PaymentConditionPT_ORDER +PaymentConditionRECEP +PaymentConditionShort10D +PaymentConditionShort10DENDMONTH +PaymentConditionShort14D +PaymentConditionShort14DENDMONTH +PaymentConditionShort30D +PaymentConditionShort30DENDMONTH +PaymentConditionShort60D +PaymentConditionShort60DENDMONTH +PaymentConditionShortDEP30PCTDEL +PaymentConditionShortPT_5050 +PaymentConditionShortPT_DELIVERY +PaymentConditionShortPT_ORDER +PaymentConditionShortRECEP +PaymentConferenceAttendee +PaymentId +PaymentModeShort +PaymentNote +PaymentNumber +PaymentRef +PaymentRule +PaymentSupplierInvoice +PaymentTermsCustomer +PaymentTermsSupplier +PaymentTypeDC +PaymentTypeFAC +PaymentTypeLIQ +PaymentTypePP +PaymentTypePRE +PaymentTypeShortCB +PaymentTypeShortCHQ +PaymentTypeShortFAC +PaymentTypeShortPRE +PaymentTypeShortTIP +PaymentTypeShortTRA +PaymentTypeShortVAD +PaymentTypeShortVIR +PaymentTypeTIP +PaymentTypeTRA +PaymentTypeVAD +PaymentTypeVIR +PaypalImportPayment +PaypalOrCBDoPayment +PermanentLeftSearchForm +Permission10001 +Permission10002 +Permission10003 +Permission10005 +Permission1001 +Permission1002 +Permission1003 +Permission1004 +Permission1005 +Permission101 +Permission1011 +Permission1012 +Permission1014 +Permission1015 +Permission1016 +Permission102 +Permission104 +Permission105 +Permission106 +Permission109 +Permission11 +Permission1101 +Permission1102 +Permission1104 +Permission1109 +Permission111 +Permission112 +Permission1121 +Permission1122 +Permission1123 +Permission1124 +Permission1125 +Permission1126 +Permission113 +Permission114 +Permission115 +Permission116 +Permission117 +Permission1181 +Permission1182 +Permission1183 +Permission1184 +Permission1185 +Permission1186 +Permission1187 +Permission1188 +Permission1189 +Permission1191 +Permission12 +Permission1201 +Permission1202 +Permission121 +Permission122 +Permission1231 +Permission1232 +Permission1233 +Permission1234 +Permission1235 +Permission1236 +Permission1237 +Permission125 +Permission1251 +Permission126 +Permission13 +Permission130 +Permission1321 +Permission1322 +Permission14 +Permission141 +Permission142 +Permission1421 +Permission144 +Permission145 +Permission146 +Permission147 +Permission15 +Permission151 +Permission152 +Permission1521 +Permission1522 +Permission153 +Permission154 +Permission16 +Permission161 +Permission162 +Permission163 +Permission164 +Permission165 +Permission167 +Permission171 +Permission172 +Permission173 +Permission174 +Permission178 +Permission180 +Permission181 +Permission182 +Permission183 +Permission184 +Permission185 +Permission186 +Permission187 +Permission188 +Permission19 +Permission192 +Permission193 +Permission194 +Permission20001 +Permission20002 +Permission20003 +Permission20004 +Permission20005 +Permission20006 +Permission20007 +Permission202 +Permission203 +Permission204 +Permission205 +Permission206 +Permission21 +Permission211 +Permission212 +Permission213 +Permission214 +Permission215 +Permission22 +Permission221 +Permission222 +Permission223 +Permission229 +Permission23001 +Permission23002 +Permission23003 +Permission23004 +Permission23101 +Permission23102 +Permission23103 +Permission23104 +Permission237 +Permission238 +Permission239 +Permission24 +Permission2401 +Permission2402 +Permission2403 +Permission241 +Permission2411 +Permission2412 +Permission2413 +Permission2414 +Permission242 +Permission243 +Permission244 +Permission25 +Permission2501 +Permission2502 +Permission2503 +Permission251 +Permission2515 +Permission252 +Permission253 +Permission254 +Permission255 +Permission256 +Permission26 +Permission2610 +Permission262 +Permission263 +Permission27 +Permission271 +Permission272 +Permission273 +Permission28 +Permission2801 +Permission2802 +Permission281 +Permission282 +Permission283 +Permission286 +Permission291 +Permission292 +Permission293 +Permission301 +Permission304 +Permission305 +Permission31 +Permission311 +Permission312 +Permission32 +Permission3200 +Permission33 +Permission3301 +Permission331 +Permission332 +Permission333 +Permission34 +Permission341 +Permission342 +Permission343 +Permission344 +Permission351 +Permission352 +Permission353 +Permission354 +Permission358 +Permission36 +Permission38 +Permission39 +Permission40001 +Permission40002 +Permission40003 +Permission4001 +Permission4002 +Permission4003 +Permission401 +Permission402 +Permission4021 +Permission4022 +Permission4023 +Permission4025 +Permission4028 +Permission403 +Permission4031 +Permission4032 +Permission4033 +Permission404 +Permission41 +Permission42 +Permission430 +Permission44 +Permission45 +Permission50101 +Permission50151 +Permission50152 +Permission50153 +Permission50201 +Permission50202 +Permission50330 +Permission50331 +Permission50332 +Permission50401 +Permission50411 +Permission50412 +Permission50414 +Permission50415 +Permission50418 +Permission50420 +Permission50430 +Permission50440 +Permission51001 +Permission51002 +Permission51003 +Permission51005 +Permission511 +Permission512 +Permission514 +Permission517 +Permission519 +Permission520 +Permission522 +Permission524 +Permission525 +Permission527 +Permission531 +Permission532 +Permission533 +Permission534 +Permission536 +Permission538 +Permission54001 +Permission55001 +Permission55002 +Permission56001 +Permission56002 +Permission56003 +Permission56004 +Permission56005 +Permission56006 +Permission561 +Permission562 +Permission563 +Permission564 +Permission59001 +Permission59002 +Permission59003 +Permission601 +Permission602 +Permission609 +Permission61 +Permission611 +Permission612 +Permission613 +Permission62 +Permission63001 +Permission63002 +Permission63003 +Permission63004 +Permission64 +Permission64001 +Permission650 +Permission651 +Permission652 +Permission660 +Permission661 +Permission662 +Permission67 +Permission67000 +Permission68 +Permission68001 +Permission68002 +Permission68004 +Permission69 +Permission70 +Permission701 +Permission702 +Permission703 +Permission71 +Permission72 +Permission74 +Permission75 +Permission76 +Permission771 +Permission772 +Permission773 +Permission775 +Permission776 +Permission777 +Permission778 +Permission779 +Permission78 +Permission79 +Permission81 +Permission82 +Permission84 +Permission85 +Permission86 +Permission87 +Permission88 +Permission89 +Permission91 +Permission92 +Permission93 +Permission94 +Permission941601 +Permission941602 +Permission941603 +Permission941604 +Permission941605 +Permission941606 +Permission95 +PermissionAdvanced251 +PermissionAdvanced253 +PhoneNumber +PhpWebLink +PointOfSale +PointOfSaleShort +PopuCom +PopuProp +PossibleLanguages +PostgreSqlExportParameters +PredefinedGroups +PredefinedInvoices +PredefinedMailContentContract +PrepareSms +PrettyLittleSentence +PrevSoldeCP +PreviewSms +PriceFormatInCurrentLanguage +PriceLevelLabels +PriceQtyMinHT +PriceQtyMinHTCurrency +PriceU +PrintGCPDesc +PrintIPPDesc +PrintMethod +PrintTestDescprintgcp +PrintTestDescprintipp +PrintingDriverDescprintgcp +PrintingDriverDescprintipp +ProductBOMHelp +ProductBarcodeDoesNotExist +ProductBatchDoesNotExist +ProductCombination +ProductCombinationGenerator +ProductCombinationGeneratorWarning +ProductDescriptionTranslated +ProductDoesNotExist +ProductFound +ProductHasNoCategory +ProductId +ProductIsInCategories +ProductLabelTranslated +ProductNoteTranslated +ProductQtyInReceptionAlreadySent +ProductQtyInSuppliersReceptionAlreadyRecevied +ProductService +ProductSheet +ProductStockWarehouse +ProductVolume +ProductWeight +ProductsMultiPrice +ProductsOnPurchaseOnly +ProductsOnSaleOnly +ProductsOnSellAndOnBuy +ProductsOrServiceMultiPrice +ProductsOrServicesTranslations +ProductsPipeServices +ProductsPricePerCustomer +ProfId10 +ProfId10FR +ProfId10Short +ProfId10ShortFR +ProfId1ShortCM +ProfId1ShortFR +ProfId2ShortCM +ProfId2ShortFR +ProfId3ShortCM +ProfId3ShortFR +ProfId4ShortCM +ProfId4ShortFR +ProfId5ShortCM +ProfId5ShortFR +ProfId6ShortCM +ProfId6ShortFR +ProfId7Short +ProfId7ShortFR +ProfId8Short +ProfId8ShortFR +ProfId9Short +ProfId9ShortFR +ProformaBill +ProjectCreatedByEmailCollector +ProjectHasNoCategory +ProjectId +ProjectOpenedProjectByOppStatus +ProjectRef +ProjectStatus +ProjectsAndTasksLines +ProjectsCategoriesShort +Properties +Property +ProposalCard +ProposalDeleted +ProposalLine +ProposalLines +ProposalShort +ProposalsAndProposalsLines +ProposedRemuneration +ProspectStatus +ProtectAndEncryptPdfFiles +ProtectAndEncryptPdfFilesDesc +PublicMemberCard +PublicMemberList +PurchaseOrderLines +PurchasedAmount +PurgeDeleteTemporaryFiles +ReConciliedBy +Read +RealURL +RealValue +ReasonDecline +ReasonDeclineOrCancel +ReceiptPrinter +ReceiptPrinterMethodDescription +ReceiptPrinterProfileDesc +ReceiptPrinterTemplateDesc +ReceivedPayments +ReceptionDescription +ReceptionLine +ReceptionsAndReceivingForSameOrder +RecordEvent +RecordMovement +RecordedQty +RecruitmentAbout +RecruitmentAboutPage +RecurringInvoice +RecurringInvoiceSource +RecurringInvoices +RecurringInvoicesJob +RecurringSupplierInvoices +RecurringSupplierInvoicesJob +Redo +Reductions +ReductionsShort +RefBill +RefOrderSupplier +RefOrderSupplierShort +RefSalary +RefSupplierShort +RefTaskParent +RegenerateMissingFiles +RegionStateOrigin +RegistrationAndPaymentWereAlreadyRecorder +RegistrationDate +RegulateStock +RegulatedOn +RegulatedQty +RelatedBill +RelatedBills +RelatedCommercialProposals +RelatedCustomerInvoices +RelatedObjects +RelatedRecurringCustomerInvoices +RelatedSupplierInvoices +RelatedTickets +RelativeDiscount +RemainderToTakeMulticurrency +RemoteControlSupport +RemoveAll +RepeatEvent +Repeatable +RepeatableSupplierInvoicesList +Repeatables +Replenishments +ReportByCustomers +ReportThirdParty +RequestedRemuneration +RequireAtLeastXDigits +RequireAtLeastXString +RequireXDigitsMax +RequiredField +ResetSms +ResourceNotAssignedToTheTask +ResourcePageIndex +ResourceTypeCode +ResponsibleOfRecruitement +Rest +RestOfEurope +RestartSelling +RuleForWarehouse +RulesCATotalSaleJournal +RulesPurchaseTurnoverTotalPurchaseJournal +Run +SALARIES_ACCOUNTING_ACCOUNT_CHARGE +SALARIES_ACCOUNTING_ACCOUNT_PAYMENT +SALARIES_ACCOUNTING_ACCOUNT_PAYMENT_Desc +SEPAMandate +SERVICE_BOOTH_LOCATION +SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION +SMSSentTo +STRIPE_CGI_URL_V2 +STRIPE_PAYONLINE_SENDEMAIL +SalariesAndPayments +SalariesPaymentsOf +SalaryInvoice +SaleLocal +SaleOrderLines +SaleRepresentativeFirstname +SaleRepresentativeLastname +SaleRepresentativeLogin +SalesRepresentativeMargins +SameCountryCustomersWithVAT +SaveAndNew +SaveAs +SaveQtyFirst +SavingAccounts +SearchACustomerInvoice +SearchASupplierInvoice +SearchOf +SearchProduct +SearchRequest +SecurityTokenHasExpiredSoActionHasBeenCanceledPleaseRetry +SeeInMarkerPlace +SeeOfficalSupport +SeeSubstitutionVars +SeeTicket +SeeVATReportInDueDebtMode +SeeVATReportInInputOutputMode +Select2MoreCharactersMore +SelectCategory +SelectFournisseur +SelectImportFields +SelectTaskToAssign +Selectformat +SellFinished +SellingMinPriceTTC +SellingPriceHT +SellingPriceTTC +SendAgreement +SendAgreementText +SendAskByMail +SendAskRef +SendBillByMail +SendBillRef +SendContractRef +SendEmailsReminders +SendEmailsRemindersOnInvoiceDueDate +SendInterventionByMail +SendInterventionRef +SendNewPasswordLink +SendOrderByMail +SendOrderRef +SendPaymentReceipt +SendProjectRef +SendPropalByMail +SendPropalRef +SendReceptionByEMail +SendReceptionRef +SendRemindByMail +SendReminderBillByMail +SendReminderBillRef +SendReminderForExpiredSubscription +SendReminderForExpiredSubscriptionTitle +SendRequestCP +SendRequestCollectiveCP +SendShippingByEMail +SendTo +Sending +SendingEmailOnAutoSubscription +SendingEmailOnCancelation +SendingEmailOnMemberValidation +SendingEmailOnNewSubscription +SendingEmailOnPartnershipAccepted +SendingEmailOnPartnershipCanceled +SendingEmailOnPartnershipRefused +SendingEmailOnPartnershipWillSoonBeCanceled +SendingReminderActionComm +SendingReminderForExpiredSubscription +SendingsAbility +SentBy +SentToSuppliers +SentXXXmessages +SerialNumberAlreadyInUse +ServiceSheet +ServicesOnPurchaseOnly +ServicesOnSaleOnly +ServicesOnSellAndOnBuy +SetLinkToAnotherThirdParty +SetRef +SetToDisabled +SetToEnabled +SetWebsiteOnlineBefore +SetupDescription3 +SetupDescription4 +SetupPayBoxToHavePaymentCreatedAutomatically +SetupShort +SetupStripeToHavePaymentCreatedAutomatically +ShipProduct +ShipmentBackToDraftInDolibarr +ShipmentClassifyClosedInDolibarr +ShipmentValidatedInDolibarr +ShippableOrderIconInList +ShoppingCart +Shortname +ShowAllFingerPrintsErrorsMightBeTooLong +ShowAllFingerPrintsMightBeTooLong +ShowCustomer +ShowCustomerPreview +ShowDiscount +ShowFiscalYear +ShowListTicketWithTrackId +ShowLoanPayment +ShowMyTasksOnly +ShowOpeningBalance +ShowProjectLabel +ShowProspect +ShowReception +ShowResource +ShowSalaryPayment +ShowSms +ShowStock +ShowSubscription +ShowSupplierPreview +ShowTempMassFilesArea +ShowTypeCard +ShowUnpaidAll +ShowUnpaidLateOnly +ShowWithdraw +SignSociete_rib +SignatureSociete_ribRef +SituationAmount +SituationDeduction +SituationTotalRayToRest +SizeUnitdm +SizeUnitfoot +SizeUnitm +SizeUnits +SkillList +Skin +Skype +SmsCard +SmsMessage +SmsNoPossibleRecipientFound +SmsRecipient +SmsRecipients +SmsResult +SmsStatusApproved +SmsStatusDraft +SmsStatusError +SmsStatusNotSent +SmsStatusSent +SmsStatusSentCompletely +SmsStatusSentPartialy +SmsStatusValidated +SmsTargets +SmsTestMessage +SmsTitle +SmsTopic +SocialNetworkSetup +SocialNetworksFacebookURL +SocialNetworksGithubURL +SocialNetworksInstagramURL +SocialNetworksLinkedinURL +SocialNetworksTwitterURL +SocialNetworksYoutubeURL +Societe_ribSigned +SoldAmount +SolvedClosed +SourceInvoiceId +SourceRequired +Speaker +SpecialCharActivation +SpecialCode +StandingOrderPayment +StandingOrderToProcess +StandingOrdersPayment +StartUpload +StateCode +StateId +StateOrigin +StatusAtInstall +StatusDebitCredit +StatusOrderApproved +StatusOrderApprovedShort +StatusOrderOnProcessShort +StatusOrderOnProcessWithValidation +StatusOrderProcessedShort +StatusOrderReceivedAllShort +StatusOrderReceivedPartially +StatusOrderReceivedPartiallyShort +StatusOrderRefused +StatusOrderRefusedShort +StatusReceptionCanceled +StatusReceptionDraft +StatusReceptionProcessed +StatusReceptionValidated +StatusReceptionValidatedReceived +StatusReceptionValidatedToReceive +StatusSendingCanceled +StatusSendingCanceledShort +StatusSendingDraft +StatusSendingProcessed +StatusSendingValidated +StatusSupplierOrderApproved +StatusSupplierOrderCanceledShort +StatusSupplierOrderDelivered +StatusSupplierOrderDeliveredShort +StatusSupplierOrderDraft +StatusSupplierOrderOnProcess +StatusSupplierOrderOnProcessWithValidation +StatusSupplierOrderProcessed +StatusSupplierOrderProcessedShort +StatusSupplierOrderReceivedAllShort +StatusSupplierOrderReceivedPartially +StatusSupplierOrderRefusedShort +StatusSupplierOrderSent +StatusSupplierOrderSentShort +StatusSupplierOrderToBill +StatusSupplierOrderToBillShort +StatusSupplierOrderToProcessShort +StatusSupplierOrderValidatedShort +Statut +StatutCP +StockDecreaseForPointOfSaleDisabledbyBatch +StockDetailPerBatch +StockLimitShort +StockStransferDecrementedCancel +StockStransferIncrementedShort +StockStransferIncrementedShortCancel +StockToBuy +StockTransferSetup +StocksWithBatch +String +String1Line +StripeAccount +StripeGateways +StripeID +StripeImportPayment +StripeOrCBDoPayment +StripePaymentModes +SubCatOf +SubProduct +SubjectNotIn +SubmitTranslation +SubmitTranslationENUS +SubscriptionId +SubscriptionRecorded +SubscriptionReminderEmail +SuggestedForTicketsInGroup +SummarySystem +SupervisorNotFound +SupplierCard +SupplierCodeShort +SupplierIBAN +SupplierInvoiceGeneratedFromTemplate +SupplierInvoiceLines +SupplierInvoicePayment +SupplierProposalCard +SupplierProposalDate +SupplierProposalRefFourn +SupplierProposalShort +SupplierProposalsDraft +SupplierReputation +SuppliersCategoryShort +SuppliersPrices +SuppliersPricesOfProductsOrServices +SurfaceUnitcm2 +SurfaceUnitdm2 +SurfaceUnitfoot2 +SurfaceUnitinch2 +SurfaceUnitm2 +SurfaceUnitmm2 +SurfaceUnits +System +SystemInfo +SystemInfoDesc +SystemTools +SystemToolsArea +TE_ADMIN +TE_GROUP +TE_MEDIUM +TE_OTHER +TE_PRIVATE +TE_RETAIL +TE_SMALL +TE_STARTUP +TE_UNKNOWN +TE_WHOLE +TF_BUS +TF_CAR +TF_ESSENCE +TF_HOTEL +TF_LUNCH +TF_METRO +TF_OTHER +TF_PEAGE +TF_TAXI +TF_TRAIN +TF_TRIP +THMEstimatedHelp +THMMachineEstimated +THMMachineEstimatedHelp +THMOperatorEstimated +THMOperatorEstimatedHelp +TICKET_CLOSEInDolibarr +TICKET_CREATEInDolibarr +TICKET_DELETEInDolibarr +TICKET_MODIFYInDolibarr +TMenuAgenda +TMenuMRP +TMenuProducts +TMenuServices +TMenuTools +TOKEN_DELETE +TabLetteringCustomer +TabLetteringSupplier +TagCheckMail +TagMailtoEmail +TagSignature +TagUnsubscribe +TakeposConnectorMethodDescription +TakeposConnectorNecesary +TakeposNeedsPayment +TaskAssignedToEnterTime +TaskDateEnd +TaskDateStart +TaskDescription +TaskId +TaskProgressSummary +TaskTimeDate +TaskTimeNote +TaskTimeSpent +TaskTimeUser +TasksHistoryForThisContact +Tb +TeleFax +TeraBytes +Terminate +TerreNumRefModelError +TestConnection +TestLoginToAPI +TestSms +TextLong +TextLongNLines +TheoricalQty +TheoricalValue +ThirdPartyAccount +ThirdPartyBankCode +ThirdPartyBookCalHelp +ThirdPartyCreatedByEmailCollector +ThirdPartyCustomersStats +ThirdPartyProspectsStats +ThirdpartiesHome +ThisIsContentOfSubscriptionReminderEmail +ThisIsContentOfYourCard +ThisIsContentOfYourMembershipRequestWasReceived +ThisIsContentOfYourMembershipWasValidated +ThisIsContentOfYourSubscriptionWasRecorded +ThisIsInformationOnDocumentToSignSociete_rib +ThisScreenAllowsYouToSignDocFromSociete_rib +TicketAssignedCustomerBody +TicketAssignedCustomerEmail +TicketCategoryShortOTHER +TicketChangeCategory +TicketChangeSeverity +TicketChangeType +TicketCloseEmailBodyAdmin +TicketCloseEmailBodyCustomer +TicketCloseEmailBodyInfosTrackUrlCustomer +TicketCloseEmailSubjectAdmin +TicketCloseEmailSubjectCustomer +TicketCreatedByEmailCollector +TicketDictCategory +TicketDictResolution +TicketDictSeverity +TicketDictType +TicketInitialMessageModified +TicketLogAssignedTo +TicketLogClosedBy +TicketLogPropertyChanged +TicketLogReopen +TicketLogStatusChanged +TicketMailExchanges +TicketMessageMailIntroAutoNewPublicMessage +TicketNewEmailBodyCustomer +TicketNewEmailSubjectCustomer +TicketNotNotifyTiersAtCreate +TicketNotificationEmailSubject +TicketNotificationLogMessage +TicketNotificationNumberEmailSent +TicketParamMail +TicketParamModule +TicketParamPublicInterface +TicketParams +TicketPleaseSelectAContract +TicketSetupPage +TicketSeverityShortBLOCKING +TicketSeverityShortHIGH +TicketSeverityShortLOW +TicketSeverityShortNORMAL +TicketTimeToRead +TicketTypeShortCOM +TicketTypeShortHELP +TicketTypeShortISSUE +TicketTypeShortOTHER +TicketTypeShortPROBLEM +TicketTypeShortPROJET +TicketTypeShortREQUEST +TicketViewAllTickets +TicketViewNonClosedOnly +TicketsActivatePublicInterfaceHelp +TicketsCategoriesArea +TicketsDisableEmail +TicketsHome +TicketsLimitViewAssignedOnly +TicketsLimitViewAssignedOnlyHelp +TicketsLogEnableEmail +TicketsLogEnableEmailHelp +TimeSpentBy +TimeSpentForIntervention +TimeSpentInvoiced +TimeType +TitleNumberOfActivatedModules +ToBillSeveralOrderSelectCustomer +ToBuildBackupFileClickHere +ToConciliate +ToDate +ToDispatch +ToLocation +ToProcess +ToStart +ToTest +ToUseAGenericEmail +TokenMustHaveBeenCreated +Tomorrow +TooMuchCombinationsWarning +ToolkitForDevelopers +TotalHTforthispage +TotalLT1ES +TotalLT1IN +TotalLT2ES +TotalLT2IN +TotalNumberOfActivatedModules +TotalSituationInvoice +TotalTTCToYourCredit +TotalTicket +TotalVATIN +TrackableSecurityEvents +TransKey +TranslatedDescription +TranslatedLabel +TranslatedNote +TranslationSetup +TranslationUncomplete +TriggerCodeInfo +TriggerCodes +TripId +TurnoverCollectedbyVatrate +TypeContact_commande_external_BILLING +TypeContact_commande_external_CUSTOMER +TypeContact_commande_external_SHIPPING +TypeContact_commande_internal_SALESREPFOLL +TypeContact_commande_internal_SHIPPING +TypeContact_contrat_external_BILLING +TypeContact_contrat_external_CUSTOMER +TypeContact_contrat_external_SALESREPSIGN +TypeContact_facture_external_BILLING +TypeContact_facture_external_SERVICE +TypeContact_facture_external_SHIPPING +TypeContact_facture_internal_SALESREPFOLL +TypeContact_fichinter_external_CUSTOMER +TypeContact_invoice_supplier_external_BILLING +TypeContact_invoice_supplier_external_SERVICE +TypeContact_invoice_supplier_external_SHIPPING +TypeContact_invoice_supplier_internal_SALESREPFOLL +TypeContact_order_supplier_external_BILLING +TypeContact_order_supplier_external_CUSTOMER +TypeContact_order_supplier_external_SHIPPING +TypeContact_order_supplier_internal_SALESREPFOLL +TypeContact_order_supplier_internal_SHIPPING +TypeContact_project_external_PROJECTCONTRIBUTOR +TypeContact_project_external_PROJECTLEADER +TypeContact_project_internal_PROJECTCONTRIBUTOR +TypeContact_project_internal_PROJECTLEADER +TypeContact_project_task_external_TASKCONTRIBUTOR +TypeContact_project_task_external_TASKEXECUTIVE +TypeContact_project_task_internal_TASKCONTRIBUTOR +TypeContact_project_task_internal_TASKEXECUTIVE +TypeContact_propal_external_BILLING +TypeContact_propal_external_CUSTOMER +TypeContact_propal_external_SHIPPING +TypeContact_propal_internal_SALESREPFOLL +TypeContact_stocktransfer_internal_STDEST +TypeContact_stocktransfer_internal_STFROM +TypeContact_stocktransfer_internal_STRESP +TypeContact_supplier_proposal_external_BILLING +TypeContact_supplier_proposal_external_SERVICE +TypeContact_supplier_proposal_external_SHIPPING +TypeContact_ticket_external_CONTRIBUTOR +TypeContact_ticket_external_SUPPORTCLI +TypeContact_ticket_internal_CONTRIBUTOR +TypeContact_ticket_internal_SUPPORTTEC +TypeContrib +TypeOfLeaveCode +TypeOfLeaveId +TypeOfLeaveLabel +TypeOfLineServiceOrProduct +Unanswered +Uncheck +Under +Undo +UnitCharges +UnitPriceTTC +UnknownAccountForThirdpartyBlocking +Unlettering +Unread +UpdateByScaningLot +UpdateByScaningProductBarcode +UpdateConfCPOK +UpdateRate +UploadFileDragDropSuccess +UrlToCheck +UsBillingContactAsIncoiveRecipientIfExist +UsageBillTimeShort +UsageOpportunity +UsageOrganizeEvent +UsageTasks +UseCredit +UseCustomerContactAsPropalRecipientIfExist +UseDebugBar +UseDiscount +UseDocFolder +UseFormatFileEmailToTarget +UseFormatInputEmailToTarget +UsePercentageVariations +UsePreviewTabs +UseTextBetween5And70Chars +UsedByInvoice +UserAccountancyCode +UserApproval +UserApproval2 +UserAuthor +UserCP +UserCard +UserClosing +UserClosingService +UserClosingShort +UserCreationShort +UserDeleted +UserEnabled +UserEnabledDisabled +UserForApprovalFirstname +UserForApprovalID +UserForApprovalLastname +UserForApprovalLogin +UserHideExternal +UserHideNonEmployee +UserID +UserLogged +UserLoginFailed +UserLogoff +UserMargins +UserModification +UserModificationShort +UserNeedPermissionToEditStockToUsePos +UserPersonalEmail +UserPersonalMobile +UserRank +UserRights +UserSetup +UserStartingService +UserUpdateCP +UserValidation +UserValidationShort +UsersHome +VALIDATEInDolibarr +VATBalance +VATDue +VATIN +VATINs +VATNPR +VATReportBuildWithOptionDefinedInModule +VATReportByCustomers +VATReportByCustomersInInputOutputMode +VATReportByPeriods +VATReportByQuartersInInputOutputMode +VATs +ValidFrom +ValidSms +ValidUntil +ValidateAndClose +ValidateInvoice +ValidateOrderFirstBeforeReception +ValidateReply +ValidatedById +ValidatedByLogin +ValidatedProjects +ValidatedWaitingApproval +ValueOfMeansLossForProductProduced +VarAmount +VariantLabelExample +VariantRefExample +VariousPaymentId +VariousPaymentLabel +Vendor +VendorEmail +VendorFirstname +VendorLastname +ViewAccountList +ViewSiteInNewTab +ViewSubAccountList +ViewWebsiteInProduction +VirementOrder +VirtualStockAtDateDesc +VisibleEverywhere +VisibleNowhere +VolumeUnitcm3 +VolumeUnitdm3 +VolumeUnitfoot3 +VolumeUnitgallon +VolumeUnitinch3 +VolumeUnitlitre +VolumeUnitm3 +VolumeUnitmm3 +VolumeUnitounce +VolumeUnits +VueBySubAccountAccounting +WEBSITE_CSS_URL +WEBSITE_PAGEURL +Waiting +WarehouseId +WarehouseRef +WarehouseUsage +WarehousesAndProducts +WarehousesAndProductsBatchDetail +WarningBillExist +WarningCloseAlways +WarningFailedToAddFileIntoDatabaseIndex +WarningInstallationMayBecomeNotCompliantWithLaw +WarningNoSmsAdded +WarningNoteModuleInvoiceForFrenchLaw +WarningNoteModulePOSForFrenchLaw +Warnings +WatermarkOnDraftSupplierProposal +WebhookSetup +Webpage +WebsiteId +WebsiteTypeLabel +WeightUnitg +WeightUnitkg +WeightUnitmg +WeightUnitounce +WeightUnitpound +WeightUnits +WeightUnitton +WelcomeOnOnlineSignaturePageSociete_rib +WidthUnits +WithBankUsingBANBIC +WithBankUsingRIB +WithDolTrackingID +WithDolTrackingIDInMsgId +WithdrawRequestAmount +WithdrawRequestErrorNilAmount +WithdrawalCantBeCreditedTwice +WithdrawalFile +WithdrawalPayment +WithoutDolTrackingID +WithoutDolTrackingIDInMsgId +WorkPlace +Workflow +WorkstationArea +WorkstationCreate +WorkstationList +WorkstationSetup +WorkstationType +WorkstationsDescription +YearInvoice +Yesterday +YouAreNotContactOfProject +YouCanEditHtmlSourceckeditor +YouCanEditPHPTZ +YouCanLinkArticleToATicketCategory +YouCantShipThis +YouMayFindYourInvoiceInThisEmail +YouTryInstallDisabledByDirLock +YouUseLastStableVersion +YouWillBeRedirectedOnPayBox +YouWillBeRedirectedOnStripe +YourCandidature +YourCandidatureAnswerMessage +YourEMail +YourMembershipRequestWasReceived +YourMembershipWasCanceled +YourMembershipWasValidated +YourOrganizationEventBoothRequestWasReceived +YourOrganizationEventConfRequestWasReceived +YourPartnershipAcceptedContent +YourPartnershipAcceptedTopic +YourPartnershipCanceledContent +YourPartnershipCanceledTopic +YourPartnershipRefusedContent +YourPartnershipRefusedTopic +YourPartnershipWillSoonBeCanceledContent +YourPartnershipWillSoonBeCanceledTopic +YourPasswordHasBeenReset +YourSEPAMandate +YourSubscriptionWasRecorded +ZapierAbout +ZapierDescription +ZapierForDolibarrSetup +accessType +activityindex +addEventToUserCP +byEX_DAY +byEX_EXP +byEX_MON +byEX_YEA +categories +commercialindex +contractindex +datapolicySetup +davDescription +day +deplacement +descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE +descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER +descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER +descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER +descWORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL +descWORKFLOW_ORDER_AUTOCREATE_INVOICE +descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL +descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL +descWORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION +descWORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED +descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING +descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED +descWORKFLOW_PROPAL_AUTOCREATE_INVOICE +descWORKFLOW_PROPAL_AUTOCREATE_ORDER +descWORKFLOW_RECEPTION_CLASSIFY_BILLED_INVOICE +descWORKFLOW_RECEPTION_CLASSIFY_CLOSED_INVOICE +descWORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE +descWORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE +descWORKFLOW_TICKET_CLOSE_INTERVENTION +descWORKFLOW_TICKET_CREATE_INTERVENTION +descWORKFLOW_TICKET_LINK_CONTRACT +descWORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS +donationindex +errorRateDelete +expensereportindex +g +gram +hour +hrmindex +interventionindex +inventoryChangePMPPermission +inventoryConfirmCreate +inventoryCreate +inventoryCreateDelete +inventoryCreatePermission +inventoryDeleteLine +inventoryDeletePermission +inventoryDraft +inventoryEdit +inventoryErrorQtyAdd +inventoryListEmpty +inventoryListTitle +inventoryMvtStock +inventoryOfWarehouse +inventoryOnDate +inventoryReadPermission +inventorySelectWarehouse +inventorySetup +inventoryTitle +inventoryValidate +inventoryValidatePermission +inventoryWarningProductAlreadyExists +inventoryWritePermission +invoiceindex +kg +kilogram +l +liter +lm +logBILL_DELETE +logBILL_PAYED +logBILL_SENTBYMAIL +logBILL_UNPAYED +logBILL_VALIDATE +logCASHCONTROL_VALIDATE +logDOC_DOWNLOAD +logDOC_PREVIEW +logDONATION_PAYMENT_CREATE +logDONATION_PAYMENT_DELETE +logDON_DELETE +logDON_MODIFY +logDON_VALIDATE +logMEMBER_SUBSCRIPTION_CREATE +logMEMBER_SUBSCRIPTION_DELETE +logMEMBER_SUBSCRIPTION_MODIFY +logMODULE_RESET +logMODULE_SET +logPAYMENT_ADD_TO_BANK +logPAYMENT_CUSTOMER_CREATE +logPAYMENT_CUSTOMER_DELETE +logPAYMENT_VARIOUS_CREATE +logPAYMENT_VARIOUS_DELETE +logPAYMENT_VARIOUS_MODIFY +loginPassword +m +m2 +m3 +mailingindex +margin +meter +modify +mrpindex +newLT1Payment +newLT1PaymentES +newLT2Payment +newLT2PaymentES +nolimitbyEX_DAY +nolimitbyEX_EXP +nolimitbyEX_MON +nolimitbyEX_YEA +notiftofixedemail +notiftouser +notiftouserandtofixedemail +oauthService +oauthToken +opensurveyindex +ordersindex +orderssuppliersindex +p +printPlannedWarehouse +productindex +projectsindex +proposalindex +rate +receptionindex +recruitment +s +se +second +sendingindex +set +specialexpensesindex +stockindex +supplier_proposalDESC +suppliersproposalsindex +with + +# Seem to be global settings +AI_CONFIGURATIONS_PROMPT +WEBPORTAL_BANNER_BACKGROUND +WEBPORTAL_BANNER_BACKGROUND_IS_DARK +WEBPORTAL_INVOICE_LIST_ACCESS +WEBPORTAL_LOGIN_BACKGROUND +WEBPORTAL_LOGIN_LOGO_URL +WEBPORTAL_MEMBER_CARD_ACCESS +WEBPORTAL_MENU_LOGO_URL +WEBPORTAL_ORDER_LIST_ACCESS +WEBPORTAL_PARTNERSHIP_CARD_ACCESS +WEBPORTAL_PRIMARY_COLOR +WEBPORTAL_PROPAL_LIST_ACCESS +WEBPORTAL_TITLE +WEBPORTAL_USER_LOGGED + + +# +# The following exceptions are added to have Continuous Integrations pass. +# They may not be valid exceptions - this list needs to be cleaned +# +ANONYMISER_AT +AiCustomPrompt +DATAPOLICYSUBSITUTION +DATAPOLICY_PORTABILITE_CONFIRMATION +DATAPOLICY_PORTABILITE_TITLE +DisplayGrandTotalInList +EditWithEditor +ElementId +ElementType +ErrorABatchShouldNotContainsSpaces +ImageGeneration +ModelTemplate +ModuleWebPortalDesc +ModuleWebPortalName +Reports +SendEmailsRemindersOnSupplierInvoiceDueDate +TXTLINKDATAPOLICYACCEPT +TXTLINKDATAPOLICYREFUSE +Transparency +WEBPORTAL_MENU_LOGO_URLTooltip +WEBPORTAL_SECONDARY_COLOR +WebPortalDescription +WebPortalInvoiceListNothing +WebPortalOrderListNothing +WebPortalPropalListNothing +WebPortalSetup +WebPortalSetupPage +XSubsriptionErrors +YouCanChooseAModelForYouMailContent +YouCanMakeSomeInstructionForEmail +helpWithAi diff --git a/dev/translation/ignore_translation_keys.lst b/dev/translation/ignore_translation_keys.lst new file mode 100644 index 00000000000..173355fe70a --- /dev/null +++ b/dev/translation/ignore_translation_keys.lst @@ -0,0 +1,1183 @@ +# File with translation keys that are ignored for +# reporting issues (where used). +# Two parts (ignored by the tools): +# - First part: +# Keys that are in the translation files, and commented +# in the code - so potentially useful in the future. +# - Second part: +# Keys that are used in the code and missing in translation +# files. These should be fixed but are ignored for now +# so that continuous integration does not complain about it +# in order to detect newly introduced issues with the keys. +# +# ██████╗ █████╗ ██████╗ ████████╗ ██╗ +# ██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝███║ +# ██████╔╝███████║██████╔╝ ██║ ╚██║ +# ██╔═══╝ ██╔══██║██╔══██╗ ██║ ██║ +# ██║ ██║ ██║██║ ██║ ██║ ██║ +# ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ +# Keys that are in the translation files, and commented +# in the code - so potentially useful in the future. +ActivateModule +AddDispatchBatchLine +AddNewNotification +AssignUser +BankAccountsAndGateways +Binding +ChartGenerated +CloneMainAttributes +CloseRefusedBecauseOneServiceActive +CollapseBatchDetailHelp +CustomersOrdersRunning +DelayToRequestCP +DescFinanceJournal +DetailLevel +DiscountNone +ErrorFieldAccountNotDefinedForInvoiceLine +EveryDay +FieldsTitle +FileIntegrityIsOkButFilesWereAdded +FirstUseDate +FollowingLinksArePublic +HidePassword +IPP_Device +InstallChoiceRecommanded +IsInPackage +MailNoChangePossible +ModuleBuilderDesc2 +ModulesMarketPlaceDesc +MoveField +MyContacts +NbOfActiveNotifications +NbOfTargetedContacts +PreviewMailing +Processing +PropalStatusClosedShort +PublicAttendeeSubscriptionPage +ResetBarcodeForAllRecords +ResourcesLinkedToElement +SetupDescription5 +ShowSending +SomethingMakeInstallFromWebNotPossible2 +StatusMotif0 +StatusOrderProcessed +SuppliersOrdersRunning +TasksOnOpenedProject +ThirdPartyCustomersWithIdProf12 +TicketPublicInfoCreateTicket +TitreRequestCP +UseAsciiDocFormat +ViewPageInNewTab +YourTicketSuccessfullySaved +# +# ██████╗ █████╗ ██████╗ ████████╗██████╗ +# ██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝╚════██╗ +# ██████╔╝███████║██████╔╝ ██║ █████╔╝ +# ██╔═══╝ ██╔══██║██╔══██╗ ██║ ██╔═══╝ +# ██║ ██║ ██║██║ ██║ ██║ ███████╗ +# ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚══════╝ +# Keys that are used in the code and missing in translation +# files. These should be fixed but are ignored for now +# so that continuous integration does not complain about it +# in order to detect newly introduced issues with the keys. +# +........ +AADE_WEBSERVICE_KEY +AADE_WEBSERVICE_USER +APCCacheInstalledButDisabled +APCInstalled +API +Accept +AccountancyErrorMismatchLetteringCode +AccountingAccount +AccountingCode +AccountingJournalType +ActionAC_ +ActionAC_ALL_ +AddSite +AddSupplier +AddTicketIntoCategory +Adherent +AdherentNotLinkedToThirdParty +AdvTgtUse +Agents +AllEntities +AllFilesDidAlreadyExist +AlreadyInV7 +AmountOfOrders +AmountOfOrdersHT +AmountOfProposals +AmountOfProposalsHT +AmountOfReceptions +AmountOfReceptionsByMonthHT +AmountOfShipments +AmountOfShipmentsByMonthHT +AmountOfTickets +AmountOfTicketsByMonthHT +AmountOfinterventions +AmountOfinterventionsByMonthHT +AnObjectWithThisClassNameAlreadyExists +Anciennete +AnnualByAccountDueDebtMode +AnnualByAccountInputOutputMode +Anonymous +AnotherField +Applications +Articles +AssetErrorFetchMaxDepreciationDateForMode +AssetInAccountNotDefined +AuthorityDidntReconizeFingerprintConformity +AuthorityReconizeFingerprintConformity +Auto +AutoGenerateDoc +AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation +Automatic +AvailabilityType +BAN +BI +BOMs +Back +Bad value for email, email lwas not verified by Google +Bad value for returned userinfo[aud] +Bad value for returned userinfo[exp]. Token expired. +Bad value for returned userinfo[iss] +BadNumberOfLinesMustHaveAtLeastOneLinePlusTitle +BadParameterWhenCallingCreateOfBlockedLog +BadPaymentMethod +BadStatusOfObject +BadValueForParameterClientOrSupplier +BankColorizeMovementName +Banque +Barcode +BarcodeDesc +BarcodeStickersMask +BatchInformationNotfound +BillOfMaterialsLine +BlockLogNeedAmountsValue +BlockLogNeedElement +BlockedLogAuthorityNeededToStoreYouFingerprintsInNonAlterableRemote +BlockedLogAuthorityUrl +BlockedLogSetup +BookCalArea +BookCalSystem +Bookings +BoxTitleLast +BoxTitleLatest +BoxTitleLatestModifiedMyObjects +ByDefault +Bzip2 +CLI +CSS +Cache +CalcModeLT +CalculatedFromProductsToConsume +CancelReception +Candidatures +CantBeNullOrPositive +CantConvertToReducAnInvoiceOfThisType +CardFichinter +CardProduct +CashDeskBankAccountForStripeTerminal +Channel +Charset +Cheque +ChequeBankUpdateSucceeded +ChequeMakeUpdateSucceeded +Child of +ClassNotFound +Clear +ClickToDial +Clients +Clone +CloneAffectation +CloneChanges +CloneFile +CloneProgression +CloneTimes +Close Done +Close2 +CloseShipment +CodeTooltipHelp +Column +Combination +CompanyPaymentMode +ComptaFiles +ConferenceOrBoothAttendeeExtraFields +Confirm Delete Dictionnary +Confirm Delete Menu +Confirm Delete Right +ConfirmActionAvailabilities +ConfirmActionMyObject +ConfirmActionTarget +ConfirmCloneMyObject +ConfirmCloneTask +ConfirmCloseShipment +ConfirmCreateAdherent +ConfirmDeleteAdherent +ConfirmDeleteIndividual +ConfirmDeleteReport +ConfirmDeleteWebsiteAccount +ConfirmReoponAsk +ConnectingToStripeTerminal +Constant +ContactAddress +ContactDefault_ +ContactSuperAdminForChange +ContactUs +Container +Contrats +Control +Convert +Core +Count +CreateFichInter +CreateRemoteOrder +CreateRepeatableIntervention +Created +CronCannotLoadLib +Crypted +Current +CustomX +CustomY +DATAPOLICYReturn +DateInvalid +DatePaymentForDepositReceived +Datee +Dateo +Dates +Datet +DecimalSeparator +Declared +Decline +DefaultCashPOSLabel +Delays_ +DeleteAdherent +DeleteAnIndividual +DeleteAsset +DeleteAssetModel +DeleteAvailabilities +DeleteCalendar +DeleteConferenceOrBooth +DeleteEvaluation +DeleteInventory +DeleteJob +DeleteKnowledgeRecord +DeleteLoan +DeleteMyObject +DeleteOldFiles +DeletePosition +DeleteReception +DeleteRecruitmentCandidature +DeleteRecruitmentJobPosition +DeleteReport +DeleteTarget +DeleteWebsiteAccount +DemandReasonType +Demo +Desc +Detail +Details +Development +Dictionaries +DictionaryEmpty +DictionaryNameUpdated +Directory +DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND +Document +Documentation +Dolibarr +Dolibarr constant MAIN_SERVER_TZ +DolibarrPassword +Down +DraftMyObjects +DragDrop +DuplicateRecord +DynamicPrice +ECMAreaDesc2 +ECMDocsByProducts +ECMSectionAutoDesc +ECMSectionManualDesc +EMail +EMails +EcmFiles +EditAdherent +EditAdherentAddress +EditRelativeDiscounts +EmailcollectorAction +EmailcollectorFilter +EmailingTargetSelector +Empty +End +EnterAnIP +EnterNameOfDictionnaryToDeleteDesc +EntityNameNotDefined +Entries +ErrSCAAuthentication +Error sql +ErrorADiscountThatHasBeenRemovedIsIncluded +ErrorAccountancyCodeOnBankAccountNotDefined +ErrorAccountancyCodeOnThirdPartyNotDefined +ErrorBackToDraft +ErrorBadEmail +ErrorBadInvoice +ErrorBadParameterCat +ErrorBadParameterQty +ErrorBadPhone +ErrorBadSocialNetworkValue +ErrorBadStatus +ErrorBadValue +ErrorBadValueForBatch +ErrorBadValueForDate +ErrorCanNotDeleteDir +ErrorCantSplitAUsedDiscount +ErrorChartOfAccountSystemNotSelected +ErrorCheckVersionIsDefined +ErrorCreateUserSkill +ErrorDB +ErrorDateEndLowerThanDateStart +ErrorDoNotProvideAccountsIfNullAmount +ErrorDuplicateEmalingSelector +ErrorDuplicateWidget +ErrorEmailInvalid +ErrorEmptyNameDic +ErrorFailToCreateZip +ErrorFailToOpenFile +ErrorFaildToOpenFile +ErrorFailedToAddUserAsContact +ErrorFailedToConnect +ErrorFailedToCopyProposal +ErrorFailedToDeleteFile +ErrorFailedToFindSomeFiles +ErrorFailedToGetListOfNotificationsToSend +ErrorFailedToLoadBankAccount +ErrorFailedToLoadDiscount +ErrorFailedToSetNewPassword +ErrorFaviconMustBeASquaredImage +ErrorFileNameInvalid +ErrorImportOfChartLimitedToCurrentChart +ErrorMAIN_ROUNDING_RULE_TOTCanMAIN_MAX_DECIMALS_TOT +ErrorMailFromRequired +ErrorNegativeValueNotAllowed +ErrorNoAccountingModuleEnabled +ErrorNoPhoneDefinedForThisUser +ErrorNoUrl +ErrorNoValueForLinkType +ErrorNoValueForSelectListType +ErrorNumberingModuleNotSetup +ErrorObjectMustHaveStatusClosedToBeReOpened +ErrorObjectMustHaveStatusValidToBeCanceled +ErrorObjectNoSupportedByFunction +ErrorOccurredReviseAndRetry +ErrorOnlyOrderNotDraftCanBeSentInMassAction +ErrorOnlyProposalNotDraftCanBeSentInMassAction +ErrorParamMustBeAnUrl +ErrorPriceExpression +ErrorProductIdIsMandatory +ErrorSetupOfCountryMustBeDone +ErrorSomeFilesCouldNotBeDeleted +ErrorStripeAccountNotDefined +ErrorTechnicalError +ErrorThirdPartyIdIsMandatory +ErrorTicketIsNotValid +ErrorTitreAlreadyExists +ErrorUpdatingUsersCP +ErrorUserFetch +ErrorValueMustBeInteger +ErrorValueTooHigh +ErrorVerif +ErrorWarehouseRequiredIntoReceptionLine +ErrorWebServicesFieldsRequired +Error_BOM_ADDON_NotDefined +Error_COMPANY_ADDON_PDF_NotDefined +Error_FICHEINTER_ADDON_NotDefined +Error_HOLIDAY_ADDON_NotDefined +Error_MRP_MO_ADDON_NotDefined +Error_RECEPTION_ADDON_NUMBER_NotDefined +ErrorloadUserOnSendingMail +EstimatedWeight +Evaluation +Evaluationdet +Evaluations +EventFee +EventIntoASerie +EventOrganizationArea +EventParticipant +ExampleOnlyForATBEDEITNLESCustomers +ExampleOnlyForBECustomers +ExampleOnlyForDECustomers +ExampleOnlyForKlarnaCustomers +ExampleOnlyForNLCustomers +Expedition +Experimental +Expired +Extension +ExtraLanguageHasWrongValue +Extrafieldcomputed +FRST +FTP +Failed +FailedToCloseProject +FailedToDefinGraph +FailedToExecutCommandJob +FailedToGetCostPrice +FailedToOpenFile +FailedToReadFile +FailedToSetPaid +FailedToSetToCancel +FailedToUncompressFile +FailedToUpdatePrice +FailedtoSetToApprove +FailedtoSetToDeny +FeatureNotAvailableWithThisDatabaseDriver +FieldNotFoundInObject +FieldsEdit +FieldsInsert +FieldsLinked +FieldsView +File encoding +FileDidAlreadyExist +FileIsNotCorrect +Filename +FilteredFrom +FiscalYear +Flashy +ForceEmailFrom +ForcedByGlobalSetup +Form for public lead registration has not been enabled +Free +FreeLegalTextOnReceptions +FrequencyPer_ +FromPublicEmail +Function_getNextValue_InModuleNotWorking +Gantt +GeneratePDF +GeoIPLibVersion +Get +GetCompanyParentsError +GlobalGroup +GlobalVariableUpdaterHelp +GlobalVariableUpdaterHelpFormat +GlobalVariableUpdaterType +GoOnTokenProviderToDeleteToken +GoSourceInvoice +Gzip +H +HTTPBasicPassword +HelpAbandonProductReturned +HideVersionLink +HolidayStarted +Hook +Hooks +IBANNotDefined +ID +IPP_COLOR_ +IconFieldSelector +Id +Image +ImpossibleToRetrieveUser +ImpossibleUpdateCat +Inactive +Inf +IntracommReport +IntracommReportDeleted +Introduction +JS +Job +JobPositionApplications +JournalNum +KO +Key +Keywords +LDAP +LDAP setup for groups not defined inside Dolibarr +LDAP setup for members not defined inside Dolibarr +LDAP setup for members types not defined inside Dolibarr +LDAP setup for users not defined inside Dolibarr +LT +LabelName +LabelPaperSize +Language_ +Languages +LdapUacf_ +Level +Lifetime +LinkedElementsInvalidDeleted +LinkedToAConcialitedTransaction +ListOfAttendeesPerConference +ListOfBookmark +ListTicketsLinkToContract +Load +LocalTaxReport +Locale +Lot +MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING +MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET +MEDIA_IPP_ +MO +MRP +MYDATA_AADE_KEY +MYDATA_AADE_USER +Mailman +MainAccountForRevenueStampSaleNotDefined +Manual +Map +Max +MaxRunReached +Maximum +Measuringtype_durationDesc +MemberAllowchangeOfType +MemberTypeCard +MembersListOfTiers +MenuAddedSuccesfuly +Message +MigrationBankTransfertsToUpdate +MigrationContractsEmptyCreationDatesUpdateSuccess +Millisecond +Minimum +Mo +Mode +Modifier +Module/Application +ModuleCompanyCode +ModuleCompanyCodeCustomer +ModuleCompanyCodeSupplier +ModuleNotEnabled +ModuleTriggeringThisWarning +Modulebuilder +ModulebuilderSetup +MonthShort +MonthVeryShort +Morphy +Movement +MultiCompanyMode +Multicompanies +MulticurrencyPaidBack +MulticurrencyRemainderToPayBack +MustBeAdminToDeleteOtherAdmin +MyFilter +MyModule +MyModuleArea +MyModuleBoxDescription +MyModuleMassAction +MyModuleSetup +MyModuleSetupPage +MyModuleTab +MyObject +MyObjects +NA +NPR +NPR counterpart +Name of the new third party. In the meantime we check if it already exists... +Nb +NbOfDonations +NbOfIntervention +NbOfOrder +NbOfSendingsByMonth +NbOfTicket +NeedRefresh +NetMeasure +Network +NewAdherent +NewAdherentAddress +NewDeposit +NewEMailTemplate +NewLead +NewPartnershipForm +NewProperty +NoActiveEstablishmentDefined +NoAddMember +NoAuthorityURLDefined +NoBankAccountFound +NoCurrencyRateSelected +NoEntriesToShow +NoEstablishmentFound +NoMail +NoModuleFound +NoOperations +NoPasswordGenerationRuleConfigured +NoReader +NoRecordedUnpaidInvoices +NoRecordfound +NoRecords +NoRecordsToDisplay +NoSenderEmailDefined +NoShippingMethodDefined +NoStripe +NoSurvey +NoTitle +NoType +NoTypeOfPagePleaseEditDictionary +NoURL +No_record_on_multicurrency_rate +NobodyHasPermissionToValidateExpenseReport +NotARecurringInterventionalTemplate +NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated +NotEnoughForAllOrders +NotFound +NotUsed +NotUserRightToView +Note: The function password_hash does not exist on your PHP +Note: The function password_hash exists on your PHP +Notification +Notify_ +Num +NumberOfCopy +NumberOfDonationsByMonth +NumberOfOrders +NumberOfProposals +Numeric +OK +Object +Objects +Offline +Ok +Omit sub-projects +Online +OnlineSignature +OnlyAdminUsersCanDisableAdminUsers +OnlyTerminal1IsAvailableForCashDeskModule +OpenSurvey +Operation +Operations +OppStatus +OrderSource +PARTNERSHIP_NEWFORM_PAYONLINE +PAYBOX_CGI_URL_V1 +PAYBOX_IBS_DEVISE +PAYPAL_API_EXPRESS +PDFStandardHrmEvaluation +PHP +PHP_OS +POS +PaperFormat +Parent +PasswordEncryption +PasswordLength +Path +PayBox +PayLoan +PayPal +Payement +PaymentBeingProcessed +PaymentCondition +PaymentConditionShort +PaymentDonation +PaymentHigherThanReminderToPaySupplier +PaymentSalary +PaymentSendToStripeTerminal +PaymentType +PaymentTypeShort +PaymentValidated +Paypal +Pending +PendingCreditTransferToComplete +PendingCreditTransferToCompleteShort +PendingDirectDebitToComplete +PendingDirectDebitToCompleteShort +PermissionAdvanced +Picto +PlanStripe +Poll +Posts +PredefinedInterventional +PrevRangeToThisRange +PreviousFingerprint +Print +PrintDriver +PrintModule +PrintUserConfDesc +PrinterId +PrinterIdEmpty +PrinterLocation +PrinterNameEmpty +PrinterParameterEmpty +Printers +Printing +ProductCodeDesc +ProductFournisseurPrice +ProductLot +ProductNotDefined +ProductReturned +Production +ProfId +Profile +Programs +Progression +ProjectNbProject +ProjectNbTask +Property %s not found in the class. The class was probably not generated by modulebuilder. +Proposer +Provider +Proxy +Pwd +QR +Question +RECUR +RSS +RateIndirect +Re-Open +Rechercher +ReconciledBy +RecordNotFound +RecruitmentJobPosition +Recurrence +RefAlreadyExists +Referer +Refuse +RegistrationAndPaymentWereAlreadyRecorded +Reinit +Rejection +RemoteOrderRef +RemotePriceMismatch +RemoteUserBadCredentials +RemoteUserMissingAssociatedSoc +RemoteUserNotPermission +RemoveDuplicates +Repair +Replace +Replaced +Reply +Request +RequireValidPhone +RequireValue +RequiredIfProduct +RequiredIfService +Resource +ResourceTypeShort +ResponseNonOK +Results +Retry +Reverse +RobotEmail +Roles +Rowid +RulesPurchaseTurnoverCollectedOfExpenseAccounts +SID +SOAPError +SPIP +SQL +SQLSort +STATE_ +STATE_IPP_ +STRIPE_APPLICATION_FEE_PLATFORM +STRIPE_BANCONTACT +STRIPE_GIROPAY +STRIPE_IDEAL +STRIPE_KLARNA +STRIPE_SOFORT +ST_ +SaveFailed +Saved +Script +SeeWikiPage +ServiceCodeDesc +Session +SetContract +SetModel +SetReceptionMethod +SetRefExt +SetRefusedAndClose +SetSendingMethod +SetTransDate +SetVATReverseCharge +SetWarehouse +Setting +SetupNotComplete +SetupNotError +SeveralEvents +ShipmentIncrementStockOnDelete +Shipping +ShowAsset +ShowAssetModel +ShowAvailabilities +ShowBill +ShowBillOfMaterials +ShowBillOfMaterialsLine +ShowCalendar +ShowCompanyPaymentMode +ShowConferenceOrBooth +ShowConferenceOrBoothAttendee +ShowCronJob +ShowEmailCollector +ShowEmailcollectorAction +ShowEmailcollectorFilter +ShowEvaluation +ShowEvaluationdet +ShowFichinter +ShowInterventionModel +ShowInventory +ShowJob +ShowKnowledgeRecord +ShowMo +ShowMyObject +ShowPartnership +ShowPayment +ShowPosition +ShowProductAttribute +ShowProductFournisseurPrice +ShowProductOrService +ShowProposal +ShowRecruitmentCandidature +ShowRecruitmentJobPosition +ShowSearchFields +ShowSkill +ShowSkillRank +ShowSkilldet +ShowStockTransfer +ShowStockTransferLine +ShowTarget +ShowTimeSpent +ShowWorkstation +Showing +SignatureKO +SignatureOK +Siren +Situation +SizeUnit +SkillCreated +SkillRank +SmsTestSubstitutionReplacedByGenericValues +SomeShipmentExists +SourceType +Split +SplitAllQuantity +Standard +StatsOnDonationsOnlyValidated +StatusProspect +Stock Total +Stock total +StockTransferLine +Stripe +StripeAutoSubscription +StripeBalance +StripeConnect +StripeConnectPay +StripeCustomer +Sub-projects +SubscriptionStripe +Success +Sumup +SumupAffiliate +SumupAppId +Supervisor +SupplierDepositsAreNotIncluded +SupplierMissingRef +Synchronize +Syslog +TLS/STARTTLS +TLSv1 +TLSv1.2 +TYPE_ +Tabs +Tag +TakePOS +TargetType +Targets +TasksToDo +Taxes +Template +TemplateIdEmpty +TemplateNameEmpty +Templates +TestPrinterTemplate +TestTemplateToPrinter +Theme +Thirdparty +ThirdpartyHasNoDefaultBanAccount +ThisIsInformationOnDocumentToSign +ThisScreenAllowsYouToSignDocFrom +TicketCategoryShort +TicketMessageMailNewText +TicketSeverityShort +TicketTypeShort +TimeOnly +Timezone +ToGetBack +ToPay +ToReopon +Token +Tooltip +TooltipEditAndRevertStockMovement +TotalEntries +Transaction +TranslationOfKey +Triggers +Trip +TripForPaid +TripForValid +TripPaid +TurnoverReport +TypeContact_ +TypeToFilter +UTF8 +Unix +UnknownError +Unlink +Up +UpdateContact +UpdateGroup +UpdateMemberType +UpdateUser +UpgradeHasBeenUnlocked +Url +Use of API for currency update is disabled by option MULTICURRENCY_DISABLE_SYNC_CURRENCYLAYER +UserRemovedFromGroup +UserSetInGroup +VCard +Vacant +ValidateAndSign +ValidationDateNotDefinedEvenIfReceptionValidated +ValueFromBom +Variable +Variant +Vote +WTOf +WaitAccountNotDefined +Warning: you will delete all menus linked to this one. +WarningFieldsMustContains +WarningPostActionErrorAfterPayment +WarningUserDifferentContactSocid +WebDAV +WebServiceKey +WebServiceURL +Website +WebsiteMustBeSameThanClonedPageIfTranslation +Weighted +WelcomeOnOnlineSignaturePage +WidgetDisabledAsModuleDisabled +Widgets +Windows +WorkingBoard +Workload +WrongAmount +XDebug +XXX +XmlCorrupted +Y +ZeroMeansEveryYear +Zstd +_blank +accountancy_error_modelnotfound +bytes +card +card3DS +checkMargins +copy_of_ +csv +customer +desc +diff_after_tomorrow +diff_before_yesterday +diff_now +diff_tomorrow +diff_yesterday +errorUpdateSkilldet +errors +iDEAL +log +minimum +multicurrency_code_already_added +noExtrafields +period_end_date +period_interval +period_recurrences +period_start_date +point +productlot +refunded +save +seconds +sepadebit +showInputBorder +skill +supplier +test01 +test02 +test03 +test04 +test05 +test06 +title1 +title2 +title3 +txt +unit +words +xcache.cacher +xcache.coverager +xcache.optimizer +xcache.stat +xxx + + +# Confirmed, will be used in the future +# (When used, remove from this list) + +AudioText +MenuResourceAdd +SendShippingRef +TextGeneration +VideoGeneration + +##################################################################### +##################################################################### +## The following list is added only to make Continuous Integration +## pass - this list needs to be cleaned up +##################################################################### +##################################################################### +$minimum +AI_KEY_API_ +AddService +AnHelpMessage +Analytic +AnalyticLabel +BOOKCAL_MYPARAM10 +BOOKCAL_MYPARAM8 +BOOKCAL_MYPARAM9 +BankId +Bcc +Birthdate +Candidature +ClientCollation +Collation +Config +Confirmed +Creation +CronLib +CronModuleNotEnabledInThisEntity +DateInitialBalance +Dimension +Don +ECM +EmptyMessageNotAllowedError +ErrorBarcodeNotFoundForProductWarehouse +ErrorCodeScannedIsBothProductAndSerial +ErrorInputRequired +ErrorLDAPFunctionsAreDisabledOnThisPHP +ErrorUpdating +Exceptions +Extra +Facture +FailedToConnectToSFTPAfterSSHAuthentication +FailedToLogin +First +France +Germany +Greece +GroupCreate +GroupUpdate +INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION +INVOICE_RETAINED_WARRANTY_LIMITED_TO_SITUATION +INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID +INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT +INVOICE_USE_RETAINED_WARRANTY +INVOICE_USE_SITUATION +INVOICE_USE_SITUATION_CREDIT_NOTE +ImpossibleToContactAuthority +InputValueIsNotAnNumber +InterDate +Inventory Code +InvoiceReplace +Italy +ItemID +JobApplications +JobPosition +Journal +Label Movement +Labels +Last +LedgerAccount +LocalTax1IsNotUsedExample +LocalTax1IsUsedExample +LocalTax2IsNotUsedExample +LocalTax2IsUsedExample +Logs +Lot/Série +MAIN_IMAP_USE_PHPIMAPDesc +MYMODULE_CATEGORY_ID_XXX +MYMODULE_MYPARAM1 +MYMODULE_MYPARAM10 +MYMODULE_MYPARAM2 +MYMODULE_MYPARAM3 +MYMODULE_MYPARAM4 +MYMODULE_MYPARAM5 +MYMODULE_MYPARAM6 +MYMODULE_MYPARAM7 +MYMODULE_MYPARAM8 +MYMODULE_MYPARAM9 +ManufacturingOrders +MemberCreate +MemberTypeCreate +MemberTypeUpdate +Messages +MoDate +MultiCompany +MyWidget +NO_PARAM_JUST_TEXT +NewSection +NoPreviousBillForCustomer +Normal +NotSelected +Null +Obsolete +Off +On +Open +PDF 1.7 +PDF/A-1b +PDF/A-3b +PartnershipSentByEMail +PdfTitle +Privileges +ProcessingError +PurchaseOrder +PurchaseOrders +ReceptionSentByEMail +ReceptionValidated +Recruited +Ref. Product +RefNewContract +Societe +Spain +Stable +Suggested +TaskModifieddInDolibarr +TicketMessageMailSignatureText +TicketSetupPage +Tiers +Timeline +TotalDiscount +TotalHTBeforeDiscount +Transfer +TryAnotherConnectionMode +UndefinedKey +UnknownType +UpdateMember +UserCreate +UserDiscarded +UserUpdate +Variables +Vat +VirtualHost +WEBPORTAL_ROOT_URL +WEBPORTAL_USER_LOGGED2 +XSubsriptionError +centimes +email +id +leftmenu +message +multicurrency_buyPriceInCurrency +multicurrency_modifyRateApplication +ref +sendEmailsReminder +smsing +societe +target +titre +type +url +Civility +IntracommReportList +PrintTestDesc +PrintingDriverDesc diff --git a/dev/translation/sanity_check_trans_missing_unused.sh b/dev/translation/sanity_check_trans_missing_unused.sh new file mode 100755 index 00000000000..459f59117a5 --- /dev/null +++ b/dev/translation/sanity_check_trans_missing_unused.sh @@ -0,0 +1,212 @@ +#!/bin/bash +# +# Find unused translations pretty fast... +# +# Principle: +# +# 1.Generate two files: +# - one for available translations keys, +# - one for expected keys. +# 2. Make the difference between the files. +# +# Find expected translation keys: +# 1. Find all occurrences that look like `->trans("` or `->trans('` +# with fast grep. +# 2. Split result to have only one '->trans(' on each line +# 3. Filter the text between the single or double quotes. +# +# Find available translation keys: +# 1. Get all strings before '=' token in the language files +# +# Notes: +# - Some side effects from translations on variables. +# - Some other minors side effects to be examined (#, %). +# +# Copyright (C) 2024 MDW + +LANG_DIR=htdocs/langs/en_US/ +MYDIR=$(dirname "$(realpath "$0")") +TMP=${TMP:=/tmp} # Most of the time defined on the system. +EXPECTED_FILE=${TMP}/expected_translations +AVAILABLE_FILE_NODEDUP=${TMP}/available_translations_no_dedup +AVAILABLE_FILE=${TMP}/available_translations +DUPLICATE_KEYS_FILE=${TMP}/duplicate_keys +DYNAMIC_KEYS_FILE=${TMP}/dynamic_keys +MISSING_AND_UNUSED_FILE=${TMP}/missing_and_unused +MISSING_FILE=${TMP}/missing +UNUSED_FILE=${TMP}/unused +EXPECTED_REGEX='(Country..|Language_.._..|MonthVeryShort\d\d|PaperFormat.*|ProfId\d(..)?|unit.*)' +DYNAMIC_KEYS_SRC_FILE=${MYDIR}/dynamic_translation_keys.lst +EXCLUDE_KEYS_SRC_FILE=${MYDIR}/ignore_translation_keys.lst +DUPLICATE_KEYS_SRC_FILE=${MYDIR}/duplicate_translation_keys.lst + +# Grep options that are reused (normal grep) +GREP_OPTS="" +GREP_OPTS="${GREP_OPTS} --exclude=htdocs/theme/common/fontawe*/" +GREP_OPTS="${GREP_OPTS} --exclude-dir=.cache --exclude-dir=.git" +GREP_OPTS="${GREP_OPTS} --exclude=*.phar --exclude=*.webp --exclude=*.z" +GREP_OPTS="${GREP_OPTS} --exclude=*.sw? --exclude=*.json" + +# Note: using 'git grep' to restrict to version controlled files +# and more flexible globbing. + +# TODO/to ignore: +# transnoentities(), transnoentitiesnoconv(), +# formSetup->newItem() + +exit_code=0 + +# Find all translations keys available in the language files (for the language) +grep --no-filename -r -oP -- '^([^#=]+?)(?=\s*=.*)' "${LANG_DIR}" \ + | grep -x -v -F -f "${EXCLUDE_KEYS_SRC_FILE}" \ + | sort > "${AVAILABLE_FILE_NODEDUP}" +sort -u \ + < "${AVAILABLE_FILE_NODEDUP}" \ + > "${AVAILABLE_FILE}" + + +# Combine strings found in sources with pre-determined dynamic string values. + +## Build some regex strings to match translations +# +EXTRACT_STR="" +JOIN_STR="" +for t in '->trans' '->transnoentities' '->transnoentitiesnoconv' 'formSetup->newItem' ; do + MATCH_STR="$MATCH_STR$JOIN_STR$t" + EXTRACT_STR="$EXTRACT_STR$JOIN_STR(?<=${t}\\([\"'])([^\"']+)(?=[\"']\$)" + JOIN_STR="|" +done + +{ + # Find static strings that are translated in the sources (comments stripped) + # shellcheck disable=2086 + # With std grep: `grep --no-filename -r ${GREP_OPTS} -- '->trans(' . ` + # Using git grep avoiding to look into unversioned files + # transnoentitiesnoconv + git grep -h -r -P -- "${MATCH_STR}\\(" ':*.php' ':*.html' \ + | sed 's@\(^#\|[^:]//\|/\*\|^\s*\*\).*@@' \ + | sed 's@)\|\(['"'"'"]\)\(,\)@\1\n@g' \ + | grep -aPo "$EXTRACT_STR(?=.$)" + + # "Append" the list of strings that are used in dynamic expressions. + # (Fixed list: needs to be updated if the dynamic strings evolve.) + cat "${DYNAMIC_KEYS_SRC_FILE}" +} \ + | grep -x -v -F -f "${EXCLUDE_KEYS_SRC_FILE}" \ + | sort -u \ + | grep -v -P '^(#|$)' \ + > "${EXPECTED_FILE}" + + +# shellcheck disable=2050 +if [ 0 = 1 ] ; then + # Find dynamic keys for call to trans. + # shellcheck disable=2086 + grep --no-filename ${GREP_OPTS} -r -- '->trans(' . \ + | tr ')' '\n' \ + | grep -- '->trans(' \ + | grep -v -P '(?<=->trans\(["'"'"'])([^"'"'"']*)(?=["'"'"'])' \ + | grep -Po '(?<=->trans\()(.*)' \ + | sort -u \ + > "${DYNAMIC_KEYS_FILE}" +fi + + +# Produce reports on STDOUT. +# Some output is already compatible with message extraction for github annotation (logToCs.py) +# # Produce reports on STDOUT. +# Some output is already compatible with message extraction for github annotation (logToCs.py) +# +diff "${AVAILABLE_FILE}" "${EXPECTED_FILE}" \ + | grep -E "^[<>]" \ + | grep -v -P "^< ${EXPECTED_REGEX}$" \ + | sort \ + > "${MISSING_AND_UNUSED_FILE}" + +if [ -s "${MISSING_AND_UNUSED_FILE}" ] ; then + echo "##[group]List Apparently Unused Translations (<) and Missing Translations (>)" + echo + echo "## :warning: Unused Translations may match ->trans(\$key.'SomeString')." + echo "## You can add such dynamic keys to $(basename "$DYNAMIC_KEYS_SRC_FILE")" + echo "## so that they are ignored for this report." + echo "## :warning: Unused Translations may be commented in the code" + echo "## You can add such 'disabled' keys to $(basename "$EXCLUDE_KEYS_SRC_FILE")" + echo "## so that they are ignored for this report." + echo + cat "${MISSING_AND_UNUSED_FILE}" + echo "##[endgroup]" + echo +fi + +sed -n 's@< \(.*\)@^\1\\s*=@p' \ + < "${MISSING_AND_UNUSED_FILE}" \ + > "${UNUSED_FILE}.grep" + +# Too many results, git grep is slow +#sed -n 's@> \(.*\)@trans.["'"'"']\1["'"'"'].@p' \ +# < "${MISSING_AND_UNUSED_FILE}" \ +# > "${MISSING_FILE}.grep" +# + +# Prepare file with exact matches for use with `git grep`, supposing " quotes +# +REPL_STR="" +for t in trans transnoentities transnoentitiesnoconv ; do + REPL_STR="${REPL_STR}\n->${t}(\"\\1\"," + REPL_STR="${REPL_STR}\n->${t}('\\1'," + REPL_STR="${REPL_STR}\n->${t}(\"\\1\")" + REPL_STR="${REPL_STR}\n->${t}('\\1')" +done + +sed -n 's@> \(.*\)'"@${REPL_STR}@p" \ + < "${MISSING_AND_UNUSED_FILE}" \ + | grep -v -E '^$' \ + > "${MISSING_FILE}.grep" + + + +if [ -s "${UNUSED_FILE}.grep" ] ; then + exit_code=1 + + # Report unused translation in recognizable format + git grep -n --column -r -f "${UNUSED_FILE}.grep" -- "${LANG_DIR}"'/*.lang' \ + | sort -t: -k 4 \ + | sed 's@^\([^:]*:[^:]*:[^:]*:\)\s*@\1 Not used, translated; @' +fi + +if [ -s "${MISSING_FILE}.grep" ] ; then + exit_code=1 + + # Report missing translation in recognizable format + git grep -n --column -r -F -f "${MISSING_FILE}.grep" -- ':*.php' ':*.html' \ + | sort -t: -k 4 \ + | sed 's@^\([^:]*:[^:]*:[^:]*:\)\s*@\1 Missing translation; @' +fi + + +diff "${AVAILABLE_FILE_NODEDUP}" "${AVAILABLE_FILE}" \ + | grep -Po '(?<=^\< )(.*)$' \ + | grep -x -v -F -f "${DUPLICATE_KEYS_SRC_FILE}" \ + | sed 's/.*/^\0=/' \ + > "${DUPLICATE_KEYS_FILE}" + +if [ -s "${DUPLICATE_KEYS_FILE}" ] ; then + exit_code=1 + echo + echo "##[group]List Duplicate Keys" + echo "## :warning:" + echo "## Duplicate keys may be expected across language files." + echo "## You may want to avoid them or they could be a copy/paste mistake." + echo "## You can add add valid duplicates to $(basename "$DUPLICATE_KEYS_SRC_FILE")" + echo "## so that they are ignored for this report." + cat "${DUPLICATE_KEYS_FILE}" + echo "##[endgroup]" + echo + + git grep -n -r -f "${DUPLICATE_KEYS_FILE}" -- "${LANG_DIR}"'/*.lang' \ + | sort -t: -k 3 \ + | sed 's@^\([^:]*:[^:]*:\)\s*@\1 Is/Has duplicate @' +fi + + +exit $exit_code diff --git a/pyproject.toml b/pyproject.toml index 23f76292a93..39d126bd778 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" # `codespell` can be run as a standalone program from the CLI # with the appropriate default options. -skip = "*/.*/*,*/langs/*,*/build/exe/*,**.log,*.pdf,*dev/resources/*,*.phar,*.z,*.gz,*.sql,*.svg,*htdocs/includes/*,*/textiso.txt,*.js,*README-*,*build/rpm/*spec,*build/pad/*ml,*htdocs/includes/phpoffice/*,*htdocs/includes/tecnickcom/*,*dev/initdemo/removeconfdemo.sh,*dev/tools/codespell/*,*pyproject.toml,*build/exe/*,*fontawe*,*htdocs/theme/*/flags-sprite.inc.php,*dev/setup/codetemplates/codetemplates.xml,*/php.ini,*/html_cerfafr.*,*/lessc.class.php,*.asciidoc,*.xml,*opensurvey/css/style.css,*dev/tools/phan/stubs/*,*/documents" +skip = "*/.*/*,*/langs/*,*/build/exe/*,**.log,*.pdf,*dev/resources/*,*.phar,*.z,*.gz,*.sql,*.svg,*htdocs/includes/*,*/textiso.txt,*.js,*README-*,*build/rpm/*spec,*build/pad/*ml,*htdocs/includes/phpoffice/*,*htdocs/includes/tecnickcom/*,*dev/initdemo/removeconfdemo.sh,*dev/tools/codespell/*,*dev/trans*/ignore_translation_keys.lst,*pyproject.toml,*build/exe/*,*fontawe*,*htdocs/theme/*/flags-sprite.inc.php,*dev/setup/codetemplates/codetemplates.xml,*/php.ini,*/html_cerfafr.*,*/lessc.class.php,*.asciidoc,*.xml,*opensurvey/css/style.css,*dev/tools/phan/stubs/*,*/documents" check-hidden = true quiet-level=2 From 4140f59335d92b09289d91a932073c383633cefb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Mar 2024 17:58:32 +0100 Subject: [PATCH 0790/1862] Fix default value --- htdocs/contrat/list.php | 4 ++-- htdocs/core/class/html.form.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 20345dd7d50..a8704ff8da3 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -67,7 +67,7 @@ $search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); $search_all = (GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search_status = GETPOST('search_status', 'alpha'); $socid = GETPOSTINT('socid'); -$search_user = GETPOSTINT('search_user'); +$search_user = GETPOST('search_user', 'intcomma'); $search_sale = GETPOSTINT('search_sale'); $search_product_category = GETPOSTINT('search_product_category'); $search_dfmonth = GETPOSTINT('search_dfmonth'); @@ -128,7 +128,7 @@ if (!$sortorder) { // Security check $id = GETPOSTINT('id'); -if ($user->socid) { +if ($user->socid > 0) { $socid = $user->socid; } $result = restrictedArea($user, 'contrat', $id); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index fb7f4a0ea4d..cb92142e820 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1990,7 +1990,7 @@ class Form /** * Return select list of users * - * @param string $selected User id or user object of user preselected. If 0 or < -2, we use id of current user. If -1, keep unselected (if empty is allowed) + * @param string|int $selected User id or user object of user preselected. If 0 or < -2, we use id of current user. If -1 or '', keep unselected (if empty is allowed) * @param string $htmlname Field name in form * @param int|string $show_empty 0=list with no empty value, 1=add also an empty value into list * @param array|null $exclude Array list of users id to exclude From c03b5dc2ec46573428d1ba5d0ca8fe1359195306 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Mar 2024 18:50:02 +0100 Subject: [PATCH 0791/1862] Fix for phan output --- dev/tools/apstats.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index 400cefa5558..cbfe0cf5745 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -801,7 +801,7 @@ if ($nblines != 0) { // Technical debt Phan -if ($phan_nblines != 0) { +if ($dir_phan != 'disabled') { $datatable_script .= ' if (typeof(DataTable)==="function") {jQuery(".sourcephan").toggle(true);} let phantable = new DataTable("#technicaldebtphan table", { From c853a4687f01b9bd8e0cec8f30c9872d5f4eed23 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Mar 2024 19:41:31 +0100 Subject: [PATCH 0792/1862] Can delete last and criteria into the generic component. --- htdocs/core/class/html.form.class.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cb92142e820..4fe3995cd65 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -10706,7 +10706,7 @@ class Form $ret .= '
'; // Show select fields as tags. - $ret .= '
'; + $ret .= '
'; if ($search_component_params_hidden) { // Split the criteria on each AND @@ -10804,6 +10804,27 @@ class Form // We repost the form $(this).closest(\'form\').submit(); }); + + jQuery("#search_component_params_input").keydown(function(e) { + console.log("We press a key on the filter field that is "+jQuery("#search_component_params_input").val()); + console.log(e.which); + if (jQuery("#search_component_params_input").val() == "" && e.which == 8) { + /* We click on back when the input field is already empty */ + event.preventDefault(); + jQuery("#divsearch_component_params .tagsearch").last().remove(); + /* Regenerate content of search_component_params_hidden from remaining .tagsearch */ + var s = ""; + jQuery("#divsearch_component_params .tagsearch").each(function( index ) { + if (s != "") { + s = s + " AND "; + } + s = s + $(this).attr("data-ufilter"); + }); + console.log("New value for search_component_params_hidden = "+s); + jQuery("#search_component_params_hidden").val(s); + } + }); + '; From 0fb4a4456351e49060c89e95f0febb56b8c11590 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Mar 2024 22:13:37 +0100 Subject: [PATCH 0793/1862] Fix nb of lines --- dev/tools/apstats.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index cbfe0cf5745..eb737b9690e 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -650,7 +650,8 @@ $html .= '
'; $html .= ''."\n"; -$tmp = ''; + +$tmpstan = ''; $nblines = 0; if (!empty($output_arrtd)) { foreach ($output_arrtd as $line) { @@ -659,16 +660,16 @@ if (!empty($output_arrtd)) { preg_match('/^::error file=(.*),line=(\d+),col=(\d+)::(.*)$/', $line, $reg); if (!empty($reg[1])) { if ($nblines < 20) { - $tmp .= '
'; + $tmpstan .= ''; } else { - $tmp .= ''; + $tmpstan .= ''; } - $tmp .= ''; - $tmp .= ''; - $tmp .= ''; - $tmp .= ''."\n"; + $tmpstan .= ''; + $tmpstan .= ''; + $tmpstan .= ''; + $tmpstan .= ''."\n"; $nblines++; } @@ -773,7 +774,8 @@ $html .= ''; // Technical debt PHPstan -if ($nblines != 0) { + +if ($dirphpstan != 'disabled') { $datatable_script .= ' if (typeof(DataTable)==="function") {jQuery(".sourcephpstan").toggle(true);} let phpstantable = new DataTable("#technicaldebt table", { @@ -789,7 +791,7 @@ if ($nblines != 0) { $html .= '
'."\n"; $html .= '
'; if ($action == 'edit') { print ''; @@ -247,6 +248,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { } print '
'; if ($action == 'edit') { print ''; @@ -255,7 +257,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { if ($action == 'edit') { print ''; } - print ''; + print ''; if ($action == 'edit') { print 'url).'">'; } else { From 279de64851b1b3710d1d41f85760b4f18d5d1517 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Mar 2024 01:21:50 +0100 Subject: [PATCH 0771/1862] Fix regression --- htdocs/accountancy/bookkeeping/balance.php | 1 + .../accountancy/class/bookkeeping.class.php | 24 +++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index a3edb6e68e0..58807c5bcd2 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -238,6 +238,7 @@ if ($action == 'export_csv') { exit; } + /* * View */ diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index d40ddeda75a..0e24f92dced 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1206,16 +1206,29 @@ class BookKeeping extends CommonObject $sql .= " SUM(t.debit) as debit,"; $sql .= " SUM(t.credit) as credit"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; + // Manage filter $sqlwhere = array(); if (count($filter) > 0) { foreach ($filter as $key => $value) { if ($key == 't.doc_date') { $sqlwhere[] = $this->db->sanitize($key)." = '".$this->db->idate($value)."'"; - } elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=' || $key == 't.doc_date>' || $key == 't.doc_date<') { - $sqlwhere[] = $this->db->sanitize($key)."'".$this->db->idate($value)."'"; - } elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=' || $key == 't.subledger_account>=' || $key == 't.subledger_account<=') { - $sqlwhere[] = $this->db->sanitize($key)."'".$this->db->escape($value)."'"; + } elseif ($key == 't.doc_date>=') { + $sqlwhere[] = "t.doc_date >= '".$this->db->idate($value)."'"; + } elseif ($key == 't.doc_date<=') { + $sqlwhere[] = "t.doc_date <= '".$this->db->idate($value)."'"; + } elseif ($key == 't.doc_date>') { + $sqlwhere[] = "t.doc_date > '".$this->db->idate($value)."'"; + } elseif ($key == 't.doc_date<') { + $sqlwhere[] = "t.doc_date < '".$this->db->idate($value)."'"; + } elseif ($key == 't.numero_compte>=') { + $sqlwhere[] = "t.numero_compte >= '".$this->db->escape($value)."'"; + } elseif ($key == 't.numero_compte<=') { + $sqlwhere[] = "t.numero_compte <= '".$this->db->escape($value)."'"; + } elseif ($key == 't.subledger_account>=') { + $sqlwhere[] = "t.subledger_account >= '".$this->db->escape($value)."'"; + } elseif ($key == 't.subledger_account<=') { + $sqlwhere[] = "t.subledger_account <= '".$this->db->escape($value)."'"; } elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') { $sqlwhere[] = $this->db->sanitize($key)." = ".((int) $value); } elseif ($key == 't.subledger_account' || $key == 't.numero_compte') { @@ -1236,6 +1249,7 @@ class BookKeeping extends CommonObject } } $sql .= ' WHERE entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features + if (count($sqlwhere) > 0) { $sql .= " AND ".implode(" ".$this->db->sanitize($filtermode)." ", $sqlwhere); } @@ -1258,7 +1272,7 @@ class BookKeeping extends CommonObject if (!empty($limit)) { $sql .= $this->db->plimit($limit + 1, $offset); } - + print $sql; $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); From 96ef01c5c702a694ce5e0f7af3dbf1612b018153 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Mar 2024 01:37:27 +0100 Subject: [PATCH 0772/1862] Fix print $sql --- htdocs/accountancy/class/bookkeeping.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 0e24f92dced..efc5d68d6f7 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1272,8 +1272,10 @@ class BookKeeping extends CommonObject if (!empty($limit)) { $sql .= $this->db->plimit($limit + 1, $offset); } - print $sql; + + //print $sql; $resql = $this->db->query($sql); + if ($resql) { $num = $this->db->num_rows($resql); From 895aa5ee85ce9c48f62b8ab529ca3e35f41b7d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 10 Mar 2024 01:44:08 +0100 Subject: [PATCH 0773/1862] fix phpstan (#28735) * fix phpstan * fix phpstan * fix phpstan --- htdocs/delivery/class/delivery.class.php | 4 +-- htdocs/expedition/class/expedition.class.php | 8 ++--- .../class/fournisseur.commande.class.php | 6 ++-- .../class/multicurrency.class.php | 11 +++---- htdocs/product/class/product.class.php | 30 +++++++++---------- .../stock/class/mouvementstock.class.php | 6 ++-- 6 files changed, 33 insertions(+), 32 deletions(-) diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 6e634bfb669..b4d139a0120 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -280,7 +280,7 @@ class Delivery extends CommonObject * @param array $array_options Array options * @return int Return integer <0 if KO, >0 if OK */ - public function create_line($origin_id, $qty, $fk_product, $description, $array_options = null) + public function create_line($origin_id, $qty, $fk_product, $description, $array_options = []) { // phpcs:enable $error = 0; @@ -636,7 +636,7 @@ class Delivery extends CommonObject * @param array $array_options Array options * @return void */ - public function addline($origin_id, $qty, $array_options = null) + public function addline($origin_id, $qty, $array_options = []) { global $conf; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index b9b21899b28..1e880c2c91a 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -497,7 +497,7 @@ class Expedition extends CommonObject * @param array $array_options extrafields array * @return int Return integer <0 if KO, line_id if OK */ - public function create_line($entrepot_id, $origin_line_id, $qty, $rang = 0, $array_options = null) + public function create_line($entrepot_id, $origin_line_id, $qty, $rang = 0, $array_options = []) { //phpcs:enable global $user; @@ -525,7 +525,7 @@ class Expedition extends CommonObject * @param array $array_options extrafields array * @return int Return integer <0 if KO, >0 if OK */ - public function create_line_batch($line_ext, $array_options = 0) + public function create_line_batch($line_ext, $array_options = []) { // phpcs:enable $error = 0; @@ -898,7 +898,7 @@ class Expedition extends CommonObject * @param array $array_options extrafields array * @return int Return integer <0 if KO, >0 if OK */ - public function addline($entrepot_id, $id, $qty, $array_options = 0) + public function addline($entrepot_id, $id, $qty, $array_options = []) { global $conf, $langs; @@ -981,7 +981,7 @@ class Expedition extends CommonObject * @param array $array_options extrafields array * @return int Return integer <0 if KO, >0 if OK */ - public function addline_batch($dbatch, $array_options = 0) + public function addline_batch($dbatch, $array_options = []) { // phpcs:enable global $conf, $langs; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 7eff5f099d2..7337429110e 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2210,8 +2210,8 @@ class CommandeFournisseur extends CommonOrder * @param int $entrepot Id of warehouse to add product * @param double $price Unit Price for PMP value calculation (Unit price without Tax and taking into account discount) * @param string $comment Comment for stock movement - * @param integer $eatby eat-by date - * @param integer $sellby sell-by date + * @param int|string $eatby eat-by date + * @param int|string $sellby sell-by date * @param string $batch Lot number * @param int $fk_commandefourndet Id of supplier order line * @param int $notrigger 1 = notrigger @@ -2894,7 +2894,7 @@ class CommandeFournisseur extends CommonOrder * @param string $ref_supplier Supplier ref * @return int Return integer < 0 if error, > 0 if ok */ - public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $notrigger = 0, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $ref_supplier = '') + public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $notrigger = 0, $date_start = '', $date_end = '', $array_options = [], $fk_unit = null, $pu_ht_devise = 0, $ref_supplier = '') { global $mysoc, $conf, $langs; dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $type, $fk_unit"); diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index ebce97e6ff6..57a6c1ee69a 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Pierre-Henry Favre + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -519,12 +520,12 @@ class MultiCurrency extends CommonObject /** * Get id and rate of currency from code * - * @param DoliDB $dbs Object db - * @param string $code Code value search - * @param integer $date_document Date from document (propal, order, invoice, ...) + * @param DoliDB $dbs Object db + * @param string $code Code value search + * @param integer|string $date_document Date from document (propal, order, invoice, ...) * - * @return array [0] => id currency - * [1] => rate + * @return array [0] => id currency + * [1] => rate */ public static function getIdAndTxFromCode($dbs, $code, $date_document = '') { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index af6f3927ac4..3b31d2064e3 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5719,21 +5719,21 @@ class Product extends CommonObject /** * Adjust stock in a warehouse for product with batch number * - * @param User $user user asking change - * @param int $id_entrepot id of warehouse - * @param double $nbpiece nb of units (should be always positive, use $movement to decide if we add or remove) - * @param int $movement 0 = add, 1 = remove - * @param string $label Label of stock movement - * @param double $price Price to use for stock eval - * @param integer $dlc eat-by date - * @param integer $dluo sell-by date - * @param string $lot Lot number - * @param string $inventorycode Inventory code - * @param string $origin_element Origin element type - * @param int $origin_id Origin id of element - * @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (useful only if product is a subproduct) - * @param Extrafields $extrafields Array of extrafields - * @param boolean $force_update_batch Force update batch + * @param User $user user asking change + * @param int $id_entrepot id of warehouse + * @param double $nbpiece nb of units (should be always positive, use $movement to decide if we add or remove) + * @param int $movement 0 = add, 1 = remove + * @param string $label Label of stock movement + * @param double $price Price to use for stock eval + * @param int|string $dlc eat-by date + * @param int|string $dluo sell-by date + * @param string $lot Lot number + * @param string $inventorycode Inventory code + * @param string $origin_element Origin element type + * @param int $origin_id Origin id of element + * @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (useful only if product is a subproduct) + * @param Extrafields $extrafields Array of extrafields + * @param boolean $force_update_batch Force update batch * @return int Return integer <0 if KO, >0 if OK */ public function correct_stock_batch($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $dlc = '', $dluo = '', $lot = '', $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null, $force_update_batch = false) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 80751ebbec7..74396b9ecc5 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -813,9 +813,9 @@ class MouvementStock extends CommonObject * @param int $qty Quantity * @param int $price Price * @param string $label Label of stock movement - * @param integer|string $datem Force date of movement - * @param integer $eatby eat-by date - * @param integer $sellby sell-by date + * @param int|string $datem Force date of movement + * @param int|string $eatby eat-by date + * @param int|string $sellby sell-by date * @param string $batch batch number * @param int $id_product_batch Id product_batch * @param string $inventorycode Inventory code From c95bab281848eef8dbdf9260f29f1185798257fc Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 10 Mar 2024 01:46:10 +0100 Subject: [PATCH 0774/1862] Qual: Add check on addExtraField type argument (#28738) * Qual: Add check on addExtraField type argument # Qual: Add check on addExtraField type argument Added a check on the type argument for addExtraField * Qual: Update phan ignore with more specific name --- dev/tools/phan/config.php | 34 ++++++++++++++++++++++++++++++- htdocs/core/lib/functions.lib.php | 2 +- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 2defcc784e7..14a8c313670 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -183,9 +183,40 @@ $VALID_MODULE_MAPPING = array( 'zapier' => 'Zapier', ); +// From ExtraFields class +$EXTRAFIELDS_TYPE2LABEL = array( + 'varchar' => 'String1Line', + 'text' => 'TextLongNLines', + 'html' => 'HtmlText', + 'int' => 'Int', + 'double' => 'Float', + 'date' => 'Date', + 'datetime' => 'DateAndTime', + //'datetimegmt'=>'DateAndTimeUTC', + 'boolean' => 'Boolean', // Remove as test + 'price' => 'ExtrafieldPrice', + 'pricecy' => 'ExtrafieldPriceWithCurrency', + 'phone' => 'ExtrafieldPhone', + 'mail' => 'ExtrafieldMail', + 'url' => 'ExtrafieldUrl', + 'ip' => 'ExtrafieldIP', + 'icon' => 'Icon', + 'password' => 'ExtrafieldPassword', + 'select' => 'ExtrafieldSelect', + 'sellist' => 'ExtrafieldSelectList', + 'radio' => 'ExtrafieldRadio', + 'checkbox' => 'ExtrafieldCheckBox', + 'chkbxlst' => 'ExtrafieldCheckBoxFromList', + 'link' => 'ExtrafieldLink', + 'separate' => 'ExtrafieldSeparator', + ); + + $moduleNameRegex = '/^(?:'.implode('|', array_merge(array_keys($DEPRECATED_MODULE_MAPPING), array_keys($VALID_MODULE_MAPPING), array('\$modulename'))).')$/'; $deprecatedModuleNameRegex = '/^(?!(?:'.implode('|', array_keys($DEPRECATED_MODULE_MAPPING)).')$).*/'; +$extraFieldTypeRegex = '/^(?:'.implode('|', array_keys($EXTRAFIELDS_TYPE2LABEL)).')$/'; + /** * This configuration will be read and overlaid on top of the * default configuration. Command line arguments will be applied @@ -270,7 +301,8 @@ return [ '/^isModEnabled$/' => [0, $moduleNameRegex, 'UnknownModuleName'], // Note: trick to have different key for same regex: '/^isModEnable[d]$/' => [0, $deprecatedModuleNameRegex, "DeprecatedModuleName"], - '/^sanitizeVal$/' => [1, $sanitizeRegex], + '/^sanitizeVal$/' => [1, $sanitizeRegex,"UnknownSanitizeType"], + '/^\\\\ExtraFields::addExtraField$/' => [2, $extraFieldTypeRegex,"UnknownExtrafieldTypeBack"], ], 'plugins' => [ __DIR__.'/plugins/NoVarDumpPlugin.php', diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 11e3c1934f3..6c8152bd228 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -951,7 +951,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null $out = preg_replace('/([<>])([-+]?\d)/', '\1 \2', $out); } - // @phan-suppress-next-line ParamMatchRegexError + // @phan-suppress-next-line UnknownSanitizeType $out = sanitizeVal($out, $check, $filter, $options); } From 28df0ba1ab55f568acdf5b313b45e2450db1a321 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Mar 2024 01:49:56 +0100 Subject: [PATCH 0775/1862] Fix doc --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 11e3c1934f3..9534f130cc8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2789,7 +2789,7 @@ function fieldLabel($langkey, $fieldkey, $fieldrequired = 0) /** * Return string to add class property on html element with pair/impair. * - * @param string $var 0 or 1 + * @param boolean $var false or true * @param string $moreclass More class to add * @return string String to add class onto HTML element */ From 37afba949eb573e6f5c57bae22308d4e1b15c212 Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 10 Mar 2024 01:53:04 +0100 Subject: [PATCH 0776/1862] Fix most PhanTypeMismatchDimAssignment notices (#28739) * Qual: Add typing to fix PhanTypeMismatchDimAssignment notice * Fix: Initialise array for code in somme * Qual: Update type hint for argument in _Set_Format * Qual: Update type hint for childtables * Qual: Add typing to attributes * Qual: Add typing for _msgContent * Qual: Suppress PhanTypeMismatchDimAssignment * Qual: Add typing for liste * Qual: Add typing to fields * Qual: Add typing hint for $objMod * Qual: Modify assignment of array with bool keys for phan typing Demonstration: ``` php -r '$a=[true=>"yes",false=>"no"];var_dump($a);' # Result demonstrates bool keys are converted to int. Command line code:1: array(2) { [1] => string(3) "yes" [0] => string(2) "no" } ``` * Qual: Add typing hint to indicate value is not null * Force non-null type on $paramname * Qual: Add typing hint to getCats() * Update inc.php --------- Co-authored-by: Laurent Destailleur --- .../class/accountancycategory.class.php | 2 +- .../accountancy/class/bookkeeping.class.php | 2 +- htdocs/admin/modules.php | 42 ++++----- htdocs/compta/resultat/result.php | 10 ++- htdocs/core/class/commonobject.class.php | 5 +- .../class/commonstickergenerator.class.php | 2 +- htdocs/core/class/extrafields.class.php | 90 +++++++++---------- htdocs/core/class/menu.class.php | 9 +- htdocs/core/class/smtps.class.php | 2 +- htdocs/core/lib/customreports.lib.php | 1 + htdocs/core/lib/functions.lib.php | 3 +- htdocs/core/modules/DolibarrModules.class.php | 10 +-- htdocs/projet/class/project.class.php | 1 + htdocs/support/inc.php | 3 - 14 files changed, 98 insertions(+), 84 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 5cd2e95de28..84c8b774960 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -773,7 +773,7 @@ class AccountancyCategory // extends CommonObject * * @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups * @param int $active 1= active, 0=not active - * @return array|int Array of groups or -1 if error + * @return array|int Array of groups or -1 if error * @see getCatsCpts(), getCptsCat() */ public function getCats($categorytype = -1, $active = 1) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index efc5d68d6f7..909bfded02a 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -2464,7 +2464,7 @@ class BookKeeping extends CommonObject * Get list of fiscal period * * @param string $filter Filter - * @return array|int Return integer <0 if KO, Fiscal periods : [[id, date_start, date_end, label], ...] + * @return array|int Return integer <0 if KO, Fiscal periods : [[id, date_start, date_end, label], ...] */ public function getFiscalPeriods($filter = '') { diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index d24c833cb85..5ce0f2042d7 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -47,7 +47,7 @@ $langs->loadLangs(array("errors", "admin", "modulebuilder")); // if we set another view list mode, we keep it (till we change one more time) if (GETPOSTISSET('mode')) { $mode = GETPOST('mode', 'alpha'); - if ($mode =='common' || $mode =='commonkanban') { + if ($mode == 'common' || $mode == 'commonkanban') { dolibarr_set_const($db, "MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT", $mode, 'chaine', 0, '', $conf->entity); } } else { @@ -78,18 +78,18 @@ if (!$user->admin) { } $familyinfo = array( - 'hr'=>array('position'=>'001', 'label'=>$langs->trans("ModuleFamilyHr")), - 'crm'=>array('position'=>'006', 'label'=>$langs->trans("ModuleFamilyCrm")), - 'srm'=>array('position'=>'007', 'label'=>$langs->trans("ModuleFamilySrm")), - 'financial'=>array('position'=>'009', 'label'=>$langs->trans("ModuleFamilyFinancial")), - 'products'=>array('position'=>'012', 'label'=>$langs->trans("ModuleFamilyProducts")), - 'projects'=>array('position'=>'015', 'label'=>$langs->trans("ModuleFamilyProjects")), - 'ecm'=>array('position'=>'018', 'label'=>$langs->trans("ModuleFamilyECM")), - 'technic'=>array('position'=>'021', 'label'=>$langs->trans("ModuleFamilyTechnic")), - 'portal'=>array('position'=>'040', 'label'=>$langs->trans("ModuleFamilyPortal")), - 'interface'=>array('position'=>'050', 'label'=>$langs->trans("ModuleFamilyInterface")), - 'base'=>array('position'=>'060', 'label'=>$langs->trans("ModuleFamilyBase")), - 'other'=>array('position'=>'100', 'label'=>$langs->trans("ModuleFamilyOther")), + 'hr' => array('position' => '001', 'label' => $langs->trans("ModuleFamilyHr")), + 'crm' => array('position' => '006', 'label' => $langs->trans("ModuleFamilyCrm")), + 'srm' => array('position' => '007', 'label' => $langs->trans("ModuleFamilySrm")), + 'financial' => array('position' => '009', 'label' => $langs->trans("ModuleFamilyFinancial")), + 'products' => array('position' => '012', 'label' => $langs->trans("ModuleFamilyProducts")), + 'projects' => array('position' => '015', 'label' => $langs->trans("ModuleFamilyProjects")), + 'ecm' => array('position' => '018', 'label' => $langs->trans("ModuleFamilyECM")), + 'technic' => array('position' => '021', 'label' => $langs->trans("ModuleFamilyTechnic")), + 'portal' => array('position' => '040', 'label' => $langs->trans("ModuleFamilyPortal")), + 'interface' => array('position' => '050', 'label' => $langs->trans("ModuleFamilyInterface")), + 'base' => array('position' => '060', 'label' => $langs->trans("ModuleFamilyBase")), + 'other' => array('position' => '100', 'label' => $langs->trans("ModuleFamilyOther")), ); $param = ''; @@ -360,7 +360,7 @@ llxHeader('', $langs->trans("Setup"), $help_url, '', '', '', $morejs, $morecss, // Search modules dirs $modulesdir = dolGetModulesDirs(); -$arrayofnatures = array('core'=>$langs->transnoentitiesnoconv("NativeModules"), 'external'=>$langs->transnoentitiesnoconv("External").' - ['.$langs->trans("AllPublishers").']'); +$arrayofnatures = array('core' => $langs->transnoentitiesnoconv("NativeModules"), 'external' => $langs->transnoentitiesnoconv("External").' - ['.$langs->trans("AllPublishers").']'); $arrayofwarnings = array(); // Array of warning each module want to show when activated $arrayofwarningsext = array(); // Array of warning each module want to show when we activate an external module $filename = array(); @@ -395,6 +395,7 @@ foreach ($modulesdir as $dir) { $res = include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error. if (class_exists($modName)) { $objMod = new $modName($db); + '@phan-var-force DolibarrModules $objMod'; $modNameLoaded[$modName] = $dir; if (!$objMod->numero > 0 && $modName != 'modUser') { dol_syslog('The module descriptor '.$modName.' must have a numero property', LOG_ERR); @@ -443,6 +444,7 @@ foreach ($modulesdir as $dir) { } else { $familykey = $objMod->family; } + '@phan-var-force string $familykey'; // if not, phan considers $familykey may be null $moduleposition = ($objMod->module_position ? $objMod->module_position : '50'); if ($objMod->isCoreOrExternalModule() == 'external' && $moduleposition < 100000) { @@ -603,10 +605,10 @@ if ($mode == 'common' || $mode == 'commonkanban') { $moreforfilter = '
'; $moreforfilter .= ''; $moreforfilter .= '
'; @@ -618,7 +620,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { $moreforfilter .= '
'; if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) { - $array_version = array('stable'=>$langs->transnoentitiesnoconv("Stable")); + $array_version = array('stable' => $langs->transnoentitiesnoconv("Stable")); if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 0) { $array_version['deprecated'] = $langs->trans("Deprecated"); } @@ -632,7 +634,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { $moreforfilter .= $form->selectarray('search_version', $array_version, $search_version, $langs->transnoentitiesnoconv('Version'), 0, 0, '', 0, 0, 0, '', 'maxwidth150', 1); $moreforfilter .= '
'; } - $array_status = array('active'=>$langs->transnoentitiesnoconv("Enabled"), 'disabled'=>$langs->transnoentitiesnoconv("Disabled")); + $array_status = array('active' => $langs->transnoentitiesnoconv("Enabled"), 'disabled' => $langs->transnoentitiesnoconv("Disabled")); $moreforfilter .= '
'; $moreforfilter .= $form->selectarray('search_status', $array_status, $search_status, $langs->transnoentitiesnoconv('Status'), 0, 0, '', 0, 0, 0, '', 'maxwidth150', 1); $moreforfilter .= '
'; @@ -717,7 +719,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { || ($moduledesc && preg_match('/'.preg_quote($search_keyword, '/').'/i', $moduledesc)) || ($moduledesclong && preg_match('/'.preg_quote($search_keyword, '/').'/i', $moduledesclong)) || ($moduleauthor && preg_match('/'.preg_quote($search_keyword, '/').'/i', $moduleauthor)) - ) { + ) { $qualified = 1; } if (!$qualified) { diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 72bb5428b75..21fa04cc931 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -231,7 +231,7 @@ if ($modecompta == "CREANCES-DETTES") { //$calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; //$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); - $arraylist = array('no'=>$langs->trans("None"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All")); + $arraylist = array('no' => $langs->trans("None"), 'yes' => $langs->trans("AccountWithNonZeroValues"), 'all' => $langs->trans("All")); $period .= '     '.$langs->trans("DetailBy").' '.$form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0); $periodlink = $textprevyear.$textnextyear; $exportlink = ''; @@ -240,7 +240,7 @@ if ($modecompta == "CREANCES-DETTES") { $builddate = dol_now(); } -report_header($name, '', $period, $periodlink ?? '', $description, $builddate, $exportlink ?? '', array('modecompta'=>$modecompta, 'action' => ''), $calcmode); +report_header($name, '', $period, $periodlink ?? '', $description, $builddate, $exportlink ?? '', array('modecompta' => $modecompta, 'action' => ''), $calcmode); if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') { @@ -356,6 +356,9 @@ if ($modecompta == 'CREANCES-DETTES') { print '
'.price($r).'
'.dolPrintLabel($reg[1]).''; + $tmpstan .= ''.dolPrintLabel($reg[2]).''; + $tmpstan .= ''.dolPrintLabel($reg[4]).'
'."\n"; $html .= ''."\n"; - $html .= $tmp; + $html .= $tmpstan; $html .= '
FileLineType
'; // Disabled, no more required as list is managed with datatable //$html .= '
Show all...
'; From 1431582b82c91c480662a6a7abebd4733006621d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2024 10:10:17 +0100 Subject: [PATCH 0794/1862] Fix cursor --- htdocs/admin/tools/dolibarr_export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 3c70bdc74aa..749674956c0 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -203,7 +203,7 @@ print '
'; print '
'; -print img_picto('', 'setup', 'class="pictofixedwidth"').''.$langs->trans("ShowAdvancedOptions").'...'; +print img_picto('', 'setup', 'class="pictofixedwidth"').''.$langs->trans("ShowAdvancedOptions").'...'; print '
'; print ' + '; + } + + // Add link to add AI content + if ($formmail->withaiprompt && isModEnabled('ai')) { + $out .= ''; + $out .= img_picto($langs->trans("FillMessageWithAIContent"), 'ai', 'class="paddingrightonly"'); + $out .= $langs->trans("FillMessageWithAIContent").'...'; + $out .= ''; + $out .= ''; + } + if ($formmail->withfckeditor) { + $out .= $formmail->getModelEmailTemplate(); + } + if ($formmail->withaiprompt && isModEnabled('ai')) { + $out .= $formmail->getSectionForAIPrompt(); + } + print $out; + print '
'; print '
'; From bb64871b355c43f0940560311ab9bbf866493bd0 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 15:23:43 +0100 Subject: [PATCH 0836/1862] Qual: Precise typing for Societeaccount's fields property (#28758) # Qual: Precise typing for Societeaccount's fields property Better typing helps static analysis and fixes the message: PhanTypeMismatchArgumentInternal Argument 2 ($array) is $object->fields['site']['arrayofkeyval'] of type null but \array_key_exists() takes array --- htdocs/societe/class/societeaccount.class.php | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index c4a3f1fa824..cff6d5e7af5 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -75,30 +76,31 @@ class SocieteAccount extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ + public $fields = array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',), - 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'default'=>1), - 'login' => array('type'=>'varchar(64)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'notnull'=>1, 'position'=>10, 'showoncombobox'=>1), - 'pass_encoding' => array('type'=>'varchar(24)', 'label'=>'PassEncoding', 'visible'=>0, 'enabled'=>1, 'position'=>30), - 'pass_crypted' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>1, 'position'=>31, 'notnull'=>1), - 'pass_temp' => array('type'=>'varchar(128)', 'label'=>'Temp', 'visible'=>0, 'enabled'=>0, 'position'=>32, 'notnull'=>-1,), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'index'=>1, 'picto'=>'company', 'css'=>'maxwidth300 widthcentpercentminusxx'), - 'site' => array('type'=>'varchar(128)', 'label'=>'WebsiteTypeLabel', 'visible'=>0, 'enabled'=>0, 'position'=>41, 'notnull'=>1, 'default' => '', 'help'=>'Name of the website or service if this is account on an external website or service'), - 'fk_website' => array('type'=>'integer:Website:website/class/website.class.php', 'label'=>'WebSite', 'visible'=>0, 'enabled'=>0, 'position'=>42, 'notnull'=>-1, 'index'=>1, 'picto'=>'website', 'css'=>'maxwidth300 widthcentpercentminusxx'), - 'site_account' => array('type'=>'varchar(128)', 'label'=>'ExternalSiteAccount', 'visible'=>0, 'enabled'=>1, 'position'=>44, 'help'=>'A key to identify the account on external web site if this is an account on an external website'), - 'key_account' => array('type'=>'varchar(128)', 'label'=>'KeyAccount', 'visible'=>0, 'enabled'=>1, 'position'=>48, 'notnull'=>0, 'index'=>1, 'searchall'=>1, 'comment'=>'The id of third party in the external web site (for site_account if site_account defined)',), - 'date_last_login' => array('type'=>'datetime', 'label'=>'LastConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>50, 'notnull'=>0,), - 'date_previous_login' => array('type'=>'datetime', 'label'=>'PreviousConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>51, 'notnull'=>0,), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -2, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id',), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'visible' => 0, 'enabled' => 1, 'position' => 5, 'default' => 1), + 'login' => array('type' => 'varchar(64)', 'label' => 'Login', 'visible' => 1, 'enabled' => 1, 'notnull' => 1, 'position' => 10, 'showoncombobox' => 1), + 'pass_encoding' => array('type' => 'varchar(24)', 'label' => 'PassEncoding', 'visible' => 0, 'enabled' => 1, 'position' => 30), + 'pass_crypted' => array('type' => 'password', 'label' => 'Password', 'visible' => -1, 'enabled' => 1, 'position' => 31, 'notnull' => 1), + 'pass_temp' => array('type' => 'varchar(128)', 'label' => 'Temp', 'visible' => 0, 'enabled' => 0, 'position' => 32, 'notnull' => -1,), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'visible' => 1, 'enabled' => 1, 'position' => 40, 'notnull' => -1, 'index' => 1, 'picto' => 'company', 'css' => 'maxwidth300 widthcentpercentminusxx'), + 'site' => array('type' => 'varchar(128)', 'label' => 'WebsiteTypeLabel', 'visible' => 0, 'enabled' => 0, 'position' => 41, 'notnull' => 1, 'default' => '', 'help' => 'Name of the website or service if this is account on an external website or service'), + 'fk_website' => array('type' => 'integer:Website:website/class/website.class.php', 'label' => 'WebSite', 'visible' => 0, 'enabled' => 0, 'position' => 42, 'notnull' => -1, 'index' => 1, 'picto' => 'website', 'css' => 'maxwidth300 widthcentpercentminusxx'), + 'site_account' => array('type' => 'varchar(128)', 'label' => 'ExternalSiteAccount', 'visible' => 0, 'enabled' => 1, 'position' => 44, 'help' => 'A key to identify the account on external web site if this is an account on an external website'), + 'key_account' => array('type' => 'varchar(128)', 'label' => 'KeyAccount', 'visible' => 0, 'enabled' => 1, 'position' => 48, 'notnull' => 0, 'index' => 1, 'searchall' => 1, 'comment' => 'The id of third party in the external web site (for site_account if site_account defined)',), + 'date_last_login' => array('type' => 'datetime', 'label' => 'LastConnexion', 'visible' => 2, 'enabled' => 1, 'position' => 50, 'notnull' => 0,), + 'date_previous_login' => array('type' => 'datetime', 'label' => 'PreviousConnexion', 'visible' => 2, 'enabled' => 1, 'position' => 51, 'notnull' => 0,), //'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>45, 'notnull'=>-1,), - 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>-1, 'enabled'=>1, 'position'=>46, 'notnull'=>-1,), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), - 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), - 'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>-1,), - 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1,), - 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'default'=>1, 'arrayofkeyval'=>array('1'=>'Active', '0'=>'Disabled')), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'visible' => -1, 'enabled' => 1, 'position' => 46, 'notnull' => -1,), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'visible' => -2, 'enabled' => 1, 'position' => 500, 'notnull' => 1,), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'visible' => -2, 'enabled' => 1, 'position' => 500, 'notnull' => 1,), + 'fk_user_creat' => array('type' => 'integer', 'label' => 'UserAuthor', 'visible' => -2, 'enabled' => 1, 'position' => 500, 'notnull' => 1,), + 'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModif', 'visible' => -2, 'enabled' => 1, 'position' => 500, 'notnull' => -1,), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'visible' => -2, 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'index' => 1,), + 'status' => array('type' => 'integer', 'label' => 'Status', 'visible' => 1, 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'index' => 1, 'default' => 1, 'arrayofkeyval' => array('1' => 'Active', '0' => 'Disabled')), ); /** From a8a2f0ff7308ca478251999da63950d4f1c02374 Mon Sep 17 00:00:00 2001 From: terhoy <70033666+terhoy@users.noreply.github.com> Date: Mon, 11 Mar 2024 15:33:10 +0100 Subject: [PATCH 0837/1862] =?UTF-8?q?FIX:=20online=20signature=20partly=20?= =?UTF-8?q?fails=20if=20commercial=20proposal=20numbering=20contains=20a?= =?UTF-8?q?=20mask=20that=E2=80=99s=20includes=20a=20space=20(#28608)=20?= =?UTF-8?q?=20(#28742)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * FIX: online signature (#28608) Update signature.lib.php If Commercial proposal numbering contains a mask that’s includes a space, that will affect the result of the online signature form. When generating the online signature form, the code in signature.lib.php line 77, will remove any existing space in the Commercial proposal numbering. The result is that the online signature form will miss data in field “Third-party” and “Amount”. * FIX: online signature (#28608) Update payments.lib.php If Commercial proposal numbering contains a mask that’s includes a space, that will affect the result of the online signature form. When generating the online signature form, the code in core/lib/payments.lib.ph, will remove any existing space in the Commercial proposal numbering. --- htdocs/core/lib/payments.lib.php | 1 - htdocs/core/lib/signature.lib.php | 1 - 2 files changed, 2 deletions(-) diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 2c496401768..e8532129b53 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -242,7 +242,6 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y { global $conf, $dolibarr_main_url_root; - $ref = str_replace(' ', '', $ref); $out = ''; // Define $urlwithroot diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index 0290ec78080..d56cd662e9d 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -74,7 +74,6 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1, $o } } - $ref = str_replace(' ', '', $ref); $out = ''; // Define $urlwithroot From f7024b61ee6797e02f2c969dda280d53668c707b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2024 15:37:16 +0100 Subject: [PATCH 0838/1862] Update api_bankaccounts.class.php --- htdocs/compta/bank/class/api_bankaccounts.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index c2f57b76056..bc973b0045b 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -258,7 +258,7 @@ class BankAccounts extends DolibarrApi // Clean data $description = sanitizeVal($description, 'alphanohtml'); - $cheque_number = sanitizeVal($cheque_number); + $cheque_number = sanitizeVal($cheque_number, 'alphanohtml'); /** * Creating bank line records From 769b682fd3690214216be2a11dd6e189209cb00e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2024 16:13:11 +0100 Subject: [PATCH 0839/1862] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bbdb8183fe2..a693c31ff2d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3281,7 +3281,7 @@ abstract class CommonObject while ($row = $this->db->fetch_row($resql)) { $rows[] = $row[0]; if ($includealltree) { - $rows = array_merge($rows, $this->getChildrenOfLine($row[0])); + $rows = array_merge($rows, $this->getChildrenOfLine($row[0], $includealltree)); } } } From 5b921d0dc4326c38e8b8cdd36cf3bca420b88603 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2024 16:26:17 +0100 Subject: [PATCH 0840/1862] Update DoliDB.class.php --- htdocs/core/db/DoliDB.class.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 4c0bfcbd0f3..1a21fb5c527 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -396,18 +396,16 @@ abstract class DoliDB implements Database } /** - * Return all results from query as an array of objects - * Note : This method executes a given SQL query and retrieves all row of results as an array of objects. It should only be used with SELECT queries - * be careful with this method use it only with some limit of results to avoid performances loss. + * Return all results from query as an array of objects. Using this is a bad practice and is discouraged. + * Note : It should only be used with SELECT queries and with a limit. If you are not able to defined/know what can be the limit, it + * just means this function is not what you need. Do not use it. * - * @param string $sql The sql query string - * @param bool $noLimitCheck set it to true to disable sql query check of limit - * @return bool|array Result + * @param string $sql The sql query string. Must end with "... LIMIT x" + * @return bool|array Result */ - public function getRows($sql, $noLimitCheck = false) + public function getRows($sql) { - - if (!$noLimitCheck && strpos($sql, 'LIMIT') === false) { + if (! preg_match('/LIMIT \d+$/', $sql)) { return false; } From 553587b6606f6f956883fba7be163315526f23c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2024 16:27:46 +0100 Subject: [PATCH 0841/1862] Update DoliDB.class.php --- htdocs/core/db/DoliDB.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 1a21fb5c527..90cb227db73 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -381,11 +381,11 @@ abstract class DoliDB implements Database { $sql .= ' LIMIT 1'; - $res = $this->query($sql); - if ($res) { - $obj = $this->fetch_object($res); + $resql = $this->query($sql); + if ($resql) { + $obj = $this->fetch_object($resql); if ($obj) { - $this->free($res); + $this->free($resql); return $obj; } else { return 0; @@ -409,15 +409,15 @@ abstract class DoliDB implements Database return false; } - $res = $this->query($sql); - if ($res) { + $resql = $this->query($sql); + if ($resql) { $results = array(); - if ($this->num_rows($res) > 0) { - while ($obj = $this->fetch_object($res)) { + if ($this->num_rows($resql) > 0) { + while ($obj = $this->fetch_object($resql)) { $results[] = $obj; } } - $this->free($res); + $this->free($resql); return $results; } From b963a9ab368a02cff7c68b3304dfb4bba8d40ecd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2024 16:30:33 +0100 Subject: [PATCH 0842/1862] Fix phpunit --- htdocs/core/db/DoliDB.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 90cb227db73..b839770410f 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -397,8 +397,8 @@ abstract class DoliDB implements Database /** * Return all results from query as an array of objects. Using this is a bad practice and is discouraged. - * Note : It should only be used with SELECT queries and with a limit. If you are not able to defined/know what can be the limit, it - * just means this function is not what you need. Do not use it. + * Note : It should only be used with SELECT queries and with a limit. If you are not able to defined/know what can be the limit, it + * just means this function is not what you need. Do not use it. * * @param string $sql The sql query string. Must end with "... LIMIT x" * @return bool|array Result From 404d594f24aa51b9e49a6d7c3113b471f530895f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2024 16:39:44 +0100 Subject: [PATCH 0843/1862] Removed not used file --- htdocs/langs/fr_FR/ai.lang | 1 - 1 file changed, 1 deletion(-) delete mode 100644 htdocs/langs/fr_FR/ai.lang diff --git a/htdocs/langs/fr_FR/ai.lang b/htdocs/langs/fr_FR/ai.lang deleted file mode 100644 index f6eb575e977..00000000000 --- a/htdocs/langs/fr_FR/ai.lang +++ /dev/null @@ -1 +0,0 @@ -AI_KEY_API_CHATGPT= Clé pour l'api IA \ No newline at end of file From b7acea0ec4c160cfb11bc44e3e2295bd02155717 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 16:47:38 +0100 Subject: [PATCH 0844/1862] Fix: PhanTypeMismatchDeclaredParamNullable notices # Fix: PhanTypeMismatchDeclaredParamNullable notices PHPDoc must indicate param is nullable if the default is null with explicit typing. (+Improved some other typing from generic Object to CommonObject). --- htdocs/core/lib/bank.lib.php | 13 +++++++------ .../modules/fichinter/doc/pdf_soleil.modules.php | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 75788627cec..ffde1206773 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -5,6 +5,7 @@ * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2021 Ferran Marcet + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -228,8 +229,8 @@ function account_statement_prepare_head($object, $num) /** * Prepare array with list of tabs * - * @param Object $object Object related to tabs - * @return array Array of tabs to shoc + * @param CommonObject $object Object related to tabs + * @return array Array of tabs to shoc */ function various_payment_prepare_head($object) { @@ -275,8 +276,8 @@ function various_payment_prepare_head($object) /** * Check SWIFT information for a bank account * - * @param Account $account A bank account (used to get BIC/SWIFT) - * @param string $swift Swift value (used to get BIC/SWIFT, param $account non used if provided) + * @param ?Account $account A bank account (used to get BIC/SWIFT) + * @param ?string $swift Swift value (used to get BIC/SWIFT, param $account non used if provided) * @return boolean True if information are valid, false otherwise */ function checkSwiftForAccount(Account $account = null, $swift = null) @@ -296,8 +297,8 @@ function checkSwiftForAccount(Account $account = null, $swift = null) /** * Check IBAN number information for a bank account. * - * @param Account $account A bank account - * @param string $ibantocheck Bank account number (used to get BAN, $account not used if provided) + * @param ?Account $account A bank account + * @param ?string $ibantocheck Bank account number (used to get BAN, $account not used if provided) * @return boolean True if information are valid, false otherwise */ function checkIbanForAccount(Account $account = null, $ibantocheck = null) diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 8c2b45055fc..82871ffae52 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -6,6 +6,7 @@ * Copyright (C) 2011 Fabrice CHERRIER * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Marcos García + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -449,7 +450,7 @@ class pdf_soleil extends ModelePDFFicheinter * @param Translate $outputlangs Langs object * @param int $hidetop Hide top bar of array * @param int $hidebottom Hide bottom bar of array - * @param Fichinter $object FichInter Object + * @param ?Fichinter $object FichInter Object * @return void */ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, FichInter $object = null) From 200bc042bd239912de7825a682c6717165704ad5 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 16:48:55 +0100 Subject: [PATCH 0845/1862] Qual: Enable PhanTypeMismatchDeclaredParamNullable # Qual: Enable PhanTypeMismatchDeclaredParamNullable The few cases for PhanTypeMismatchDeclaredParamNullable were fixed, so the notification can be enabled --- dev/tools/phan/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 0bb240128f8..609f2cc267c 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -475,7 +475,7 @@ return [ // 'PhanPluginUnknownFunctionReturnType', // 'PhanPluginDescriptionlessCommentOnProtectedProperty', 'PhanPluginRedundantAssignmentInGlobalScope', - 'PhanTypeMismatchDeclaredParamNullable', + // 'PhanTypeMismatchDeclaredParamNullable', 'PhanTypeInvalidRightOperandOfAdd', // 'PhanPluginDescriptionlessCommentOnPrivateProperty', // 'PhanUndeclaredVariableDim', // Array initialisation on undeclared var: $abc['x']='ab' From 9aaae61c9ad4cd600c7b4f5983b8c637f2303cea Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Mon, 11 Mar 2024 16:49:46 +0100 Subject: [PATCH 0846/1862] Fix var --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7ffc4d04934..7ebb7a6eba5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -12287,12 +12287,12 @@ function getElementProperties($elementType) $classname = 'EmailSenderProfile'; $table_element = 'c_email_senderprofile'; $subelement = ''; - } elseif ($objectType == 'conferenceorboothattendee') { + } elseif ($elementType == 'conferenceorboothattendee') { $classpath = 'eventorganization/class'; $classfile = 'conferenceorboothattendee'; $classname = 'ConferenceOrBoothAttendee'; $module = 'eventorganization'; - } elseif ($objectType == 'conferenceorbooth') { + } elseif ($elementType == 'conferenceorbooth') { $classpath = 'eventorganization/class'; $classfile = 'conferenceorbooth'; $classname = 'ConferenceOrBooth'; From 087390b44e4e8e8563797c3baa81f68f094a67dc Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:15:54 +0100 Subject: [PATCH 0847/1862] Change logic to help static tool analysis --- htdocs/admin/modulehelp.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 50e83f65fcb..22165d2c305 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2017 Regis Houssin * Copyright (C) 2022 Charlene Benke + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -167,7 +168,10 @@ foreach ($modulesdir as $dir) { $familyinfo = array_merge($familyinfo, $objMod->familyinfo); $familykey = key($objMod->familyinfo); } else { - $familykey = empty($objMod->family) ? 'other' : $objMod->family; + $familykey = $objMod->family; + if (empty($familykey)) { + $familykey = 'other'; + } } $moduleposition = ($objMod->module_position ? $objMod->module_position : '50'); From 831aee8fa2f10da172915cf129d9fb8d5b3a0d07 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Mon, 11 Mar 2024 17:31:01 +0100 Subject: [PATCH 0848/1862] add link for redirect in setup module --- htdocs/ai/ajax/generate_content.php | 8 +++++++- htdocs/ai/class/ai.class.php | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/ai/ajax/generate_content.php b/htdocs/ai/ajax/generate_content.php index 9b1adf13b84..c476a0b09f4 100644 --- a/htdocs/ai/ajax/generate_content.php +++ b/htdocs/ai/ajax/generate_content.php @@ -67,7 +67,13 @@ $function = 'textgeneration'; $generatedContent = $ai->generateContent($instructions, 'auto', $function); if (is_array($generatedContent) && $generatedContent['error']) { - print "Error : " . $generatedContent['message']; + // client errors + if ($generatedContent['code'] >= 400) { + print "Error : " . $generatedContent['message']; + print '
'.$langs->trans('Check Config of Module').''; + } else { + print "Error : " . $generatedContent['message']; + } } else { print $generatedContent; } diff --git a/htdocs/ai/class/ai.class.php b/htdocs/ai/class/ai.class.php index 399b3adb1ee..d3baf33421c 100644 --- a/htdocs/ai/class/ai.class.php +++ b/htdocs/ai/class/ai.class.php @@ -131,7 +131,7 @@ class Ai $response = curl_exec($ch); if (curl_errno($ch)) { - throw new Exception('cURL error: ' . curl_error($ch)); + throw new Exception('Wrong configuration !' . curl_error($ch)); } $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); @@ -146,7 +146,7 @@ class Ai return $generatedEmailContent; } catch (Exception $e) { - return array('error' => true, 'message' => $e->getMessage()); + return array('error' => true, 'message' => $e->getMessage(), 'code' => $statusCode); } finally { curl_close($ch); } From 1350f4d29e2a75648d15c662f1e94ab09ac75679 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:38:36 +0100 Subject: [PATCH 0849/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/adherents/class/adherent.class.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 531c089e1f1..0c593549865 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -15,6 +15,7 @@ * Copyright (C) 2020 Josep Lluís Amador * Copyright (C) 2021 Waël Almoman * Copyright (C) 2021 Philippe Grand + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -315,7 +316,7 @@ class Adherent extends CommonObject /** - * @var array fields + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), @@ -323,14 +324,14 @@ class Adherent extends CommonObject 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1), 'ref_ext' => array('type' => 'varchar(128)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 20), 'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => -1, 'position' => 25), - 'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'showoncombobox'=>1), - 'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => 1, 'position' => 35, 'showoncombobox'=>1), + 'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'showoncombobox' => 1), + 'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => 1, 'position' => 35, 'showoncombobox' => 1), 'login' => array('type' => 'varchar(50)', 'label' => 'Login', 'enabled' => 1, 'visible' => 1, 'position' => 40), 'pass' => array('type' => 'varchar(50)', 'label' => 'Pass', 'enabled' => 1, 'visible' => -1, 'position' => 45), 'pass_crypted' => array('type' => 'varchar(128)', 'label' => 'Pass crypted', 'enabled' => 1, 'visible' => -1, 'position' => 50), 'morphy' => array('type' => 'varchar(3)', 'label' => 'MemberNature', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 55), 'fk_adherent_type' => array('type' => 'integer', 'label' => 'Fk adherent type', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 60), - 'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => 1, 'position' => 65, 'showoncombobox'=>2), + 'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => 1, 'position' => 65, 'showoncombobox' => 2), 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => 1, 'position' => 70), 'address' => array('type' => 'text', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 75), 'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80), @@ -341,14 +342,14 @@ class Adherent extends CommonObject 'phone_perso' => array('type' => 'varchar(30)', 'label' => 'Phone perso', 'enabled' => 1, 'visible' => -1, 'position' => 120), 'phone_mobile' => array('type' => 'varchar(30)', 'label' => 'Phone mobile', 'enabled' => 1, 'visible' => -1, 'position' => 125), 'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'visible' => 1, 'position' => 126), - 'url' =>array('type'=>'varchar(255)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>127), + 'url' => array('type' => 'varchar(255)', 'label' => 'Url', 'enabled' => 1, 'visible' => -1, 'position' => 127), 'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => -1, 'position' => 128), 'birth' => array('type' => 'date', 'label' => 'DateOfBirth', 'enabled' => 1, 'visible' => -1, 'position' => 130), 'gender' => array('type' => 'varchar(10)', 'label' => 'Gender', 'enabled' => 1, 'visible' => -1, 'position' => 132), 'photo' => array('type' => 'varchar(255)', 'label' => 'Photo', 'enabled' => 1, 'visible' => -1, 'position' => 135), 'public' => array('type' => 'smallint(6)', 'label' => 'Public', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 145), 'datefin' => array('type' => 'datetime', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => 1, 'position' => 150), - 'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>-1, 'position'=> 153), + 'default_lang' => array('type' => 'varchar(6)', 'label' => 'Default lang', 'enabled' => 1, 'visible' => -1, 'position' => 153), 'note_public' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155), 'note_private' => array('type' => 'text', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 160), 'datevalid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 165), @@ -2421,7 +2422,7 @@ class Adherent extends CommonObject } global $action; $hookmanager->initHooks(array($this->element . 'dao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; @@ -3276,7 +3277,7 @@ class Adherent extends CommonObject $return .= '
'; $return .= ''; if (property_exists($this, 'photo') || !empty($this->photo)) { - $return.= Form::showphoto('memberphoto', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1); + $return .= Form::showphoto('memberphoto', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1); } else { $return .= img_picto('', 'user'); } From f6920538b62bd263aca4786411d09750978f5be1 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:38:38 +0100 Subject: [PATCH 0850/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/adherents/class/subscription.class.php | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 111cb2c04ea..92a1edf1fe7 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -103,21 +104,21 @@ class Subscription extends CommonObject public $fk_bank; /** - * @var array Array with all fields into database and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>20), - 'fk_adherent' =>array('type'=>'integer', 'label'=>'Member', 'enabled'=>1, 'visible'=>-1, 'position'=>25), - 'dateadh' =>array('type'=>'datetime', 'label'=>'DateSubscription', 'enabled'=>1, 'visible'=>-1, 'position'=>30), - 'datef' =>array('type'=>'datetime', 'label'=>'DateEndSubscription', 'enabled'=>1, 'visible'=>-1, 'position'=>35), - 'subscription' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'position'=>40, 'isameasure'=>1), - 'fk_bank' =>array('type'=>'integer', 'label'=>'BankId', 'enabled'=>1, 'visible'=>-1, 'position'=>45), - 'note' =>array('type'=>'html', 'label'=>'Note', 'enabled'=>1, 'visible'=>-1, 'position'=>50), - 'fk_type' =>array('type'=>'integer', 'label'=>'MemberType', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'fk_user_creat' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>60), - 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>65), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 15), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 20), + 'fk_adherent' => array('type' => 'integer', 'label' => 'Member', 'enabled' => 1, 'visible' => -1, 'position' => 25), + 'dateadh' => array('type' => 'datetime', 'label' => 'DateSubscription', 'enabled' => 1, 'visible' => -1, 'position' => 30), + 'datef' => array('type' => 'datetime', 'label' => 'DateEndSubscription', 'enabled' => 1, 'visible' => -1, 'position' => 35), + 'subscription' => array('type' => 'double(24,8)', 'label' => 'Amount', 'enabled' => 1, 'visible' => -1, 'position' => 40, 'isameasure' => 1), + 'fk_bank' => array('type' => 'integer', 'label' => 'BankId', 'enabled' => 1, 'visible' => -1, 'position' => 45), + 'note' => array('type' => 'html', 'label' => 'Note', 'enabled' => 1, 'visible' => -1, 'position' => 50), + 'fk_type' => array('type' => 'integer', 'label' => 'MemberType', 'enabled' => 1, 'visible' => -1, 'position' => 55), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'position' => 60), + 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 65), ); @@ -295,7 +296,7 @@ class Subscription extends CommonObject $result = $member->update_end_date($user); if (!$error && !$notrigger) { - $this->context = array('member'=>$member); + $this->context = array('member' => $member); // Call triggers $result = $this->call_trigger('MEMBER_SUBSCRIPTION_MODIFY', $user); if ($result < 0) { From 67d01e2a9b470b703cb9a66fc9774a18337c718d Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:38:40 +0100 Subject: [PATCH 0851/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/asset/class/asset.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 9c034a3340b..e757f3efdd4 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2018 Alexandre Spangaro * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -93,7 +94,7 @@ class Asset extends CommonObject */ /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From 47405621413e259af2a0d4e98c1ff0eb003514db Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:38:42 +0100 Subject: [PATCH 0852/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- .../class/assetdepreciationoptions.class.php | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/htdocs/asset/class/assetdepreciationoptions.class.php b/htdocs/asset/class/assetdepreciationoptions.class.php index e6aa273060c..a07ae6b5043 100644 --- a/htdocs/asset/class/assetdepreciationoptions.class.php +++ b/htdocs/asset/class/assetdepreciationoptions.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -64,7 +65,7 @@ class AssetDepreciationOptions extends CommonObject */ /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); @@ -77,15 +78,15 @@ class AssetDepreciationOptions extends CommonObject 'label' => 'AssetDepreciationOptionEconomic', 'table' => 'asset_depreciation_options_economic', 'fields' => array( - 'depreciation_type' => array('type'=>'smallint', 'label'=>'AssetDepreciationOptionDepreciationType', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>1, 'default'=>'0', 'arrayofkeyval'=>array('0'=>'AssetDepreciationOptionDepreciationTypeLinear', '1'=>'AssetDepreciationOptionDepreciationTypeDegressive', '2'=>'AssetDepreciationOptionDepreciationTypeExceptional'), 'validate'=>'1',), - 'degressive_coefficient' => array('type'=>'double(24,8)', 'label'=>'AssetDepreciationOptionDegressiveRate', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>1, 'default'=>'0', 'isameasure'=>'1', 'validate'=>'1','enabled_field' => 'economic:depreciation_type:1'), - 'duration' => array('type'=>'integer', 'label'=>'AssetDepreciationOptionDuration', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'default'=>'0', 'isameasure'=>'1', 'validate'=>'1',), - 'duration_type' => array('type'=>'smallint', 'label'=>'AssetDepreciationOptionDurationType', 'enabled'=>'1', 'position'=>40, 'notnull'=>1, 'visible'=>1, 'default'=>'0', 'arrayofkeyval'=>array('0'=>'AssetDepreciationOptionDurationTypeAnnual', '1'=>'AssetDepreciationOptionDurationTypeMonthly'/*, '2'=>'AssetDepreciationOptionDurationTypeDaily'*/), 'validate'=>'1',), - 'rate' => array('type'=>'double(24,8)', 'label'=>'AssetDepreciationOptionRate', 'enabled'=>'1', 'position'=>50, 'visible'=>3, 'default'=>'0', 'isameasure'=>'1', 'validate'=>'1', 'computed' => '$object->asset_depreciation_options->getRate("economic")',), - 'accelerated_depreciation_option' => array('type'=>'boolean', 'label'=>'AssetDepreciationOptionAcceleratedDepreciation', 'enabled'=>'1', 'position'=>60, 'column_break' => true, 'notnull'=>0, 'default'=>'0', 'visible'=>1, 'validate'=>'1',), - 'amount_base_depreciation_ht' => array('type'=>'price', 'label'=>'AssetDepreciationOptionAmountBaseDepreciationHT', 'enabled'=>'isset($object)&&get_class($object)=="Asset"', 'only_on_asset'=>1, 'position'=>90, 'notnull'=>0, 'required'=>1, 'visible'=>1, 'default'=>'$object->reversal_amount_ht > 0 ? $object->reversal_amount_ht : $object->acquisition_value_ht', 'isameasure'=>'1', 'validate'=>'1',), - 'amount_base_deductible_ht' => array('type'=>'price', 'label'=>'AssetDepreciationOptionAmountBaseDeductibleHT', 'enabled'=>'isset($object)&&get_class($object)=="Asset"', 'only_on_asset'=>1, 'position'=>100, 'notnull'=>0, 'visible'=>1, 'default'=>'0', 'isameasure'=>'1', 'validate'=>'1',), - 'total_amount_last_depreciation_ht' => array('type'=>'price', 'label'=>'AssetDepreciationOptionTotalAmountLastDepreciationHT', 'enabled'=>'isset($object)&&get_class($object)=="Asset"', 'only_on_asset'=>1, 'position'=>110, 'noteditable'=> 1, 'notnull'=>0, 'visible'=>1, 'default'=>'0', 'isameasure'=>'1', 'validate'=>'1',), + 'depreciation_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDepreciationType', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array('0' => 'AssetDepreciationOptionDepreciationTypeLinear', '1' => 'AssetDepreciationOptionDepreciationTypeDegressive', '2' => 'AssetDepreciationOptionDepreciationTypeExceptional'), 'validate' => '1',), + 'degressive_coefficient' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionDegressiveRate', 'enabled' => '1', 'position' => 20, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => '1', 'validate' => '1','enabled_field' => 'economic:depreciation_type:1'), + 'duration' => array('type' => 'integer', 'label' => 'AssetDepreciationOptionDuration', 'enabled' => '1', 'position' => 30, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => '1', 'validate' => '1',), + 'duration_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDurationType', 'enabled' => '1', 'position' => 40, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array('0' => 'AssetDepreciationOptionDurationTypeAnnual', '1' => 'AssetDepreciationOptionDurationTypeMonthly'/*, '2'=>'AssetDepreciationOptionDurationTypeDaily'*/), 'validate' => '1',), + 'rate' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionRate', 'enabled' => '1', 'position' => 50, 'visible' => 3, 'default' => '0', 'isameasure' => '1', 'validate' => '1', 'computed' => '$object->asset_depreciation_options->getRate("economic")',), + 'accelerated_depreciation_option' => array('type' => 'boolean', 'label' => 'AssetDepreciationOptionAcceleratedDepreciation', 'enabled' => '1', 'position' => 60, 'column_break' => true, 'notnull' => 0, 'default' => '0', 'visible' => 1, 'validate' => '1',), + 'amount_base_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDepreciationHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 90, 'notnull' => 0, 'required' => 1, 'visible' => 1, 'default' => '$object->reversal_amount_ht > 0 ? $object->reversal_amount_ht : $object->acquisition_value_ht', 'isameasure' => '1', 'validate' => '1',), + 'amount_base_deductible_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDeductibleHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => '1', 'validate' => '1',), + 'total_amount_last_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionTotalAmountLastDepreciationHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 110, 'noteditable' => 1, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => '1', 'validate' => '1',), ), ), 'accelerated_depreciation' => array( @@ -93,14 +94,14 @@ class AssetDepreciationOptions extends CommonObject 'table' => 'asset_depreciation_options_fiscal', 'enabled_field' => 'economic:accelerated_depreciation_option:1', 'fields' => array( - 'depreciation_type' => array('type'=>'smallint', 'label'=>'AssetDepreciationOptionDepreciationType', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>1, 'default'=>'0', 'arrayofkeyval'=>array('0'=>'AssetDepreciationOptionDepreciationTypeLinear', '1'=>'AssetDepreciationOptionDepreciationTypeDegressive', '2'=>'AssetDepreciationOptionDepreciationTypeExceptional'), 'validate'=>'1',), - 'degressive_coefficient' => array('type'=>'double(24,8)', 'label'=>'AssetDepreciationOptionDegressiveRate', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>1, 'default'=>'0', 'isameasure'=>'1', 'validate'=>'1','enabled_field' => 'accelerated_depreciation:depreciation_type:1'), - 'duration' => array('type'=>'integer', 'label'=>'AssetDepreciationOptionDuration', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'default'=>'0', 'isameasure'=>'1', 'validate'=>'1',), - 'duration_type' => array('type'=>'smallint', 'label'=>'AssetDepreciationOptionDurationType', 'enabled'=>'1', 'position'=>40, 'notnull'=>1, 'visible'=>1, 'default'=>'0', 'arrayofkeyval'=>array('0'=>'AssetDepreciationOptionDurationTypeAnnual', '1'=>'AssetDepreciationOptionDurationTypeMonthly'/*, '2'=>'AssetDepreciationOptionDurationTypeDaily'*/), 'validate'=>'1',), - 'rate' => array('type'=>'double(24,8)', 'label'=>'AssetDepreciationOptionRate', 'enabled'=>'1', 'position'=>50, 'visible'=>3, 'default'=>'0', 'isameasure'=>'1', 'validate'=>'1', 'computed' => '$object->asset_depreciation_options->getRate("accelerated_depreciation")',), - 'amount_base_depreciation_ht' => array('type'=>'price', 'label'=>'AssetDepreciationOptionAmountBaseDepreciationHT', 'enabled'=>'isset($object)&&get_class($object)=="Asset"', 'only_on_asset'=>1, 'position'=>80, 'column_break' => true, 'notnull'=>0, 'required'=>1, 'visible'=>1, 'default'=>'$object->reversal_amount_ht > 0 ? $object->reversal_amount_ht : $object->acquisition_value_ht', 'isameasure'=>'1', 'validate'=>'1',), - 'amount_base_deductible_ht' => array('type'=>'price', 'label'=>'AssetDepreciationOptionAmountBaseDeductibleHT', 'enabled'=>'isset($object)&&get_class($object)=="Asset"', 'only_on_asset'=>1, 'position'=>90, 'notnull'=>0, 'visible'=>1, 'default'=>'0', 'isameasure'=>'1', 'validate'=>'1',), - 'total_amount_last_depreciation_ht' => array('type'=>'price', 'label'=>'AssetDepreciationOptionTotalAmountLastDepreciationHT', 'enabled'=>'isset($object)&&get_class($object)=="Asset"', 'only_on_asset'=>1, 'position'=>100, 'noteditable'=> 1, 'notnull'=>0, 'visible'=>1, 'default'=>'0', 'isameasure'=>'1', 'validate'=>'1',), + 'depreciation_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDepreciationType', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array('0' => 'AssetDepreciationOptionDepreciationTypeLinear', '1' => 'AssetDepreciationOptionDepreciationTypeDegressive', '2' => 'AssetDepreciationOptionDepreciationTypeExceptional'), 'validate' => '1',), + 'degressive_coefficient' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionDegressiveRate', 'enabled' => '1', 'position' => 20, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => '1', 'validate' => '1','enabled_field' => 'accelerated_depreciation:depreciation_type:1'), + 'duration' => array('type' => 'integer', 'label' => 'AssetDepreciationOptionDuration', 'enabled' => '1', 'position' => 30, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => '1', 'validate' => '1',), + 'duration_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDurationType', 'enabled' => '1', 'position' => 40, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array('0' => 'AssetDepreciationOptionDurationTypeAnnual', '1' => 'AssetDepreciationOptionDurationTypeMonthly'/*, '2'=>'AssetDepreciationOptionDurationTypeDaily'*/), 'validate' => '1',), + 'rate' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionRate', 'enabled' => '1', 'position' => 50, 'visible' => 3, 'default' => '0', 'isameasure' => '1', 'validate' => '1', 'computed' => '$object->asset_depreciation_options->getRate("accelerated_depreciation")',), + 'amount_base_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDepreciationHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 80, 'column_break' => true, 'notnull' => 0, 'required' => 1, 'visible' => 1, 'default' => '$object->reversal_amount_ht > 0 ? $object->reversal_amount_ht : $object->acquisition_value_ht', 'isameasure' => '1', 'validate' => '1',), + 'amount_base_deductible_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDeductibleHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 90, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => '1', 'validate' => '1',), + 'total_amount_last_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionTotalAmountLastDepreciationHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 100, 'noteditable' => 1, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => '1', 'validate' => '1',), ), ), ); @@ -178,7 +179,7 @@ class AssetDepreciationOptions extends CommonObject $this->{$field_key} = $this->deprecation_options[$mode][$field_key] ?? null; } - $this->fields['rowid'] = array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"); + $this->fields['rowid'] = array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"); if (empty($class_type)) { $this->fields['fk_asset'] = array('type' => 'integer:Asset:asset/class/asset.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label' => 'Asset', 'enabled' => '1', 'position' => 0, 'notnull' => 0, 'visible' => 0, 'index' => 1, 'validate' => '1',); } else { From 622a32b2bb3527f3f2dddd484d0f6431817fd8df Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:38:44 +0100 Subject: [PATCH 0853/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/asset/class/assetmodel.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index 811f50252d7..5b995978015 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2021 Open-Dsi * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -99,7 +100,7 @@ class AssetModel extends CommonObject */ /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From f4b444cc0f4ce8adcd07e6f917f791cc60e62e3e Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:38:46 +0100 Subject: [PATCH 0854/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/bom/class/bom.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 451926a030c..ac9173a4a07 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2023 Benjamin Falière * Copyright (C) 2023 Charlene Benke * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -110,7 +111,7 @@ class BOM extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), From d494def49d37382737bed84677e3da4183cf2f73 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:38:48 +0100 Subject: [PATCH 0855/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/bookcal/class/availabilities.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index e3320b531c7..a2bbcd6ffc8 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2022 Alice Adminson * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -111,7 +112,7 @@ class Availabilities extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 2, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From bc8f023653e63235f5a52bacf42e2dd794878b34 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:38:50 +0100 Subject: [PATCH 0856/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/bookcal/class/calendar.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index cad6ca0eeb2..a3320c04cda 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2023-2024 Frédéric France * Copyright (C) 2023 Alice Adminson + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -111,7 +112,7 @@ class Calendar extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'right', 'comment' => "Id"), From 4ec7a53e3f3fe5bbb319ee8aeb778c65e7e95397 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:38:52 +0100 Subject: [PATCH 0857/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- .../action/class/actioncommreminder.class.php | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index 4880e42300d..a55752b62c6 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/htdocs/comm/action/class/actioncommreminder.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -75,20 +76,20 @@ class ActionCommReminder extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), - 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), - 'dateremind' => array('type'=>'datetime', 'label'=>'DateRemind', 'visible'=>1, 'enabled'=>1, 'position'=>60, 'notnull'=>1, 'index'=>1,), - 'typeremind' => array('type'=>'varchar(32)', 'label'=>'TypeRemind', 'visible'=>-1, 'enabled'=>1, 'position'=>55, 'notnull'=>1, 'comment'=>"email, browser, sms",), - 'fk_user' => array('type'=>'integer', 'label'=>'User', 'visible'=>-1, 'enabled'=>1, 'position'=>65, 'notnull'=>1, 'index'=>1,), - 'offsetvalue' => array('type'=>'integer', 'label'=>'OffsetValue', 'visible'=>1, 'enabled'=>1, 'position'=>56, 'notnull'=>1,), - 'offsetunit' => array('type'=>'varchar(1)', 'label'=>'OffsetUnit', 'visible'=>1, 'enabled'=>1, 'position'=>57, 'notnull'=>1, 'comment'=>"y, m, d, w, h, i",), - 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>58, 'notnull'=>1, 'default'=>0, 'index'=>0, 'arrayofkeyval'=>array('0'=>'ToDo', '1'=>'Done')), - 'lasterror' => array('type'=>'varchar(128)', 'label'=>'LastError', 'visible'=>-1, 'enabled'=>1, 'position'=>59, 'index'=>0), - 'fk_actioncomm' => array('type'=>'integer', 'label'=>'Project', 'visible'=>1, 'enabled'=>1, 'position'=>70, 'notnull'=>1, 'index'=>1,), - 'fk_email_template' => array('type'=>'integer', 'label'=>'EmailTemplate', 'visible'=>1, 'enabled'=>1, 'position'=>80, 'notnull'=>0), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'visible' => 0, 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'index' => 1,), + 'dateremind' => array('type' => 'datetime', 'label' => 'DateRemind', 'visible' => 1, 'enabled' => 1, 'position' => 60, 'notnull' => 1, 'index' => 1,), + 'typeremind' => array('type' => 'varchar(32)', 'label' => 'TypeRemind', 'visible' => -1, 'enabled' => 1, 'position' => 55, 'notnull' => 1, 'comment' => "email, browser, sms",), + 'fk_user' => array('type' => 'integer', 'label' => 'User', 'visible' => -1, 'enabled' => 1, 'position' => 65, 'notnull' => 1, 'index' => 1,), + 'offsetvalue' => array('type' => 'integer', 'label' => 'OffsetValue', 'visible' => 1, 'enabled' => 1, 'position' => 56, 'notnull' => 1,), + 'offsetunit' => array('type' => 'varchar(1)', 'label' => 'OffsetUnit', 'visible' => 1, 'enabled' => 1, 'position' => 57, 'notnull' => 1, 'comment' => "y, m, d, w, h, i",), + 'status' => array('type' => 'integer', 'label' => 'Status', 'visible' => 1, 'enabled' => 1, 'position' => 58, 'notnull' => 1, 'default' => 0, 'index' => 0, 'arrayofkeyval' => array('0' => 'ToDo', '1' => 'Done')), + 'lasterror' => array('type' => 'varchar(128)', 'label' => 'LastError', 'visible' => -1, 'enabled' => 1, 'position' => 59, 'index' => 0), + 'fk_actioncomm' => array('type' => 'integer', 'label' => 'Project', 'visible' => 1, 'enabled' => 1, 'position' => 70, 'notnull' => 1, 'index' => 1,), + 'fk_email_template' => array('type' => 'integer', 'label' => 'EmailTemplate', 'visible' => 1, 'enabled' => 1, 'position' => 80, 'notnull' => 0), ); /** From ed703c72419a22841ac6cfcdadfcbd61b654fa86 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:38:55 +0100 Subject: [PATCH 0858/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/comm/propal/class/propal.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 5097273a833..a19ee568c3b 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -19,6 +19,7 @@ * Copyright (C) 2022 OpenDSI * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023 William Mead + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -319,7 +320,7 @@ class Propal extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), From 3f5a3b03eeeeafc3f2164fa9fad6a659aa6ef404 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:38:57 +0100 Subject: [PATCH 0859/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/commande/class/commande.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index d89d3b39dfb..e4cc13362b6 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -13,6 +13,7 @@ * Copyright (C) 2016-2022 Ferran Marcet * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2022 Gauthier VERDOL + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -310,7 +311,7 @@ class Commande extends CommonOrder // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), From ec18ec0605daecb570d938eaf79d40b09db42a0b Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:38:59 +0100 Subject: [PATCH 0860/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/compta/bank/class/account.class.php | 83 +++++++++++----------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 980139ac752..9efdbcd8451 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -10,6 +10,7 @@ * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2019 JC Prieto * Copyright (C) 2022-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -311,49 +312,49 @@ class Account extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'ref' =>array('type'=>'varchar(12)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>25), - 'label' =>array('type'=>'varchar(30)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>30), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>35, 'index'=>1), - 'bank' =>array('type'=>'varchar(60)', 'label'=>'Bank', 'enabled'=>1, 'visible'=>-1, 'position'=>40), - 'code_banque' =>array('type'=>'varchar(128)', 'label'=>'Code banque', 'enabled'=>1, 'visible'=>-1, 'position'=>45), - 'code_guichet' =>array('type'=>'varchar(6)', 'label'=>'Code guichet', 'enabled'=>1, 'visible'=>-1, 'position'=>50), - 'number' =>array('type'=>'varchar(255)', 'label'=>'Number', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'cle_rib' =>array('type'=>'varchar(5)', 'label'=>'Cle rib', 'enabled'=>1, 'visible'=>-1, 'position'=>60), - 'bic' =>array('type'=>'varchar(11)', 'label'=>'Bic', 'enabled'=>1, 'visible'=>-1, 'position'=>65), - 'iban_prefix' =>array('type'=>'varchar(34)', 'label'=>'Iban prefix', 'enabled'=>1, 'visible'=>-1, 'position'=>70), - 'country_iban' =>array('type'=>'varchar(2)', 'label'=>'Country iban', 'enabled'=>1, 'visible'=>-1, 'position'=>75), - 'cle_iban' =>array('type'=>'varchar(2)', 'label'=>'Cle iban', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'domiciliation' =>array('type'=>'varchar(255)', 'label'=>'Domiciliation', 'enabled'=>1, 'visible'=>-1, 'position'=>85), - 'state_id' =>array('type'=>'integer', 'label'=>'StateId', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'fk_pays' =>array('type'=>'integer', 'label'=>'Country', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>95), - 'proprio' =>array('type'=>'varchar(60)', 'label'=>'Proprio', 'enabled'=>1, 'visible'=>-1, 'position'=>100), - 'owner_address' =>array('type'=>'varchar(255)', 'label'=>'Owner address', 'enabled'=>1, 'visible'=>-1, 'position'=>105), - 'owner_zip' =>array('type'=>'varchar(25)', 'label'=>'Owner zip', 'enabled'=>1, 'visible'=>-1, 'position'=>106), - 'owner_town' =>array('type'=>'varchar(50)', 'label'=>'Owner town', 'enabled'=>1, 'visible'=>-1, 'position'=>107), - 'owner_country_id' =>array('type'=>'integer', 'label'=>'Owner country', 'enabled'=>1, 'visible'=>-1, 'position'=>108), - 'courant' =>array('type'=>'smallint(6)', 'label'=>'Courant', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>110), - 'clos' =>array('type'=>'smallint(6)', 'label'=>'Clos', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>115), - 'rappro' =>array('type'=>'smallint(6)', 'label'=>'Rappro', 'enabled'=>1, 'visible'=>-1, 'position'=>120), - 'url' =>array('type'=>'varchar(128)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>125), - 'account_number' =>array('type'=>'varchar(32)', 'label'=>'Account number', 'enabled'=>1, 'visible'=>-1, 'position'=>130), - 'fk_accountancy_journal' =>array('type'=>'integer', 'label'=>'Accountancy journal ID', 'enabled'=>1, 'visible'=>-1, 'position'=>132), - 'accountancy_journal' =>array('type'=>'varchar(20)', 'label'=>'Accountancy journal', 'enabled'=>1, 'visible'=>-1, 'position'=>135), - 'currency_code' =>array('type'=>'varchar(3)', 'label'=>'Currency code', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>140), - 'min_allowed' =>array('type'=>'integer', 'label'=>'Min allowed', 'enabled'=>1, 'visible'=>-1, 'position'=>145), - 'min_desired' =>array('type'=>'integer', 'label'=>'Min desired', 'enabled'=>1, 'visible'=>-1, 'position'=>150), - 'comment' =>array('type'=>'text', 'label'=>'Comment', 'enabled'=>1, 'visible'=>-1, 'position'=>155), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>156), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>157), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>160), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>165), - 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>170), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>175), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>180), - 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>185), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'ref' => array('type' => 'varchar(12)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'showoncombobox' => 1, 'position' => 25), + 'label' => array('type' => 'varchar(30)', 'label' => 'Label', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 30), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 35, 'index' => 1), + 'bank' => array('type' => 'varchar(60)', 'label' => 'Bank', 'enabled' => 1, 'visible' => -1, 'position' => 40), + 'code_banque' => array('type' => 'varchar(128)', 'label' => 'Code banque', 'enabled' => 1, 'visible' => -1, 'position' => 45), + 'code_guichet' => array('type' => 'varchar(6)', 'label' => 'Code guichet', 'enabled' => 1, 'visible' => -1, 'position' => 50), + 'number' => array('type' => 'varchar(255)', 'label' => 'Number', 'enabled' => 1, 'visible' => -1, 'position' => 55), + 'cle_rib' => array('type' => 'varchar(5)', 'label' => 'Cle rib', 'enabled' => 1, 'visible' => -1, 'position' => 60), + 'bic' => array('type' => 'varchar(11)', 'label' => 'Bic', 'enabled' => 1, 'visible' => -1, 'position' => 65), + 'iban_prefix' => array('type' => 'varchar(34)', 'label' => 'Iban prefix', 'enabled' => 1, 'visible' => -1, 'position' => 70), + 'country_iban' => array('type' => 'varchar(2)', 'label' => 'Country iban', 'enabled' => 1, 'visible' => -1, 'position' => 75), + 'cle_iban' => array('type' => 'varchar(2)', 'label' => 'Cle iban', 'enabled' => 1, 'visible' => -1, 'position' => 80), + 'domiciliation' => array('type' => 'varchar(255)', 'label' => 'Domiciliation', 'enabled' => 1, 'visible' => -1, 'position' => 85), + 'state_id' => array('type' => 'integer', 'label' => 'StateId', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'fk_pays' => array('type' => 'integer', 'label' => 'Country', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 95), + 'proprio' => array('type' => 'varchar(60)', 'label' => 'Proprio', 'enabled' => 1, 'visible' => -1, 'position' => 100), + 'owner_address' => array('type' => 'varchar(255)', 'label' => 'Owner address', 'enabled' => 1, 'visible' => -1, 'position' => 105), + 'owner_zip' => array('type' => 'varchar(25)', 'label' => 'Owner zip', 'enabled' => 1, 'visible' => -1, 'position' => 106), + 'owner_town' => array('type' => 'varchar(50)', 'label' => 'Owner town', 'enabled' => 1, 'visible' => -1, 'position' => 107), + 'owner_country_id' => array('type' => 'integer', 'label' => 'Owner country', 'enabled' => 1, 'visible' => -1, 'position' => 108), + 'courant' => array('type' => 'smallint(6)', 'label' => 'Courant', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 110), + 'clos' => array('type' => 'smallint(6)', 'label' => 'Clos', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 115), + 'rappro' => array('type' => 'smallint(6)', 'label' => 'Rappro', 'enabled' => 1, 'visible' => -1, 'position' => 120), + 'url' => array('type' => 'varchar(128)', 'label' => 'Url', 'enabled' => 1, 'visible' => -1, 'position' => 125), + 'account_number' => array('type' => 'varchar(32)', 'label' => 'Account number', 'enabled' => 1, 'visible' => -1, 'position' => 130), + 'fk_accountancy_journal' => array('type' => 'integer', 'label' => 'Accountancy journal ID', 'enabled' => 1, 'visible' => -1, 'position' => 132), + 'accountancy_journal' => array('type' => 'varchar(20)', 'label' => 'Accountancy journal', 'enabled' => 1, 'visible' => -1, 'position' => 135), + 'currency_code' => array('type' => 'varchar(3)', 'label' => 'Currency code', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 140), + 'min_allowed' => array('type' => 'integer', 'label' => 'Min allowed', 'enabled' => 1, 'visible' => -1, 'position' => 145), + 'min_desired' => array('type' => 'integer', 'label' => 'Min desired', 'enabled' => 1, 'visible' => -1, 'position' => 150), + 'comment' => array('type' => 'text', 'label' => 'Comment', 'enabled' => 1, 'visible' => -1, 'position' => 155), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 156), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 157), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'position' => 160), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 165), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 170), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 175), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 180), + 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 185), ); // END MODULEBUILDER PROPERTIES From a8a7d71426486dbf565fca5b516312b8c6192462 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:01 +0100 Subject: [PATCH 0861/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/compta/bank/class/paymentvarious.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 33ac0d8f817..fe7ea276767 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -197,7 +198,7 @@ class PaymentVarious extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array fields definition + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( // TODO: fill this array @@ -744,7 +745,7 @@ class PaymentVarious extends CommonObject global $action; $hookmanager->initHooks(array('variouspayment')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; From 88ba7d1bc502e0903fe43796a8126c5679e4796b Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:03 +0100 Subject: [PATCH 0862/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/compta/facture/class/facture-rec.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 50317b0ece3..957f7040a66 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2017-2024 Frédéric France * Copyright (C) 2023 Nick Fragoulis + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -171,7 +172,7 @@ class FactureRec extends CommonInvoice // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), From 0c0f04f2d5284288cd0ffcf5184aa00a9b8d33bc Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:05 +0100 Subject: [PATCH 0863/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/compta/facture/class/facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index e0e994959a7..6caa4a49b8c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -290,7 +290,7 @@ class Facture extends CommonInvoice // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 1), From fd757539346ad5bc04b58967507e511c789bfc73 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:07 +0100 Subject: [PATCH 0864/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/compta/prelevement/class/bonprelevement.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index abda85280a0..5a92797fdb7 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2014-2016 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2019 JC Prieto + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -144,7 +145,7 @@ class BonPrelevement extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => 0,), From c88a9ea1eb8c601e35f8e00caaa689f7c8427941 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:09 +0100 Subject: [PATCH 0865/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/contact/class/contact.class.php | 79 +++++++++++++------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 9b6752305a7..8b46a8d4c5a 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -12,6 +12,7 @@ * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Open-Dsi * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -97,45 +98,45 @@ class Contact extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>3, 'notnull'=>1, 'position'=>30, 'index'=>1), - 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>3, 'position'=>35), - 'civility' =>array('type'=>'varchar(6)', 'label'=>'Civility', 'enabled'=>1, 'visible'=>3, 'position'=>40), - 'lastname' =>array('type'=>'varchar(50)', 'label'=>'Lastname', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'showoncombobox'=>1, 'searchall'=>1), - 'name_alias' =>array('type'=>'varchar(255)', 'label'=>'Name alias', 'enabled'=>1, 'visible'=>-1, 'position'=>46, 'searchall'=>1), - 'firstname' =>array('type'=>'varchar(50)', 'label'=>'Firstname', 'enabled'=>1, 'visible'=>1, 'position'=>50, 'showoncombobox'=>1, 'searchall'=>1), - 'poste' =>array('type'=>'varchar(80)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>-1, 'position'=>52), - 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>1, 'position'=>60), - 'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>65), - 'fk_departement' =>array('type'=>'integer', 'label'=>'Fk departement', 'enabled'=>1, 'visible'=>3, 'position'=>70), - 'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>3, 'position'=>75), - 'fk_soc' =>array('type'=>'integer', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>1, 'position'=>77, 'searchall'=>1), - 'birthday' =>array('type'=>'date', 'label'=>'Birthday', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'phone' =>array('type'=>'varchar(30)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>1, 'position'=>90, 'searchall'=>1), - 'phone_perso' =>array('type'=>'varchar(30)', 'label'=>'PhonePerso', 'enabled'=>1, 'visible'=>-1, 'position'=>95, 'searchall'=>1), - 'phone_mobile' =>array('type'=>'varchar(30)', 'label'=>'PhoneMobile', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'searchall'=>1), - 'fax' =>array('type'=>'varchar(30)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'searchall'=>1), - 'email' =>array('type'=>'varchar(255)', 'label'=>'Email', 'enabled'=>1, 'visible'=>1, 'position'=>110, 'searchall'=>1), - 'socialnetworks' =>array('type'=>'text', 'label'=>'SocialNetworks', 'enabled'=>1, 'visible'=>3, 'position'=>115), - 'photo' =>array('type'=>'varchar(255)', 'label'=>'Photo', 'enabled'=>1, 'visible'=>3, 'position'=>170), - 'priv' =>array('type'=>'smallint(6)', 'label'=>'ContactVisibility', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>175), - 'fk_stcommcontact' =>array('type'=>'integer', 'label'=>'ProspectStatus', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>220), - 'fk_prospectcontactlevel' =>array('type'=>'varchar(12)', 'label'=>'ProspectLevel', 'enabled'=>1, 'visible'=>-1, 'position'=>255), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => 3, 'notnull' => 1, 'position' => 30, 'index' => 1), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 3, 'position' => 35), + 'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => 3, 'position' => 40), + 'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => 1, 'position' => 45, 'showoncombobox' => 1, 'searchall' => 1), + 'name_alias' => array('type' => 'varchar(255)', 'label' => 'Name alias', 'enabled' => 1, 'visible' => -1, 'position' => 46, 'searchall' => 1), + 'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => 1, 'position' => 50, 'showoncombobox' => 1, 'searchall' => 1), + 'poste' => array('type' => 'varchar(80)', 'label' => 'PostOrFunction', 'enabled' => 1, 'visible' => -1, 'position' => 52), + 'address' => array('type' => 'varchar(255)', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 55), + 'zip' => array('type' => 'varchar(25)', 'label' => 'Zip', 'enabled' => 1, 'visible' => 1, 'position' => 60), + 'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -1, 'position' => 65), + 'fk_departement' => array('type' => 'integer', 'label' => 'Fk departement', 'enabled' => 1, 'visible' => 3, 'position' => 70), + 'fk_pays' => array('type' => 'integer', 'label' => 'Fk pays', 'enabled' => 1, 'visible' => 3, 'position' => 75), + 'fk_soc' => array('type' => 'integer', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => 1, 'position' => 77, 'searchall' => 1), + 'birthday' => array('type' => 'date', 'label' => 'Birthday', 'enabled' => 1, 'visible' => -1, 'position' => 80), + 'phone' => array('type' => 'varchar(30)', 'label' => 'Phone', 'enabled' => 1, 'visible' => 1, 'position' => 90, 'searchall' => 1), + 'phone_perso' => array('type' => 'varchar(30)', 'label' => 'PhonePerso', 'enabled' => 1, 'visible' => -1, 'position' => 95, 'searchall' => 1), + 'phone_mobile' => array('type' => 'varchar(30)', 'label' => 'PhoneMobile', 'enabled' => 1, 'visible' => 1, 'position' => 100, 'searchall' => 1), + 'fax' => array('type' => 'varchar(30)', 'label' => 'Fax', 'enabled' => 1, 'visible' => -1, 'position' => 105, 'searchall' => 1), + 'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'visible' => 1, 'position' => 110, 'searchall' => 1), + 'socialnetworks' => array('type' => 'text', 'label' => 'SocialNetworks', 'enabled' => 1, 'visible' => 3, 'position' => 115), + 'photo' => array('type' => 'varchar(255)', 'label' => 'Photo', 'enabled' => 1, 'visible' => 3, 'position' => 170), + 'priv' => array('type' => 'smallint(6)', 'label' => 'ContactVisibility', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 175), + 'fk_stcommcontact' => array('type' => 'integer', 'label' => 'ProspectStatus', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 220), + 'fk_prospectcontactlevel' => array('type' => 'varchar(12)', 'label' => 'ProspectLevel', 'enabled' => 1, 'visible' => -1, 'position' => 255), //no more used. Replace by a scan of email into mailing_unsubscribe. 'no_email' =>array('type'=>'smallint(6)', 'label'=>'No_Email', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>180), - 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>3, 'position'=>195, 'searchall'=>1), - 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>3, 'position'=>200, 'searchall'=>1), - 'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>3, 'position'=>205), - 'canvas' =>array('type'=>'varchar(32)', 'label'=>'Canvas', 'enabled'=>1, 'visible'=>3, 'position'=>210), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>300), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>305), - 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>3, 'position'=>310), - 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>3, 'position'=>315), - 'statut' =>array('type'=>'tinyint(4)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>1000), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 3, 'position' => 195, 'searchall' => 1), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 3, 'position' => 200, 'searchall' => 1), + 'default_lang' => array('type' => 'varchar(6)', 'label' => 'Default lang', 'enabled' => 1, 'visible' => 3, 'position' => 205), + 'canvas' => array('type' => 'varchar(32)', 'label' => 'Canvas', 'enabled' => 1, 'visible' => 3, 'position' => 210), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 300), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 305), + 'fk_user_creat' => array('type' => 'integer', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => 3, 'position' => 310), + 'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModif', 'enabled' => 1, 'visible' => 3, 'position' => 315), + 'statut' => array('type' => 'tinyint(4)', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 500), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -1, 'position' => 1000), ); public $civility_id; // In fact we store civility_code @@ -1797,7 +1798,7 @@ class Contact extends CommonObject while ($obj = $this->db->fetch_object($resql)) { $transkey = "TypeContact_".$obj->element."_".$obj->source."_".$obj->code; $libelle_element = $langs->trans('ContactDefault_'.$obj->element); - $this->roles[$obj->contactroleid] = array('id'=>$obj->rowid, 'socid'=>$obj->socid, 'element'=>$obj->element, 'source'=>$obj->source, 'code'=>$obj->code, 'label'=>$libelle_element.' - '.($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->label)); + $this->roles[$obj->contactroleid] = array('id' => $obj->rowid, 'socid' => $obj->socid, 'element' => $obj->element, 'source' => $obj->source, 'code' => $obj->code, 'label' => $libelle_element.' - '.($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->label)); } } } else { @@ -1846,7 +1847,7 @@ class Contact extends CommonObject $i = 0; while ($i < $num) { $obj = $this->db->fetch_object($resql); - $tab[] = array('fk_socpeople'=>$obj->id, 'type_contact'=>$obj->fk_c_type_contact); + $tab[] = array('fk_socpeople' => $obj->id, 'type_contact' => $obj->fk_c_type_contact); $i++; } @@ -2178,7 +2179,7 @@ class Contact extends CommonObject $return .= ''; //var_dump($this->photo);exit; if (property_exists($this, 'photo') && !is_null($this->photo)) { - $return.= Form::showphoto('contact', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1); + $return .= Form::showphoto('contact', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1); } else { $return .= img_picto('', $this->picto); } From 640eb1b75d71ce326f4a4c536330106a634d7004 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:11 +0100 Subject: [PATCH 0866/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/contrat/class/contrat.class.php | 108 ++++++++++++------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 8139d7aa755..e15c3f57a3f 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -243,31 +243,31 @@ class Contrat extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'ref' =>array('type'=>'varchar(50)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'showoncombobox'=>1, 'position'=>15, 'searchall'=>1), - 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>20), - 'ref_customer' =>array('type'=>'varchar(50)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>25, 'searchall'=>1), - 'ref_supplier' =>array('type'=>'varchar(50)', 'label'=>'RefSupplier', 'enabled'=>1, 'visible'=>-1, 'position'=>26, 'searchall'=>1), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>30, 'index'=>1), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>35), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>40), - 'date_contrat' =>array('type'=>'datetime', 'label'=>'Date contrat', 'enabled'=>1, 'visible'=>-1, 'position'=>45), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'isModEnabled("societe")', 'visible'=>-1, 'notnull'=>1, 'position'=>70), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>75), - 'fk_commercial_signature' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'SaleRepresentative Signature', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'fk_commercial_suivi' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'SaleRepresentative follower', 'enabled'=>1, 'visible'=>-1, 'position'=>85), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>90), - 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>105, 'searchall'=>1), - 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110, 'searchall'=>1), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>115), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>120), - 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>125), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>135), - 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'Last main doc', 'enabled'=>1, 'visible'=>-1, 'position'=>140), - 'statut' =>array('type'=>'smallint(6)', 'label'=>'Statut', 'enabled'=>1, 'visible'=>-1, 'position'=>500, 'notnull'=>1, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Closed')) + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'ref' => array('type' => 'varchar(50)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'showoncombobox' => 1, 'position' => 15, 'searchall' => 1), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 20), + 'ref_customer' => array('type' => 'varchar(50)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => -1, 'position' => 25, 'searchall' => 1), + 'ref_supplier' => array('type' => 'varchar(50)', 'label' => 'RefSupplier', 'enabled' => 1, 'visible' => -1, 'position' => 26, 'searchall' => 1), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 30, 'index' => 1), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 35), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 40), + 'date_contrat' => array('type' => 'datetime', 'label' => 'Date contrat', 'enabled' => 1, 'visible' => -1, 'position' => 45), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'notnull' => 1, 'position' => 70), + 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Project', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 75), + 'fk_commercial_signature' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'SaleRepresentative Signature', 'enabled' => 1, 'visible' => -1, 'position' => 80), + 'fk_commercial_suivi' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'SaleRepresentative follower', 'enabled' => 1, 'visible' => -1, 'position' => 85), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 90), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 105, 'searchall' => 1), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 110, 'searchall' => 1), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 115), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 120), + 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 125), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 135), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'Last main doc', 'enabled' => 1, 'visible' => -1, 'position' => 140), + 'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => -1, 'position' => 500, 'notnull' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 2 => 'Closed')) ); // END MODULEBUILDER PROPERTIES @@ -2154,7 +2154,7 @@ class Contrat extends CommonObject global $action; $hookmanager->initHooks(array('contractdao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; @@ -2744,7 +2744,7 @@ class Contrat extends CommonObject $error = 0; $this->output = ''; - $this->error=''; + $this->error = ''; $contractlineprocessed = array(); $contractignored = array(); @@ -2753,13 +2753,13 @@ class Contrat extends CommonObject dol_syslog(__METHOD__, LOG_DEBUG); $sql = 'SELECT c.rowid, c.ref_customer, cd.rowid as lid, cd.date_fin_validite, p.duration'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'contrat as c, '.MAIN_DB_PREFIX.'contratdet as cd'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON p.rowid = cd.fk_product'; - $sql.= ' WHERE cd.fk_contrat = c.rowid'; - $sql.= " AND date_format(cd.date_fin_validite, '%Y-%m-%d') <= date_format('".$this->db->idate($enddatetoscan)."', '%Y-%m-%d')"; - $sql.= " AND cd.statut = 4"; + $sql .= ' FROM '.MAIN_DB_PREFIX.'contrat as c, '.MAIN_DB_PREFIX.'contratdet as cd'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON p.rowid = cd.fk_product'; + $sql .= ' WHERE cd.fk_contrat = c.rowid'; + $sql .= " AND date_format(cd.date_fin_validite, '%Y-%m-%d') <= date_format('".$this->db->idate($enddatetoscan)."', '%Y-%m-%d')"; + $sql .= " AND cd.statut = 4"; if ($thirdparty_id > 0) { - $sql.=" AND c.fk_soc = ".((int) $thirdparty_id); + $sql .= " AND c.fk_soc = ".((int) $thirdparty_id); } //print $sql; @@ -2769,7 +2769,7 @@ class Contrat extends CommonObject include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $i=0; + $i = 0; while ($i < $num) { $obj = $this->db->fetch_object($resql); if ($obj) { @@ -2806,7 +2806,7 @@ class Contrat extends CommonObject usort($object->linkedObjects['facture'], array('Contrat', 'contractCmpDate')); //dol_sort_array($object->linkedObjects['facture'], 'date'); - $someinvoicenotpaid=0; + $someinvoicenotpaid = 0; foreach ($object->linkedObjects['facture'] as $idinvoice => $invoice) { if ($invoice->statut == Facture::STATUS_DRAFT) { continue; @@ -2826,7 +2826,7 @@ class Contrat extends CommonObject if ($expirationdate && $expirationdate < $enddatetoscan) { dol_syslog("Define the newdate of end of services from expirationdate=".$expirationdate); $newdate = $expirationdate; - $protecti=0; //$protecti is to avoid infinite loop + $protecti = 0; //$protecti is to avoid infinite loop while ($newdate < $enddatetoscan && $protecti < 1000) { $newdate = dol_time_plus_duree($newdate, $duration_value, $duration_unit); $protecti++; @@ -2844,10 +2844,10 @@ class Contrat extends CommonObject $comment = 'Renew date of contract '.$object->ref.' line '.$obj->lid.' by doAutoRenewContracts'; $sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."contratdet SET date_fin_validite = '".$this->db->idate($newdate)."'"; - $sqlupdate.= ' WHERE rowid = '.((int) $obj->lid); + $sqlupdate .= ' WHERE rowid = '.((int) $obj->lid); $resqlupdate = $this->db->query($sqlupdate); if ($resqlupdate) { - $contractlineprocessed[$obj->lid]=$object->ref; + $contractlineprocessed[$obj->lid] = $object->ref; $actioncode = 'RENEW_CONTRACT'; $now = dol_now(); @@ -2869,7 +2869,7 @@ class Contrat extends CommonObject $ret = $actioncomm->create($user); // User creating action } else { - $contracterror[$object->id]=$object->ref; + $contracterror[$object->id] = $object->ref; $error++; $errorforlocaltransaction++; @@ -2895,7 +2895,7 @@ class Contrat extends CommonObject $this->error = $this->db->lasterror(); } - $this->output .= count($contractlineprocessed).' contract line(s) with end date before '.dol_print_date($enddatetoscan, 'day').' were renewed'.(count($contractlineprocessed)>0 ? ' : '.implode(',', $contractlineprocessed) : ''); + $this->output .= count($contractlineprocessed).' contract line(s) with end date before '.dol_print_date($enddatetoscan, 'day').' were renewed'.(count($contractlineprocessed) > 0 ? ' : '.implode(',', $contractlineprocessed) : ''); return ($error ? 1 : 0); } @@ -3109,27 +3109,27 @@ class ContratLigne extends CommonObjectLine * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>30, 'index'=>1), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>35), - 'qty' =>array('type'=>'integer', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>35, 'isameasure'=>1), - 'total_ht' =>array('type'=>'integer', 'label'=>'AmountHT', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>36, 'isameasure'=>1), - 'total_tva' =>array('type'=>'integer', 'label'=>'AmountVAT', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>37, 'isameasure'=>1), - 'total_ttc' =>array('type'=>'integer', 'label'=>'AmountTTC', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>38, 'isameasure'=>1), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 30, 'index' => 1), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 35), + 'qty' => array('type' => 'integer', 'label' => 'Quantity', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 35, 'isameasure' => 1), + 'total_ht' => array('type' => 'integer', 'label' => 'AmountHT', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 36, 'isameasure' => 1), + 'total_tva' => array('type' => 'integer', 'label' => 'AmountVAT', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 37, 'isameasure' => 1), + 'total_ttc' => array('type' => 'integer', 'label' => 'AmountTTC', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 38, 'isameasure' => 1), //'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>40), //'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>70), - 'fk_contrat' =>array('type'=>'integer:Contrat:contrat/class/contrat.class.php', 'label'=>'Contract', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>70), - 'fk_product' =>array('type'=>'integer:Product:product/class/product.class.php:1', 'label'=>'Product', 'enabled'=>1, 'visible'=>-1, 'position'=>75), + 'fk_contrat' => array('type' => 'integer:Contrat:contrat/class/contrat.class.php', 'label' => 'Contract', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 70), + 'fk_product' => array('type' => 'integer:Product:product/class/product.class.php:1', 'label' => 'Product', 'enabled' => 1, 'visible' => -1, 'position' => 75), //'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>90), - 'note_private' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>105), - 'note_public' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), + 'note_private' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 105), + 'note_public' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 110), //'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>115), //'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>120), //'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>125), - 'fk_user_ouverture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserStartingService', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>135), - 'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosingService', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>135), - 'statut' =>array('type'=>'smallint(6)', 'label'=>'Statut', 'enabled'=>1, 'visible'=>-1, 'position'=>500, 'arrayofkeyval'=>array(0=>'Draft', 4=>'Open', 5=>'Closed')), - 'rang' =>array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'position'=>500, 'default' =>0) + 'fk_user_ouverture' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserStartingService', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 135), + 'fk_user_cloture' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserClosingService', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 135), + 'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => -1, 'position' => 500, 'arrayofkeyval' => array(0 => 'Draft', 4 => 'Open', 5 => 'Closed')), + 'rang' => array('type' => 'integer', 'label' => 'Rank', 'enabled' => 1, 'visible' => 0, 'position' => 500, 'default' => 0) ); // END MODULEBUILDER PROPERTIES @@ -3200,7 +3200,7 @@ class ContratLigne extends CommonObjectLine $params = array(); $reg = array(); if (preg_match('/class="(.*)"/', $moreatt, $reg)) { - $params = array('badgeParams'=>array('css' => $reg[1])); + $params = array('badgeParams' => array('css' => $reg[1])); } return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode, '', $params); } From 3730dbc31b55f334e734b20ce7a9818d273c79ec Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:13 +0100 Subject: [PATCH 0867/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/core/class/defaultvalues.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index cdb14b5bd5a..1d8fb59c4c1 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2021 Florian HENRY * Copyright (C) 2021-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -86,7 +87,7 @@ class DefaultValues extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), From 1035e92861c6cf63116d3cff3b539fe6d5bbdea0 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:15 +0100 Subject: [PATCH 0868/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- .../core/class/emailsenderprofile.class.php | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 00a8d800251..6aa1222c9d6 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -88,19 +89,19 @@ class EmailSenderProfile extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',), - 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>-1, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>1), - 'email' => array('type'=>'varchar(255)', 'label'=>'Email', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1), - 'private' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'User', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'default'=>'0', 'notnull'=>1), - 'signature' => array('type'=>'html', 'label'=>'Signature', 'visible'=>3, 'enabled'=>1, 'position'=>400, 'notnull'=>-1, 'index'=>1,), - 'position' => array('type'=>'integer', 'label'=>'Position', 'visible'=>1, 'enabled'=>1, 'position'=>405, 'notnull'=>-1, 'index'=>1,), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), - 'active' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'default'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0=>'Disabled', 1=>'Enabled')), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id',), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'visible' => -1, 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'index' => 1,), + 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'visible' => 1, 'enabled' => 1, 'position' => 30, 'notnull' => 1), + 'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'visible' => 1, 'enabled' => 1, 'position' => 40, 'notnull' => -1), + 'private' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'User', 'visible' => 1, 'enabled' => 1, 'position' => 50, 'default' => '0', 'notnull' => 1), + 'signature' => array('type' => 'html', 'label' => 'Signature', 'visible' => 3, 'enabled' => 1, 'position' => 400, 'notnull' => -1, 'index' => 1,), + 'position' => array('type' => 'integer', 'label' => 'Position', 'visible' => 1, 'enabled' => 1, 'position' => 405, 'notnull' => -1, 'index' => 1,), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'visible' => -1, 'enabled' => 1, 'position' => 500, 'notnull' => 1,), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'visible' => -1, 'enabled' => 1, 'position' => 500, 'notnull' => 1,), + 'active' => array('type' => 'integer', 'label' => 'Status', 'visible' => 1, 'enabled' => 1, 'default' => 1, 'position' => 1000, 'notnull' => 1, 'index' => 1, 'arrayofkeyval' => array(0 => 'Disabled', 1 => 'Enabled')), ); /** From dcf25336ba2145f6d6497ca5ce47aa1ddec116bc Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:17 +0100 Subject: [PATCH 0869/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/core/class/timespent.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index a4327d55ae9..c3a830c5d48 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2023-2024 Frédéric France * Copyright (C) 2023 Gauthier VERDOL + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -111,7 +112,7 @@ class TimeSpent extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From 254dc732bd3770781fe0c20389cfd29d50572fbf Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:19 +0100 Subject: [PATCH 0870/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- .../class/emailcollector.class.php | 93 ++++++++++--------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index bffa405796e..9400a7d9437 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -119,40 +120,40 @@ class EmailCollector extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1), - 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1', 'csslist'=>'tdoverflowmax200'), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>'Example: My Email collector', 'csslist'=>'tdoverflowmax150'), - 'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>60, 'notnull'=>-1, 'cssview'=>'small', 'csslist'=>'small tdoverflowmax200'), - 'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>90, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com', 'csslist'=>'tdoverflowmax125'), - 'port' => array('type'=>'varchar(10)', 'label'=>'EMailHostPort', 'visible'=>1, 'enabled'=>1, 'position'=>91, 'notnull'=>1, 'searchall'=>0, 'comment'=>"IMAP server port", 'help'=>'Example: 993', 'csslist'=>'tdoverflowmax50', 'default'=>'993'), - 'hostcharset' => array('type'=>'varchar(16)', 'label'=>'HostCharset', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>0, 'searchall'=>0, 'comment'=>"IMAP server charset", 'help'=>'Example: "UTF-8" (May be "US-ASCII" with some Office365)', 'default'=>'UTF-8'), - 'imap_encryption' => array('type'=>'varchar(16)', 'label'=>'ImapEncryption', 'visible'=>-1, 'enabled'=>1, 'position'=>93, 'searchall'=>0, 'comment'=>"IMAP encryption", 'help'=>'ImapEncryptionHelp', 'arrayofkeyval'=> array('ssl'=>'SSL', 'tls' => 'TLS', 'notls' => 'NOTLS'), 'default'=>'ssl'), - 'norsh' => array('type'=>'integer', 'label'=>'NoRSH', 'visible'=>-1, 'enabled'=>"!getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position'=>94, 'searchall'=>0, 'help'=>'NoRSHHelp', 'arrayofkeyval'=> array(0 =>'No', 1 => 'Yes'), 'default'=> 0), - 'acces_type' => array('type'=>'integer', 'label'=>'accessType', 'visible'=>-1, 'enabled'=>"getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position'=>101, 'notnull'=>1, 'index'=>1, 'comment'=>"IMAP login type", 'arrayofkeyval'=>array('0'=>'loginPassword', '1'=>'oauthToken'), 'default'=>'0', 'help'=>''), - 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), - 'password' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>"1", 'position'=>103, 'notnull'=>-1, 'comment'=>"IMAP password", 'help'=>'WithGMailYouCanCreateADedicatedPassword'), - 'oauth_service' => array('type'=>'varchar(128)', 'label'=>'oauthService', 'visible'=>-1, 'enabled'=>"getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position'=>104, 'notnull'=>0, 'index'=>1, 'comment'=>"IMAP login oauthService", 'arrayofkeyval'=>array(), 'help'=>'TokenMustHaveBeenCreated'), - 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>109, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX, [Gmail]/Spam, [Gmail]/Draft, [Gmail]/Brouillons, [Gmail]/Sent Mail, [Gmail]/Messages envoyés, ...'), - 'target_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxTargetDirectory', 'visible'=>1, 'enabled'=>1, 'position'=>110, 'notnull'=>0, 'help'=>"EmailCollectorTargetDir"), - 'maxemailpercollect' => array('type'=>'integer', 'label'=>'MaxEmailCollectPerCollect', 'visible'=>-1, 'enabled'=>1, 'position'=>111, 'default'=>50), - 'datelastresult' => array('type'=>'datetime', 'label'=>'DateLastCollectResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>121, 'notnull'=>-1, 'csslist'=>'nowraponall'), - 'codelastresult' => array('type'=>'varchar(16)', 'label'=>'CodeLastResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>122, 'notnull'=>-1,), - 'lastresult' => array('type'=>'varchar(255)', 'label'=>'LastResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>123, 'notnull'=>-1, 'cssview'=>'small', 'csslist'=>'small tdoverflowmax200'), - 'datelastok' => array('type'=>'datetime', 'label'=>'DateLastcollectResultOk', 'visible'=>1, 'enabled'=>'$action != "create"', 'position'=>125, 'notnull'=>-1, 'csslist'=>'nowraponall'), - 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'visible'=>0, 'enabled'=>1, 'position'=>61, 'notnull'=>-1,), - 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>0, 'enabled'=>1, 'position'=>62, 'notnull'=>-1,), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-2, 'enabled'=>1, 'position'=>501, 'notnull'=>1,), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => 2, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'default' => 1, 'notnull' => 1, 'index' => 1, 'position' => 20), + 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 1, 'index' => 1, 'position' => 10, 'searchall' => 1, 'help' => 'Example: MyCollector1', 'csslist' => 'tdoverflowmax200'), + 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'visible' => 1, 'enabled' => 1, 'position' => 30, 'notnull' => -1, 'searchall' => 1, 'help' => 'Example: My Email collector', 'csslist' => 'tdoverflowmax150'), + 'description' => array('type' => 'text', 'label' => 'Description', 'visible' => -1, 'enabled' => 1, 'position' => 60, 'notnull' => -1, 'cssview' => 'small', 'csslist' => 'small tdoverflowmax200'), + 'host' => array('type' => 'varchar(255)', 'label' => 'EMailHost', 'visible' => 1, 'enabled' => 1, 'position' => 90, 'notnull' => 1, 'searchall' => 1, 'comment' => "IMAP server", 'help' => 'Example: imap.gmail.com', 'csslist' => 'tdoverflowmax125'), + 'port' => array('type' => 'varchar(10)', 'label' => 'EMailHostPort', 'visible' => 1, 'enabled' => 1, 'position' => 91, 'notnull' => 1, 'searchall' => 0, 'comment' => "IMAP server port", 'help' => 'Example: 993', 'csslist' => 'tdoverflowmax50', 'default' => '993'), + 'hostcharset' => array('type' => 'varchar(16)', 'label' => 'HostCharset', 'visible' => -1, 'enabled' => 1, 'position' => 92, 'notnull' => 0, 'searchall' => 0, 'comment' => "IMAP server charset", 'help' => 'Example: "UTF-8" (May be "US-ASCII" with some Office365)', 'default' => 'UTF-8'), + 'imap_encryption' => array('type' => 'varchar(16)', 'label' => 'ImapEncryption', 'visible' => -1, 'enabled' => 1, 'position' => 93, 'searchall' => 0, 'comment' => "IMAP encryption", 'help' => 'ImapEncryptionHelp', 'arrayofkeyval' => array('ssl' => 'SSL', 'tls' => 'TLS', 'notls' => 'NOTLS'), 'default' => 'ssl'), + 'norsh' => array('type' => 'integer', 'label' => 'NoRSH', 'visible' => -1, 'enabled' => "!getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position' => 94, 'searchall' => 0, 'help' => 'NoRSHHelp', 'arrayofkeyval' => array(0 => 'No', 1 => 'Yes'), 'default' => 0), + 'acces_type' => array('type' => 'integer', 'label' => 'accessType', 'visible' => -1, 'enabled' => "getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position' => 101, 'notnull' => 1, 'index' => 1, 'comment' => "IMAP login type", 'arrayofkeyval' => array('0' => 'loginPassword', '1' => 'oauthToken'), 'default' => '0', 'help' => ''), + 'login' => array('type' => 'varchar(128)', 'label' => 'Login', 'visible' => -1, 'enabled' => 1, 'position' => 102, 'notnull' => -1, 'index' => 1, 'comment' => "IMAP login", 'help' => 'Example: myaccount@gmail.com'), + 'password' => array('type' => 'password', 'label' => 'Password', 'visible' => -1, 'enabled' => "1", 'position' => 103, 'notnull' => -1, 'comment' => "IMAP password", 'help' => 'WithGMailYouCanCreateADedicatedPassword'), + 'oauth_service' => array('type' => 'varchar(128)', 'label' => 'oauthService', 'visible' => -1, 'enabled' => "getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position' => 104, 'notnull' => 0, 'index' => 1, 'comment' => "IMAP login oauthService", 'arrayofkeyval' => array(), 'help' => 'TokenMustHaveBeenCreated'), + 'source_directory' => array('type' => 'varchar(255)', 'label' => 'MailboxSourceDirectory', 'visible' => -1, 'enabled' => 1, 'position' => 109, 'notnull' => 1, 'default' => 'Inbox', 'help' => 'Example: INBOX, [Gmail]/Spam, [Gmail]/Draft, [Gmail]/Brouillons, [Gmail]/Sent Mail, [Gmail]/Messages envoyés, ...'), + 'target_directory' => array('type' => 'varchar(255)', 'label' => 'MailboxTargetDirectory', 'visible' => 1, 'enabled' => 1, 'position' => 110, 'notnull' => 0, 'help' => "EmailCollectorTargetDir"), + 'maxemailpercollect' => array('type' => 'integer', 'label' => 'MaxEmailCollectPerCollect', 'visible' => -1, 'enabled' => 1, 'position' => 111, 'default' => 50), + 'datelastresult' => array('type' => 'datetime', 'label' => 'DateLastCollectResult', 'visible' => 1, 'enabled' => '$action != "create" && $action != "edit"', 'position' => 121, 'notnull' => -1, 'csslist' => 'nowraponall'), + 'codelastresult' => array('type' => 'varchar(16)', 'label' => 'CodeLastResult', 'visible' => 1, 'enabled' => '$action != "create" && $action != "edit"', 'position' => 122, 'notnull' => -1,), + 'lastresult' => array('type' => 'varchar(255)', 'label' => 'LastResult', 'visible' => 1, 'enabled' => '$action != "create" && $action != "edit"', 'position' => 123, 'notnull' => -1, 'cssview' => 'small', 'csslist' => 'small tdoverflowmax200'), + 'datelastok' => array('type' => 'datetime', 'label' => 'DateLastcollectResultOk', 'visible' => 1, 'enabled' => '$action != "create"', 'position' => 125, 'notnull' => -1, 'csslist' => 'nowraponall'), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'visible' => 0, 'enabled' => 1, 'position' => 61, 'notnull' => -1,), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'visible' => 0, 'enabled' => 1, 'position' => 62, 'notnull' => -1,), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'visible' => -2, 'enabled' => 1, 'position' => 500, 'notnull' => 1,), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'visible' => -2, 'enabled' => 1, 'position' => 501, 'notnull' => 1,), //'date_validation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502), - 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'visible'=>-2, 'enabled'=>1, 'position'=>510, 'notnull'=>1,), - 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'visible'=>-2, 'enabled'=>1, 'position'=>511, 'notnull'=>-1,), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'visible' => -2, 'enabled' => 1, 'position' => 510, 'notnull' => 1,), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'visible' => -2, 'enabled' => 1, 'position' => 511, 'notnull' => -1,), //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), - 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1,), - 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'arrayofkeyval'=>array('0'=>'Inactive', '1'=>'Active')) + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'visible' => -2, 'enabled' => 1, 'position' => 1000, 'notnull' => -1,), + 'status' => array('type' => 'integer', 'label' => 'Status', 'visible' => 1, 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '0', 'index' => 1, 'arrayofkeyval' => array('0' => 'Inactive', '1' => 'Active')) ); @@ -614,7 +615,7 @@ class EmailCollector extends CommonObject //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); $hookmanager->initHooks(array('emailcollectordao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; @@ -730,7 +731,7 @@ class EmailCollector extends CommonObject $i = 0; while ($i < $num) { $obj = $this->db->fetch_object($resql); - $this->filters[$obj->rowid] = array('id'=>$obj->rowid, 'type'=>$obj->type, 'rulevalue'=>$obj->rulevalue, 'status'=>$obj->status); + $this->filters[$obj->rowid] = array('id' => $obj->rowid, 'type' => $obj->type, 'rulevalue' => $obj->rulevalue, 'status' => $obj->status); $i++; } $this->db->free($resql); @@ -762,7 +763,7 @@ class EmailCollector extends CommonObject $i = 0; while ($i < $num) { $obj = $this->db->fetch_object($resql); - $this->actions[$obj->rowid] = array('id'=>$obj->rowid, 'type'=>$obj->type, 'actionparam'=>$obj->actionparam, 'status'=>$obj->status); + $this->actions[$obj->rowid] = array('id' => $obj->rowid, 'type' => $obj->type, 'actionparam' => $obj->actionparam, 'status' => $obj->status); $i++; } $this->db->free($resql); @@ -1673,8 +1674,8 @@ class EmailCollector extends CommonObject } else { $operationslog .= " - ".dol_escape_htmltag((string) $imapemail); } - $operationslog .= " - References: ".dol_escape_htmltag($headers['References']??'')." - Subject: ".dol_escape_htmltag($headers['Subject']); - dol_syslog("** Process email ".$iforemailloop." References: ".($headers['References']??'')." Subject: ".$headers['Subject']); + $operationslog .= " - References: ".dol_escape_htmltag($headers['References'] ?? '')." - Subject: ".dol_escape_htmltag($headers['Subject']); + dol_syslog("** Process email ".$iforemailloop." References: ".($headers['References'] ?? '')." Subject: ".$headers['Subject']); $trackidfoundintorecipienttype = ''; @@ -2678,7 +2679,7 @@ class EmailCollector extends CommonObject } if (!empty($attachments)) { // There is an attachment for the ticket -> store attachment - $ticket = New Ticket($this->db); + $ticket = new Ticket($this->db); $ticket->fetch($fk_element_id); $destdir = $conf->ticket->dir_output.'/'.$ticket->ref; if (!dol_is_dir($destdir)) { @@ -3248,23 +3249,23 @@ class EmailCollector extends CommonObject } $parameters = array( - 'connection'=> $connection, - 'imapemail'=>$imapemail, - 'overview'=>$overview, + 'connection' => $connection, + 'imapemail' => $imapemail, + 'overview' => $overview, 'from' => $from, 'fromtext' => $fromtext, - 'actionparam'=> $operation['actionparam'], + 'actionparam' => $operation['actionparam'], 'thirdpartyid' => $thirdpartyid, - 'objectid'=> $objectid, - 'objectemail'=> $objectemail, + 'objectid' => $objectid, + 'objectemail' => $objectemail, - 'messagetext'=>$messagetext, - 'subject'=>$subject, - 'header'=>$header, - 'attachments'=>$attachments, + 'messagetext' => $messagetext, + 'subject' => $subject, + 'header' => $header, + 'attachments' => $attachments, ); $reshook = $hookmanager->executeHooks('doCollectImapOneCollector', $parameters, $this, $operation['type']); From 8a00ee901f28540a0a871d735fef2e3be6c38e75 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:21 +0100 Subject: [PATCH 0871/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- .../class/emailcollectoraction.class.php | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index bdefd8a1f87..cafee277913 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) ---Put here your own copyright and developer email--- * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -78,20 +79,20 @@ class EmailCollectorAction extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), - 'fk_emailcollector' => array('type'=>'integer', 'label'=>'Id of emailcollector', 'foreignkey'=>'emailcollector.rowid'), - 'type' => array('type'=>'varchar(128)', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1), - 'actionparam' => array('type'=>'text', 'label'=>'ParamForAction', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>-1), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,), - 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'llx_user.rowid',), - 'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,), - 'position' => array('type'=>'integer', 'label'=>'Position', 'enabled'=>1, 'visible'=>1, 'position'=>600, 'default'=>'0',), - 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), - 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>1000, 'notnull'=>1, 'default'=>1, 'arrayofkeyval'=>array('0'=>'Disabled', '1'=>'Enabled')), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), + 'fk_emailcollector' => array('type' => 'integer', 'label' => 'Id of emailcollector', 'foreignkey' => 'emailcollector.rowid'), + 'type' => array('type' => 'varchar(128)', 'label' => 'Type', 'enabled' => 1, 'visible' => 1, 'position' => 10, 'notnull' => 1, 'index' => 1), + 'actionparam' => array('type' => 'text', 'label' => 'ParamForAction', 'enabled' => 1, 'visible' => 1, 'position' => 40, 'notnull' => -1), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'position' => 500, 'notnull' => 1,), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'position' => 501, 'notnull' => 1,), + 'fk_user_creat' => array('type' => 'integer', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'position' => 510, 'notnull' => 1, 'foreignkey' => 'llx_user.rowid',), + 'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'position' => 511, 'notnull' => -1,), + 'position' => array('type' => 'integer', 'label' => 'Position', 'enabled' => 1, 'visible' => 1, 'position' => 600, 'default' => '0',), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 1000, 'notnull' => -1,), + 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'position' => 1000, 'notnull' => 1, 'default' => 1, 'arrayofkeyval' => array('0' => 'Disabled', '1' => 'Enabled')), ); public $rowid; public $fk_emailcollector; @@ -337,7 +338,7 @@ class EmailCollectorAction extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('emailcollectoractiondao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; From 696d748375431e904dd00139d1c8d979e375af02 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:23 +0100 Subject: [PATCH 0872/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- .../class/emailcollectorfilter.class.php | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index 52acc3440d7..6e1442c50a5 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) ---Put here your own copyright and developer email--- * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -80,19 +81,19 @@ class EmailCollectorFilter extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), - 'fk_emailcollector' => array('type'=>'integer', 'label'=>'Id of emailcollector', 'foreignkey'=>'emailcollector.rowid'), - 'type' => array('type'=>'varchar(128)', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>10, 'notnull'=>1,), - 'rulevalue' => array('type'=>'varchar(255)', 'label'=>'ValueOfRule', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>-1, 'help'=>"Value of Rule",), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,), - 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'llx_user.rowid',), - 'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,), - 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), - 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>1000, 'notnull'=>1, 'default'=>1, 'arrayofkeyval'=>array('0'=>'Disabled', '1'=>'Enabled')), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), + 'fk_emailcollector' => array('type' => 'integer', 'label' => 'Id of emailcollector', 'foreignkey' => 'emailcollector.rowid'), + 'type' => array('type' => 'varchar(128)', 'label' => 'Type', 'enabled' => 1, 'visible' => 1, 'position' => 10, 'notnull' => 1,), + 'rulevalue' => array('type' => 'varchar(255)', 'label' => 'ValueOfRule', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'notnull' => -1, 'help' => "Value of Rule",), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'position' => 500, 'notnull' => 1,), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'position' => 501, 'notnull' => 1,), + 'fk_user_creat' => array('type' => 'integer', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'position' => 510, 'notnull' => 1, 'foreignkey' => 'llx_user.rowid',), + 'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'position' => 511, 'notnull' => -1,), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 1000, 'notnull' => -1,), + 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'position' => 1000, 'notnull' => 1, 'default' => 1, 'arrayofkeyval' => array('0' => 'Disabled', '1' => 'Enabled')), ); public $rowid; public $fk_emailcollector; @@ -351,7 +352,7 @@ class EmailCollectorFilter extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('emailcollectorfilterdao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; From 829712cf200056dd97a8a1622b854935f9197e08 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:26 +0100 Subject: [PATCH 0873/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- .../class/conferenceorboothattendee.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 29f7fb8eafa..1712a02cec4 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) ---Put here your own copyright and developer email--- * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -99,7 +100,7 @@ class ConferenceOrBoothAttendee extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From b323ae5d3dc95b30d3082895e86110cbbc9c30b3 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:28 +0100 Subject: [PATCH 0874/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/expedition/class/expedition.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 1e880c2c91a..39eab0d71d0 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -13,6 +13,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Lenin Rivas + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -91,7 +92,7 @@ class Expedition extends CommonObject /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); @@ -1691,7 +1692,7 @@ class Expedition extends CommonObject $line->pa_ht = $obj->pa_ht; // Local taxes - $localtax_array = array(0=>$obj->localtax1_type, 1=>$obj->localtax1_tx, 2=>$obj->localtax2_type, 3=>$obj->localtax2_tx); + $localtax_array = array(0 => $obj->localtax1_type, 1 => $obj->localtax1_tx, 2 => $obj->localtax2_type, 3 => $obj->localtax2_tx); $localtax1_tx = get_localtax($obj->tva_tx, 1, $this->thirdparty); $localtax2_tx = get_localtax($obj->tva_tx, 2, $this->thirdparty); @@ -1913,7 +1914,7 @@ class Expedition extends CommonObject $result .= $linkend; global $action; $hookmanager->initHooks(array($this->element . 'dao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; @@ -2252,7 +2253,7 @@ class Expedition extends CommonObject // If stock increment is done on closing if (!$error && isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) { $result = $this->manageStockMvtOnEvt($user); - if ($result<0) { + if ($result < 0) { $error++; } } @@ -2294,7 +2295,7 @@ class Expedition extends CommonObject { global $langs; - $error=0; + $error = 0; require_once DOL_DOCUMENT_ROOT . '/product/stock/class/mouvementstock.class.php'; @@ -2366,7 +2367,7 @@ class Expedition extends CommonObject } else { $this->error = $this->db->lasterror(); $this->errors[] = $this->db->lasterror(); - $error ++; + $error++; } return $error; From 61f9bd468db65bed681c2443f2d0582c77a03076 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:30 +0100 Subject: [PATCH 0875/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- .../expensereport/class/expensereport_ik.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index 5079a6a5210..a1cc92421e4 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2017 Pierre-Henry Favre + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -71,14 +72,14 @@ class ExpenseReportIk extends CommonObject /** * Attribute object linked with database - * @var array + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid'=>array('type'=>'integer', 'index'=>true) - ,'fk_c_exp_tax_cat'=>array('type'=>'integer', 'index'=>true) - ,'fk_range'=>array('type'=>'integer', 'index'=>true) - ,'coef'=>array('type'=>'double') - ,'ikoffset'=>array('type'=>'double') + 'rowid' => array('type' => 'integer', 'index' => true) + ,'fk_c_exp_tax_cat' => array('type' => 'integer', 'index' => true) + ,'fk_range' => array('type' => 'integer', 'index' => true) + ,'coef' => array('type' => 'double') + ,'ikoffset' => array('type' => 'double') ); From b04317adb66173cec3e7894b4f5d31c88a955e9f Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:32 +0100 Subject: [PATCH 0876/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- .../class/expensereport_rule.class.php | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/expensereport/class/expensereport_rule.class.php b/htdocs/expensereport/class/expensereport_rule.class.php index 5966ba2399a..2e07990ac93 100644 --- a/htdocs/expensereport/class/expensereport_rule.class.php +++ b/htdocs/expensereport/class/expensereport_rule.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2017 Pierre-Henry Favre + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -109,20 +110,20 @@ class ExpenseReportRule extends CommonObject /** * Attribute object linked with database - * @var array + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid'=>array('type'=>'integer', 'index'=>true) - ,'dates'=>array('type'=>'date') - ,'datee'=>array('type'=>'date') - ,'amount'=>array('type'=>'double') - ,'restrictive'=>array('type'=>'integer') - ,'fk_user'=>array('type'=>'integer') - ,'fk_usergroup'=>array('type'=>'integer') - ,'fk_c_type_fees'=>array('type'=>'integer') - ,'code_expense_rules_type'=>array('type'=>'string') - ,'is_for_all'=>array('type'=>'integer') - ,'entity'=>array('type'=>'integer') + 'rowid' => array('type' => 'integer', 'index' => true) + ,'dates' => array('type' => 'date') + ,'datee' => array('type' => 'date') + ,'amount' => array('type' => 'double') + ,'restrictive' => array('type' => 'integer') + ,'fk_user' => array('type' => 'integer') + ,'fk_usergroup' => array('type' => 'integer') + ,'fk_c_type_fees' => array('type' => 'integer') + ,'code_expense_rules_type' => array('type' => 'string') + ,'is_for_all' => array('type' => 'integer') + ,'entity' => array('type' => 'integer') ); From 23eea8430937063ae010d08f712a967a48867566 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:34 +0100 Subject: [PATCH 0877/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/fourn/class/fournisseur.facture-rec.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index f592f36ea9f..4b5fd7a64ac 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -7,6 +7,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Marcos García * Copyright (C) 2017-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -189,7 +190,7 @@ class FactureFournisseurRec extends CommonInvoice // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), From e289e36fc1260105f604098aa381930292f670e6 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:36 +0100 Subject: [PATCH 0878/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/hrm/class/evaluation.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index fe3dc78df7f..ccc97cc8f87 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -103,7 +104,7 @@ class Evaluation extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From a2a2b3fa0e980632d34b884b2eed847549cc1b93 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:38 +0100 Subject: [PATCH 0879/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/hrm/class/evaluationdet.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 5a2d230bf59..50335a09417 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -102,7 +103,7 @@ class EvaluationLine extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From 71fa5af141cff4f09f097b629267fa1d24fbd5f0 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:40 +0100 Subject: [PATCH 0880/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/hrm/class/job.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 08ef1dc33de..1e2bc91b1cd 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -101,7 +102,7 @@ class Job extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From 7fb5c23758dae0f277ea43f3f2d25f4bf4078c1e Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:42 +0100 Subject: [PATCH 0881/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/hrm/class/position.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index a65fc43e564..65d1e8c3557 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -101,7 +102,7 @@ class Position extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 2, 'index' => 1, 'css' => 'left', 'comment' => "Id"), From 4c56911ee89ba382a9a5db3364932e77adb47d95 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:44 +0100 Subject: [PATCH 0882/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/hrm/class/skill.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index a7e799e7c47..8a91dbc816b 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -107,7 +108,7 @@ class Skill extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From 3865c099544b01d6a943cfc87be89fc7b8b3a8f2 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:46 +0100 Subject: [PATCH 0883/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/hrm/class/skilldet.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index 905ce049df9..fa9a4736b78 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -101,7 +102,7 @@ class Skilldet extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From 54b2305e74cdd58325aba604d9e955085494047e Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:48 +0100 Subject: [PATCH 0884/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/hrm/class/skillrank.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 4f820c3a62f..103067d9154 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -103,7 +104,7 @@ class SkillRank extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From 2ab17157d25923d16d50bfffa037203522b090c1 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:50 +0100 Subject: [PATCH 0885/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/knowledgemanagement/class/knowledgerecord.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 558922a7af8..74368e35e58 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -99,7 +99,7 @@ class KnowledgeRecord extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From 26e487d69e3db8181d5a34f958a21c563d5670aa Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:52 +0100 Subject: [PATCH 0886/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- .../template/class/myobject.class.php | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 906cdc3d0e2..b0d8ce35479 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2023-2024 Frédéric France * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -115,30 +116,30 @@ class MyObject extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields into database and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'), - 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>10), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'noteditable'=>0, 'default'=>'', 'notnull'=> 1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object', 'validate'=>1), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>'Help text', 'showoncombobox'=>2, 'validate'=>1, 'alwayseditable'=>1), - 'amount' => array('type'=>'price', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount', 'validate'=>1), - 'qty' => array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp', 'validate'=>1), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'picto'=>'company', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>'isModEnabled("societe")', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'OrganizationEventLinkToThirdParty', 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'isModEnabled("project")', 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150'), - 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>60, 'validate'=>1), - 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'validate'=>1, 'cssview'=>'wordbreak'), - 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'validate'=>1, 'cssview'=>'wordbreak'), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>500), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 0, 'position'=>501), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'default' => 1, 'index' => 1, 'position' => 10), + 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'noteditable' => 0, 'default' => '', 'notnull' => 1, 'showoncombobox' => 1, 'index' => 1, 'position' => 20, 'searchall' => 1, 'comment' => 'Reference of object', 'validate' => 1), + 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => 'Help text', 'showoncombobox' => 2, 'validate' => 1, 'alwayseditable' => 1), + 'amount' => array('type' => 'price', 'label' => 'Amount', 'enabled' => 1, 'visible' => 1, 'default' => 'null', 'position' => 40, 'searchall' => 0, 'isameasure' => 1, 'help' => 'Help text for amount', 'validate' => 1), + 'qty' => array('type' => 'real', 'label' => 'Qty', 'enabled' => 1, 'visible' => 1, 'default' => '0', 'position' => 45, 'searchall' => 0, 'isameasure' => 1, 'help' => 'Help text for quantity', 'css' => 'maxwidth75imp', 'validate' => 1), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'picto' => 'company', 'label' => 'ThirdParty', 'visible' => 1, 'enabled' => 'isModEnabled("societe")', 'position' => 50, 'notnull' => -1, 'index' => 1, 'help' => 'OrganizationEventLinkToThirdParty', 'validate' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), + 'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1', 'label' => 'Project', 'picto' => 'project', 'enabled' => 'isModEnabled("project")', 'visible' => -1, 'position' => 52, 'notnull' => -1, 'index' => 1, 'validate' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), + 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => 3, 'position' => 60, 'validate' => 1), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 61, 'validate' => 1, 'cssview' => 'wordbreak'), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 62, 'validate' => 1, 'cssview' => 'wordbreak'), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 500), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'notnull' => 0, 'position' => 501), //'date_validation ' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502), - 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>510, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax150'), - 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511, 'csslist'=>'tdoverflowmax150'), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'picto' => 'user', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 510, 'foreignkey' => 'user.rowid', 'csslist' => 'tdoverflowmax150'), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'picto' => 'user', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 511, 'csslist' => 'tdoverflowmax150'), //'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), - 'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>0, 'notnull'=>0, 'position'=>600), - 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), - 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'notnull'=>-1, 'position'=>1010), - 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=> 1, 'default'=>0, 'index'=>1, 'position'=>2000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 9=>'Canceled'), 'validate'=>1), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => 0, 'notnull' => 0, 'position' => 600), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'notnull' => -1, 'position' => 1010), + 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => 0, 'index' => 1, 'position' => 2000, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 9 => 'Canceled'), 'validate' => 1), ); /** From c7221ff338d73c6a25e81da45d586c5d32963797 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:54 +0100 Subject: [PATCH 0887/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/mrp/class/mo.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 9c1ade49f15..c896d3216cc 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -94,7 +94,7 @@ class Mo extends CommonObject */ /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), From db110db3cb66d14609e2acbd6beca76ade561b80 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:56 +0100 Subject: [PATCH 0888/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/opensurvey/class/opensurveysondage.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 8d0d577cce7..cc28ad8c41d 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2013-2014 Laurent Destailleur * Copyright (C) 2014 Marcos García * Copyright (C) 2020-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -100,7 +101,7 @@ class Opensurveysondage extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'id_sondage' => array('type' => 'varchar(16)', 'label' => 'Idsondage', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => -1,), From 8ff540ecab931fb45a32a4d827b23450b3b6a6cd Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:39:58 +0100 Subject: [PATCH 0889/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/partnership/class/partnership.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 606acb2ecd7..721121b8658 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -104,7 +104,7 @@ class Partnership extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From 9d866f3dc3586a1fe291785bfd3f8a7e8e24cf57 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:01 +0100 Subject: [PATCH 0890/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/product/class/product.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 3b31d2064e3..233b35edb76 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -16,6 +16,7 @@ * Copyright (C) 2017 Gustavo Novaro * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2023 Benjamin Falière + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -582,7 +583,7 @@ class Product extends CommonObject */ /** - * @var array fields of object product + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), From 37b466a1358ce3a25be97342a95d0edeaa3e4693 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:03 +0100 Subject: [PATCH 0891/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/product/class/productcustomerprice.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 03b55d72fcb..4507b0fbdb9 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class ProductCustomerPrice extends CommonObject { /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 4, 'position' => 10, 'notnull' => 1, 'default' => '(PROV)', 'index' => 1, 'searchall' => 1, 'comment' => "Reference of object", 'showoncombobox' => '1', 'noteditable' => 1), From d55ebea8fbb6499b0819cb9521048a5f00e7f886 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:05 +0100 Subject: [PATCH 0892/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/product/class/productfournisseurprice.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index f34ce5f9b64..ef09d7b4307 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -92,7 +92,7 @@ class ProductFournisseurPrice extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => 0,), From 1f328ddd812fd1aeb5d8916b5a9b8559cb2be376 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:07 +0100 Subject: [PATCH 0893/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/product/inventory/class/inventory.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index cb3da2f695a..6ce66586c6c 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -95,7 +96,7 @@ class Inventory extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id',), From 1106b9a40fdcdb15e2cdf1e71c1c77eac3ce9252 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:09 +0100 Subject: [PATCH 0894/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/product/stock/class/entrepot.class.php | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index c3106759f8e..203a3b77b9a 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2016 Francis Appels * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -120,30 +121,30 @@ class Entrepot extends CommonObject /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>10), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>15), - 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25, 'searchall'=>1), - 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35, 'searchall'=>1), - 'lieu' =>array('type'=>'varchar(64)', 'label'=>'LocationSummary', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'showoncombobox'=>2, 'searchall'=>1), - 'fk_parent' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:1:((statut:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label'=>'ParentWarehouse', 'enabled'=>1, 'visible'=>-2, 'position'=>41), - 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>25), - 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-2, 'position'=>45, 'searchall'=>1), - 'zip' =>array('type'=>'varchar(10)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-2, 'position'=>50, 'searchall'=>1), - 'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-2, 'position'=>55, 'searchall'=>1), - 'fk_departement' =>array('type'=>'integer', 'label'=>'State', 'enabled'=>1, 'visible'=>0, 'position'=>60), - 'fk_pays' =>array('type'=>'integer:Ccountry:core/class/ccountry.class.php', 'label'=>'Country', 'enabled'=>1, 'visible'=>-1, 'position'=>65), - 'phone' =>array('type'=>'varchar(20)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>-2, 'position'=>70, 'searchall'=>1), - 'fax' =>array('type'=>'varchar(20)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>-2, 'position'=>75, 'searchall'=>1), + 'rowid' => array('type' => 'integer', 'label' => 'ID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 10), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'default' => 1, 'notnull' => 1, 'index' => 1, 'position' => 15), + 'ref' => array('type' => 'varchar(255)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'showoncombobox' => 1, 'position' => 25, 'searchall' => 1), + 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => -2, 'position' => 35, 'searchall' => 1), + 'lieu' => array('type' => 'varchar(64)', 'label' => 'LocationSummary', 'enabled' => 1, 'visible' => 1, 'position' => 40, 'showoncombobox' => 2, 'searchall' => 1), + 'fk_parent' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php:1:((statut:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label' => 'ParentWarehouse', 'enabled' => 1, 'visible' => -2, 'position' => 41), + 'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Project', 'enabled' => '$conf->project->enabled', 'visible' => -1, 'position' => 25), + 'address' => array('type' => 'varchar(255)', 'label' => 'Address', 'enabled' => 1, 'visible' => -2, 'position' => 45, 'searchall' => 1), + 'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -2, 'position' => 50, 'searchall' => 1), + 'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -2, 'position' => 55, 'searchall' => 1), + 'fk_departement' => array('type' => 'integer', 'label' => 'State', 'enabled' => 1, 'visible' => 0, 'position' => 60), + 'fk_pays' => array('type' => 'integer:Ccountry:core/class/ccountry.class.php', 'label' => 'Country', 'enabled' => 1, 'visible' => -1, 'position' => 65), + 'phone' => array('type' => 'varchar(20)', 'label' => 'Phone', 'enabled' => 1, 'visible' => -2, 'position' => 70, 'searchall' => 1), + 'fax' => array('type' => 'varchar(20)', 'label' => 'Fax', 'enabled' => 1, 'visible' => -2, 'position' => 75, 'searchall' => 1), //'fk_user_author' =>array('type'=>'integer', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-2, 'position'=>82), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>300), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>301), - 'warehouse_usage' => array('type'=>'integer', 'label' => 'WarehouseUsage', 'enabled'=>'getDolGlobalInt("MAIN_FEATURES_LEVEL")', 'visible'=>1, 'position'=>400, 'arrayofkeyval'=>array(1=>'InternalWarehouse', 2=>'ExternalWarehouse')), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'position' => 300), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 301), + 'warehouse_usage' => array('type' => 'integer', 'label' => 'WarehouseUsage', 'enabled' => 'getDolGlobalInt("MAIN_FEATURES_LEVEL")', 'visible' => 1, 'position' => 400, 'arrayofkeyval' => array(1 => 'InternalWarehouse', 2 => 'ExternalWarehouse')), //'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000), //'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPDF', 'enabled'=>1, 'visible'=>0, 'position'=>1010), - 'statut' =>array('type'=>'tinyint(4)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>500, 'css'=>'minwidth50'), + 'statut' => array('type' => 'tinyint(4)', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'position' => 500, 'css' => 'minwidth50'), ); /** @@ -825,7 +826,7 @@ class Entrepot extends CommonObject global $action; $hookmanager->initHooks(array('warehousedao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result, 'withpicto' => $withpicto, 'option' => $option, 'showfullpath' => $showfullpath, 'notooltip'=> $notooltip); + $parameters = array('id' => $this->id, 'getnomurl' => &$result, 'withpicto' => $withpicto, 'option' => $option, 'showfullpath' => $showfullpath, 'notooltip' => $notooltip); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; From b54f4b4af5d4a2d0daca161d85651e2013f8a701 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:11 +0100 Subject: [PATCH 0895/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- .../product/stock/class/productlot.class.php | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 28f8b53c88b..8e48d272407 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023 Gauthier VERDOL + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -98,28 +99,28 @@ class Productlot extends CommonObject */ /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'), - 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>5, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'picto' => 'product', 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'maxwidth150'), - 'batch' => array('type'=>'varchar(30)', 'label'=>'Batch', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'comment'=>'Batch', 'searchall'=>1, 'picto'=>'lot', 'validate'=>1), - 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), - 'sellby' => array('type'=>'date', 'label'=>'SellByDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_SELLBY)?1:0', 'visible'=>1, 'notnull'=>0, 'position'=>60), - 'eatby' => array('type'=>'date', 'label'=>'EatByDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_EATBY)?1:0', 'visible'=>1, 'notnull'=>0, 'position'=>62), - 'eol_date' => array('type'=>'date', 'label'=>'EndOfLife', 'enabled'=>'getDolGlobalInt("PRODUCT_LOT_ENABLE_QUALITY_CONTROL")?1:0', 'visible'=>'getDolGlobalInt("PRODUCT_LOT_ENABLE_QUALITY_CONTROL")?5:0', 'position'=>70), - 'manufacturing_date' => array('type'=>'date', 'label'=>'ManufacturingDate', 'enabled'=>'getDolGlobalInt("PRODUCT_LOT_ENABLE_TRACEABILITY")?1:0', 'visible'=>'getDolGlobalInt("PRODUCT_LOT_ENABLE_TRACEABILITY")?5:0', 'position'=>80), - 'scrapping_date' => array('type'=>'date', 'label'=>'DestructionDate', 'enabled'=>'getDolGlobalInt("PRODUCT_LOT_ENABLE_TRACEABILITY")?1:0', 'visible'=>'getDolGlobalInt("PRODUCT_LOT_ENABLE_TRACEABILITY")?5:0', 'position'=>90), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), + 'fk_product' => array('type' => 'integer:Product:product/class/product.class.php', 'label' => 'Product', 'enabled' => 1, 'visible' => 1, 'position' => 5, 'notnull' => 1, 'index' => 1, 'searchall' => 1, 'picto' => 'product', 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'maxwidth150'), + 'batch' => array('type' => 'varchar(30)', 'label' => 'Batch', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 1, 'index' => 1, 'position' => 10, 'comment' => 'Batch', 'searchall' => 1, 'picto' => 'lot', 'validate' => 1), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'default' => 1, 'notnull' => 1, 'index' => 1, 'position' => 20), + 'sellby' => array('type' => 'date', 'label' => 'SellByDate', 'enabled' => 'empty($conf->global->PRODUCT_DISABLE_SELLBY)?1:0', 'visible' => 1, 'notnull' => 0, 'position' => 60), + 'eatby' => array('type' => 'date', 'label' => 'EatByDate', 'enabled' => 'empty($conf->global->PRODUCT_DISABLE_EATBY)?1:0', 'visible' => 1, 'notnull' => 0, 'position' => 62), + 'eol_date' => array('type' => 'date', 'label' => 'EndOfLife', 'enabled' => 'getDolGlobalInt("PRODUCT_LOT_ENABLE_QUALITY_CONTROL")?1:0', 'visible' => 'getDolGlobalInt("PRODUCT_LOT_ENABLE_QUALITY_CONTROL")?5:0', 'position' => 70), + 'manufacturing_date' => array('type' => 'date', 'label' => 'ManufacturingDate', 'enabled' => 'getDolGlobalInt("PRODUCT_LOT_ENABLE_TRACEABILITY")?1:0', 'visible' => 'getDolGlobalInt("PRODUCT_LOT_ENABLE_TRACEABILITY")?5:0', 'position' => 80), + 'scrapping_date' => array('type' => 'date', 'label' => 'DestructionDate', 'enabled' => 'getDolGlobalInt("PRODUCT_LOT_ENABLE_TRACEABILITY")?1:0', 'visible' => 'getDolGlobalInt("PRODUCT_LOT_ENABLE_TRACEABILITY")?5:0', 'position' => 90), //'commissionning_date' => array('type'=>'date', 'label'=>'FirstUseDate', 'enabled'=>'getDolGlobalInt("PRODUCT_LOT_ENABLE_TRACEABILITY", 0)', 'visible'=>5, 'position'=>100), - 'qc_frequency' => array('type'=>'integer', 'label'=>'QCFrequency', 'enabled'=>'getDolGlobalInt("PRODUCT_LOT_ENABLE_QUALITY_CONTROL")?1:0', 'visible'=>'getDolGlobalInt("PRODUCT_LOT_ENABLE_QUALITY_CONTROL")?5:0', 'position'=>110), - 'lifetime' => array('type'=>'integer', 'label'=>'Lifetime', 'enabled'=>'getDolGlobalInt("PRODUCT_LOT_ENABLE_QUALITY_CONTROL")?1:0', 'visible'=>'getDolGlobalInt("PRODUCT_LOT_ENABLE_QUALITY_CONTROL")?5:0', 'position'=>110), + 'qc_frequency' => array('type' => 'integer', 'label' => 'QCFrequency', 'enabled' => 'getDolGlobalInt("PRODUCT_LOT_ENABLE_QUALITY_CONTROL")?1:0', 'visible' => 'getDolGlobalInt("PRODUCT_LOT_ENABLE_QUALITY_CONTROL")?5:0', 'position' => 110), + 'lifetime' => array('type' => 'integer', 'label' => 'Lifetime', 'enabled' => 'getDolGlobalInt("PRODUCT_LOT_ENABLE_QUALITY_CONTROL")?1:0', 'visible' => 'getDolGlobalInt("PRODUCT_LOT_ENABLE_QUALITY_CONTROL")?5:0', 'position' => 110), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 215), 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => -2, 'position' => 310), - 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>500), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), - 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510, 'foreignkey'=>'llx_user.rowid'), - 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511), - 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000) + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 500), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 501), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 510, 'foreignkey' => 'llx_user.rowid'), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 511), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000) ); /** @@ -161,7 +162,7 @@ class Productlot extends CommonObject */ public $import_key; - public $stats_supplier_order=array(); + public $stats_supplier_order = array(); /** From 58df99e873119def42b67aa40b74ce7412d86d15 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:13 +0100 Subject: [PATCH 0896/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- .../product/stock/stocktransfer/class/stocktransfer.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index 7ba9d0105dc..d90a892382c 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2022-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -123,7 +124,7 @@ class StockTransfer extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'comment' => "Id"), From e996c4028a4982279a96d2e9cd474548b3722ce5 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:15 +0100 Subject: [PATCH 0897/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- .../stock/stocktransfer/class/stocktransferline.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php index f726293c5e4..5a71cd70afd 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) ---Put here your own copyright and developer email--- * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -93,7 +94,7 @@ class StockTransferLine extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'comment' => "Id"), From d62e8f78b46415d00541880c8c7b725d3f043ac3 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:17 +0100 Subject: [PATCH 0898/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/projet/class/project.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 763382fd70c..f245a9c727a 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -9,6 +9,7 @@ * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Gauthier VERDOL * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -292,7 +293,7 @@ class Project extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'ID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), From 9d0e78985ca46f2efc7f1e8138517b60b4d4adfc Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:19 +0100 Subject: [PATCH 0899/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/recruitment/class/recruitmentcandidature.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index bf874a1fa1f..8ccc0a498d0 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -106,7 +107,7 @@ class RecruitmentCandidature extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'comment' => "Id"), From 5985ab8ce06781bebb92328438b69ce416b92982 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:21 +0100 Subject: [PATCH 0900/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/recruitment/class/recruitmentjobposition.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index a288bc65f97..d035b8bd5eb 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2020 Laurent Destailleur /* Copyright (C) 2022 Alexandre Spangaro * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -112,7 +113,7 @@ class RecruitmentJobPosition extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'comment' => "Id"), From 46a275c376c07ef517177d43a80ea4e637ff09fb Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:23 +0100 Subject: [PATCH 0901/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/salaries/class/paymentsalary.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 0de7eaaf457..70a714f02f3 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -152,7 +153,7 @@ class PaymentSalary extends CommonObject public $datev = ''; /** - * @var array + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), From c370ad8dac385568a5b21247643a31c2f4dd7a6c Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:25 +0100 Subject: [PATCH 0902/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/societe/class/companypaymentmode.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 99901fc00c8..9494f434c3c 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,7 +83,7 @@ class CompanyPaymentMode extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' =>array('type'=>'integer', 'label'=>'Rowid', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>10), From c36a03d7e085fc9ed538b51e24212985d92820c9 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:27 +0100 Subject: [PATCH 0903/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index eedaa168c37..8150efa1be1 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -188,7 +188,7 @@ class Societe extends CommonObject */ /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), From d491c9f264148725fa9a55a99273052f492dbe94 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:29 +0100 Subject: [PATCH 0904/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/ticket/class/cticketcategory.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index 1bc4f15c5bf..963c7647934 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) ---Put here your own copyright and developer email--- * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -97,7 +98,7 @@ class CTicketCategory extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), From 13fcaf19f2a018c367cb8cb41d8896251b3047f9 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:31 +0100 Subject: [PATCH 0905/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/variants/class/ProductAttribute.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/variants/class/ProductAttribute.class.php b/htdocs/variants/class/ProductAttribute.class.php index f0014a0a7ab..ea66396479c 100644 --- a/htdocs/variants/class/ProductAttribute.class.php +++ b/htdocs/variants/class/ProductAttribute.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2016 Marcos García * Copyright (C) 2022 Open-Dsi * Copyright (C) 2023 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -97,7 +98,7 @@ class ProductAttribute extends CommonObject * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. */ /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), From c58a2db86b94d85f3fd0cd7e8b8e4932aee255da Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:33 +0100 Subject: [PATCH 0906/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/variants/class/ProductAttributeValue.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/variants/class/ProductAttributeValue.class.php b/htdocs/variants/class/ProductAttributeValue.class.php index 7636df31290..556dbbfac30 100644 --- a/htdocs/variants/class/ProductAttributeValue.class.php +++ b/htdocs/variants/class/ProductAttributeValue.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2022 Open-Dsi + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -75,7 +76,7 @@ class ProductAttributeValue extends CommonObjectLine * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. */ /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), From b1148cf2626c2730826c5c1efbac6d3204b4a9f5 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:35 +0100 Subject: [PATCH 0907/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/webhook/class/target.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 484991e1dc7..d7bbc3af3a6 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) ---Put here your own copyright and developer email--- * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -100,7 +101,7 @@ class Target extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From 8cf93e2cb323a0fe537db76a8d52dad84f776c77 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:37 +0100 Subject: [PATCH 0908/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/website/class/websitepage.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 7a0a42a0f9f..f005727a326 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2020 Nicolas ZABOURI * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -162,7 +163,7 @@ class WebsitePage extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), From 6551b752d6163d98d3e48a25b127b128e34f6746 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:39 +0100 Subject: [PATCH 0909/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/workstation/class/workstation.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index ad650d6c7b0..f34232c86d4 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2020 Gauthier VERDOL * Copyright (C) 2023-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -95,7 +96,7 @@ class Workstation extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), From 23ac94ac49bc9823c2f1d951c4e83c438a8e9237 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:41 +0100 Subject: [PATCH 0910/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/workstation/class/workstationresource.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/workstation/class/workstationresource.class.php b/htdocs/workstation/class/workstationresource.class.php index c50a8417e90..56df285ace1 100644 --- a/htdocs/workstation/class/workstationresource.class.php +++ b/htdocs/workstation/class/workstationresource.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2020 Gauthier VERDOL + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,7 +36,7 @@ class WorkstationResource extends CommonObject public $element = 'workstationresource'; /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'fk_workstation' => array('type' => 'integer'), From b3aaa6c4e7c0e3a24a853754a7e7af75689205b4 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:43 +0100 Subject: [PATCH 0911/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/workstation/class/workstationusergroup.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/workstation/class/workstationusergroup.class.php b/htdocs/workstation/class/workstationusergroup.class.php index e53bee221ef..7fed35b4b14 100644 --- a/htdocs/workstation/class/workstationusergroup.class.php +++ b/htdocs/workstation/class/workstationusergroup.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2020 Gauthier VERDOL + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,7 +35,7 @@ class WorkstationUserGroup extends CommonObject public $element = 'workstationusergroup'; /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'fk_workstation' => array('type' => 'integer'), From 5027cd4de9bb27daee12b2cac23878e4eca93e8c Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:40:45 +0100 Subject: [PATCH 0912/1862] Fix: Repeat fields typing in CommonClass children # Fix: Repeat fields typing in CommonClass children phpstan needs typing to be 'co-variant' and therefore typing must be repeated as the method is not to initialise the property in the constructor, but to override the proparty by a 'local' definition in the child class --- htdocs/zapier/class/hook.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index b5a25699205..9e953292cd6 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2024 MDW * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -80,7 +81,7 @@ class Hook extends CommonObject */ /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array( From 6b34b8757f9a7821e1cde07420a2602920e2987e Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:43:57 +0100 Subject: [PATCH 0913/1862] fixup! Change logic to help static tool analysis --- htdocs/admin/modulehelp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 22165d2c305..8116316dfa1 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -169,7 +169,7 @@ foreach ($modulesdir as $dir) { $familykey = key($objMod->familyinfo); } else { $familykey = $objMod->family; - if (empty($familykey)) { + if (empty($familykey) || $familykey === null) { $familykey = 'other'; } } From 8e422f15e38b5d65ec0d88c216b5a85074c2ea65 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Mon, 11 Mar 2024 18:00:43 +0100 Subject: [PATCH 0914/1862] New update in generate_content in module Ai --- htdocs/ai/class/ai.class.php | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/htdocs/ai/class/ai.class.php b/htdocs/ai/class/ai.class.php index 399b3adb1ee..5b4f4003248 100644 --- a/htdocs/ai/class/ai.class.php +++ b/htdocs/ai/class/ai.class.php @@ -20,6 +20,8 @@ * or see https://www.gnu.org/ */ require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; + /** * Class for AI @@ -116,30 +118,27 @@ class Ai $fullInstructions = $prePrompt.' '.$instructions.' .'.$postPrompt; // TODO Replace this with a simple call of getDolURLContent(); - $ch = curl_init($this->apiEndpoint); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([ + // $ch = curl_init($this->apiEndpoint); + // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + //curl_setopt($ch, CURLOPT_HTTPHEADER, [ + $payload = json_encode([ 'messages' => [ ['role' => 'user', 'content' => $fullInstructions] ], 'model' => $model - ])); - curl_setopt($ch, CURLOPT_HTTPHEADER, [ + ]); + + $headers = ([ 'Authorization: Bearer ' . $this->apiKey, 'Content-Type: application/json' ]); + $response = getURLContent($this->apiEndpoint, 'POST', $payload, $headers); - $response = curl_exec($ch); - if (curl_errno($ch)) { - throw new Exception('cURL error: ' . curl_error($ch)); - } - - $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - if ($statusCode != 200) { - throw new Exception('API request failed with status code ' . $statusCode); + if ($response['http_code'] != 200) { + throw new Exception('API request failed with status code ' . $response['http_code']); } // Decode JSON response - $decodedResponse = json_decode($response, true); + $decodedResponse = json_decode($response['content'], true); // Extraction content $generatedEmailContent = $decodedResponse['choices'][0]['message']['content']; @@ -147,8 +146,6 @@ class Ai return $generatedEmailContent; } catch (Exception $e) { return array('error' => true, 'message' => $e->getMessage()); - } finally { - curl_close($ch); } } } From fc6c93877b369d6974c0732072882de70c071971 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 18:02:19 +0100 Subject: [PATCH 0915/1862] fixup! Change logic to help static tool analysis --- htdocs/admin/modulehelp.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 8116316dfa1..e076187e563 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -169,9 +169,9 @@ foreach ($modulesdir as $dir) { $familykey = key($objMod->familyinfo); } else { $familykey = $objMod->family; - if (empty($familykey) || $familykey === null) { - $familykey = 'other'; - } + } + if (empty($familykey) || $familykey === null) { + $familykey = 'other'; } $moduleposition = ($objMod->module_position ? $objMod->module_position : '50'); From d916a70acff5eb14cb20c564a6d8014e056dd5e4 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Mon, 11 Mar 2024 18:03:33 +0100 Subject: [PATCH 0916/1862] Remove comments --- htdocs/ai/class/ai.class.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/ai/class/ai.class.php b/htdocs/ai/class/ai.class.php index 5b4f4003248..ee3970912b6 100644 --- a/htdocs/ai/class/ai.class.php +++ b/htdocs/ai/class/ai.class.php @@ -117,10 +117,7 @@ class Ai } $fullInstructions = $prePrompt.' '.$instructions.' .'.$postPrompt; - // TODO Replace this with a simple call of getDolURLContent(); - // $ch = curl_init($this->apiEndpoint); - // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - //curl_setopt($ch, CURLOPT_HTTPHEADER, [ + $payload = json_encode([ 'messages' => [ ['role' => 'user', 'content' => $fullInstructions] From 8e1b6543b8e9d0f5ea24abd8afddc05247feda5a Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:57:54 +0100 Subject: [PATCH 0917/1862] Qual: Typing : make all $module_parts fields optional and add missing # Qual: Typing : make all $module_parts fields optional and add missing According to the initialisations of the modules all fields for $module_parts are optional and some keys were missing in the definition. This is updated. --- htdocs/core/modules/DolibarrModules.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 2994a5c58b0..15fbe56aa32 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2014 Raphaël Doursenaud * Copyright (C) 2018 Josep Lluís Amador * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -140,7 +141,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it public $menu = array(); /** - * @var array{triggers:int,login:int,substitutions:int,menus:int,theme:int,tpl:int,barcode:int,models:int,css:string,js:string,hooks:string[]} Module parts + * @var array{triggers?:int<0,1>,login?:int<0,1>,substitutions?:int<0,1>,menus?:int<0,1>,theme?:int<0,1>,tpl?:int<0,1>,barcode?:int<0,1>,models?:int<0,1>,printing?:int<0,1>,css?:string[],js?:string[],hooks?:array{data:string[],entity:string},moduleforexternal?:int<0,1>,websitetemplates?:int<0,1>,contactelement?:int<0,1>} Module parts * array( * // Set this to 1 if module has its own trigger directory (/mymodule/core/triggers) * 'triggers' => 0, From 7bcb635a4e1de8b3a5e38af195d51825eb8aed04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 18:13:48 +0100 Subject: [PATCH 0918/1862] clean code and phpdoc --- .../core/modules/asset/mod_asset_standard.php | 6 +++--- .../barcode/mod_barcode_product_standard.php | 4 ++-- .../mod_barcode_thirdparty_standard.php | 2 +- htdocs/core/modules/bom/mod_bom_advanced.php | 4 ++-- htdocs/core/modules/bom/mod_bom_standard.php | 11 +++++----- .../modules/cheque/mod_chequereceipt_mint.php | 18 ++--------------- .../cheque/mod_chequereceipt_thyme.php | 17 +--------------- .../modules/commande/mod_commande_marbre.php | 20 +++---------------- .../modules/commande/mod_commande_saphir.php | 19 ++---------------- .../modules/contract/mod_contract_magre.php | 16 +-------------- .../modules/contract/mod_contract_serpis.php | 19 ++---------------- .../modules/delivery/mod_delivery_jade.php | 20 +++---------------- .../modules/delivery/mod_delivery_saphir.php | 20 +++---------------- .../expedition/mod_expedition_ribera.php | 18 ++--------------- .../expedition/mod_expedition_safor.php | 19 +++--------------- .../expensereport/mod_expensereport_jade.php | 5 +++-- .../expensereport/mod_expensereport_sand.php | 5 +++-- .../core/modules/facture/mod_facture_mars.php | 5 +++-- .../modules/facture/mod_facture_mercure.php | 3 ++- .../modules/facture/mod_facture_terre.php | 5 +++-- .../societe/mod_codeclient_elephant.php | 2 +- .../societe/mod_codeclient_leopard.php | 4 ++-- .../modules/societe/mod_codeclient_monkey.php | 2 +- 23 files changed, 54 insertions(+), 190 deletions(-) diff --git a/htdocs/core/modules/asset/mod_asset_standard.php b/htdocs/core/modules/asset/mod_asset_standard.php index 7c34cc27931..1c957de8724 100644 --- a/htdocs/core/modules/asset/mod_asset_standard.php +++ b/htdocs/core/modules/asset/mod_asset_standard.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2022 Frédéric France + * Copyright (C) 2022-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -78,7 +78,7 @@ class mod_asset_standard extends ModeleNumRefAsset * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Asset $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -118,7 +118,7 @@ class mod_asset_standard extends ModeleNumRefAsset /** * Return next free value * - * @param Object $object Object we need next value for + * @param Asset $object Object we need next value for * @return string|-1 Next value if OK, -1 if KO */ public function getNextValue($object) diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index c2df3f7c3a0..2190150ec62 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -127,8 +127,8 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode /** * Return literal barcode type code from numerical rowid type of barcode * - * @param Database $db Database - * @param int $type Type of barcode (EAN, ISBN, ...) as rowid + * @param DoliDB $db Database + * @param int $type Type of barcode (EAN, ISBN, ...) as rowid * @return string */ public function literalBarcodeType($db, $type = 0) diff --git a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php index 118e87cbc3a..6825c1e53bb 100644 --- a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php @@ -139,7 +139,7 @@ class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode /** * Return literal barcode type code from numerical rowid type of barcode * - * @param Database $db Database + * @param DoliDB $db Database * @param int $type Type of barcode (EAN, ISBN, ...) as rowid * @return string */ diff --git a/htdocs/core/modules/bom/mod_bom_advanced.php b/htdocs/core/modules/bom/mod_bom_advanced.php index 0e9f3d4f977..2428e79595d 100644 --- a/htdocs/core/modules/bom/mod_bom_advanced.php +++ b/htdocs/core/modules/bom/mod_bom_advanced.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -119,7 +119,7 @@ class mod_bom_advanced extends ModeleNumRefBoms * Return next free value * * @param Product $objprod Object product - * @param Object $object Object we need next value for + * @param Bom $object Object we need next value for * @return string|0 Next value if OK, 0 if KO */ public function getNextValue($objprod, $object) diff --git a/htdocs/core/modules/bom/mod_bom_standard.php b/htdocs/core/modules/bom/mod_bom_standard.php index 1e26ba2254a..f4ba8293423 100644 --- a/htdocs/core/modules/bom/mod_bom_standard.php +++ b/htdocs/core/modules/bom/mod_bom_standard.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -76,8 +77,8 @@ class mod_bom_standard extends ModeleNumRefBoms * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for - * @return boolean false if conflict, true if ok + * @param Bom $object Object we need next value for + * @return boolean false if conflict, true if ok */ public function canBeActivated($object) { @@ -112,9 +113,9 @@ class mod_bom_standard extends ModeleNumRefBoms /** * Return next free value * - * @param Product $objprod Object product - * @param Object $object Object we need next value for - * @return string|-1 Next value if OK, -1 if KO + * @param Product $objprod Object product + * @param Bom $object Object we need next value for + * @return string|-1 Next value if OK, -1 if KO */ public function getNextValue($objprod, $object) { diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php index 5106697211d..c42806e603e 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -73,7 +74,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param RemiseCheque $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -150,19 +151,4 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts dol_syslog(__METHOD__." return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next free value - * - * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search - * @return string Next free value - */ - public function chequereceipt_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } } diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php index 5a2ae083d2f..44eff63035d 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php @@ -1,6 +1,6 @@ - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -131,19 +131,4 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts return $numFinal; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next free value - * - * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search - * @return string Next free value - */ - public function chequereceipt_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } } diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php index ad664e10e3a..8583d30d46c 100644 --- a/htdocs/core/modules/commande/mod_commande_marbre.php +++ b/htdocs/core/modules/commande/mod_commande_marbre.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -88,7 +89,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Commande $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -125,7 +126,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes * Return next free value * * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for + * @param Commande $object Object we need next value for * @return string|-1 Value if OK, -1 if KO */ public function getNextValue($objsoc, $object) @@ -165,19 +166,4 @@ class mod_commande_marbre extends ModeleNumRefCommandes dol_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next free value - * - * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search - * @return string|-1 Next free value, -1 if KO - */ - public function commande_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } } diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php index 2cc4331e98e..f727b9dff70 100644 --- a/htdocs/core/modules/commande/mod_commande_saphir.php +++ b/htdocs/core/modules/commande/mod_commande_saphir.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -119,7 +119,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes * Return next free value * * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for + * @param Commande $object Object we need next value for * @return string|0 Next value if OK, 0 if KO */ public function getNextValue($objsoc, $object) @@ -149,19 +149,4 @@ class mod_commande_saphir extends ModeleNumRefCommandes return $numFinal; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next free value - * - * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search - * @return string Next free value - */ - public function commande_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } } diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php index f68e180a65c..ebd7957780f 100644 --- a/htdocs/core/modules/contract/mod_contract_magre.php +++ b/htdocs/core/modules/contract/mod_contract_magre.php @@ -105,7 +105,7 @@ class mod_contract_magre extends ModelNumRefContracts * Return next value * * @param Societe $objsoc third party object - * @param Object $contract contract object + * @param Contrat $contract contract object * @return string|0 Next value if OK, 0 if KO */ public function getNextValue($objsoc, $contract) @@ -125,18 +125,4 @@ class mod_contract_magre extends ModelNumRefContracts return $numFinal; } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next value - * - * @param Societe $objsoc third party object - * @param Object $objforref contract object - * @return string|0 Value if OK, 0 if KO - */ - public function contract_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } } diff --git a/htdocs/core/modules/contract/mod_contract_serpis.php b/htdocs/core/modules/contract/mod_contract_serpis.php index fe155099ac7..d78c6ebbf89 100644 --- a/htdocs/core/modules/contract/mod_contract_serpis.php +++ b/htdocs/core/modules/contract/mod_contract_serpis.php @@ -76,7 +76,7 @@ class mod_contract_serpis extends ModelNumRefContracts /** * Test if existing numbers make problems with numbering * - * @param Object $object Object we need next value for + * @param Contrat $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -113,7 +113,7 @@ class mod_contract_serpis extends ModelNumRefContracts * Return next value * * @param Societe $objsoc third party object - * @param Object $contract contract object + * @param Contrat $contract contract object * @return string|-1 Value if OK, -1 if KO */ public function getNextValue($objsoc, $contract) @@ -151,19 +151,4 @@ class mod_contract_serpis extends ModelNumRefContracts dol_syslog("mod_contract_serpis::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next value - * - * @param Societe $objsoc third party object - * @param Object $objforref contract object - * @return string|-1 Value if OK, -1 if KO - */ - public function contract_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } } diff --git a/htdocs/core/modules/delivery/mod_delivery_jade.php b/htdocs/core/modules/delivery/mod_delivery_jade.php index c29a5f7f4bd..95e3e0ff18e 100644 --- a/htdocs/core/modules/delivery/mod_delivery_jade.php +++ b/htdocs/core/modules/delivery/mod_delivery_jade.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -86,7 +87,7 @@ class mod_delivery_jade extends ModeleNumRefDeliveryOrder * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Delivery $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -126,7 +127,7 @@ class mod_delivery_jade extends ModeleNumRefDeliveryOrder * Return next free value * * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for + * @param Delivery $object Object we need next value for * @return string|-1 Value if OK, -1 if KO */ public function getNextValue($objsoc, $object) @@ -168,19 +169,4 @@ class mod_delivery_jade extends ModeleNumRefDeliveryOrder dol_syslog("mod_delivery_jade::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next free ref - * - * @param Societe $objsoc Object thirdparty - * @param Object $object Object livraison - * @return string|-1 Value if OK, -1 if KO - */ - public function delivery_get_num($objsoc = 0, $object = '') - { - // phpcs:enable - return $this->getNextValue($objsoc, $object); - } } diff --git a/htdocs/core/modules/delivery/mod_delivery_saphir.php b/htdocs/core/modules/delivery/mod_delivery_saphir.php index 209d848ec31..4d6bdb7c716 100644 --- a/htdocs/core/modules/delivery/mod_delivery_saphir.php +++ b/htdocs/core/modules/delivery/mod_delivery_saphir.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -121,7 +122,7 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder * Return next value * * @param Societe $objsoc Object third party - * @param Object $object Object delivery + * @param Delivery $object Object delivery * @return string|0 Value if OK, 0 if KO */ public function getNextValue($objsoc, $object) @@ -148,26 +149,11 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder * Return next free value * * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search + * @param Delivery $objforref Object for number to search * @return string|0 Next free value, 0 if KO */ public function getNumRef($objsoc, $objforref) { return $this->getNextValue($objsoc, $objforref); } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next free ref - * - * @param Societe $objsoc Object thirdparty - * @param Object $object Object livraison - * @return string|0 Value if OK, 0 if KO - */ - public function delivery_get_num($objsoc = 0, $object = '') - { - // phpcs:enable - return $this->getNextValue($objsoc, $object); - } } diff --git a/htdocs/core/modules/expedition/mod_expedition_ribera.php b/htdocs/core/modules/expedition/mod_expedition_ribera.php index 2d8c5f7f138..4d85f303169 100644 --- a/htdocs/core/modules/expedition/mod_expedition_ribera.php +++ b/htdocs/core/modules/expedition/mod_expedition_ribera.php @@ -1,6 +1,6 @@ - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -117,7 +117,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition * Return next value * * @param Societe $objsoc Third party object - * @param Object $shipment Shipment object + * @param Expedition $shipment Shipment object * @return string|0 Value if OK, 0 if KO */ public function getNextValue($objsoc, $shipment) @@ -139,18 +139,4 @@ class mod_expedition_ribera extends ModelNumRefExpedition return $numFinal; } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next free value - * - * @param Societe $objsoc Third party object - * @param Object $objforref Shipment object - * @return string|0 Next free value, 0 if KO - */ - public function expedition_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } } diff --git a/htdocs/core/modules/expedition/mod_expedition_safor.php b/htdocs/core/modules/expedition/mod_expedition_safor.php index 579ba6a4d4f..98f20203fa2 100644 --- a/htdocs/core/modules/expedition/mod_expedition_safor.php +++ b/htdocs/core/modules/expedition/mod_expedition_safor.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -81,7 +82,7 @@ class mod_expedition_safor extends ModelNumRefExpedition /** * Test if existing numbers make problems with numbering * - * @param Object $object Object we need next value for + * @param Expedition $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -118,7 +119,7 @@ class mod_expedition_safor extends ModelNumRefExpedition * Return next value * * @param Societe $objsoc Third party object - * @param Object $shipment Shipment object + * @param Expedition $shipment Shipment object * @return string|-1 Value if OK, -1 if KO */ public function getNextValue($objsoc, $shipment) @@ -156,18 +157,4 @@ class mod_expedition_safor extends ModelNumRefExpedition dol_syslog("mod_expedition_safor::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next free value - * - * @param Societe $objsoc Third party object - * @param Object $objforref Shipment object - * @return string|-1 Next free value, -1 if KO - */ - public function expedition_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } } diff --git a/htdocs/core/modules/expensereport/mod_expensereport_jade.php b/htdocs/core/modules/expensereport/mod_expensereport_jade.php index 60de9d22014..ddac61f46c5 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_jade.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_jade.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,8 +83,8 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for - * @return boolean false if conflict, true if ok + * @param ExpenseReport $object Object we need next value for + * @return boolean false if conflict, true if ok */ public function canBeActivated($object) { diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index 8a0165e3799..5bb216e5f65 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -120,8 +121,8 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport /** * Return next free value * - * @param Object $object Object we need next value for - * @return string|0 Next value if OK, 0 if KO + * @param ExpenseReport $object Object we need next value for + * @return string|0 Next value if OK, 0 if KO */ public function getNextValue($object) { diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index 10d42804a9c..71f9fb27eec 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -96,7 +97,7 @@ class mod_facture_mars extends ModeleNumRefFactures * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Facture $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -243,7 +244,7 @@ class mod_facture_mars extends ModeleNumRefFactures * Return next free value * * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search + * @param Facture $objforref Object for number to search * @param string $mode 'next' for next value or 'last' for last value * @return string Next free value */ diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index 1aae660c1a9..8d1194b7d4a 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -5,6 +5,7 @@ * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2013 uanjo Menent * Copyright (C) 2022 Anthony Berton + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -178,7 +179,7 @@ class mod_facture_mercure extends ModeleNumRefFactures * Return next free value * * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search + * @param Facture $objforref Object for number to search * @param string $mode 'next' for next value or 'last' for last value * @return string|0 Next free value, 0 if KO */ diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index 3336340cd63..bf116118024 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2015 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -112,7 +113,7 @@ class mod_facture_terre extends ModeleNumRefFactures * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Facture $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -283,7 +284,7 @@ class mod_facture_terre extends ModeleNumRefFactures * Return next free value * * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search + * @param Facture $objforref Object for number to search * @param string $mode 'next' for next value or 'last' for last value * @return string|int<-1,0> Next free value, -1 or 0 if error */ diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index 9039c9a2907..c0787d83fe9 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -125,7 +125,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode * Return an example of result returned by getNextValue * * @param Translate $langs Object langs - * @param societe $objsoc Object thirdparty + * @param Societe $objsoc Object thirdparty * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @return string Return string example */ diff --git a/htdocs/core/modules/societe/mod_codeclient_leopard.php b/htdocs/core/modules/societe/mod_codeclient_leopard.php index 9729c15e7d7..4d4870a3f35 100644 --- a/htdocs/core/modules/societe/mod_codeclient_leopard.php +++ b/htdocs/core/modules/societe/mod_codeclient_leopard.php @@ -77,7 +77,7 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode * Return an example of result returned by getNextValue * * @param Translate $langs Object langs - * @param societe $objsoc Object thirdparty + * @param Societe $objsoc Object thirdparty * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @return string Return string example */ @@ -89,7 +89,7 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode /** * Return an example of result returned by getNextValue * - * @param societe $objsoc Object thirdparty + * @param Societe $objsoc Object thirdparty * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @return string Return next value */ diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index 1d843fd007e..7c9457bd904 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -77,7 +77,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode * Return an example of result returned by getNextValue * * @param Translate $langs Object langs - * @param societe $objsoc Object thirdparty + * @param Societe $objsoc Object thirdparty * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @return string Return string example */ From f19fc5c70ce7bc70f116e186fa5d6fadfb76ed7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 18:18:59 +0100 Subject: [PATCH 0919/1862] clean code and phpdoc --- htdocs/core/modules/fichinter/mod_arctic.php | 5 +++-- htdocs/core/modules/fichinter/mod_pacific.php | 11 ++++++----- .../holiday/mod_holiday_immaculate.php | 16 +--------------- .../modules/holiday/mod_holiday_madonna.php | 19 ++----------------- .../modules/hrm/mod_evaluation_advanced.php | 4 ++-- .../modules/hrm/mod_evaluation_standard.php | 5 +++-- 6 files changed, 17 insertions(+), 43 deletions(-) diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index 4e23b6cb1e3..54362d39bd4 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -121,7 +122,7 @@ class mod_arctic extends ModeleNumRefFicheinter * Return next free value * * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for + * @param Fichinter $object Object we need next value for * @return string|0 Value if OK, 0 if KO */ public function getNextValue($objsoc = 0, $object = '') @@ -148,7 +149,7 @@ class mod_arctic extends ModeleNumRefFicheinter * Return next free value * * @param Societe $objsoc Object third party - * @param Object $objforref Object for number to search + * @param Fichinter $objforref Object for number to search * @return string|0 Next free value, 0 if KO */ public function getNumRef($objsoc, $objforref) diff --git a/htdocs/core/modules/fichinter/mod_pacific.php b/htdocs/core/modules/fichinter/mod_pacific.php index 1892d9f3759..a1f90012125 100644 --- a/htdocs/core/modules/fichinter/mod_pacific.php +++ b/htdocs/core/modules/fichinter/mod_pacific.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,7 +83,7 @@ class mod_pacific extends ModeleNumRefFicheinter * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Fichinter $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -121,7 +122,7 @@ class mod_pacific extends ModeleNumRefFicheinter * Return next free value * * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for + * @param Fichinter $object Object we need next value for * @return string Value if KO, <0 if KO */ public function getNextValue($objsoc = 0, $object = '') @@ -161,9 +162,9 @@ class mod_pacific extends ModeleNumRefFicheinter /** * Return next free value * - * @param Societe $objsoc Object third party - * @param Object $objforref Object for number to search - * @return string Next free value + * @param Societe $objsoc Object third party + * @param Fichinter $objforref Object for number to search + * @return string Next free value */ public function getNumRef($objsoc, $objforref) { diff --git a/htdocs/core/modules/holiday/mod_holiday_immaculate.php b/htdocs/core/modules/holiday/mod_holiday_immaculate.php index ca246324929..434b9614985 100644 --- a/htdocs/core/modules/holiday/mod_holiday_immaculate.php +++ b/htdocs/core/modules/holiday/mod_holiday_immaculate.php @@ -105,7 +105,7 @@ class mod_holiday_immaculate extends ModelNumRefHolidays * Return next value * * @param Societe $objsoc third party object - * @param Object $holiday holiday object + * @param Holiday $holiday holiday object * @return string|0 Value if OK, 0 if KO */ public function getNextValue($objsoc, $holiday) @@ -125,18 +125,4 @@ class mod_holiday_immaculate extends ModelNumRefHolidays return $numFinal; } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next value - * - * @param User $fuser User object - * @param Object $objforref Holiday object - * @return string|0 Value if OK, 0 if KO - */ - public function holiday_get_num($fuser, $objforref) - { - // phpcs:enable - return $this->getNextValue($fuser, $objforref); - } } diff --git a/htdocs/core/modules/holiday/mod_holiday_madonna.php b/htdocs/core/modules/holiday/mod_holiday_madonna.php index d2eeceeafc2..636ee4269d3 100644 --- a/htdocs/core/modules/holiday/mod_holiday_madonna.php +++ b/htdocs/core/modules/holiday/mod_holiday_madonna.php @@ -77,7 +77,7 @@ class mod_holiday_madonna extends ModelNumRefHolidays /** * Test if existing numbers make problems with numbering * - * @param Object $object Object we need next value for + * @param Holiday $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -114,7 +114,7 @@ class mod_holiday_madonna extends ModelNumRefHolidays * Return next value * * @param Societe $objsoc third party object - * @param Object $holiday Holiday object + * @param Holiday $holiday Holiday object * @return string|-1 Value if OK, -1 if KO */ public function getNextValue($objsoc, $holiday) @@ -152,19 +152,4 @@ class mod_holiday_madonna extends ModelNumRefHolidays dol_syslog("mod_holiday_madonna::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next value - * - * @param User $fuser User object - * @param Object $objforref Holiday object - * @return string|-1 Value if OK, -1 if KO - */ - public function holiday_get_num($fuser, $objforref) - { - // phpcs:enable - return $this->getNextValue($fuser, $objforref); - } } diff --git a/htdocs/core/modules/hrm/mod_evaluation_advanced.php b/htdocs/core/modules/hrm/mod_evaluation_advanced.php index 2c89930a5ab..78d396d909b 100644 --- a/htdocs/core/modules/hrm/mod_evaluation_advanced.php +++ b/htdocs/core/modules/hrm/mod_evaluation_advanced.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -123,7 +123,7 @@ class mod_evaluation_advanced extends ModeleNumRefEvaluation /** * Return next free value * - * @param Object $object Object we need next value for + * @param Evaluation $object Object we need next value for * @return string|0 Value if OK, 0 if KO */ public function getNextValue($object) diff --git a/htdocs/core/modules/hrm/mod_evaluation_standard.php b/htdocs/core/modules/hrm/mod_evaluation_standard.php index 17cb75ad4ea..418b7b1e5ba 100644 --- a/htdocs/core/modules/hrm/mod_evaluation_standard.php +++ b/htdocs/core/modules/hrm/mod_evaluation_standard.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -77,7 +78,7 @@ class mod_evaluation_standard extends ModeleNumRefEvaluation * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Evaluation $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -117,7 +118,7 @@ class mod_evaluation_standard extends ModeleNumRefEvaluation /** * Return next free value * - * @param Object $object Object we need next value for + * @param Evaluation $object Object we need next value for * @return string|-1 Value if OK, -1 if KO */ public function getNextValue($object) From 23b323f7a5d694d0983c3e1e4739eafdceb27a0f Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Mon, 11 Mar 2024 18:25:30 +0100 Subject: [PATCH 0920/1862] Fix date by using dol_mktime --- htdocs/bookcal/availabilities_card.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/htdocs/bookcal/availabilities_card.php b/htdocs/bookcal/availabilities_card.php index f3fe963f906..ac6eec12015 100644 --- a/htdocs/bookcal/availabilities_card.php +++ b/htdocs/bookcal/availabilities_card.php @@ -136,14 +136,24 @@ if (empty($reshook)) { $triggermodname = 'BOOKCAL_AVAILABILITIES_MODIFY'; // Name of trigger action code to execute when we modify record - $dateStartTimestamp = dol_stringtotime(GETPOST('start')); - $dateEndTimestamp = dol_stringtotime(GETPOST('end')); - $startHour = intval(GETPOST('startHour')); - $endHour = intval(GETPOST('endHour')); + $startday = GETPOST('startday', 'int'); + $startmonth = GETPOST('startmonth', 'int'); + $startyear = GETPOST('startyear', 'int'); + $starthour = GETPOST('startHour', 'int'); + + $dateStartTimestamp = dol_mktime($starthour, 0, 0, $startmonth, $startday, $startyear); + + $endday = GETPOST('endday', 'int'); + $endmonth = GETPOST('endmonth', 'int'); + $endyear = GETPOST('endyear', 'int'); + $endhour = GETPOST('endHour', 'int'); + + + $dateEndTimestamp = dol_mktime($endhour, 0, 0, $endmonth, $endday, $endyear); // check hours - if ($startHour > $endHour) { + if ($starthour > $endhour) { if ($dateStartTimestamp === $dateEndTimestamp) { $error++; setEventMessages($langs->trans("ErrorEndTimeMustBeGreaterThanStartTime"), null, 'errors'); From 9cc32d70d29ea48bedecf85ebeba0e6b0a06cfdf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2024 18:25:48 +0100 Subject: [PATCH 0921/1862] Clean code --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index eedaa168c37..8565e7260e1 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -4951,7 +4951,7 @@ class Societe extends CommonObject */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { - global $conf, $user, $langs; + global $langs; if (!empty($moreparams) && !empty($moreparams['use_companybankid'])) { $modelpath = "core/modules/bank/doc/"; From 330abe14fe8568cfa499d59c44f5107580e6028a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2024 18:28:20 +0100 Subject: [PATCH 0922/1862] FIX Option MAIN_DOC_USE_TIMING can be a string with date format --- .../core/modules/asset/doc/doc_generic_asset_odt.modules.php | 4 ++-- htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php | 4 ++-- .../modules/commande/doc/doc_generic_order_odt.modules.php | 4 ++-- .../modules/contract/doc/doc_generic_contract_odt.modules.php | 4 ++-- .../expedition/doc/doc_generic_shipment_odt.modules.php | 4 ++-- .../modules/facture/doc/doc_generic_invoice_odt.modules.php | 4 ++-- .../core/modules/member/doc/doc_generic_member_odt.class.php | 4 ++-- htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php | 4 ++-- .../modules/product/doc/doc_generic_product_odt.modules.php | 4 ++-- .../modules/project/doc/doc_generic_project_odt.modules.php | 4 ++-- .../modules/propale/doc/doc_generic_proposal_odt.modules.php | 4 ++-- .../reception/doc/doc_generic_reception_odt.modules.php | 4 ++-- htdocs/core/modules/societe/doc/doc_generic_odt.modules.php | 4 ++-- .../core/modules/stock/doc/doc_generic_stock_odt.modules.php | 4 ++-- .../doc/doc_generic_supplier_invoice_odt.modules.php | 4 ++-- .../doc/doc_generic_supplier_order_odt.modules.php | 4 ++-- .../doc/doc_generic_supplier_proposal_odt.modules.php | 4 ++-- .../modules/ticket/doc/doc_generic_ticket_odt.modules.php | 4 ++-- htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php | 4 ++-- .../usergroup/doc/doc_generic_usergroup_odt.modules.php | 4 ++-- .../doc/doc_generic_recruitmentjobposition_odt.modules.php | 4 ++-- 21 files changed, 42 insertions(+), 42 deletions(-) diff --git a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php index 15d95bde92e..ca77c6f13d0 100644 --- a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php +++ b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php @@ -262,8 +262,8 @@ class doc_generic_asset_odt extends ModelePDFAsset //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 1fcc55446a8..9e3df7965fb 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -274,8 +274,8 @@ class doc_generic_bom_odt extends ModelePDFBom //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index e8d7abfe0d7..63884795307 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -280,8 +280,8 @@ class doc_generic_order_odt extends ModelePDFCommandes // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 515109c4f20..dffded55555 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -278,8 +278,8 @@ class doc_generic_contract_odt extends ModelePDFContract // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 219c0f47029..a678d8265c5 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -278,8 +278,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index b74934d96a4..6b28da3e1e1 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -278,8 +278,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index 2076e156bac..bff58b2737f 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -268,8 +268,8 @@ class doc_generic_member_odt extends ModelePDFMember // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index fe18e6eb6ea..fe33eec3bba 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -267,8 +267,8 @@ class doc_generic_mo_odt extends ModelePDFMo //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index 2728bf266c2..8f799be03ae 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -276,8 +276,8 @@ class doc_generic_product_odt extends ModelePDFProduct // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index e8c1357e7a2..d3cf5e7440c 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -559,8 +559,8 @@ class doc_generic_project_odt extends ModelePDFProjects //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 734ebdc5137..0c6ef9df011 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -312,8 +312,8 @@ class doc_generic_proposal_odt extends ModelePDFPropales // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 2bc493eb580..71fcf65b197 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -271,8 +271,8 @@ class doc_generic_reception_odt extends ModelePdfReception //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 261aeef9ad5..374c44c7a25 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -252,8 +252,8 @@ class doc_generic_odt extends ModeleThirdPartyDoc $newfiletmp = dol_sanitizeFileName(dol_string_nospecial($object->name)) . '-' . $newfiletmp; $newfiletmp = preg_replace('/__+/', '_', $newfiletmp); // Replace repeated _ into one _ (to avoid string with substitution syntax) } - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index 5aae143fc2b..a0e89ad1d76 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -278,8 +278,8 @@ class doc_generic_stock_odt extends ModelePDFStock // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php index 6031907b305..27cb836e420 100644 --- a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php @@ -271,8 +271,8 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index 285be7c2799..ff7a4f33d36 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -266,8 +266,8 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index bbc0fdb583a..35bf81667f8 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -300,8 +300,8 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php index 7aa6b4a07e4..9b6646c313b 100644 --- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php +++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php @@ -266,8 +266,8 @@ class doc_generic_ticket_odt extends ModelePDFTicket // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index d6e52e2f21e..6e671eadae0 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -300,8 +300,8 @@ class doc_generic_user_odt extends ModelePDFUser // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 74ad5902966..666a7945e2d 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -282,8 +282,8 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php index a93a724fbd9..da7640d708a 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php @@ -267,8 +267,8 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } From e160ba6ba441a42aa96bdd8044f48d86c4b9bcd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 18:29:41 +0100 Subject: [PATCH 0923/1862] clean code and phpdoc --- .../modules/member/mod_member_advanced.php | 2 +- .../core/modules/member/mod_member_simple.php | 2 +- htdocs/core/modules/mrp/mod_mo_advanced.php | 4 ++-- htdocs/core/modules/mrp/mod_mo_standard.php | 5 +++-- .../product_batch/mod_lot_standard.php | 3 ++- .../modules/product_batch/mod_sn_standard.php | 3 ++- .../modules/project/mod_project_simple.php | 3 ++- .../modules/project/mod_project_universal.php | 16 +--------------- .../modules/propale/mod_propale_marbre.php | 5 +++-- .../modules/reception/mod_reception_beryl.php | 19 +++---------------- .../reception/mod_reception_moonstone.php | 18 ++---------------- .../societe/mod_codecompta_aquarium.php | 3 ++- .../mod_stocktransfer_advanced.php | 6 +++--- .../mod_stocktransfer_standard.php | 9 +++++---- 14 files changed, 32 insertions(+), 66 deletions(-) diff --git a/htdocs/core/modules/member/mod_member_advanced.php b/htdocs/core/modules/member/mod_member_advanced.php index 2147961ea82..4ed9bb1740c 100644 --- a/htdocs/core/modules/member/mod_member_advanced.php +++ b/htdocs/core/modules/member/mod_member_advanced.php @@ -79,7 +79,7 @@ class mod_member_advanced extends ModeleNumRefMembers * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Adherent $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) diff --git a/htdocs/core/modules/member/mod_member_simple.php b/htdocs/core/modules/member/mod_member_simple.php index c76d7a38c38..77b1bd8632d 100644 --- a/htdocs/core/modules/member/mod_member_simple.php +++ b/htdocs/core/modules/member/mod_member_simple.php @@ -79,7 +79,7 @@ class mod_member_simple extends ModeleNumRefMembers * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Adherent $object Object we need next value for * @return boolean false if KO (there is a conflict), true if OK */ public function canBeActivated($object) diff --git a/htdocs/core/modules/mrp/mod_mo_advanced.php b/htdocs/core/modules/mrp/mod_mo_advanced.php index b04001e84d3..fe2948e1ea5 100644 --- a/htdocs/core/modules/mrp/mod_mo_advanced.php +++ b/htdocs/core/modules/mrp/mod_mo_advanced.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2020 Josep Lluís Amador * * This program is free software; you can redistribute it and/or modify @@ -120,7 +120,7 @@ class mod_mo_advanced extends ModeleNumRefMos * Return next free value * * @param Product $objprod Object product - * @param Object $object Object we need next value for + * @param Mo $object Object we need next value for * @return string|0 Value if OK, 0 if KO */ public function getNextValue($objprod, $object) diff --git a/htdocs/core/modules/mrp/mod_mo_standard.php b/htdocs/core/modules/mrp/mod_mo_standard.php index d1e294fd3d3..191bf3439d6 100644 --- a/htdocs/core/modules/mrp/mod_mo_standard.php +++ b/htdocs/core/modules/mrp/mod_mo_standard.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -76,7 +77,7 @@ class mod_mo_standard extends ModeleNumRefMos * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Mo $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -113,7 +114,7 @@ class mod_mo_standard extends ModeleNumRefMos * Return next free value * * @param Product $objprod Object product - * @param Object $object Object we need next value for + * @param Mo $object Object we need next value for * @return string|-1 Value if OK, -1 if KO */ public function getNextValue($objprod, $object) diff --git a/htdocs/core/modules/product_batch/mod_lot_standard.php b/htdocs/core/modules/product_batch/mod_lot_standard.php index 82e4098a246..43a33dbba67 100644 --- a/htdocs/core/modules/product_batch/mod_lot_standard.php +++ b/htdocs/core/modules/product_batch/mod_lot_standard.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2021 Christophe Battarel + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -77,7 +78,7 @@ class mod_lot_standard extends ModeleNumRefBatch * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Productlot $object Object we need next value for * @return boolean false if KO (there is a conflict), true if OK */ public function canBeActivated($object) diff --git a/htdocs/core/modules/product_batch/mod_sn_standard.php b/htdocs/core/modules/product_batch/mod_sn_standard.php index 42986330cf8..474b6531c65 100644 --- a/htdocs/core/modules/product_batch/mod_sn_standard.php +++ b/htdocs/core/modules/product_batch/mod_sn_standard.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2021 Christophe Battarel + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -77,7 +78,7 @@ class mod_sn_standard extends ModeleNumRefBatch * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Productlot $object Object we need next value for * @return boolean false if KO (there is a conflict), true if OK */ public function canBeActivated($object) diff --git a/htdocs/core/modules/project/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php index 69229dcf77f..8dac1238ab2 100644 --- a/htdocs/core/modules/project/mod_project_simple.php +++ b/htdocs/core/modules/project/mod_project_simple.php @@ -1,6 +1,7 @@ * Copyright (C) 2010 Laurent Destailleur + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -85,7 +86,7 @@ class mod_project_simple extends ModeleNumRefProjects * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Project $object Object we need next value for * @return boolean false if KO (there is a conflict), true if OK */ public function canBeActivated($object) diff --git a/htdocs/core/modules/project/mod_project_universal.php b/htdocs/core/modules/project/mod_project_universal.php index e4b280cf226..6ed05b3e728 100644 --- a/htdocs/core/modules/project/mod_project_universal.php +++ b/htdocs/core/modules/project/mod_project_universal.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -150,19 +151,4 @@ class mod_project_universal extends ModeleNumRefProjects return $numFinal; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next reference not yet used as a reference - * - * @param Societe $objsoc Object third party - * @param Project $project Object project - * @return string|0 Next not used reference, 0 if KO - */ - public function project_get_num($objsoc = 0, $project = '') - { - // phpcs:enable - return $this->getNextValue($objsoc, $project); - } } diff --git a/htdocs/core/modules/propale/mod_propale_marbre.php b/htdocs/core/modules/propale/mod_propale_marbre.php index e5a8c1a0d9d..e38d8076604 100644 --- a/htdocs/core/modules/propale/mod_propale_marbre.php +++ b/htdocs/core/modules/propale/mod_propale_marbre.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -85,7 +86,7 @@ class mod_propale_marbre extends ModeleNumRefPropales * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Propal $object Object we need next value for * @return boolean false if KO (there is a conflict), true if OK */ public function canBeActivated($object) @@ -167,7 +168,7 @@ class mod_propale_marbre extends ModeleNumRefPropales * Return next free value * * @param Societe $objsoc Object third party - * @param Object $objforref Object for number to search + * @param Propal $objforref Object for number to search * @return string|-1 Next free value, -1 if KO */ public function getNumRef($objsoc, $objforref) diff --git a/htdocs/core/modules/reception/mod_reception_beryl.php b/htdocs/core/modules/reception/mod_reception_beryl.php index 164732886a3..896d8f86fb6 100644 --- a/htdocs/core/modules/reception/mod_reception_beryl.php +++ b/htdocs/core/modules/reception/mod_reception_beryl.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -61,7 +62,7 @@ class mod_reception_beryl extends ModelNumRefReception /** * Test if existing numbers make problems with numbering * - * @param Object $object Object we need next value for + * @param Reception $object Object we need next value for * @return boolean false if KO (there is a conflict), true if OK */ public function canBeActivated($object) @@ -98,7 +99,7 @@ class mod_reception_beryl extends ModelNumRefReception * Return next value * * @param Societe $objsoc Third party object - * @param Object $reception Reception object + * @param Reception $reception Reception object * @return string|-1 Value if OK, -1 if KO */ public function getNextValue($objsoc, $reception) @@ -136,18 +137,4 @@ class mod_reception_beryl extends ModelNumRefReception dol_syslog("mod_reception_beryl::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next free value - * - * @param Societe $objsoc Third party object - * @param Object $objforref Shipment object - * @return string|-1 Next free value, -1 if KO - */ - public function reception_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } } diff --git a/htdocs/core/modules/reception/mod_reception_moonstone.php b/htdocs/core/modules/reception/mod_reception_moonstone.php index 8742dede043..0ccf7ff1328 100644 --- a/htdocs/core/modules/reception/mod_reception_moonstone.php +++ b/htdocs/core/modules/reception/mod_reception_moonstone.php @@ -1,6 +1,6 @@ - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -98,7 +98,7 @@ class mod_reception_moonstone extends ModelNumRefReception * Return next value * * @param Societe $objsoc Third party object - * @param Object|null $reception Reception object + * @param Receptiont|null $reception Reception object * @return string|0 Value if OK, 0 if KO */ public function getNextValue($objsoc, $reception) @@ -124,18 +124,4 @@ class mod_reception_moonstone extends ModelNumRefReception return $numFinal; } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next free value - * - * @param Societe $objsoc Third party object - * @param Object $objforref Reception object - * @return string|0 Next free value, 0 if KO - */ - public function reception_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } } diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index cd73e6a0473..264ee51741b 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -3,6 +3,7 @@ * Copyright (C) 2005 Eric Seigne * Copyright (C) 2006-2011 Laurent Destailleur * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -130,7 +131,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode * Return an example of result returned by getNextValue * * @param Translate $langs Object langs - * @param societe $objsoc Object thirdparty + * @param Societe $objsoc Object thirdparty * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @return string Return string example */ diff --git a/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php b/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php index 21da56af6bc..5860b120342 100644 --- a/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php +++ b/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2021 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -124,8 +124,8 @@ class mod_stocktransfer_advanced extends ModeleNumRefStockTransfer /** * Return next free value * - * @param Object $object Object we need next value for - * @return string|0 Value if OK, 0 if KO + * @param StockTransfer $object Object we need next value for + * @return string|0 Value if OK, 0 if KO */ public function getNextValue($object) { diff --git a/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php b/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php index c1e16da016b..35e02b76fa4 100644 --- a/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php +++ b/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -78,8 +79,8 @@ class mod_stocktransfer_standard extends ModeleNumRefStockTransfer * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for - * @return boolean false if conflict, true if ok + * @param StockTransfer $object Object we need next value for + * @return boolean false if conflict, true if ok */ public function canBeActivated($object) { @@ -118,8 +119,8 @@ class mod_stocktransfer_standard extends ModeleNumRefStockTransfer /** * Return next free value * - * @param Object $object Object we need next value for - * @return string|-1 Value if OK, -1 if KO + * @param StockTransfer $object Object we need next value for + * @return string|-1 Value if OK, -1 if KO */ public function getNextValue($object) { From 6f3ba871e0ecc80d243c528c6e4c448ddbdd8825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 18:33:41 +0100 Subject: [PATCH 0924/1862] clean code and phpdoc --- .../mod_facture_fournisseur_cactus.php | 19 +++++++++-------- .../mod_facture_fournisseur_tulip.php | 21 ++++++++++--------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php index 418db94b07e..95612da93f0 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013-2018 Philippe Grand * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -91,7 +92,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices /** * Tests if the numbers already in the database do not cause conflicts that would prevent this numbering. * - * @param Object $object Object we need next value for + * @param FactureFournisseur $object Object we need next value for * @return boolean false if KO (there is a conflict), true if OK */ public function canBeActivated($object) @@ -173,10 +174,10 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices /** * Return next value * - * @param Societe $objsoc Object third party - * @param Object $object Object invoice - * @param string $mode 'next' for next value or 'last' for last value - * @return string|-1 Value if OK, -1 if KO + * @param Societe $objsoc Object third party + * @param FactureFournisseur $object Object invoice + * @param string $mode 'next' for next value or 'last' for last value + * @return string|-1 Value if OK, -1 if KO */ public function getNextValue($objsoc, $object, $mode = 'next') { @@ -256,10 +257,10 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices /** * Return next free value * - * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search - * @param string $mode 'next' for next value or 'last' for last value - * @return string Next free value + * @param Societe $objsoc Object third party + * @param FactureFournisseur $objforref Object for number to search + * @param string $mode 'next' for next value or 'last' for last value + * @return string Next free value */ public function getNumRef($objsoc, $objforref, $mode = 'next') { diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index b567b7e5522..39643722cf5 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -5,6 +5,7 @@ * Copyright (C) 2013-2018 Philippe Grand * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2016-2021 Alexandre Spangaro + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,8 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefo /** - \class mod_facture_fournisseur_tulip - \brief Tulip Class of numbering models of suppliers invoices references + * \class mod_facture_fournisseur_tulip + * \brief Tulip Class of numbering models of suppliers invoices references */ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices { @@ -146,10 +147,10 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices /** * Return next value * - * @param Societe $objsoc Object third party - * @param Object $object Object invoice - * @param string $mode 'next' for next value or 'last' for last value - * @return string|0 Value if OK, 0 if KO + * @param Societe $objsoc Object third party + * @param FactureFournisseur $object Object invoice + * @param string $mode 'next' for next value or 'last' for last value + * @return string|0 Value if OK, 0 if KO */ public function getNextValue($objsoc, $object, $mode = 'next') { @@ -185,10 +186,10 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices /** * Return next free value * - * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search - * @param string $mode 'next' for next value or 'last' for last value - * @return string Next free value + * @param Societe $objsoc Object third party + * @param FactureFournisseur $objforref Object for number to search + * @param string $mode 'next' for next value or 'last' for last value + * @return string Next free value */ public function getNumRef($objsoc, $objforref, $mode = 'next') { From 71a65557bb8e81e4c80941a5c90549d49cf7c232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 18:36:05 +0100 Subject: [PATCH 0925/1862] clean code and phpdoc --- .../reception/mod_reception_moonstone.php | 2 +- .../mod_commande_fournisseur_muguet.php | 24 ++++--------------- .../mod_commande_fournisseur_orchidee.php | 22 ++++------------- 3 files changed, 10 insertions(+), 38 deletions(-) diff --git a/htdocs/core/modules/reception/mod_reception_moonstone.php b/htdocs/core/modules/reception/mod_reception_moonstone.php index 0ccf7ff1328..9acf2cfd161 100644 --- a/htdocs/core/modules/reception/mod_reception_moonstone.php +++ b/htdocs/core/modules/reception/mod_reception_moonstone.php @@ -98,7 +98,7 @@ class mod_reception_moonstone extends ModelNumRefReception * Return next value * * @param Societe $objsoc Third party object - * @param Receptiont|null $reception Reception object + * @param Reception|null $reception Reception object * @return string|0 Value if OK, 0 if KO */ public function getNextValue($objsoc, $reception) diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php index 35aec96e909..1ff309bdcdf 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -95,7 +96,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param CommandeFournisseur $object Object we need next value for * @return boolean false if KO (there is a conflict), true if OK */ public function canBeActivated($object) @@ -130,9 +131,9 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders /** * Return next value * - * @param Societe $objsoc Object third party - * @param Object $object Object - * @return string Value if OK, 0 if KO + * @param Societe $objsoc Object third party + * @param CommandeFournisseur $object Object + * @return string Value if OK, 0 if KO */ public function getNextValue($objsoc = 0, $object = '') { @@ -170,19 +171,4 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders return $this->prefix.$yymm."-".$num; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Renvoie la reference de commande suivante non utilisee - * - * @param Societe $objsoc Object third party - * @param Object $object Object - * @return string Descriptive text - */ - public function commande_get_num($objsoc = 0, $object = '') - { - // phpcs:enable - return $this->getNextValue($objsoc, $object); - } } diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php index a0322ab2956..db138369a53 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -121,9 +122,9 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders /** * Return next value * - * @param Societe $objsoc Object third party - * @param Object $object Object - * @return string|0 Value if OK, 0 if KO + * @param Societe $objsoc Object third party + * @param CommandeFournisseur $object Object + * @return string|0 Value if OK, 0 if KO */ public function getNextValue($objsoc = 0, $object = '') { @@ -143,19 +144,4 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders return $numFinal; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Renvoie la reference de commande suivante non utilisee - * - * @param Societe $objsoc Object third party - * @param Object $object Object - * @return string Descriptive text - */ - public function commande_get_num($objsoc = 0, $object = '') - { - // phpcs:enable - return $this->getNextValue($objsoc, $object); - } } From 50e8c19b7e630a7e8492ea065d31cfa1b948ee62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 18:50:18 +0100 Subject: [PATCH 0926/1862] clean code and phpdoc --- .../mod_supplier_payment_brodator.php | 22 +++------------- .../mod_supplier_payment_bronan.php | 26 +++++-------------- .../mod_supplier_proposal_marbre.php | 11 ++++---- .../takepos/mod_takepos_ref_simple.php | 5 ++-- .../takepos/mod_takepos_ref_universal.php | 3 ++- .../core/modules/ticket/mod_ticket_simple.php | 3 ++- .../workstation/mod_workstation_advanced.php | 4 +-- .../workstation/mod_workstation_standard.php | 5 ++-- 8 files changed, 28 insertions(+), 51 deletions(-) diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php index b2a26199a32..6790389a328 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -118,9 +119,9 @@ class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments /** * Return next free value * - * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for - * @return string|0 Next value if OK, 0 if KO + * @param Societe $objsoc Object thirdparty + * @param PaiementFourn $object Object we need next value for + * @return string|0 Next value if OK, 0 if KO */ public function getNextValue($objsoc, $object) { @@ -140,19 +141,4 @@ class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments return $numFinal; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next free value - * - * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search - * @return string Next free value - */ - public function commande_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } } diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php index 38d41158f04..710369855b8 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -83,8 +84,8 @@ class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for - * @return boolean false if KO (there is a conflict), true if OK + * @param PaiementFourn $object Object we need next value for + * @return boolean false if KO (there is a conflict), true if OK */ public function canBeActivated($object) { @@ -119,9 +120,9 @@ class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments /** * Return next free value * - * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for - * @return string|-1 Value if OK, -1 if KO + * @param Societe $objsoc Object thirdparty + * @param PaiementFourn $object Object we need next value for + * @return string|-1 Value if OK, -1 if KO */ public function getNextValue($objsoc, $object) { @@ -160,19 +161,4 @@ class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments dol_syslog(__METHOD__." return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next free value - * - * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search - * @return string Next free value - */ - public function payment_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } } diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php index 97a3507ff3b..d1a638345d3 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -85,8 +86,8 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for - * @return boolean false if KO (there is a conflict), true if OK + * @param SupplierProposal $object Object we need next value for + * @return boolean false if KO (there is a conflict), true if OK */ public function canBeActivated($object) { @@ -166,9 +167,9 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal /** * Return next free value * - * @param Societe $objsoc Object third party - * @param Object $objforref Object for number to search - * @return string Next free value + * @param Societe $objsoc Object third party + * @param SupplierProposal $objforref Object for number to search + * @return string Next free value */ public function getNumRef($objsoc, $objforref) { diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php index af9b41f3f97..616c43513dd 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2020 Open-DSI + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -85,7 +86,7 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos * Test if the numbers already in the database do not cause any conflicts that will prevent this * of conflicts that will prevent this numbering from working. * - * @param Object $object Object we need next value for + * @param Facture $object Object we need next value for * @return boolean false if KO (there is a conflict), true if OK */ public function canBeActivated($object) @@ -208,7 +209,7 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos * Return next free value * * @param Societe $objsoc Object third party - * @param Object $objforref Object for number to search + * @param Facture $objforref Object for number to search * @return string Next free value */ public function getNumRef($objsoc, $objforref) diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php index 35a02f4823c..1c06bfdd16a 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php @@ -5,6 +5,7 @@ * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2020 Open-DSI + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -151,7 +152,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos * Return next free value * * @param Societe $objsoc Object third party - * @param Object $objforref Object for number to search + * @param Facture $objforref Object for number to search * @return string Next free value */ public function getNumRef($objsoc, $objforref) diff --git a/htdocs/core/modules/ticket/mod_ticket_simple.php b/htdocs/core/modules/ticket/mod_ticket_simple.php index 943f26c2c50..eca05a8e700 100644 --- a/htdocs/core/modules/ticket/mod_ticket_simple.php +++ b/htdocs/core/modules/ticket/mod_ticket_simple.php @@ -1,6 +1,7 @@ * Copyright (C) 2010 Laurent Destailleur + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -81,7 +82,7 @@ class mod_ticket_simple extends ModeleNumRefTicket * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Ticket $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) diff --git a/htdocs/core/modules/workstation/mod_workstation_advanced.php b/htdocs/core/modules/workstation/mod_workstation_advanced.php index 3081519dad1..032083ba641 100644 --- a/htdocs/core/modules/workstation/mod_workstation_advanced.php +++ b/htdocs/core/modules/workstation/mod_workstation_advanced.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2020 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -124,7 +124,7 @@ class mod_workstation_advanced extends ModeleNumRefWorkstation /** * Return next free value * - * @param Object $object Object we need next value for + * @param Workstation $object Object we need next value for * @return string|0 Next value if OK, 0 if KO */ public function getNextValue($object) diff --git a/htdocs/core/modules/workstation/mod_workstation_standard.php b/htdocs/core/modules/workstation/mod_workstation_standard.php index bb8938e6440..5d2b3cbde0e 100644 --- a/htdocs/core/modules/workstation/mod_workstation_standard.php +++ b/htdocs/core/modules/workstation/mod_workstation_standard.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2020 Gauthier VERDOL + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -77,7 +78,7 @@ class mod_workstation_standard extends ModeleNumRefWorkstation * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Workstation $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -115,7 +116,7 @@ class mod_workstation_standard extends ModeleNumRefWorkstation /** * Return next free value * - * @param Object $object Object we need next value for + * @param Workstation $object Object we need next value for * @return string|-1 Next value if OK, -1 if KO */ public function getNextValue($object) From 56a4dd46db7d489759af538cd1b301fd51bdc747 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2024 20:41:56 +0100 Subject: [PATCH 0927/1862] Add a log --- htdocs/ai/ajax/generate_content.php | 2 +- htdocs/ai/class/ai.class.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/ai/ajax/generate_content.php b/htdocs/ai/ajax/generate_content.php index 9b1adf13b84..f60cef9ee09 100644 --- a/htdocs/ai/ajax/generate_content.php +++ b/htdocs/ai/ajax/generate_content.php @@ -67,7 +67,7 @@ $function = 'textgeneration'; $generatedContent = $ai->generateContent($instructions, 'auto', $function); if (is_array($generatedContent) && $generatedContent['error']) { - print "Error : " . $generatedContent['message']; + print "Error returned by API call: " . $generatedContent['message']; } else { print $generatedContent; } diff --git a/htdocs/ai/class/ai.class.php b/htdocs/ai/class/ai.class.php index 399b3adb1ee..fd1c7ca17c5 100644 --- a/htdocs/ai/class/ai.class.php +++ b/htdocs/ai/class/ai.class.php @@ -64,6 +64,10 @@ class Ai */ public function generateContent($instructions, $model = 'auto', $function = 'textgeneration') { + if (empty($this->apiKey)) { + return array('error' => true, 'message' => 'API key is no defined'); + } + if (empty($this->apiEndpoint)) { if ($function == 'textgeneration') { $this->apiEndpoint = 'https://api.openai.com/v1/chat/completions'; @@ -97,6 +101,8 @@ class Ai } } + dol_syslog("Call API for apiEndpoint=".$this->apiEndpoint." apiKey=".substr($this->apiKey, 0, 3).'***********, model='.$model); + try { $configurationsJson = getDolGlobalString('AI_CONFIGURATIONS_PROMPT'); $configurations = json_decode($configurationsJson, true); From 325cb587f62d50e255b51336ba8c196de9786b87 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 20:46:21 +0100 Subject: [PATCH 0928/1862] Qual: Exclude some tests from windows-ci until fixed # Qual: Exclude some tests from windows-ci until fixed Until #28598 and #28264 find some way to the develop branch, this update will skip the tests that currently fail on windows so that the results of other tests have an effect on the CI status and github annotations --- .github/workflows/windows-ci.yaml | 4 ++-- test/phpunit/FilesLibTest.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-ci.yaml b/.github/workflows/windows-ci.yaml index c0e44dbb74f..f8441c438fc 100644 --- a/.github/workflows/windows-ci.yaml +++ b/.github/workflows/windows-ci.yaml @@ -114,7 +114,7 @@ jobs: curl "http://${{ env.PHPSERVER_DOMAIN_PORT }}" shell: powershell - name: Run PHPUnit tests - continue-on-error: true + # continue-on-error: true shell: cmd # setting up php.ini, starting the php server are currently in this step run: |- @@ -143,7 +143,7 @@ jobs: cat htdocs/conf/conf.php curl "http://${{ env.PHPSERVER_DOMAIN_PORT }}" REM 'DOSKEY' USED to recover error code (no pipefile equivalent in windows?) - ( php "%PHPROOT%\phpunit" -d memory_limit=-1 -c %CD%\test\phpunit\phpunittest.xml "test\phpunit\AllTests.php" & call doskey /exename=err err=%%^^errorlevel%% ) | "${{ env.TEE }}" "${{ env.PHPUNIT_LOG }}" + ( php "%PHPROOT%\phpunit" -d memory_limit=-1 -c %CD%\test\phpunit\phpunittest.xml "test\phpunit\AllTests.php" --exclude-group WindowsWaitingForFix & call doskey /exename=err err=%%^^errorlevel%% ) | "${{ env.TEE }}" "${{ env.PHPUNIT_LOG }}" for /f "tokens=2 delims==" %%A in ('doskey /m:err') do EXIT /B %%A - name: Convert Raw Log to Annotations uses: mdeweerd/logToCheckStyle@v2024.2.9 diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index 91cdcc816bd..32616542c2a 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -247,6 +247,7 @@ class FilesLibTest extends CommonClassTest * testDolCopyMoveDelete * * @return void + * @group WindowsWaitingForFix */ public function testDolCopyMoveDelete() { @@ -490,6 +491,7 @@ class FilesLibTest extends CommonClassTest * testDolDirMove * * @return void + * @group WindowsWaitingForFix */ public function testDolDirMove() { From 23ae21958b828c0bfb2564cb33c1a90738002045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 20:57:48 +0100 Subject: [PATCH 0929/1862] clean code and phpdoc --- htdocs/core/modules/delivery/mod_delivery_saphir.php | 1 + htdocs/core/modules/facture/mod_facture_mars.php | 1 + htdocs/core/modules/facture/mod_facture_mercure.php | 1 + htdocs/core/modules/facture/mod_facture_terre.php | 1 + htdocs/core/modules/fichinter/mod_arctic.php | 1 + htdocs/core/modules/fichinter/mod_pacific.php | 1 + htdocs/core/modules/propale/mod_propale_marbre.php | 1 + .../modules/supplier_invoice/mod_facture_fournisseur_cactus.php | 1 + .../modules/supplier_invoice/mod_facture_fournisseur_tulip.php | 1 + .../modules/supplier_proposal/mod_supplier_proposal_marbre.php | 1 + htdocs/core/modules/takepos/mod_takepos_ref_simple.php | 1 + htdocs/core/modules/takepos/mod_takepos_ref_universal.php | 1 + htdocs/fourn/class/fournisseur.facture.class.php | 2 +- 13 files changed, 13 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/delivery/mod_delivery_saphir.php b/htdocs/core/modules/delivery/mod_delivery_saphir.php index 4d6bdb7c716..b6669961cd0 100644 --- a/htdocs/core/modules/delivery/mod_delivery_saphir.php +++ b/htdocs/core/modules/delivery/mod_delivery_saphir.php @@ -151,6 +151,7 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder * @param Societe $objsoc Object third party * @param Delivery $objforref Object for number to search * @return string|0 Next free value, 0 if KO + * @deprecated see getNextValue */ public function getNumRef($objsoc, $objforref) { diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index 71f9fb27eec..94c45e0ce37 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -247,6 +247,7 @@ class mod_facture_mars extends ModeleNumRefFactures * @param Facture $objforref Object for number to search * @param string $mode 'next' for next value or 'last' for last value * @return string Next free value + * @deprecated see getNextValue */ public function getNumRef($objsoc, $objforref, $mode = 'next') { diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index 8d1194b7d4a..1043808be3a 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -182,6 +182,7 @@ class mod_facture_mercure extends ModeleNumRefFactures * @param Facture $objforref Object for number to search * @param string $mode 'next' for next value or 'last' for last value * @return string|0 Next free value, 0 if KO + * @deprecated see getNextValue */ public function getNumRef($objsoc, $objforref, $mode = 'next') { diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index bf116118024..07c6173a17b 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -287,6 +287,7 @@ class mod_facture_terre extends ModeleNumRefFactures * @param Facture $objforref Object for number to search * @param string $mode 'next' for next value or 'last' for last value * @return string|int<-1,0> Next free value, -1 or 0 if error + * @deprecated see getNextValue */ public function getNumRef($objsoc, $objforref, $mode = 'next') { diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index 54362d39bd4..e8f79c9c084 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -151,6 +151,7 @@ class mod_arctic extends ModeleNumRefFicheinter * @param Societe $objsoc Object third party * @param Fichinter $objforref Object for number to search * @return string|0 Next free value, 0 if KO + * @deprecated see getNextValue */ public function getNumRef($objsoc, $objforref) { diff --git a/htdocs/core/modules/fichinter/mod_pacific.php b/htdocs/core/modules/fichinter/mod_pacific.php index a1f90012125..2e7dfe34792 100644 --- a/htdocs/core/modules/fichinter/mod_pacific.php +++ b/htdocs/core/modules/fichinter/mod_pacific.php @@ -165,6 +165,7 @@ class mod_pacific extends ModeleNumRefFicheinter * @param Societe $objsoc Object third party * @param Fichinter $objforref Object for number to search * @return string Next free value + * @deprecated see getNextValue */ public function getNumRef($objsoc, $objforref) { diff --git a/htdocs/core/modules/propale/mod_propale_marbre.php b/htdocs/core/modules/propale/mod_propale_marbre.php index e38d8076604..c649f1139cb 100644 --- a/htdocs/core/modules/propale/mod_propale_marbre.php +++ b/htdocs/core/modules/propale/mod_propale_marbre.php @@ -170,6 +170,7 @@ class mod_propale_marbre extends ModeleNumRefPropales * @param Societe $objsoc Object third party * @param Propal $objforref Object for number to search * @return string|-1 Next free value, -1 if KO + * @deprecated see getNextValue */ public function getNumRef($objsoc, $objforref) { diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php index 95612da93f0..a3a4c321bf3 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -261,6 +261,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices * @param FactureFournisseur $objforref Object for number to search * @param string $mode 'next' for next value or 'last' for last value * @return string Next free value + * @deprecated see getNextValue */ public function getNumRef($objsoc, $objforref, $mode = 'next') { diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index 39643722cf5..7fb38484e21 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -190,6 +190,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices * @param FactureFournisseur $objforref Object for number to search * @param string $mode 'next' for next value or 'last' for last value * @return string Next free value + * @deprecated see getNextValue */ public function getNumRef($objsoc, $objforref, $mode = 'next') { diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php index d1a638345d3..71949409f92 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php @@ -170,6 +170,7 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal * @param Societe $objsoc Object third party * @param SupplierProposal $objforref Object for number to search * @return string Next free value + * @deprecated see getNextValue */ public function getNumRef($objsoc, $objforref) { diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php index 616c43513dd..a4757350a57 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php @@ -211,6 +211,7 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos * @param Societe $objsoc Object third party * @param Facture $objforref Object for number to search * @return string Next free value + * @deprecated see getNextValue */ public function getNumRef($objsoc, $objforref) { diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php index 1c06bfdd16a..8eb7c341643 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php @@ -154,6 +154,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos * @param Societe $objsoc Object third party * @param Facture $objforref Object for number to search * @return string Next free value + * @deprecated see getNextValue */ public function getNumRef($objsoc, $objforref) { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index dc1f44735d7..5130c4ad2bd 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2972,7 +2972,7 @@ class FactureFournisseur extends CommonInvoice $obj = new $classname(); $numref = ""; - $numref = $obj->getNumRef($soc, $this, $mode); + $numref = $obj->getNextValue($soc, $this, $mode); if ($numref != "") { return $numref; From aaf173a0d22266c8b7f0eebe10e0721c3a0b3357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 21:01:20 +0100 Subject: [PATCH 0930/1862] clean code and phpdoc --- htdocs/core/class/commonnumrefgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonnumrefgenerator.class.php b/htdocs/core/class/commonnumrefgenerator.class.php index c4edb202031..60104d09cd7 100644 --- a/htdocs/core/class/commonnumrefgenerator.class.php +++ b/htdocs/core/class/commonnumrefgenerator.class.php @@ -132,7 +132,7 @@ abstract class CommonNumRefGenerator * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param CommonObject $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) From fbcfd89f88e2077cd322cf99d96a64e800d2ac0c Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 21:27:22 +0100 Subject: [PATCH 0931/1862] Fix PHPDoc date_start typo --- htdocs/accountancy/class/bookkeeping.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index f291093d063..3696c997737 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -2528,7 +2528,7 @@ class BookKeeping extends CommonObject * Get list of fiscal period * * @param string $filter Filter - * @return array|int Return integer <0 if KO, Fiscal periods : [[id, date_start, date_end, label], ...] + * @return array|int Return integer <0 if KO, Fiscal periods : [[id, date_start, date_end, label], ...] */ public function getFiscalPeriods($filter = '') { From cb35dabd8fe3aec02ac7f739481815a9763a3930 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 21:39:04 +0100 Subject: [PATCH 0932/1862] Qual: Document sendMail according to code --- htdocs/core/class/CMailFile.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index e782e83f662..1e1004a7959 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -7,6 +7,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2019-2023 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -274,7 +275,7 @@ class CMailFile // This converts an embed file with src="/viewimage.php?modulepart... into a cid link // TODO Exclude viewimage used for the read tracker ? $findimg = $this->findHtmlImages($dolibarr_main_data_root.'/medias'); - if ($findimg<0) { + if ($findimg < 0) { dol_syslog("CMailFile::CMailfile: Error on findHtmlImages"); $this->error = 'ErrorInAddAttachementsImageBaseOnMedia'; return; @@ -285,7 +286,7 @@ class CMailFile // Search into the body for error = 'ErrorInAddAttachementsImageBaseOnMedia'; return; @@ -388,7 +389,7 @@ class CMailFile $addr_cc = implode(',', $tabcc); //Verify for $addr_bcc - $replacebcc= false; + $replacebcc = false; $tabbcc = explode(',', $addr_bcc); foreach ($tabbcc as $key => $bcc) { if (in_array($bcc, $tabbcc)) { @@ -730,7 +731,7 @@ class CMailFile /** * Send mail that was prepared by constructor. * - * @return boolean True if mail sent, false otherwise + * @return negative-int|bool|string True if mail sent, false otherwise. Negative int if error in hook. String if incorrect send mode. */ public function sendfile() { From 6e5c4ef851475feb7a882955fefb66aa8f9e9227 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 21:43:50 +0100 Subject: [PATCH 0933/1862] Fix PHPDoc date_m typo --- htdocs/core/db/DoliDB.class.php | 2 +- htdocs/core/lib/files.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index b839770410f..73470391fce 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -188,7 +188,7 @@ abstract class DoliDB implements Database dol_syslog("BEGIN Transaction".($textinlog ? ' '.$textinlog : ''), LOG_DEBUG); dol_syslog('', 0, 1); } - return $ret; + return (int) $ret; } else { $this->transaction_opened++; dol_syslog('', 0, 1); diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index d07f1960e15..8623989482c 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -256,7 +256,7 @@ function dol_dir_list($utf8_path, $types = "all", $recursive = 0, $filter = "", * @param string $sortcriteria Sort criteria ("","fullname","name","date","size") * @param int $sortorder Sort order (SORT_ASC, SORT_DESC) * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like description - * @return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file',...) + * @return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file',...) * @see dol_dir_list() */ function dol_dir_list_in_database($path, $filter = "", $excludefilter = null, $sortcriteria = "name", $sortorder = SORT_ASC, $mode = 0) From 85efac2257914c3d5610776ebc655a0812e570de Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 21:47:38 +0100 Subject: [PATCH 0934/1862] Qual: Update PHPdoc to correspond to code --- htdocs/core/menus/standard/empty.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 16809c89405..48e5edc719f 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -78,7 +78,7 @@ class MenuManager * * @param string $mode 'top', 'left', 'jmobile' * @param array $moredata An array with more data to output - * @return int 0 or nb of top menu entries if $mode = 'topnb' + * @return int|string 0 or nb of top menu entries if $mode = 'topnb', string inc ase of bad parameter */ public function showmenu($mode, $moredata = null) { From 4e20c644c227fdd94ae18719a1374dacae70a902 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 21:51:04 +0100 Subject: [PATCH 0935/1862] Qual: Correct PHPdoc typing --- htdocs/core/modules/barcode/modules_barcode.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/barcode/modules_barcode.class.php b/htdocs/core/modules/barcode/modules_barcode.class.php index f8026af15e1..1a2d056a17c 100644 --- a/htdocs/core/modules/barcode/modules_barcode.class.php +++ b/htdocs/core/modules/barcode/modules_barcode.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,7 +55,6 @@ abstract class ModeleBarCode */ abstract class ModeleNumRefBarCode extends CommonNumRefGenerator { - // variables inherited from CommonNumRefGenerator public $code_null; @@ -62,9 +62,9 @@ abstract class ModeleNumRefBarCode extends CommonNumRefGenerator /** * Return next value available * - * @param Product $objproduct Object Product - * @param string $type Type of barcode (EAN, ISBN, ...) - * @return string Value + * @param CommonObject $objproduct Object Product, Thirdparty + * @param string $type Type of barcode (EAN, ISBN, ...) + * @return string Value */ public function getNextValue($objproduct, $type = '') { From ad96de073a66b78a951942e523fd313ea67364d7 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 21:57:50 +0100 Subject: [PATCH 0936/1862] Fix: Correct type of field configuration values --- htdocs/ecm/class/ecmfiles.class.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 3aceab4db49..fcf77549177 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -157,26 +157,26 @@ class EcmFiles extends CommonObject public $section_id; public $fields = array( - 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), - 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => '1', 'position' => 20, 'notnull' => 1, 'visible' => -1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => '1', 'validate' => '1', 'comment' => "contains hash from filename+filepath"), - 'label' => array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => '1', 'position' => 30, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => '2', 'validate' => '1', 'comment' => "contains hash of file content"), - 'share' => array('type' => 'varchar(128)', 'label' => 'Share', 'enabled' => '1', 'position' => 40, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => '2', 'validate' => '1', 'comment' => "contains hash for file sharing"), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), + 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => -1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => "contains hash from filename+filepath"), + 'label' => array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "contains hash of file content"), + 'share' => array('type' => 'varchar(128)', 'label' => 'Share', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "contains hash for file sharing"), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 50, 'index' => 1), - 'filepath' => array('type' => 'varchar(255)', 'label' => 'FilePath', 'enabled' => '1', 'position' => 60, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => '2', 'validate' => '1','comment' => "relative to dolibarr document dir. Example module/def"), - 'filename' => array('type' => 'varchar(255)', 'label' => 'FileName', 'enabled' => '1', 'position' => 70, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => '2', 'validate' => '1','comment' => "file name only without any directory"), - 'src_object_type' => array('type' => 'varchar(64)', 'label' => 'SourceType', 'enabled' => '1', 'position' => 80, 'notnull' => 0, 'visible' => 0, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => '2', 'validate' => '1','comment' => "Source object type ('proposal', 'invoice', ...)"), + 'filepath' => array('type' => 'varchar(255)', 'label' => 'FilePath', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "relative to dolibarr document dir. Example module/def"), + 'filename' => array('type' => 'varchar(255)', 'label' => 'FileName', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "file name only without any directory"), + 'src_object_type' => array('type' => 'varchar(64)', 'label' => 'SourceType', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => 0, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "Source object type ('proposal', 'invoice', ...)"), 'src_object_id' => array('type' => 'integer', 'label' => 'SourceID', 'default' => 1, 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 90, 'index' => 1, 'comment' => "Source object id"), - 'fullpath_orig' => array('type' => 'varchar(750)', 'label' => 'FullPathOrig', 'enabled' => '1', 'position' => 100, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => '2', 'validate' => '1','comment' => "full path of original filename, when file is uploaded from a local computer"), + 'fullpath_orig' => array('type' => 'varchar(750)', 'label' => 'FullPathOrig', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "full path of original filename, when file is uploaded from a local computer"), 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => 0, 'position' => 110), - 'keywords' => array('type' => 'varchar(750)', 'label' => 'Keywords', 'enabled' => '1', 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => '2', 'validate' => '1','comment' => "list of keywords, separated with comma. Must be limited to most important keywords."), + 'keywords' => array('type' => 'varchar(750)', 'label' => 'Keywords', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "list of keywords, separated with comma. Must be limited to most important keywords."), 'cover' => array('type' => 'text', 'label' => 'Cover', 'enabled' => 1, 'visible' => 0, 'position' => 130, 'comment' => "is this file a file to use for a cover"), 'position' => array('type' => 'integer', 'label' => 'Position', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 140, 'index' => 1, 'comment' => "position of file among others"), - 'gen_or_uploaded' => array('type' => 'varchar(12)', 'label' => 'GenOrUpload', 'enabled' => '1', 'position' => 150, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => '2', 'validate' => '1','comment' => "'generated' or 'uploaded'"), - 'extraparams' => array('type' => 'varchar(255)', 'label' => 'ExtraParams', 'enabled' => '1', 'position' => 160, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => '2', 'validate' => '1', 'comment' => "for stocking other parameters with json format"), + 'gen_or_uploaded' => array('type' => 'varchar(12)', 'label' => 'GenOrUpload', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "'generated' or 'uploaded'"), + 'extraparams' => array('type' => 'varchar(255)', 'label' => 'ExtraParams', 'enabled' => 1, 'position' => 160, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "for stocking other parameters with json format"), 'date_c' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 175), - 'fk_user_c' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => '1', 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',), - 'fk_user_m' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => '1', 'position' => 511, 'notnull' => -1, 'visible' => -2,), + 'fk_user_c' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',), + 'fk_user_m' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2,), 'note_public' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155), 'note_private' => array('type' => 'text', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 160), 'acl' => array('type' => 'text', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 160, 'comment' => "for future permission 'per file'"), From a300206c28e264f0d572bbe4a9d624ebc1422550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 21:59:48 +0100 Subject: [PATCH 0937/1862] clean code and phpdoc --- htdocs/core/modules/facture/mod_facture_mercure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index 1043808be3a..123ced406da 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2013 uanjo Menent + * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2022 Anthony Berton * Copyright (C) 2024 Frédéric France * From 7a2045b646434aacb08e5b05e4b3524e68cb4b10 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:02:08 +0100 Subject: [PATCH 0938/1862] Fix PHPdoc for childtables --- .../class/emailcollector.class.php | 93 ++++++++++--------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index bffa405796e..b8323b5d1d2 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -88,7 +89,7 @@ class EmailCollector extends CommonObject public $fk_element = 'fk_emailcollector'; /** - * @var array List of child tables. To test if we can delete object. + * @var array> List of child tables. To test if we can delete object. */ protected $childtables = array(); @@ -122,37 +123,37 @@ class EmailCollector extends CommonObject * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1), - 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1', 'csslist'=>'tdoverflowmax200'), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>'Example: My Email collector', 'csslist'=>'tdoverflowmax150'), - 'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>60, 'notnull'=>-1, 'cssview'=>'small', 'csslist'=>'small tdoverflowmax200'), - 'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>90, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com', 'csslist'=>'tdoverflowmax125'), - 'port' => array('type'=>'varchar(10)', 'label'=>'EMailHostPort', 'visible'=>1, 'enabled'=>1, 'position'=>91, 'notnull'=>1, 'searchall'=>0, 'comment'=>"IMAP server port", 'help'=>'Example: 993', 'csslist'=>'tdoverflowmax50', 'default'=>'993'), - 'hostcharset' => array('type'=>'varchar(16)', 'label'=>'HostCharset', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>0, 'searchall'=>0, 'comment'=>"IMAP server charset", 'help'=>'Example: "UTF-8" (May be "US-ASCII" with some Office365)', 'default'=>'UTF-8'), - 'imap_encryption' => array('type'=>'varchar(16)', 'label'=>'ImapEncryption', 'visible'=>-1, 'enabled'=>1, 'position'=>93, 'searchall'=>0, 'comment'=>"IMAP encryption", 'help'=>'ImapEncryptionHelp', 'arrayofkeyval'=> array('ssl'=>'SSL', 'tls' => 'TLS', 'notls' => 'NOTLS'), 'default'=>'ssl'), - 'norsh' => array('type'=>'integer', 'label'=>'NoRSH', 'visible'=>-1, 'enabled'=>"!getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position'=>94, 'searchall'=>0, 'help'=>'NoRSHHelp', 'arrayofkeyval'=> array(0 =>'No', 1 => 'Yes'), 'default'=> 0), - 'acces_type' => array('type'=>'integer', 'label'=>'accessType', 'visible'=>-1, 'enabled'=>"getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position'=>101, 'notnull'=>1, 'index'=>1, 'comment'=>"IMAP login type", 'arrayofkeyval'=>array('0'=>'loginPassword', '1'=>'oauthToken'), 'default'=>'0', 'help'=>''), - 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), - 'password' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>"1", 'position'=>103, 'notnull'=>-1, 'comment'=>"IMAP password", 'help'=>'WithGMailYouCanCreateADedicatedPassword'), - 'oauth_service' => array('type'=>'varchar(128)', 'label'=>'oauthService', 'visible'=>-1, 'enabled'=>"getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position'=>104, 'notnull'=>0, 'index'=>1, 'comment'=>"IMAP login oauthService", 'arrayofkeyval'=>array(), 'help'=>'TokenMustHaveBeenCreated'), - 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>109, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX, [Gmail]/Spam, [Gmail]/Draft, [Gmail]/Brouillons, [Gmail]/Sent Mail, [Gmail]/Messages envoyés, ...'), - 'target_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxTargetDirectory', 'visible'=>1, 'enabled'=>1, 'position'=>110, 'notnull'=>0, 'help'=>"EmailCollectorTargetDir"), - 'maxemailpercollect' => array('type'=>'integer', 'label'=>'MaxEmailCollectPerCollect', 'visible'=>-1, 'enabled'=>1, 'position'=>111, 'default'=>50), - 'datelastresult' => array('type'=>'datetime', 'label'=>'DateLastCollectResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>121, 'notnull'=>-1, 'csslist'=>'nowraponall'), - 'codelastresult' => array('type'=>'varchar(16)', 'label'=>'CodeLastResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>122, 'notnull'=>-1,), - 'lastresult' => array('type'=>'varchar(255)', 'label'=>'LastResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>123, 'notnull'=>-1, 'cssview'=>'small', 'csslist'=>'small tdoverflowmax200'), - 'datelastok' => array('type'=>'datetime', 'label'=>'DateLastcollectResultOk', 'visible'=>1, 'enabled'=>'$action != "create"', 'position'=>125, 'notnull'=>-1, 'csslist'=>'nowraponall'), - 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'visible'=>0, 'enabled'=>1, 'position'=>61, 'notnull'=>-1,), - 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>0, 'enabled'=>1, 'position'=>62, 'notnull'=>-1,), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-2, 'enabled'=>1, 'position'=>501, 'notnull'=>1,), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => 2, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'default' => 1, 'notnull' => 1, 'index' => 1, 'position' => 20), + 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 1, 'index' => 1, 'position' => 10, 'searchall' => 1, 'help' => 'Example: MyCollector1', 'csslist' => 'tdoverflowmax200'), + 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'visible' => 1, 'enabled' => 1, 'position' => 30, 'notnull' => -1, 'searchall' => 1, 'help' => 'Example: My Email collector', 'csslist' => 'tdoverflowmax150'), + 'description' => array('type' => 'text', 'label' => 'Description', 'visible' => -1, 'enabled' => 1, 'position' => 60, 'notnull' => -1, 'cssview' => 'small', 'csslist' => 'small tdoverflowmax200'), + 'host' => array('type' => 'varchar(255)', 'label' => 'EMailHost', 'visible' => 1, 'enabled' => 1, 'position' => 90, 'notnull' => 1, 'searchall' => 1, 'comment' => "IMAP server", 'help' => 'Example: imap.gmail.com', 'csslist' => 'tdoverflowmax125'), + 'port' => array('type' => 'varchar(10)', 'label' => 'EMailHostPort', 'visible' => 1, 'enabled' => 1, 'position' => 91, 'notnull' => 1, 'searchall' => 0, 'comment' => "IMAP server port", 'help' => 'Example: 993', 'csslist' => 'tdoverflowmax50', 'default' => '993'), + 'hostcharset' => array('type' => 'varchar(16)', 'label' => 'HostCharset', 'visible' => -1, 'enabled' => 1, 'position' => 92, 'notnull' => 0, 'searchall' => 0, 'comment' => "IMAP server charset", 'help' => 'Example: "UTF-8" (May be "US-ASCII" with some Office365)', 'default' => 'UTF-8'), + 'imap_encryption' => array('type' => 'varchar(16)', 'label' => 'ImapEncryption', 'visible' => -1, 'enabled' => 1, 'position' => 93, 'searchall' => 0, 'comment' => "IMAP encryption", 'help' => 'ImapEncryptionHelp', 'arrayofkeyval' => array('ssl' => 'SSL', 'tls' => 'TLS', 'notls' => 'NOTLS'), 'default' => 'ssl'), + 'norsh' => array('type' => 'integer', 'label' => 'NoRSH', 'visible' => -1, 'enabled' => "!getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position' => 94, 'searchall' => 0, 'help' => 'NoRSHHelp', 'arrayofkeyval' => array(0 => 'No', 1 => 'Yes'), 'default' => 0), + 'acces_type' => array('type' => 'integer', 'label' => 'accessType', 'visible' => -1, 'enabled' => "getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position' => 101, 'notnull' => 1, 'index' => 1, 'comment' => "IMAP login type", 'arrayofkeyval' => array('0' => 'loginPassword', '1' => 'oauthToken'), 'default' => '0', 'help' => ''), + 'login' => array('type' => 'varchar(128)', 'label' => 'Login', 'visible' => -1, 'enabled' => 1, 'position' => 102, 'notnull' => -1, 'index' => 1, 'comment' => "IMAP login", 'help' => 'Example: myaccount@gmail.com'), + 'password' => array('type' => 'password', 'label' => 'Password', 'visible' => -1, 'enabled' => "1", 'position' => 103, 'notnull' => -1, 'comment' => "IMAP password", 'help' => 'WithGMailYouCanCreateADedicatedPassword'), + 'oauth_service' => array('type' => 'varchar(128)', 'label' => 'oauthService', 'visible' => -1, 'enabled' => "getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position' => 104, 'notnull' => 0, 'index' => 1, 'comment' => "IMAP login oauthService", 'arrayofkeyval' => array(), 'help' => 'TokenMustHaveBeenCreated'), + 'source_directory' => array('type' => 'varchar(255)', 'label' => 'MailboxSourceDirectory', 'visible' => -1, 'enabled' => 1, 'position' => 109, 'notnull' => 1, 'default' => 'Inbox', 'help' => 'Example: INBOX, [Gmail]/Spam, [Gmail]/Draft, [Gmail]/Brouillons, [Gmail]/Sent Mail, [Gmail]/Messages envoyés, ...'), + 'target_directory' => array('type' => 'varchar(255)', 'label' => 'MailboxTargetDirectory', 'visible' => 1, 'enabled' => 1, 'position' => 110, 'notnull' => 0, 'help' => "EmailCollectorTargetDir"), + 'maxemailpercollect' => array('type' => 'integer', 'label' => 'MaxEmailCollectPerCollect', 'visible' => -1, 'enabled' => 1, 'position' => 111, 'default' => 50), + 'datelastresult' => array('type' => 'datetime', 'label' => 'DateLastCollectResult', 'visible' => 1, 'enabled' => '$action != "create" && $action != "edit"', 'position' => 121, 'notnull' => -1, 'csslist' => 'nowraponall'), + 'codelastresult' => array('type' => 'varchar(16)', 'label' => 'CodeLastResult', 'visible' => 1, 'enabled' => '$action != "create" && $action != "edit"', 'position' => 122, 'notnull' => -1,), + 'lastresult' => array('type' => 'varchar(255)', 'label' => 'LastResult', 'visible' => 1, 'enabled' => '$action != "create" && $action != "edit"', 'position' => 123, 'notnull' => -1, 'cssview' => 'small', 'csslist' => 'small tdoverflowmax200'), + 'datelastok' => array('type' => 'datetime', 'label' => 'DateLastcollectResultOk', 'visible' => 1, 'enabled' => '$action != "create"', 'position' => 125, 'notnull' => -1, 'csslist' => 'nowraponall'), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'visible' => 0, 'enabled' => 1, 'position' => 61, 'notnull' => -1,), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'visible' => 0, 'enabled' => 1, 'position' => 62, 'notnull' => -1,), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'visible' => -2, 'enabled' => 1, 'position' => 500, 'notnull' => 1,), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'visible' => -2, 'enabled' => 1, 'position' => 501, 'notnull' => 1,), //'date_validation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502), - 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'visible'=>-2, 'enabled'=>1, 'position'=>510, 'notnull'=>1,), - 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'visible'=>-2, 'enabled'=>1, 'position'=>511, 'notnull'=>-1,), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'visible' => -2, 'enabled' => 1, 'position' => 510, 'notnull' => 1,), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'visible' => -2, 'enabled' => 1, 'position' => 511, 'notnull' => -1,), //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), - 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1,), - 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'arrayofkeyval'=>array('0'=>'Inactive', '1'=>'Active')) + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'visible' => -2, 'enabled' => 1, 'position' => 1000, 'notnull' => -1,), + 'status' => array('type' => 'integer', 'label' => 'Status', 'visible' => 1, 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '0', 'index' => 1, 'arrayofkeyval' => array('0' => 'Inactive', '1' => 'Active')) ); @@ -614,7 +615,7 @@ class EmailCollector extends CommonObject //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); $hookmanager->initHooks(array('emailcollectordao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; @@ -730,7 +731,7 @@ class EmailCollector extends CommonObject $i = 0; while ($i < $num) { $obj = $this->db->fetch_object($resql); - $this->filters[$obj->rowid] = array('id'=>$obj->rowid, 'type'=>$obj->type, 'rulevalue'=>$obj->rulevalue, 'status'=>$obj->status); + $this->filters[$obj->rowid] = array('id' => $obj->rowid, 'type' => $obj->type, 'rulevalue' => $obj->rulevalue, 'status' => $obj->status); $i++; } $this->db->free($resql); @@ -762,7 +763,7 @@ class EmailCollector extends CommonObject $i = 0; while ($i < $num) { $obj = $this->db->fetch_object($resql); - $this->actions[$obj->rowid] = array('id'=>$obj->rowid, 'type'=>$obj->type, 'actionparam'=>$obj->actionparam, 'status'=>$obj->status); + $this->actions[$obj->rowid] = array('id' => $obj->rowid, 'type' => $obj->type, 'actionparam' => $obj->actionparam, 'status' => $obj->status); $i++; } $this->db->free($resql); @@ -1673,8 +1674,8 @@ class EmailCollector extends CommonObject } else { $operationslog .= " - ".dol_escape_htmltag((string) $imapemail); } - $operationslog .= " - References: ".dol_escape_htmltag($headers['References']??'')." - Subject: ".dol_escape_htmltag($headers['Subject']); - dol_syslog("** Process email ".$iforemailloop." References: ".($headers['References']??'')." Subject: ".$headers['Subject']); + $operationslog .= " - References: ".dol_escape_htmltag($headers['References'] ?? '')." - Subject: ".dol_escape_htmltag($headers['Subject']); + dol_syslog("** Process email ".$iforemailloop." References: ".($headers['References'] ?? '')." Subject: ".$headers['Subject']); $trackidfoundintorecipienttype = ''; @@ -2678,7 +2679,7 @@ class EmailCollector extends CommonObject } if (!empty($attachments)) { // There is an attachment for the ticket -> store attachment - $ticket = New Ticket($this->db); + $ticket = new Ticket($this->db); $ticket->fetch($fk_element_id); $destdir = $conf->ticket->dir_output.'/'.$ticket->ref; if (!dol_is_dir($destdir)) { @@ -3248,23 +3249,23 @@ class EmailCollector extends CommonObject } $parameters = array( - 'connection'=> $connection, - 'imapemail'=>$imapemail, - 'overview'=>$overview, + 'connection' => $connection, + 'imapemail' => $imapemail, + 'overview' => $overview, 'from' => $from, 'fromtext' => $fromtext, - 'actionparam'=> $operation['actionparam'], + 'actionparam' => $operation['actionparam'], 'thirdpartyid' => $thirdpartyid, - 'objectid'=> $objectid, - 'objectemail'=> $objectemail, + 'objectid' => $objectid, + 'objectemail' => $objectemail, - 'messagetext'=>$messagetext, - 'subject'=>$subject, - 'header'=>$header, - 'attachments'=>$attachments, + 'messagetext' => $messagetext, + 'subject' => $subject, + 'header' => $header, + 'attachments' => $attachments, ); $reshook = $hookmanager->executeHooks('doCollectImapOneCollector', $parameters, $this, $operation['type']); From fb730e2c5b7498d6f746eca88a1047972929bbea Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:05:24 +0100 Subject: [PATCH 0939/1862] Qual: set default value to match PHPdoc type --- .../class/expensereport.class.php | 103 +++++++++--------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 38d86dc15c7..a62d4dc04f2 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (c) 2018-2024 Frédéric France * Copyright (C) 2016-2020 Ferran Marcet + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -230,49 +231,49 @@ class ExpenseReport extends CommonObject const STATUS_REFUSED = 99; public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'ref' =>array('type'=>'varchar(50)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>15), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20), - 'ref_number_int' =>array('type'=>'integer', 'label'=>'Ref number int', 'enabled'=>1, 'visible'=>-1, 'position'=>25), - 'ref_ext' =>array('type'=>'integer', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>-1, 'position'=>30), - 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'Total ht', 'enabled'=>1, 'visible'=>-1, 'position'=>35), - 'total_tva' =>array('type'=>'double(24,8)', 'label'=>'Total tva', 'enabled'=>1, 'visible'=>-1, 'position'=>40), - 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'Localtax1', 'enabled'=>1, 'visible'=>-1, 'position'=>45), - 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'Localtax2', 'enabled'=>1, 'visible'=>-1, 'position'=>50), - 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'date_debut' =>array('type'=>'date', 'label'=>'Date debut', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>60), - 'date_fin' =>array('type'=>'date', 'label'=>'Date fin', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>65), - 'date_valid' =>array('type'=>'datetime', 'label'=>'Date valid', 'enabled'=>1, 'visible'=>-1, 'position'=>75), - 'date_approve' =>array('type'=>'datetime', 'label'=>'Date approve', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'date_refuse' =>array('type'=>'datetime', 'label'=>'Date refuse', 'enabled'=>1, 'visible'=>-1, 'position'=>85), - 'date_cancel' =>array('type'=>'datetime', 'label'=>'Date cancel', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'fk_user_author' =>array('type'=>'integer', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>100), - 'fk_user_modif' =>array('type'=>'integer', 'label'=>'Fk user modif', 'enabled'=>1, 'visible'=>-1, 'position'=>105), - 'fk_user_valid' =>array('type'=>'integer', 'label'=>'Fk user valid', 'enabled'=>1, 'visible'=>-1, 'position'=>110), - 'fk_user_validator' =>array('type'=>'integer', 'label'=>'Fk user validator', 'enabled'=>1, 'visible'=>-1, 'position'=>115), - 'fk_user_approve' =>array('type'=>'integer', 'label'=>'Fk user approve', 'enabled'=>1, 'visible'=>-1, 'position'=>120), - 'fk_user_refuse' =>array('type'=>'integer', 'label'=>'Fk user refuse', 'enabled'=>1, 'visible'=>-1, 'position'=>125), - 'fk_user_cancel' =>array('type'=>'integer', 'label'=>'Fk user cancel', 'enabled'=>1, 'visible'=>-1, 'position'=>130), - 'fk_c_paiement' =>array('type'=>'integer', 'label'=>'Fk c paiement', 'enabled'=>1, 'visible'=>-1, 'position'=>140), - 'paid' =>array('type'=>'integer', 'label'=>'Paid', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>145), - 'note_public' =>array('type'=>'html', 'label'=>'Note public', 'enabled'=>1, 'visible'=>0, 'position'=>150), - 'note_private' =>array('type'=>'html', 'label'=>'Note private', 'enabled'=>1, 'visible'=>0, 'position'=>155), - 'detail_refuse' =>array('type'=>'varchar(255)', 'label'=>'Detail refuse', 'enabled'=>1, 'visible'=>-1, 'position'=>160), - 'detail_cancel' =>array('type'=>'varchar(255)', 'label'=>'Detail cancel', 'enabled'=>1, 'visible'=>-1, 'position'=>165), - 'integration_compta' =>array('type'=>'integer', 'label'=>'Integration compta', 'enabled'=>1, 'visible'=>-1, 'position'=>170), - 'fk_bank_account' =>array('type'=>'integer', 'label'=>'Fk bank account', 'enabled'=>1, 'visible'=>-1, 'position'=>175), - 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>-1, 'position'=>185), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Multicurrency code', 'enabled'=>1, 'visible'=>-1, 'position'=>190), - 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency tx', 'enabled'=>1, 'visible'=>-1, 'position'=>195), - 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ht', 'enabled'=>1, 'visible'=>-1, 'position'=>200), - 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total tva', 'enabled'=>1, 'visible'=>-1, 'position'=>205), - 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>210), - 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>220), - 'date_create' =>array('type'=>'datetime', 'label'=>'Date create', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>300), - 'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>305), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>1000), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>1010), - 'fk_statut' =>array('type'=>'integer', 'label'=>'Fk statut', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), + 'rowid' => array('type' => 'integer', 'label' => 'ID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'ref' => array('type' => 'varchar(50)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'showoncombobox' => 1, 'position' => 15), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 20), + 'ref_number_int' => array('type' => 'integer', 'label' => 'Ref number int', 'enabled' => 1, 'visible' => -1, 'position' => 25), + 'ref_ext' => array('type' => 'integer', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => -1, 'position' => 30), + 'total_ht' => array('type' => 'double(24,8)', 'label' => 'Total ht', 'enabled' => 1, 'visible' => -1, 'position' => 35), + 'total_tva' => array('type' => 'double(24,8)', 'label' => 'Total tva', 'enabled' => 1, 'visible' => -1, 'position' => 40), + 'localtax1' => array('type' => 'double(24,8)', 'label' => 'Localtax1', 'enabled' => 1, 'visible' => -1, 'position' => 45), + 'localtax2' => array('type' => 'double(24,8)', 'label' => 'Localtax2', 'enabled' => 1, 'visible' => -1, 'position' => 50), + 'total_ttc' => array('type' => 'double(24,8)', 'label' => 'Total ttc', 'enabled' => 1, 'visible' => -1, 'position' => 55), + 'date_debut' => array('type' => 'date', 'label' => 'Date debut', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 60), + 'date_fin' => array('type' => 'date', 'label' => 'Date fin', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 65), + 'date_valid' => array('type' => 'datetime', 'label' => 'Date valid', 'enabled' => 1, 'visible' => -1, 'position' => 75), + 'date_approve' => array('type' => 'datetime', 'label' => 'Date approve', 'enabled' => 1, 'visible' => -1, 'position' => 80), + 'date_refuse' => array('type' => 'datetime', 'label' => 'Date refuse', 'enabled' => 1, 'visible' => -1, 'position' => 85), + 'date_cancel' => array('type' => 'datetime', 'label' => 'Date cancel', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'fk_user_author' => array('type' => 'integer', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 100), + 'fk_user_modif' => array('type' => 'integer', 'label' => 'Fk user modif', 'enabled' => 1, 'visible' => -1, 'position' => 105), + 'fk_user_valid' => array('type' => 'integer', 'label' => 'Fk user valid', 'enabled' => 1, 'visible' => -1, 'position' => 110), + 'fk_user_validator' => array('type' => 'integer', 'label' => 'Fk user validator', 'enabled' => 1, 'visible' => -1, 'position' => 115), + 'fk_user_approve' => array('type' => 'integer', 'label' => 'Fk user approve', 'enabled' => 1, 'visible' => -1, 'position' => 120), + 'fk_user_refuse' => array('type' => 'integer', 'label' => 'Fk user refuse', 'enabled' => 1, 'visible' => -1, 'position' => 125), + 'fk_user_cancel' => array('type' => 'integer', 'label' => 'Fk user cancel', 'enabled' => 1, 'visible' => -1, 'position' => 130), + 'fk_c_paiement' => array('type' => 'integer', 'label' => 'Fk c paiement', 'enabled' => 1, 'visible' => -1, 'position' => 140), + 'paid' => array('type' => 'integer', 'label' => 'Paid', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 145), + 'note_public' => array('type' => 'html', 'label' => 'Note public', 'enabled' => 1, 'visible' => 0, 'position' => 150), + 'note_private' => array('type' => 'html', 'label' => 'Note private', 'enabled' => 1, 'visible' => 0, 'position' => 155), + 'detail_refuse' => array('type' => 'varchar(255)', 'label' => 'Detail refuse', 'enabled' => 1, 'visible' => -1, 'position' => 160), + 'detail_cancel' => array('type' => 'varchar(255)', 'label' => 'Detail cancel', 'enabled' => 1, 'visible' => -1, 'position' => 165), + 'integration_compta' => array('type' => 'integer', 'label' => 'Integration compta', 'enabled' => 1, 'visible' => -1, 'position' => 170), + 'fk_bank_account' => array('type' => 'integer', 'label' => 'Fk bank account', 'enabled' => 1, 'visible' => -1, 'position' => 175), + 'fk_multicurrency' => array('type' => 'integer', 'label' => 'Fk multicurrency', 'enabled' => 1, 'visible' => -1, 'position' => 185), + 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'Multicurrency code', 'enabled' => 1, 'visible' => -1, 'position' => 190), + 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'Multicurrency tx', 'enabled' => 1, 'visible' => -1, 'position' => 195), + 'multicurrency_total_ht' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total ht', 'enabled' => 1, 'visible' => -1, 'position' => 200), + 'multicurrency_total_tva' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total tva', 'enabled' => 1, 'visible' => -1, 'position' => 205), + 'multicurrency_total_ttc' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total ttc', 'enabled' => 1, 'visible' => -1, 'position' => 210), + 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 220), + 'date_create' => array('type' => 'datetime', 'label' => 'Date create', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 300), + 'tms' => array('type' => 'timestamp', 'label' => 'Tms', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 305), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -1, 'position' => 1000), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 1010), + 'fk_statut' => array('type' => 'integer', 'label' => 'Fk statut', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 500), ); /** @@ -521,7 +522,7 @@ class ExpenseReport extends CommonObject if (!$error) { // Hook of thirdparty module if (is_object($hookmanager)) { - $parameters = array('objFrom'=>$objFrom); + $parameters = array('objFrom' => $objFrom); $action = ''; $reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -1820,7 +1821,7 @@ class ExpenseReport extends CommonObject global $action; $hookmanager->initHooks(array($this->element . 'dao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; @@ -2294,7 +2295,7 @@ class ExpenseReport extends CommonObject */ public function deleteLine($rowid, $fuser = '', $notrigger = 0) { - $error=0; + $error = 0; $this->db->begin(); @@ -2721,10 +2722,10 @@ class ExpenseReport extends CommonObject $sql = " SELECT count(n.qty) as cumul FROM ".MAIN_DB_PREFIX."expensereport_det n"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport e ON e.rowid = n.fk_expensereport"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_fees tf ON tf.id = n.fk_c_type_fees"; - $sql.= " WHERE e.fk_user_author = ".(int) $this->fk_user_author; - $sql.= " AND YEAR(n.date) = ".(int) $arrayDate['year']; - $sql.= " AND tf.code = 'EX_KME' "; - $sql.= " AND e.fk_statut = ".(int) ExpenseReport::STATUS_VALIDATED; + $sql .= " WHERE e.fk_user_author = ".(int) $this->fk_user_author; + $sql .= " AND YEAR(n.date) = ".(int) $arrayDate['year']; + $sql .= " AND tf.code = 'EX_KME' "; + $sql .= " AND e.fk_statut = ".(int) ExpenseReport::STATUS_VALIDATED; $resql = $this->db->query($sql); @@ -2748,7 +2749,7 @@ class ExpenseReport extends CommonObject for ($i = 0; $i < $num; $i++) { if ($i < ($num - 1)) { - if ($qty > $ranges[$i]->range_ik && $qty < $ranges[$i+1]->range_ik) { + if ($qty > $ranges[$i]->range_ik && $qty < $ranges[$i + 1]->range_ik) { $coef = $ranges[$i]->coef; $offset = $ranges[$i]->ikoffset; } From 1ea9a7fa4858f50c60d84c834b981a9645591716 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:10:04 +0100 Subject: [PATCH 0940/1862] Qual: set default value to match PHPdoc type --- htdocs/fourn/class/fournisseur.commande.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 407d1c7e0a9..a1be6fa35f8 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -14,6 +14,7 @@ * Copyright (C) 2021 Josep Lluís Amador * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2024 Solution Libre SAS + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -396,7 +397,7 @@ class CommandeFournisseur extends CommonOrder 'multicurrency_total_ttc' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountTTC', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 240), 'date_creation' => array('type' => 'datetime', 'label' => 'Date creation', 'enabled' => 1, 'visible' => -1, 'position' => 500), 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => 1, 'notnull' => 1, 'position' => 50), - 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 1000, 'index' => 1), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 1000, 'index' => 1), 'tms' => array('type' => 'datetime', 'label' => "DateModificationShort", 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 501), 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => 0, 'position' => 700), 'fk_statut' => array('type' => 'smallint(6)', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'position' => 701), From 7a7d342aaadb7fd7421c31416bcbfccb42d87da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 22:14:39 +0100 Subject: [PATCH 0941/1862] clean code and phpdoc --- dev/tools/phan/config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 0bb240128f8..ae33dadbb32 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France */ define('DOL_PROJECT_ROOT', __DIR__.'/../../..'); define('DOL_DOCUMENT_ROOT', DOL_PROJECT_ROOT.'/htdocs'); @@ -535,7 +536,7 @@ return [ // 'PhanTypeInvalidThrowsIsInterface', // 'PhanPluginRedundantAssignmentInLoop', // 'PhanInvalidCommentForDeclarationType', - //'PhanParamSignatureMismatchInternal', + 'PhanParamSignatureMismatchInternal', // 'PhanPluginEmptyStatementForeachLoop', // 'PhanCompatibleDimAlternativeSyntax', 'PhanInvalidFQSENInClasslike', @@ -656,5 +657,4 @@ return [ 'sockets' => PHAN_DIR . '/stubs/sockets.phan_php', 'zip' => PHAN_DIR . '/stubs/zip.phan_php', ], - ]; From 44376cd066fa459ac68e6d6f400c4b0c45f75093 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:16:27 +0100 Subject: [PATCH 0942/1862] More specific type for childtablesoncascade --- htdocs/core/class/commonobject.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a693c31ff2d..11be8c7e0c0 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -781,9 +781,9 @@ abstract class CommonObject protected $childtables = array(); /** - * @var array List of child tables. To know object to delete on cascade. - * If name is like '@ClassName:FilePathClass:ParentFkFieldName', it will - * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object. + * @var string[] List of child tables. To know object to delete on cascade. + * If name is like '@ClassName:FilePathClass:ParentFkFieldName', it will + * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object. */ protected $childtablesoncascade = array(); From b1b49811611d6e9e9efe63d062fb72b94862632c Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:19:49 +0100 Subject: [PATCH 0943/1862] Qual: Fix PHPdoc to match parent --- htdocs/salaries/class/salary.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index 76a8982062e..0e242e38b39 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,9 +50,9 @@ class Salary extends CommonObject public $picto = 'salary'; /** - * @var array List of child tables. To test if we can delete object. + * @var array> List of child tables. To test if we can delete object. */ - protected $childtables = array('payment_salary' => array('name'=>'SalaryPayment', 'fk_element'=>'fk_salary')); + protected $childtables = array('payment_salary' => array('name' => 'SalaryPayment', 'fk_element' => 'fk_salary')); // /** // * @var array List of child tables. To know object to delete on cascade. @@ -572,7 +573,7 @@ class Salary extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('salarypayment')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; From e60db40fa4421f59a2da72214c71f38a2604ca51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 22:20:29 +0100 Subject: [PATCH 0944/1862] clean code and phpdoc --- dev/tools/phan/config.php | 3 ++- dev/tools/phan/config_fixer.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index ae33dadbb32..36aca92b25e 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -536,7 +536,8 @@ return [ // 'PhanTypeInvalidThrowsIsInterface', // 'PhanPluginRedundantAssignmentInLoop', // 'PhanInvalidCommentForDeclarationType', - 'PhanParamSignatureMismatchInternal', + // 'PhanParamSignatureMismatchInternal', + 'PhanParamSignatureMismatch', // 'PhanPluginEmptyStatementForeachLoop', // 'PhanCompatibleDimAlternativeSyntax', 'PhanInvalidFQSENInClasslike', diff --git a/dev/tools/phan/config_fixer.php b/dev/tools/phan/config_fixer.php index a588483e3bf..8033331240b 100644 --- a/dev/tools/phan/config_fixer.php +++ b/dev/tools/phan/config_fixer.php @@ -1,4 +1,7 @@ + * Copyright (C) 2024 Frédéric France + */ // Uncomment require_once to enable corresponding fixer @@ -7,8 +10,6 @@ //require_once __DIR__.'/plugins/UrlEncodeStringifyFixer.php'; require_once __DIR__.'/plugins/SelectDateFixer.php'; -/* Copyright (C) 2024 MDW - */ define('DOL_PROJECT_ROOT', __DIR__.'/../../..'); define('DOL_DOCUMENT_ROOT', DOL_PROJECT_ROOT.'/htdocs'); define('PHAN_DIR', __DIR__); From f4e1026e7d2fa26ae7e6de372db43431dd161099 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:21:08 +0100 Subject: [PATCH 0945/1862] Qual: Fix PHPdoc to match parent --- htdocs/projet/class/task.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index a8217136ff6..5f97d8c9a3f 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2020 Juanjo Menent * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Gauthier VERDOL + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,7 +60,7 @@ class Task extends CommonObjectLine public $picto = 'projecttask'; /** - * @var array List of child tables. To test if we can delete object. + * @var array> List of child tables. To test if we can delete object. */ protected $childtables = array( 'element_time' => array('name' => 'Task', 'parent' => 'projet_task', 'parentkey' => 'fk_element', 'parenttypefield' => 'elementtype', 'parenttypevalue' => 'task') @@ -881,7 +882,7 @@ class Task extends CommonObjectLine $result .= (($addlabel && $this->label) ? $sep.dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); } - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; From 71948cb559c54df3734998c27e409be9007bc50d Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:24:04 +0100 Subject: [PATCH 0946/1862] Qual: Fix PHPdoc to match parent --- htdocs/product/inventory/class/inventory.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index cb3da2f695a..05a59a22875 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -204,11 +205,11 @@ class Inventory extends CommonObject public $class_element_line = 'Inventoryline'; /** - * @var array List of child tables. To test if we can delete object. + * @var array> List of child tables. To test if we can delete object. */ protected $childtables = array(); /** - * @var array List of child tables. To know object to delete on cascade. + * @var string[] List of child tables. To know object to delete on cascade. */ protected $childtablesoncascade = array('inventorydet'); From 303d0ef6791b5f490b2e5d6d56749213ef3c0bd8 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:25:57 +0100 Subject: [PATCH 0947/1862] Qual: Fix PHPdoc to match parent --- htdocs/product/class/product.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 3b31d2064e3..3be66063f6f 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -16,6 +16,7 @@ * Copyright (C) 2017 Gustavo Novaro * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2023 Benjamin Falière + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -76,7 +77,7 @@ class Product extends CommonObject public $oldcopy; /** - * @var array List of child tables. To test if we can delete object. + * @var array> List of child tables. To test if we can delete object. */ protected $childtables = array( 'supplier_proposaldet' => array('name' => 'SupplierProposal', 'parent' => 'supplier_proposal', 'parentkey' => 'fk_supplier_proposal'), @@ -113,7 +114,7 @@ class Product extends CommonObject public $regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.webp|\.xpm|\.xbm'; // See also into images.lib.php /** - * @deprecated + * @deprecated Use $label instead * @see $label */ public $libelle; From 03d14dfe56f268566b680dd95f8807d6bc8fa14e Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:27:35 +0100 Subject: [PATCH 0948/1862] Qual: set default value to match PHPdoc type --- htdocs/partnership/class/partnership_type.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index 335009e0e29..b5a6cc21656 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2018-2019 Thibault Foucart * Copyright (C) 2021 Waël Almoman * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -71,7 +72,7 @@ class PartnershipType extends CommonObject public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), - 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1), 'code' => array('type' => 'varchar(32)', 'label' => 'Code', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 20), 'label' => array('type' => 'varchar(64)', 'label' => 'Label', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 25, 'showoncombobox' => 1), 'active' => array('type' => 'integer', 'label' => 'Active', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 30), From 7fabf59b46cfc90d9a6b773cafa1ec69b47a7fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 23:13:30 +0100 Subject: [PATCH 0949/1862] clean code and phpdoc --- htdocs/comm/remx.php | 5 +++-- htdocs/core/lib/usergroups.lib.php | 32 ++++++++++++++---------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 994e30fb9f1..f1584aa8b30 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2004 Rodolphe Quiedeville * Copyright (C) 2004-2019 Laurent Destailleur * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,6 +45,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Security check $socid = GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('socid'); +/** @var User $user */ if ($user->socid > 0) { $socid = $user->socid; } @@ -55,7 +56,7 @@ if ($user->socid > 0) { } $result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); -$permissiontocreate = ($user->rights->societe->creer || $user->rights->facture->creer); +$permissiontocreate = ($user->hasRight('societe', 'creer') || $user->hasRight('facture', 'creer')); diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 30db640ed07..87e6e367cb3 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -4,6 +4,7 @@ * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2021-2023 Anthony Berton + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -237,7 +238,7 @@ function group_prepare_head($object) $canreadperms = true; if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) { - $canreadperms = ($user->admin || $user->rights->user->group_advance->readperms); + $canreadperms = ($user->admin || $user->hasRight('user', 'group_advance', 'readperms')); } $h = 0; @@ -504,17 +505,17 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) //Nothing } else { $listofdarkmodes = array( - '0' => $langs->trans("AlwaysDisabled"), - '1' => $langs->trans("AccordingToBrowser"), - '2' => $langs->trans("AlwaysEnabled") + $langs->trans("AlwaysDisabled"), + $langs->trans("AccordingToBrowser"), + $langs->trans("AlwaysEnabled") ); print '
'.$langs->trans("DarkThemeMode").''; if ($edit) { - print $form->selectarray('THEME_DARKMODEENABLED', $listofdarkmodes, isset($conf->global->THEME_DARKMODEENABLED) ? $conf->global->THEME_DARKMODEENABLED : 0); + print $form->selectarray('THEME_DARKMODEENABLED', $listofdarkmodes, getDolGlobalInt('THEME_DARKMODEENABLED')); } else { - print $listofdarkmodes[isset($conf->global->THEME_DARKMODEENABLED) ? $conf->global->THEME_DARKMODEENABLED : 0]; + print $listofdarkmodes[getDolGlobalInt('THEME_DARKMODEENABLED')]; } print $form->textwithpicto('', $langs->trans("DoesNotWorkWithAllThemes")); print '
'.$langs->trans("TopMenuDisableImages").''; - if ($edit) - { + if ($edit) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','',1).' '; - } - else - { - $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); + } else { + $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); if ($color) print ''; else print ''; } From 7ad8f6b074180984bbb7685095fc70f7f59a7deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 23:18:01 +0100 Subject: [PATCH 0950/1862] clean code and phpdoc --- htdocs/core/lib/functions2.lib.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 1335da5649a..f5e95da450c 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -7,6 +7,7 @@ * Copyright (C) 2015-2016 Raphaël Doursenaud * Copyright (C) 2017 Juanjo Menent * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -892,7 +893,7 @@ function array2table($data, $tableMarkup = 1, $tableoptions = '', $troptions = ' * @param string $table Table containing field with counter * @param string $field Field containing already used values of counter * @param string $where To add a filter on selection (for example to filter on invoice types) - * @param Societe $objsoc The company that own the object we need a counter for + * @param Societe|string $objsoc The company that own the object we need a counter for * @param string $date Date to use for the {y},{m},{d} tags. * @param string $mode 'next' for next value or 'last' for last value * @param bool $bentityon Activate the entity filter. Default is true (for modules not compatible with multicompany) @@ -2511,16 +2512,16 @@ function colorLighten($hex, $percent) /** - * @param string $hex color in hex - * @param float $alpha 0 to 1 to add alpha channel - * @param bool $returnArray true=return an array instead, false=return string - * @return string|array String or array + * @param string $hex color in hex + * @param float|false $alpha 0 to 1 to add alpha channel + * @param bool $returnArray true=return an array instead, false=return string + * @return string|array String or array */ function colorHexToRgb($hex, $alpha = false, $returnArray = false) { $string = ''; - $hex = str_replace('#', '', $hex); - $length = strlen($hex); + $hex = str_replace('#', '', $hex); + $length = strlen($hex); $rgb = array(); $rgb['r'] = hexdec($length == 6 ? substr($hex, 0, 2) : ($length == 3 ? str_repeat(substr($hex, 0, 1), 2) : 0)); $rgb['g'] = hexdec($length == 6 ? substr($hex, 2, 2) : ($length == 3 ? str_repeat(substr($hex, 1, 1), 2) : 0)); From b79328f4e613f0f635b5be1d2bec1953aa1c8d37 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:28:39 +0100 Subject: [PATCH 0951/1862] Qual: Fix PHPdoc to match parent --- htdocs/core/class/CMailFile.class.php | 2 +- htdocs/user/class/usergroup.class.php | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 1e1004a7959..ea236ae12bc 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -731,7 +731,7 @@ class CMailFile /** * Send mail that was prepared by constructor. * - * @return negative-int|bool|string True if mail sent, false otherwise. Negative int if error in hook. String if incorrect send mode. + * @return int|bool|string True if mail sent, false otherwise. Negative int if error in hook. String if incorrect send mode. */ public function sendfile() { diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 48ec6758351..25a188fa8ee 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2019 Abbes Bahfir * Copyright (C) 2023-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -111,13 +112,13 @@ class UserGroup extends CommonObject public $oldcopy; // To contains a clone of this when we need to save old properties of object public $fields = array( - 'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), - 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5), - 'nom'=>array('type'=>'varchar(180)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Group name'), - 'note' => array('type'=>'html', 'label'=>'Description', 'enabled'=>1, 'visible'=>1, 'position'=>20, 'notnull'=>-1, 'searchall'=>1), - 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>50, 'notnull'=>1,), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>60, 'notnull'=>1,), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPDF', 'enabled'=>1, 'visible'=>0, 'position'=>100), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'default' => 1, 'index' => 1, 'position' => 5), + 'nom' => array('type' => 'varchar(180)', 'label' => 'Name', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 1, 'index' => 1, 'position' => 10, 'searchall' => 1, 'comment' => 'Group name'), + 'note' => array('type' => 'html', 'label' => 'Description', 'enabled' => 1, 'visible' => 1, 'position' => 20, 'notnull' => -1, 'searchall' => 1), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'position' => 50, 'notnull' => 1,), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'position' => 60, 'notnull' => 1,), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'ModelPDF', 'enabled' => 1, 'visible' => 0, 'position' => 100), ); /** @@ -126,12 +127,12 @@ class UserGroup extends CommonObject public $fk_element = 'fk_usergroup'; /** - * @var array List of child tables. To test if we can delete object. + * @var array> List of child tables. To test if we can delete object. */ protected $childtables = array(); /** - * @var array List of child tables. To know object to delete on cascade. + * @var string[] List of child tables. To know object to delete on cascade. */ protected $childtablesoncascade = array('usergroup_rights', 'usergroup_user'); @@ -407,7 +408,7 @@ class UserGroup extends CommonObject if (!$error) { $langs->load("other"); - $this->context = array('audit'=>$langs->trans("PermissionsAdd").($rid ? ' (id='.$rid.')' : '')); + $this->context = array('audit' => $langs->trans("PermissionsAdd").($rid ? ' (id='.$rid.')' : '')); // Call trigger $result = $this->call_trigger('USERGROUP_MODIFY', $user); @@ -536,7 +537,7 @@ class UserGroup extends CommonObject if (!$error) { $langs->load("other"); - $this->context = array('audit'=>$langs->trans("PermissionsDelete").($rid ? ' (id='.$rid.')' : '')); + $this->context = array('audit' => $langs->trans("PermissionsDelete").($rid ? ' (id='.$rid.')' : '')); // Call trigger $result = $this->call_trigger('USERGROUP_MODIFY', $user); @@ -860,7 +861,7 @@ class UserGroup extends CommonObject global $action; $hookmanager->initHooks(array('groupdao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; From d9b63894d1b1de5ad636297994956867d72a7fea Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:29:48 +0100 Subject: [PATCH 0952/1862] Qual: Fix PHPdoc to match parent --- htdocs/societe/class/societe.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index eedaa168c37..5258417e0cc 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -83,7 +83,7 @@ class Societe extends CommonObject public $fieldsforcombobox = 'nom,name_alias'; /** - * @var array List of child tables. To test if we can delete object. + * @var array> List of child tables. To test if we can delete object. */ protected $childtables = array( 'supplier_proposal' => array('name' => 'SupplierProposal'), @@ -101,7 +101,7 @@ class Societe extends CommonObject ); /** - * @var array List of child tables. To know object to delete on cascade. + * @var string[] List of child tables. To know object to delete on cascade. * if name like with @ClassName:FilePathClass:ParentFkFieldName' it will call method deleteByParentField (with parentId as parameters) and FieldName to fetch and delete child object */ protected $childtablesoncascade = array( From 868c52dd1dce31160f39e01244e2d3e0e9affd39 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:32:48 +0100 Subject: [PATCH 0953/1862] Qual: Fix PHPdoc to match parent & default to match doc --- htdocs/mrp/class/mo.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 9c1ade49f15..1b92a3a2851 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -221,12 +221,12 @@ class Mo extends CommonObject public $class_element_line = 'MoLine'; /** - * @var array List of child tables. To test if we can delete object. + * @var array> List of child tables. To test if we can delete object. */ protected $childtables = array(); /** - * @var array List of child tables. To know object to delete on cascade. + * @var string[] List of child tables. To know object to delete on cascade. */ protected $childtablesoncascade = array('mrp_production'); @@ -2016,8 +2016,8 @@ class MoLine extends CommonObjectLine 'fk_product' => array('type' => 'integer', 'label' => 'Product', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 25), 'fk_warehouse' => array('type' => 'integer', 'label' => 'Warehouse', 'enabled' => 1, 'visible' => -1, 'position' => 30), 'qty' => array('type' => 'real', 'label' => 'Qty', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 35), - 'qty_frozen' => array('type' => 'smallint', 'label' => 'QuantityFrozen', 'enabled' => 1, 'visible' => 1, 'default' => 0, 'position' => 105, 'css' => 'maxwidth50imp', 'help' => 'QuantityConsumedInvariable'), - 'disable_stock_change' => array('type' => 'smallint', 'label' => 'DisableStockChange', 'enabled' => 1, 'visible' => 1, 'default' => 0, 'position' => 108, 'css' => 'maxwidth50imp', 'help' => 'DisableStockChangeHelp'), + 'qty_frozen' => array('type' => 'smallint', 'label' => 'QuantityFrozen', 'enabled' => 1, 'visible' => 1, 'default' => '0', 'position' => 105, 'css' => 'maxwidth50imp', 'help' => 'QuantityConsumedInvariable'), + 'disable_stock_change' => array('type' => 'smallint', 'label' => 'DisableStockChange', 'enabled' => 1, 'visible' => 1, 'default' => '0', 'position' => 108, 'css' => 'maxwidth50imp', 'help' => 'DisableStockChangeHelp'), 'batch' => array('type' => 'varchar(30)', 'label' => 'Batch', 'enabled' => 1, 'visible' => -1, 'position' => 140), 'role' => array('type' => 'varchar(10)', 'label' => 'Role', 'enabled' => 1, 'visible' => -1, 'position' => 145), 'fk_mrp_production' => array('type' => 'integer', 'label' => 'Fk mrp production', 'enabled' => 1, 'visible' => -1, 'position' => 150), From c8c003a437e7bbd3311eaab5b8842002ec66571d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 23:46:48 +0100 Subject: [PATCH 0954/1862] restore rule --- dev/tools/phan/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 36aca92b25e..53982aaee7f 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -537,7 +537,7 @@ return [ // 'PhanPluginRedundantAssignmentInLoop', // 'PhanInvalidCommentForDeclarationType', // 'PhanParamSignatureMismatchInternal', - 'PhanParamSignatureMismatch', + // 'PhanParamSignatureMismatch', // 'PhanPluginEmptyStatementForeachLoop', // 'PhanCompatibleDimAlternativeSyntax', 'PhanInvalidFQSENInClasslike', From 6d92b164f0b14c877bba7bbebc225612ac6cccdc Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:35:23 +0100 Subject: [PATCH 0955/1862] Qual: set default value to match PHPdoc type --- htdocs/hrm/class/establishment.class.php | 39 ++++++++++++------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 37ab22b84a9..d2faf176a86 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -130,24 +131,24 @@ class Establishment extends CommonObject public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1), - 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>20), - 'label' =>array('type'=>'varchar(128)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'showoncombobox'=>2, 'position'=>22), - 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>25), - 'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-1, 'position'=>30), - 'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>35), - 'fk_state' =>array('type'=>'integer', 'label'=>'Fkstate', 'enabled'=>1, 'visible'=>-1, 'position'=>40), - 'fk_country' =>array('type'=>'integer', 'label'=>'Fkcountry', 'enabled'=>1, 'visible'=>-1, 'position'=>45), - 'profid1' =>array('type'=>'varchar(20)', 'label'=>'Profid1', 'enabled'=>1, 'visible'=>-1, 'position'=>50), - 'profid2' =>array('type'=>'varchar(20)', 'label'=>'Profid2', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'profid3' =>array('type'=>'varchar(20)', 'label'=>'Profid3', 'enabled'=>1, 'visible'=>-1, 'position'=>60), - 'phone' =>array('type'=>'varchar(20)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>-1, 'position'=>65), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fkuserauthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>70), - 'fk_user_mod' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fkusermod', 'enabled'=>1, 'visible'=>-1, 'position'=>75), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>80), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>85), - 'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1), + 'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'showoncombobox' => 1, 'position' => 20), + 'label' => array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => 1, 'visible' => -1, 'showoncombobox' => 2, 'position' => 22), + 'address' => array('type' => 'varchar(255)', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 25), + 'zip' => array('type' => 'varchar(25)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 30), + 'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -1, 'position' => 35), + 'fk_state' => array('type' => 'integer', 'label' => 'Fkstate', 'enabled' => 1, 'visible' => -1, 'position' => 40), + 'fk_country' => array('type' => 'integer', 'label' => 'Fkcountry', 'enabled' => 1, 'visible' => -1, 'position' => 45), + 'profid1' => array('type' => 'varchar(20)', 'label' => 'Profid1', 'enabled' => 1, 'visible' => -1, 'position' => 50), + 'profid2' => array('type' => 'varchar(20)', 'label' => 'Profid2', 'enabled' => 1, 'visible' => -1, 'position' => 55), + 'profid3' => array('type' => 'varchar(20)', 'label' => 'Profid3', 'enabled' => 1, 'visible' => -1, 'position' => 60), + 'phone' => array('type' => 'varchar(20)', 'label' => 'Phone', 'enabled' => 1, 'visible' => -1, 'position' => 65), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fkuserauthor', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 70), + 'fk_user_mod' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fkusermod', 'enabled' => 1, 'visible' => -1, 'position' => 75), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 80), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 85), + 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => -1, 'position' => 500), ); @@ -505,7 +506,7 @@ class Establishment extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('establishmentdao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; From 217e3afda5332f0586ba0b9602cb81fd99007765 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:52:15 +0100 Subject: [PATCH 0956/1862] Qual: set default value to match PHPdoc type --- htdocs/bom/class/bom.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 451926a030c..f6a1d4f9deb 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2023 Benjamin Falière * Copyright (C) 2023 Charlene Benke * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -236,7 +237,7 @@ class BOM extends CommonObject // protected $childtables=array(); /** - * @var array List of child tables. To know object to delete on cascade. + * @var string[] List of child tables. To know object to delete on cascade. */ protected $childtablesoncascade = array('bom_bomline'); From 3c7cbac2400bb010e1b1399ba4beab3ac7f2c9f4 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:54:04 +0100 Subject: [PATCH 0957/1862] Qual: set default value to match PHPdoc type --- htdocs/ecm/class/ecmfiles.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index fcf77549177..69501fda02b 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -161,16 +161,16 @@ class EcmFiles extends CommonObject 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => -1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => "contains hash from filename+filepath"), 'label' => array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "contains hash of file content"), 'share' => array('type' => 'varchar(128)', 'label' => 'Share', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "contains hash for file sharing"), - 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 50, 'index' => 1), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 50, 'index' => 1), 'filepath' => array('type' => 'varchar(255)', 'label' => 'FilePath', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "relative to dolibarr document dir. Example module/def"), 'filename' => array('type' => 'varchar(255)', 'label' => 'FileName', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "file name only without any directory"), 'src_object_type' => array('type' => 'varchar(64)', 'label' => 'SourceType', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => 0, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "Source object type ('proposal', 'invoice', ...)"), - 'src_object_id' => array('type' => 'integer', 'label' => 'SourceID', 'default' => 1, 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 90, 'index' => 1, 'comment' => "Source object id"), + 'src_object_id' => array('type' => 'integer', 'label' => 'SourceID', 'default' => '1', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 90, 'index' => 1, 'comment' => "Source object id"), 'fullpath_orig' => array('type' => 'varchar(750)', 'label' => 'FullPathOrig', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "full path of original filename, when file is uploaded from a local computer"), 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => 0, 'position' => 110), 'keywords' => array('type' => 'varchar(750)', 'label' => 'Keywords', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "list of keywords, separated with comma. Must be limited to most important keywords."), 'cover' => array('type' => 'text', 'label' => 'Cover', 'enabled' => 1, 'visible' => 0, 'position' => 130, 'comment' => "is this file a file to use for a cover"), - 'position' => array('type' => 'integer', 'label' => 'Position', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 140, 'index' => 1, 'comment' => "position of file among others"), + 'position' => array('type' => 'integer', 'label' => 'Position', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 140, 'index' => 1, 'comment' => "position of file among others"), 'gen_or_uploaded' => array('type' => 'varchar(12)', 'label' => 'GenOrUpload', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "'generated' or 'uploaded'"), 'extraparams' => array('type' => 'varchar(255)', 'label' => 'ExtraParams', 'enabled' => 1, 'position' => 160, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "for stocking other parameters with json format"), 'date_c' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170), From 77c10d653ea72bc14859716b3c954f7faf5e6903 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 22:55:05 +0100 Subject: [PATCH 0958/1862] Qual: set default value to match PHPdoc type --- htdocs/fichinter/class/fichinter.class.php | 59 +++++++++++----------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 0b29b094202..010427ab2a4 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023-2024 William Mead + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,33 +39,33 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; class Fichinter extends CommonObject { public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'isModEnabled("societe")', 'visible'=>-1, 'notnull'=>1, 'position'=>15), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label'=>'Fk projet', 'enabled'=>'isModEnabled("project")', 'visible'=>-1, 'position'=>20), - 'fk_contrat' =>array('type'=>'integer', 'label'=>'Fk contrat', 'enabled'=>'$conf->contrat->enabled', 'visible'=>-1, 'position'=>25), - 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>30), - 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35), - 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>36), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>40, 'index'=>1), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>45), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>50), - 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'datei' =>array('type'=>'date', 'label'=>'Datei', 'enabled'=>1, 'visible'=>-1, 'position'=>60), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>65), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>70), - 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>75), - 'dateo' =>array('type'=>'date', 'label'=>'Dateo', 'enabled'=>1, 'visible'=>-1, 'position'=>85), - 'datee' =>array('type'=>'date', 'label'=>'Datee', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'datet' =>array('type'=>'date', 'label'=>'Datet', 'enabled'=>1, 'visible'=>-1, 'position'=>95), - 'duree' =>array('type'=>'double', 'label'=>'Duree', 'enabled'=>1, 'visible'=>-1, 'position'=>100), - 'description' =>array('type'=>'html', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'showoncombobox'=>2), - 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), - 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>115), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>120), - 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'Last main doc', 'enabled'=>1, 'visible'=>-1, 'position'=>125), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>130), - 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>135), - 'fk_statut' =>array('type'=>'integer', 'label'=>'Fk statut', 'enabled'=>1, 'visible'=>-1, 'position'=>500), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'notnull' => 1, 'position' => 15), + 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Fk projet', 'enabled' => 'isModEnabled("project")', 'visible' => -1, 'position' => 20), + 'fk_contrat' => array('type' => 'integer', 'label' => 'Fk contrat', 'enabled' => '$conf->contrat->enabled', 'visible' => -1, 'position' => 25), + 'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'showoncombobox' => 1, 'position' => 30), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 35), + 'ref_client' => array('type' => 'varchar(255)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => -1, 'position' => 36), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 40, 'index' => 1), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 45), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 50), + 'date_valid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 55), + 'datei' => array('type' => 'date', 'label' => 'Datei', 'enabled' => 1, 'visible' => -1, 'position' => 60), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'position' => 65), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 70), + 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 75), + 'dateo' => array('type' => 'date', 'label' => 'Dateo', 'enabled' => 1, 'visible' => -1, 'position' => 85), + 'datee' => array('type' => 'date', 'label' => 'Datee', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'datet' => array('type' => 'date', 'label' => 'Datet', 'enabled' => 1, 'visible' => -1, 'position' => 95), + 'duree' => array('type' => 'double', 'label' => 'Duree', 'enabled' => 1, 'visible' => -1, 'position' => 100), + 'description' => array('type' => 'html', 'label' => 'Description', 'enabled' => 1, 'visible' => -1, 'position' => 105, 'showoncombobox' => 2), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 110), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 115), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 120), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'Last main doc', 'enabled' => 1, 'visible' => -1, 'position' => 125), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 130), + 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 135), + 'fk_statut' => array('type' => 'integer', 'label' => 'Fk statut', 'enabled' => 1, 'visible' => -1, 'position' => 500), ); /** @@ -945,7 +946,7 @@ class Fichinter extends CommonObject global $action; $hookmanager->initHooks(array('interventiondao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; @@ -1326,7 +1327,7 @@ class Fichinter extends CommonObject // Hook of thirdparty module if (is_object($hookmanager)) { - $parameters = array('objFrom'=>$objFrom); + $parameters = array('objFrom' => $objFrom); $action = ''; $reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { From eefe123dcb4b30fae29a34da77d108922169e454 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 23:42:45 +0100 Subject: [PATCH 0959/1862] fixup! fix phpstan (#28727) --- .../barcode/mod_barcode_product_standard.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index c2df3f7c3a0..9e830faa4c2 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -4,6 +4,7 @@ * Copyright (C) 2007-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -157,14 +158,19 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode /** * Return next value * - * @param Product $objproduct Object product - * @param string $type Type of barcode (EAN, ISBN, ...) + * @param CommonObject $objproduct Object product + * @param string $type Type of barcode (EAN, ISBN, ...) * @return string Value if OK, '' if module not configured, <0 if KO */ public function getNextValue($objproduct, $type = '') { global $db, $conf; + if (!$objproduct instanceof Product) { + dol_syslog(get_class($this)."::getNextValue used on incompatible".get_class($objproduct), LOG_ERR); + return -1; + } + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/barcode.lib.php'; // to be able to call function barcode_gen_ean_sum($ean) @@ -192,19 +198,19 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode $numFinal = get_next_value($db, $mask, 'product', $field, $where, '', $now); //Begin barcode with key: for barcode with key (EAN13...) calculate and substitute the last character (* or ?) used in the mask by the key - if ((substr($numFinal, -1)=='*') or (substr($numFinal, -1)=='?')) { // if last mask character is * or ? a joker, probably we have to calculate a key as last character (EAN13...) + if ((substr($numFinal, -1) == '*') or (substr($numFinal, -1) == '?')) { // if last mask character is * or ? a joker, probably we have to calculate a key as last character (EAN13...) $literaltype = ''; $literaltype = $this->literalBarcodeType($db, $type);//get literal_Barcode_Type switch ($literaltype) { case 'EAN13': //EAN13 rowid = 2 - if (strlen($numFinal)==13) {// be sure that the mask length is correct for EAN13 + if (strlen($numFinal) == 13) {// be sure that the mask length is correct for EAN13 $ean = substr($numFinal, 0, 12); //take first 12 digits - $eansum = barcode_gen_ean_sum($ean); + $eansum = barcode_gen_ean_sum($ean); $ean .= $eansum; //substitute the las character by the key $numFinal = $ean; } break; - // Other barcode cases with key could be written here + // Other barcode cases with key could be written here default: break; } From 8b79cfa0956be7a7de55b42e7983ab5ba47dc2f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Tue, 12 Mar 2024 00:16:06 +0100 Subject: [PATCH 0960/1862] clean --- htdocs/core/modules/barcode/modules_barcode.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/barcode/modules_barcode.class.php b/htdocs/core/modules/barcode/modules_barcode.class.php index f8026af15e1..ed2326edafb 100644 --- a/htdocs/core/modules/barcode/modules_barcode.class.php +++ b/htdocs/core/modules/barcode/modules_barcode.class.php @@ -62,11 +62,11 @@ abstract class ModeleNumRefBarCode extends CommonNumRefGenerator /** * Return next value available * - * @param Product $objproduct Object Product - * @param string $type Type of barcode (EAN, ISBN, ...) - * @return string Value + * @param CommonObject $objcommon CommonObject + * @param string $type Type of barcode (EAN, ISBN, ...) + * @return string Value */ - public function getNextValue($objproduct, $type = '') + public function getNextValue($objcommon, $type = '') { global $langs; return $langs->trans("Function_getNextValue_InModuleNotWorking"); From 4f64c683ee2525dff91d1099fa2e44f14cfa6eb1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2024 01:55:26 +0100 Subject: [PATCH 0961/1862] Better support for MAIN_OPTIMIZEFORTEXTBROWSER --- htdocs/core/class/conf.class.php | 11 ++++-- htdocs/core/lib/security2.lib.php | 2 +- htdocs/core/menus/standard/auguria.lib.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/core/menus/standard/empty.php | 2 +- htdocs/core/search_page.php | 39 ++++++++++++---------- htdocs/core/tpl/login.tpl.php | 4 +-- htdocs/index.php | 8 ++--- htdocs/main.inc.php | 9 +++-- 9 files changed, 47 insertions(+), 32 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 647354ef247..9f73b069950 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -1,4 +1,6 @@ * Copyright (C) 2003 Xavier Dutoit * Copyright (C) 2004-2020 Laurent Destailleur @@ -41,9 +43,14 @@ class Conf extends stdClass */ public $db; - //! To store properties found into database + /** + * @var Object To store global setup found into database + */ public $global; - //! To store browser info (->name, ->os, ->version, ->ua, ->layout, ...) + + /** + * @var Object To store browser info (->name, ->os, ->version, ->ua, ->layout, ...) + */ public $browser; //! To store some setup of generic modules diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index d08912c169e..33157cde1ce 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -149,7 +149,7 @@ if (!function_exists('dol_loginfunction')) { // Title $appli = constant('DOL_APPLICATION_TITLE'); - $title = $appli.' '.constant('DOL_VERSION'); + $title = $appli.(getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '' : ' '.constant('DOL_VERSION')); if (getDolGlobalString('MAIN_APPLICATION_TITLE')) { $title = getDolGlobalString('MAIN_APPLICATION_TITLE'); } diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index d727967222e..8509416d4fc 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -178,7 +178,7 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout } $showmode = 1; - if (empty($noout)) { + if (empty($noout) && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { print_start_menu_entry_auguria('', 'class="tmenuend"', $showmode); print_end_menu_entry_auguria($showmode); print_end_menu_array_auguria(); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index b5de6584a85..8ef3b8c9b90 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -590,7 +590,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = } $showmode = 1; - if (empty($noout)) { + if (empty($noout) && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { print_start_menu_entry('', 'class="tmenuend"', $showmode); print_end_menu_entry($showmode); print_end_menu_array(); diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 16809c89405..0b925551848 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -139,7 +139,7 @@ class MenuManager } $showmode = 1; - if (empty($noout)) { + if (empty($noout) && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { print_start_menu_entry_empty('', 'class="tmenuend"', $showmode); } if (empty($noout)) { diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index adaa198087d..0f91b78b9ed 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -165,25 +165,28 @@ if (empty($reshook)) { $searchform .= '
'; -// Add search on URL -$ret = ''; -$ret .= ''; -$ret .= ''; -$ret .= ''; -$ret .= ''; -$ret .= '
'; -$ret .= img_picto('', 'url', '', false, 0, 0, '', 'paddingright width20'); -$ret .= 'trans("OrPasteAnURL")).'"'; -$ret .= ' name="url" id="url" />'; -$ret .= ''; -$ret .= '
'; -$ret .= "\n"; -$searchform .= $ret; +// Add search on URL +if ($conf->dol_use_jmobile) { + $ret = ''; + $ret .= '
'; + $ret .= ''; + $ret .= ''; + $ret .= ''; + $ret .= '
'; + $ret .= img_picto('', 'url', '', false, 0, 0, '', 'paddingright width20'); + $ret .= 'trans("OrPasteAnURL")).'"'; + $ret .= ' name="url" id="url" />'; + $ret .= ''; + $ret .= '
'; + $ret .= "
\n"; + + $searchform .= $ret; +} // Show all forms diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 4d5dc2833dc..b2072e48eed 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -402,9 +402,9 @@ if (!empty($_SESSION['dol_loginmesg'])) { $message = $_SESSION['dol_loginmesg']; // By default this is an error message if (preg_match('//', $message)) { // if it contains this comment, this is a warning message $message = str_replace('', '', $message); - print '
'; + print '
'; print $langs->trans("ForceInvoiceDate"); print ''; print $form->selectyesno("forcedate", getDolGlobalInt('FAC_FORCE_DATE_VALIDATION', 0), 1); print ''; -print ''; +print ''; print "
'; print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices"), $langs->trans("AddCRIfTooLong").'

'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; $variablename = 'INVOICE_FREE_TEXT'; @@ -789,7 +798,7 @@ if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { print $doleditor->Create(); } print '
'; -print ''; +print ''; print "
'; print $form->textwithpicto($langs->trans("WatermarkOnDraftBill"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; print '
'; print ''; -print ''; +print ''; print "
'.dol_escape_htmltag($vals['label']).''.$vals['nbline'].'
'.$langs->trans("SelectTheTypeOfObjectToAnalyze").'
'; $out .= $form->buttonsSaveCancel("Add", ""); - + $out .= ''; $out .= '


'; print $out; @@ -269,19 +293,24 @@ if ($action == 'edit' || $action == 'create') { $out .= '
'.$arrayofaifeatures[$key]['picto'].' '.$langs->trans($arrayofaifeatures[$key]['label']); - $out .= ''.img_edit().''; + $out .= ''.img_edit().''; $out .= ''.img_delete().''; $out .= '
'; $out .= 'pre-Prompt'; $out .= ''; - $out .= ''; + $out .= ''; $out .= '
'; - $out .= ''; + $out .= ''; + $out .= '
'; $out .= '
'; } - $out .= ''; $out .= ""; print $out; From f15725ee33017963885ef13cf75bd7db669484ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2024 18:10:30 +0100 Subject: [PATCH 1235/1862] Update usergroups.lib.php --- htdocs/core/lib/usergroups.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 2ffc38d1072..2a0dc0d4bc8 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -199,8 +199,8 @@ function user_prepare_head(User $object) } else { $sql = "SELECT COUNT(ac.id) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as ac"; - $sql .= " WHERE fk_user_action = ".((int) $object->id); - $sql .= " AND entity IN (".getEntity('agenda').")"; + $sql .= " WHERE ac.fk_user_action = ".((int) $object->id); + $sql .= " AND ac.entity IN (".getEntity('agenda').")"; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); From 7b4c0536c75ad80408733d640b3fbe1e8ae51422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 13 Mar 2024 18:11:40 +0100 Subject: [PATCH 1236/1862] fix warnings --- htdocs/hrm/compare.php | 8 +++++--- htdocs/hrm/skill_tab.php | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/hrm/compare.php b/htdocs/hrm/compare.php index a75965f797e..8286c7f0cf4 100644 --- a/htdocs/hrm/compare.php +++ b/htdocs/hrm/compare.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -278,6 +279,7 @@ $fk_usergroup1 = GETPOST('fk_usergroup1'); print dol_get_fiche_end(); llxFooter(); +$db->close(); @@ -357,10 +359,10 @@ function rate(&$TMergedSkills, $field) } /** - * return a html ul list of skills + * return a html ul list of skills * - * @param array $TMergedSkills skill list for display - * @return string (ul list in html ) + * @param array $TMergedSkills skill list for display + * @return string (ul list in html ) */ function skillList(&$TMergedSkills) { diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index c7a0e1bd988..a1e71528361 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -481,6 +482,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $rslt = $db->query($sqlEval); $numEval = $db->num_rows($sqlEval); + $page = 0; print_barre_liste($langs->trans("Evaluations"), $page, $_SERVER["PHP_SELF"], '', '', '', '', $numEval, $numEval, $evaltmp->picto, 0); print '
'; @@ -547,6 +549,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print dol_get_fiche_end(); - - llxFooter(); } + +llxFooter(); +$db->close(); From e01d9452d50a5526277b3941ab4cc6d9374553b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2024 18:12:00 +0100 Subject: [PATCH 1237/1862] Update agenda.php --- htdocs/user/agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/agenda.php b/htdocs/user/agenda.php index af23913a051..229c299a2e7 100644 --- a/htdocs/user/agenda.php +++ b/htdocs/user/agenda.php @@ -89,7 +89,7 @@ if (($object->id != $user->id) && !$user->hasRight('user', 'user', 'lire')) { accessforbidden(); } -$parameters = array('id' => $user->id); +$parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 09b11719c436a01c87e155bc73e7dca003d5d46f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2024 18:15:36 +0100 Subject: [PATCH 1238/1862] Update report.php --- htdocs/compta/cashcontrol/report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index 5a863e5e410..bf6a7310720 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -210,7 +210,7 @@ if ($resql) { $transactionspertype = array(); $amountpertype = array(); - $totalarray = array('nbfield' => 0,'pos' => array()); + $totalarray = array('nbfield' => 0, 'pos' => array()); while ($i < $num) { $objp = $db->fetch_object($resql); From f7ec65f10415292eec3f274b7dbb054596b9892e Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Wed, 13 Mar 2024 18:16:55 +0100 Subject: [PATCH 1239/1862] Add error msg foin ai generate_content --- htdocs/ai/ajax/generate_content.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/ai/ajax/generate_content.php b/htdocs/ai/ajax/generate_content.php index 2d65256ad01..11aaa3e787b 100644 --- a/htdocs/ai/ajax/generate_content.php +++ b/htdocs/ai/ajax/generate_content.php @@ -72,6 +72,8 @@ if (is_array($generatedContent) && $generatedContent['error']) { if ($generatedContent['code'] >= 400) { print "Error : " . $generatedContent['message']; print '
'.$langs->trans('Check Config of Module').''; + } elseif ($generatedContent['code'] == 429) { + print "Quota or allowed period exceeded. Retry Later !"; } else { print "Error returned by API call: " . $generatedContent['message']; } From 26fe76733c717a3fa1191edfe69df149a20e7f68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 13 Mar 2024 18:20:41 +0100 Subject: [PATCH 1240/1862] fix warnings --- htdocs/commande/class/commande.class.php | 4 ++-- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/utils.class.php | 5 +++-- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- .../core/modules/asset/doc/doc_generic_asset_odt.modules.php | 4 ++-- htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php | 4 ++-- htdocs/core/modules/hrm/mod_evaluation_advanced.php | 2 +- htdocs/core/modules/hrm/mod_evaluation_standard.php | 2 +- htdocs/core/tpl/advtarget.tpl.php | 3 ++- 10 files changed, 16 insertions(+), 14 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index b7d2e37c24d..07dccd2bf24 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1317,8 +1317,8 @@ class Commande extends CommonOrder { global $conf, $hookmanager; - dol_include_once('/multicurrency/class/multicurrency.class.php'); - dol_include_once('/core/class/extrafields.class.php'); + require_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; $error = 0; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4a3f654a83e..cee9e9bfafd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6009,7 +6009,7 @@ class Form print ''; print ''; } else { - dol_include_once('/core/lib/company.lib.php'); + require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; print !empty($selected) ? currency_name($selected, 1) : ' '; } } diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 810ee8f24fc..6b00c3bc17b 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2022 Anthony Berton * Copyright (C) 2023-2024 William Mead * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1006,7 +1007,7 @@ class Utils return -1; } - dol_include_once('/core/lib/files.lib.php'); + require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; $nbSaves = intval(getDolGlobalString('SYSLOG_FILE_SAVES', 10)); @@ -1412,7 +1413,7 @@ class Utils dol_syslog("Utils::cleanUnfinishedCronjob Starting cleaning"); // Import Cronjob class if not present - dol_include_once('/cron/class/cronjob.class.php'); + require_once DOL_DOCUMENT_ROOT . '/cron/class/cronjob.class.php'; // Get this job object $this_job = new Cronjob($db); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 2384751a523..07395e49191 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1615,7 +1615,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr $tms_start = ''; $tms_end = ''; } - dol_include_once('/comm/action/class/actioncomm.class.php'); + require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; // Check parameters if (!is_object($filterobj) && !is_object($objcon)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2c94e4d4a8c..7b0edc2931b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13129,7 +13129,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, global $param, $massactionbutton; - dol_include_once('/comm/action/class/actioncomm.class.php'); + require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; // Check parameters if (!is_object($filterobj) && !is_object($objcon)) { diff --git a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php index 7e6405baf78..b01f50afb70 100644 --- a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php +++ b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php @@ -4,7 +4,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2021 Philippe Grand - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ * \brief File of class to build ODT documents for assets */ -dol_include_once('/asset/core/modules/asset/modules_asset.php'); +require_once DOL_DOCUMENT_ROOT . '/asset/core/modules/asset/modules_asset.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index 15a9d3bf15c..5b6dc78bf0c 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -8,7 +8,7 @@ * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ * \brief File of class to generate document from standard template */ -dol_include_once('/asset/core/modules/asset/modules_asset.php'); +require_once DOL_DOCUMENT_ROOT . '/asset/core/modules/asset/modules_asset.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/core/modules/hrm/mod_evaluation_advanced.php b/htdocs/core/modules/hrm/mod_evaluation_advanced.php index 78d396d909b..f5b236d4594 100644 --- a/htdocs/core/modules/hrm/mod_evaluation_advanced.php +++ b/htdocs/core/modules/hrm/mod_evaluation_advanced.php @@ -26,7 +26,7 @@ * \brief File containing class for advanced numbering model of Evaluation */ -dol_include_once('/core/modules/hrm/modules_evaluation.php'); + require_once DOL_DOCUMENT_ROOT . '/core/modules/hrm/modules_evaluation.php'; /** diff --git a/htdocs/core/modules/hrm/mod_evaluation_standard.php b/htdocs/core/modules/hrm/mod_evaluation_standard.php index 9a568923e44..eb69f3c0953 100644 --- a/htdocs/core/modules/hrm/mod_evaluation_standard.php +++ b/htdocs/core/modules/hrm/mod_evaluation_standard.php @@ -23,7 +23,7 @@ * \ingroup hrm * \brief File of class to manage Evaluation numbering rules standard */ -dol_include_once('/core/modules/hrm/modules_evaluation.php'); +require_once DOL_DOCUMENT_ROOT . '/core/modules/hrm/modules_evaluation.php'; /** diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index 225707f0828..a4c13f5cd4f 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France */ /* * @@ -274,7 +275,7 @@ if (!getDolGlobalString('MAIN_EXTRAFIELDS_DISABLED')) { $socstatic = new Societe($db); $elementtype = $socstatic->table_element; // fetch optionals attributes and labels - dol_include_once('/core/class/extrafields.class.php'); + require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; $extrafields = new ExtraFields($db); $extrafields->fetch_name_optionals_label($elementtype); foreach ($extrafields->attributes[$elementtype]['label'] as $key => $val) { From 439654a634209b505c367fb2334ce089e195c129 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2024 18:24:35 +0100 Subject: [PATCH 1241/1862] Fix ternary of ternary too difficult to read --- htdocs/user/ldap.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index f2e9a3708d2..328e14910ae 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -126,7 +126,10 @@ print '
'.$langs->trans("SID").''.$userSID.'
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($object->multicurrency_total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($object->multicurrency_total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($object->multicurrency_total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($object->multicurrency_total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($sign * $object->multicurrency_total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($sign * $object->multicurrency_total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '
'; $out .= ''; $out .= ''; + $out .= '
'.$langs->trans("AIProcessingPleaseWait").'
'; $out .= "
'; + + $sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount"; + $sql .= ", cls.code as opp_status_code"; + $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact as ec on p.rowid = ec.element_id"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sc on ec.fk_socpeople = sc.rowid"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_contact as tc on ec.fk_c_type_contact = tc.rowid"; + $sql .= " WHERE sc.fk_soc = ".((int) $object->id); + $sql .= " AND p.entity IN (".getEntity('project').")"; + $sql .= " AND tc.element = 'project'"; + $sql .= " ORDER BY p.dateo DESC"; + + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + if ($num > 0) { + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + + $projecttmp = new Project($db); + + $i = 0; + + while ($i < $num) { + $obj = $db->fetch_object($result); + $projecttmp->fetch($obj->id); + + // To verify role of users + $userAccess = $projecttmp->restrictedProjectArea($user); + + if ($user->rights->projet->lire && $userAccess > 0) { + print ''; + + // Ref + print ''; + + // Label + print ''; + // Date start + print ''; + // Date end + print ''; + // Opp amount + print ''; + // Opp status + print ''; + // Opp percent + print ''; + // Status + print ''; + + print ''; + } + $i++; + } + } else { + print ''; + } + $db->free($result); + } else { + dol_print_error($db); + } + } + $parameters = array('sql' => $sql, 'function' => 'show_projects'); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 2857c585ba4..3750b9bab8a 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -88,6 +88,8 @@ SearchString=Chaîne de recherche NotAvailableWhenAjaxDisabled=Non disponible quand Ajax est désactivé AllowToSelectProjectFromOtherCompany=Sur les éléments d'un tiers, autorise la sélection d'un projet lié à un autre tiers TimesheetPreventAfterFollowingMonths=Empêcher l'enregistrement du temps consacré après le nombre de mois suivant +PROJECT_DISPLAY_LINKED_BY_CONTACT=Afficher les projets liés par un contact +PROJECT_DISPLAY_LINKED_BY_CONTACT_help=Cette option permet d'ajouter la liste de tous les projets dans lesquels un des contact du tiers est rattaché JavascriptDisabled=Javascript désactivé UsePreviewTabs=Afficher les onglets "Aperçu" ShowPreview=Afficher aperçu diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index 962372b874b..d5d1f2ce01c 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -142,6 +142,7 @@ DoNotShowMyTasksOnly=Voir aussi les tâches qui ne me sont pas affectées ShowMyTasksOnly=Ne voir que les tâches qui me sont affectées TaskRessourceLinks=Contacts de la tâche ProjectsDedicatedToThisThirdParty=Projets dédiés à ce tiers +ProjectsLinkedToThisThirdParty=Projets liés à ce tiers par un contact commun NoTasks=Aucune tâche pour ce projet LinkedToAnotherCompany=Liés à autre société TaskIsNotAssignedToUser=Tâche non assignée à l'utilisateur. Utilisez le bouton '%s' pour assigner la tâche maintenant. diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index 184f8ac6104..9dc673aa745 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -841,6 +841,18 @@ print ''; print ''; print ''; + +$key = 'PROJECT_DISPLAY_LINKED_BY_CONTACT'; +echo '', + '', + '', + ''; + + print '
'.$langs->trans("Ref").''.$langs->trans("Name").''.$langs->trans("DateStart").''.$langs->trans("DateEnd").''.$langs->trans("OpportunityAmountShort").''.$langs->trans("OpportunityStatusShort").''.$langs->trans("OpportunityProbabilityShort").''.$langs->trans("Status").'
'; + print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:'.$_SERVER["PHP_SELF"].'?socid=__SOCID__'); + print ''.dol_escape_htmltag($obj->title).''.dol_print_date($db->jdate($obj->do), "day").''.dol_print_date($db->jdate($obj->de), "day").''; + if ($obj->opp_status_code) { + print ''.price($obj->opp_amount, 1, '', 1, -1, -1, '').''; + } + print ''; + if ($obj->opp_status_code) { + print $langs->trans("OppStatus".$obj->opp_status_code); + } + print ''; + if ($obj->opp_percent) { + print price($obj->opp_percent, 1, '', 1, 0).'%'; + } + print ''.$projecttmp->getLibStatut(5).'
'.$langs->trans("None").'
', + $form->textwithpicto($langs->transnoentities($key), $langs->transnoentities($key . '_help')), + '', + ajax_constantonoff($key), + '
'; print ''; From a4d85d870671ae610a51af9ad017d679f5c3784f Mon Sep 17 00:00:00 2001 From: jyhere Date: Thu, 14 Mar 2024 10:11:54 +0100 Subject: [PATCH 1257/1862] UPDATE: improved extrafields code autofill Add normalize() (to convert accented chars to unaccented chars) and replace whitespaces by underscores to make the db column name more readable. --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 19245020f26..7b8092ef81d 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -140,7 +140,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con global->MAIN_EXTRAFIELDS_CODE_AUTOFILL_DISABLED)) : ?> jQuery("#label").keyup(function() { console.log("Update new field"); - $("#attrname").val( $(this).val().replace(/[^a-zA-Z0-9_]/g, '').toLowerCase() ); + $("#attrname").val( $(this).val().normalize('NFD').replace(/\s/g, "_").replace(/[^a-zA-Z0-9_]/g, '').toLowerCase() ); }); }); From 07fe0f6cd0a66dbcdfb8310fd1ab26d474400401 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 10:29:36 +0100 Subject: [PATCH 1258/1862] NEW: Module Website: Can link/unlink translation between web pages --- htdocs/website/index.php | 57 +++++++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 9 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 566a1c2feb9..37430439427 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1155,7 +1155,17 @@ if ($action == 'addcontainer' && $usercanedit) { $substitutionarray = array(); $substitutionarray['__WEBSITE_CREATE_BY__'] = $user->getFullName($langs); - // Define id of page the new page is translation of + // Define id of the page the new page is translation of + /* + if ($objectpage->lang == $object->lang) { + // If + $pageidfortranslation = (GETPOSTINT('pageidfortranslation') > 0 ? GETPOSTINT('pageidfortranslation') : 0); + if ($pageidfortranslation > 0) { + // We must update the page $pageidfortranslation to set fk_page = $object->id. + // But what if page $pageidfortranslation is already linked to another ? + } + } else { + */ $pageidfortranslation = (GETPOSTINT('pageidfortranslation') > 0 ? GETPOSTINT('pageidfortranslation') : 0); if ($pageidfortranslation > 0) { // Check if the page we are translation of is already a translation of a source page. if yes, we will use source id instead @@ -1166,6 +1176,7 @@ if ($action == 'addcontainer' && $usercanedit) { } } $objectpage->fk_page = $pageidfortranslation; + //} $sample = GETPOST('sample', 'alpha'); if (empty($sample)) { @@ -2406,6 +2417,22 @@ if ($usercanedit && (($action == 'updatesource' || $action == 'updatecontent' || } } +if ($action == 'deletelang' && $usercanedit) { + $sql = "UPDATE ".MAIN_DB_PREFIX."website_page SET fk_page = NULL"; + $sql .= " WHERE rowid = ".GETPOSTINT('deletelangforid'); + //$sql .= " AND fk_page = ".((int) $objectpage->id); + + $resql = $db->query($sql); + if (!$resql) { + setEventMessages($db->lasterror(), null, 'errors'); + } else { + $objectpage->fk_page = null; + } + + $action = 'editmeta'; +} + + // Export site if ($action == 'exportsite' && $user->hasRight('website', 'export')) { $fileofzip = $object->exportWebSite(); @@ -4360,7 +4387,9 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties if ($i > 0) { $tmpstring .= '
'; } - $tmpstring .= $tmppage->getNomUrl(1).' ('.$tmppage->lang.')'; + $tmpstring .= $tmppage->getNomUrl(1).' '.picto_from_langcode($tmppage->lang).' '.$tmppage->lang; + // Button unlink + $tmpstring .= ' id).'">'.img_picto($langs->trans("Remove"), 'unlink').''; $translatedby++; $i++; } @@ -4376,17 +4405,27 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties dol_print_error($db); } } - if (empty($translatedby) && ($action == 'editmeta' || $action == 'createcontainer' || $objectpage->fk_page > 0)) { + if ((empty($translatedby) || ($objectpage->lang != $object->lang)) && ($action == 'editmeta' || $action == 'createcontainer' || $objectpage->fk_page > 0)) { $sourcepage = new WebsitePage($db); - $result = $sourcepage->fetch($objectpage->fk_page); - if ($result == 0) { - // not found, we can reset value to clean database - } elseif ($result > 0) { + $result = 1; + if ($objectpage->fk_page > 0) { + $result = $sourcepage->fetch($objectpage->fk_page); + if ($result == 0) { + // not found, we can reset value to clean database + // TODO + } + } + if ($result >= 0) { + if ($translatedby) { + print '
'; + } $translationof = $objectpage->fk_page; print ''.$langs->trans('ThisPageIsTranslationOf').' '; - print $formwebsite->selectContainer($website, 'pageidfortranslation', ($translationof ? $translationof : -1), 1, $action, 'minwidth300', array($objectpage->id)); + print $sourcepage->getNomUrl(2).' '.$formwebsite->selectContainer($website, 'pageidfortranslation', ($translationof ? $translationof : -1), 1, $action, 'minwidth300', array($objectpage->id)); if ($translationof > 0 && $sourcepage->lang) { - print $sourcepage->getNomUrl(2).' ('.$sourcepage->lang.')'; + print picto_from_langcode($sourcepage->lang).' '.$sourcepage->lang; + // Button unlink + print ' id).'">'.img_picto($langs->trans("Remove"), 'unlink').''; } } } From 90210c3bfcc423858f22fef1b1fe8cce5ce750fd Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 14 Mar 2024 10:36:55 +0100 Subject: [PATCH 1259/1862] translation --- htdocs/langs/en_US/admin.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 576180c6371..f20f46f5c03 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -88,6 +88,8 @@ SearchString=Search string NotAvailableWhenAjaxDisabled=Not available when Ajax disabled AllowToSelectProjectFromOtherCompany=On document of a third party, can choose a project linked to another third party TimesheetPreventAfterFollowingMonths=Prevent recording time spent after the following number of months +PROJECT_DISPLAY_LINKED_BY_CONTACT=Display project linked by a common contact +PROJECT_DISPLAY_LINKED_BY_CONTACT_help=That option add a new list on Project tab with all projects linked to that thirdparty via a contact relationship JavascriptDisabled=JavaScript disabled UsePreviewTabs=Use preview tabs ShowPreview=Show preview From d4ea162cfb158992d4929441000b65ee798b6297 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 14 Mar 2024 10:37:46 +0100 Subject: [PATCH 1260/1862] locale --- htdocs/langs/en_US/projects.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index f0d303285d4..e522a34fd1e 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -142,6 +142,7 @@ DoNotShowMyTasksOnly=See also tasks not assigned to me ShowMyTasksOnly=View only tasks assigned to me TaskRessourceLinks=Contacts of task ProjectsDedicatedToThisThirdParty=Projects dedicated to this third party +ProjectsLinkedToThisThirdParty=Projects linked to that third party thanks to a contact NoTasks=No tasks for this project LinkedToAnotherCompany=Linked to other third party TaskIsNotAssignedToUser=Task not assigned to user. Use button '%s' to assign task now. From 4e872df2a646f8e18308e1c7fe3f486238eca0ed Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 10:45:37 +0100 Subject: [PATCH 1261/1862] New change input to textarea for prompts in ai module --- htdocs/ai/admin/custom_prompt.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/ai/admin/custom_prompt.php b/htdocs/ai/admin/custom_prompt.php index 7790c822249..8974e25a66c 100644 --- a/htdocs/ai/admin/custom_prompt.php +++ b/htdocs/ai/admin/custom_prompt.php @@ -255,7 +255,7 @@ if ($action == 'edit') { $out .= 'pre-Prompt'; $out .= '
'; - $out .= ''; + $out .= ''; $out .= '
'; - $out .= ''; + $out .= ''; $out .= '
'; - $out .= ''; + $out .= ''; $out .= '
'; - $out .= ''; + $out .= ''; $out .= '
'; + $out .= '
'.$langs->trans("ActionDoneBy").''; - print $form->select_dolusers(GETPOSTISSET("doneby") ? GETPOSTINT("doneby") : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1); - print '
'.$langs->trans("Location").'
'.$langs->trans("ActionDoneBy").''; - print $form->select_dolusers($object->userdoneid > 0 ? $object->userdoneid : -1, 'doneby', 1); - print '
'.$langs->trans("Location").'
'.$langs->trans("ActionDoneBy").''; - if ($object->userdoneid > 0) { - $tmpuser = new User($db); - $tmpuser->fetch($object->userdoneid); - print $tmpuser->getNomUrl(1); - } - print '
'.$langs->trans("Categories").''; From 2b187c4b308a3b5a79ca4250a22b39e2c5235b13 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 13:45:55 +0100 Subject: [PATCH 1272/1862] Fix: the line "file generated" must appears once. --- htdocs/website/class/website.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 5f91c26ebd2..335c3447e6a 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -1075,15 +1075,15 @@ class Website extends CommonObject $i++; } + $line = '-- File generated by Dolibarr '.DOL_VERSION.' --;'."\n"; + $line .= "\n"; + foreach ($listofpages as $pageid => $objectpageold) { $oldpageid = $objectpageold->id; $allaliases = $objectpageold->pageurl; $allaliases .= ($objectpageold->aliasalt ? ','.$objectpageold->aliasalt : ''); - $line = '-- File generated by Dolibarr '.DOL_VERSION.' -- '.dol_print_date(dol_now('gmt'), 'standard', 'gmt').' UTC --;'."\n"; - $line .= "\n"; - if (!getDolGlobalInt('WEBSITE_EXPORT_KEEP_FILES_OF_PAGES')) { // We don't need to keep the PHP files of pages and aliases (they are regenerated at import) so we remove them. You can ask to keep them in the export // Delete the pageX.tpl.php page dol_delete_file($conf->website->dir_temp.'/'.$website->ref.'/containers/page'.$objectpageold->id.'.tpl.php', 0, 0, 0, null, false, 0); From 71e7adac7fa75ec25797dfe8296bc94c69e5a6f5 Mon Sep 17 00:00:00 2001 From: William Mead Date: Thu, 14 Mar 2024 13:48:00 +0100 Subject: [PATCH 1273/1862] Deleted fk_user_done --- htdocs/install/mysql/tables/llx_actioncomm.sql | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_actioncomm.sql b/htdocs/install/mysql/tables/llx_actioncomm.sql index 54eac887362..eccb6f49fe8 100644 --- a/htdocs/install/mysql/tables/llx_actioncomm.sql +++ b/htdocs/install/mysql/tables/llx_actioncomm.sql @@ -17,7 +17,7 @@ -- along with this program. If not, see . -- -- --- Table of events and actions (past and to do). +-- Table of events and actions (past and to do). -- This is also the table to track events on other Dolibarr objects. -- ======================================================================== @@ -31,7 +31,7 @@ create table llx_actioncomm datep2 datetime, -- date end fk_action integer, -- type of action (optional link with id in llx_c_actioncomm or null) - code varchar(50) NULL, -- code of action for automatic action ('AC_OTH_AUTO' for automatic actions, 'AC_EMAILIN_AUTO' for email input, 'AC_xxx' for manual action...) + code varchar(50) NULL, -- code of action for automatic action ('AC_OTH_AUTO' for automatic actions, 'AC_EMAILIN_AUTO' for email input, 'AC_xxx' for manual action...) datec datetime, -- date creation tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date @@ -43,7 +43,6 @@ create table llx_actioncomm fk_contact integer, fk_parent integer NOT NULL default 0, fk_user_action integer, -- user id of owner of action (note that users assigned to event are stored into table 'actioncomm_resources') - fk_user_done integer, -- user id of user that has made action (deprecated) transparency integer, -- transparency (ical standard). used to say if user assigned to event are busy or not by event. This field may be deprecated if we want to store transparency for each assigned user, moved into table llx_actioncomm_resources. @@ -56,9 +55,9 @@ create table llx_actioncomm label varchar(255) NOT NULL, -- label/title of event or topic of email note mediumtext, -- private note of event or content of email - + calling_duration integer, -- when event is a phone call, duration of phone call - + email_subject varchar(255), -- when event was an email, we store here the subject. content is stored into note. email_msgid varchar(255), -- when event was an email, we store here the msgid email_from varchar(255), -- when event was an email, we store here the from @@ -68,7 +67,7 @@ create table llx_actioncomm email_tobcc varchar(255), -- when event was an email, we store here the email_tobcc errors_to varchar(255), -- when event was an email, we store here the erros_to reply_to varchar(255), -- when event was an email, we store here the reply_to - + recurid varchar(128), -- used to store event id to link each other all the repeating event record. It can be the 'iCalUID' as in RFC5545 (an id similar for all the same serie) recurrule varchar(128), -- contains string with ical format recurring rule like 'FREQ=MONTHLY;INTERVAL=2;BYMONTHDAY=19' or 'FREQ=WEEKLY;BYDAY=MO' recurdateend datetime, -- no more recurring event after this date From da2546d9d3605bf9ceb217bfe3fb7f564ac1f3b5 Mon Sep 17 00:00:00 2001 From: William Mead Date: Thu, 14 Mar 2024 13:48:44 +0100 Subject: [PATCH 1274/1862] Added contributor details --- htdocs/comm/action/class/actioncomm.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index b8364ea8dbc..db8eadee618 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -6,7 +6,8 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 William Mead * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 7264621c75e02dd535dd7131aa4fdeb2cd5670dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 13:55:47 +0100 Subject: [PATCH 1275/1862] Fix: the line "file generated" must appears once. --- htdocs/website/class/website.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 335c3447e6a..2dbc2227f9d 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -1077,6 +1077,7 @@ class Website extends CommonObject $line = '-- File generated by Dolibarr '.DOL_VERSION.' --;'."\n"; $line .= "\n"; + fwrite($fp, $line); foreach ($listofpages as $pageid => $objectpageold) { $oldpageid = $objectpageold->id; @@ -1098,13 +1099,12 @@ class Website extends CommonObject } // This comment syntax is important, it is parsed by import to get information on page ID and all aliases to regenerate - $line .= '-- Page ID '.$objectpageold->newid.'__+MAX_llx_website_page__ - Aliases '.$allaliases.' --;'; // newid start at 1, 2... + $line = '-- Page ID '.$objectpageold->newid.'__+MAX_llx_website_page__ - Aliases '.$allaliases.' --;'; // newid start at 1, 2... $line .= "\n"; fwrite($fp, $line); // Warning: We must keep llx_ here. It is a generic SQL. $line = 'INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames)'; - $line .= " VALUES("; $line .= $objectpageold->newid."__+MAX_llx_website_page__, "; $line .= ($objectpageold->newfk_page ? $this->db->escape($objectpageold->newfk_page)."__+MAX_llx_website_page__" : "null").", "; @@ -1170,7 +1170,7 @@ class Website extends CommonObject fwrite($fp, $line); } - $line .= "\n"; + fwrite($fp, "\n"); } $line = "\n-- For Dolibarr v14+ --;\n"; @@ -1180,6 +1180,7 @@ class Website extends CommonObject fwrite($fp, $line); fclose($fp); + dolChmod($filesql); // Build zip file From ca3141c255834b478dd89bc8e7f253d912d291d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 14:03:21 +0100 Subject: [PATCH 1276/1862] Fix picto --- htdocs/core/modules/modAi.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAi.class.php b/htdocs/core/modules/modAi.class.php index 3194a93ed5a..c0a527a6463 100644 --- a/htdocs/core/modules/modAi.class.php +++ b/htdocs/core/modules/modAi.class.php @@ -78,7 +78,7 @@ class modAi extends DolibarrModules // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' // To use a supported fa-xxx css style of font awesome, use this->picto='xxx' - $this->picto = 'fa-microchip'; + $this->picto = 'fa-magic'; // Define some features supported by module (triggers, login, substitutions, menus, css, etc...) $this->module_parts = array( From 9dbc249cf0ee9b9f91df9a4bcb5023d89ce99118 Mon Sep 17 00:00:00 2001 From: William Mead Date: Thu, 14 Mar 2024 14:59:04 +0100 Subject: [PATCH 1277/1862] Fixed undefined task object --- htdocs/core/lib/project.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index ab142a50675..12974209afe 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -934,7 +934,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t // Extra fields $extrafieldsobjectkey = $taskstatic->table_element; $extrafieldsobjectprefix = 'efpt.'; - $obj = $lines[$i]->obj; + $obj = $lines[$i]; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook $parameters = array('arrayfields' => $arrayfields, 'obj' => $lines[$i]); From a25e8ee14de2c08067dba4ad24bdea1f8a51a682 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 15:09:44 +0100 Subject: [PATCH 1278/1862] FIX PHPStan warnings --- htdocs/core/modules/member/doc/pdf_standard.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 8585f4ee1b4..5ce0565f4eb 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -263,7 +263,7 @@ class pdf_standard extends CommonStickerGenerator /** * Function to build PDF on disk, then output on HTTP stream. * - * @param Adherent $object Member object. Old usage: Array of record information (array('textleft'=>,'textheader'=>, ...'id'=>,'photo'=>) + * @param mixed $object Member object. Old usage: Array of record information (array('textleft'=>,'textheader'=>, ...'id'=>,'photo'=>) * @param Translate $outputlangs Lang object for output language * @param string $srctemplatepath Full path of source filename for generator using a template file. Example: '5161', 'AVERYC32010', 'CARD', ... * @param string $mode Tell if doc module is called for 'member', ... From 21b291a87ad94a14ba426da94b61912e78dd1a21 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 15:21:39 +0100 Subject: [PATCH 1279/1862] FIX variable assignement for PHPStan warnings --- htdocs/expensereport/payment/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index 88cd5ecb2d0..bd3ba374d76 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -517,9 +517,9 @@ while ($i < $imaxinloop) { if ($objp->bid) { $accountstatic->fetch($objp->bid); - $paymentexpensereportstatic->fk_bank = $accountstatic->getNomUrl(1); + $paymentexpensereportstatic->fk_bank = $accountstatic->id; } else { - $paymentexpensereportstatic->fk_bank = null; + $paymentexpensereportstatic->fk_bank = 0; } $userstatic->id = $objp->userid; From 560d5618d2b4eb02b5de1a3f8947aa9945fbd433 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 15:31:11 +0100 Subject: [PATCH 1280/1862] FIX type in doc for variable childtables --- htdocs/hrm/class/job.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index c0ec08939d4..34893a805b2 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -148,7 +148,7 @@ class Job extends CommonObject // public $class_element_line = 'Jobline'; // /** - // * @var array List of child tables. To test if we can delete object. + // * @var string[] List of child tables. To test if we can delete object. // */ protected $childtables = array('hrm_evaluation', 'hrm_job_user'); From b818a6a137cc6023903b3a37bc3c6cac4f53f543 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 15:52:37 +0100 Subject: [PATCH 1281/1862] Fix return type in getAllMochilds (PHPStan warnings) --- htdocs/mrp/class/mo.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 2a1c580a03b..0244bfd3866 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -236,7 +236,7 @@ class Mo extends CommonObject public $lines = array(); /** - * @var MoLine MO line + * @var MoLine|null MO line */ public $line = array(); @@ -1859,7 +1859,7 @@ class Mo extends CommonObject * Function used to return all child MOs recursively * * @param int $depth Depth for recursing loop count - * @return Mo[]|int[] array of MOs if OK, -1 if KO + * @return Mo[]|int array of MOs if OK, -1 if KO */ public function getAllMoChilds($depth = 0) { From 3c7f5391e5b27a64232bb0534698bc685709cfdf Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 16:00:43 +0100 Subject: [PATCH 1282/1862] FIX variable by adding a type BOMLine (PHPStan warnings) --- htdocs/mrp/class/mo.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 2a1c580a03b..da5b1caf030 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -231,7 +231,7 @@ class Mo extends CommonObject protected $childtablesoncascade = array('mrp_production'); /** - * @var MoLine[] Array of subtable lines + * @var MoLine[]|BOMLine[] Array of subtable lines */ public $lines = array(); From c46e5ac34b6abcc09b210766c523de933e685fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Mar 2024 16:01:12 +0100 Subject: [PATCH 1283/1862] some fix for vinci --- .../modules/mrp/doc/pdf_vinci.modules.php | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index cc5bc784df0..1fd7f7d6005 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -5,7 +5,7 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -124,13 +124,13 @@ class pdf_vinci extends ModelePDFMo /** * Function to build pdf onto disk * - * @param CommandeFournisseur $object Id of object to generate - * @param Translate $outputlangs Lang output object - * @param string $srctemplatepath Full path of source filename for generator using a template file - * @param int $hidedetails Do not show line details - * @param int $hidedesc Do not show desc - * @param int $hideref Do not show ref - * @return int 1=OK, 0=KO + * @param Mo $object Id of object to generate + * @param Translate $outputlangs Lang output object + * @param string $srctemplatepath Full path of source filename for generator using a template file + * @param int $hidedetails Do not show line details + * @param int $hidedesc Do not show desc + * @param int $hideref Do not show ref + * @return int 1=OK, 0=KO */ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0) { @@ -235,10 +235,10 @@ class pdf_vinci extends ModelePDFMo $pdf->SetDrawColor(128, 128, 128); $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); - $pdf->SetSubject($outputlangs->transnoentities("Mo")); + $pdf->SetSubject($outputlangs->transnoentities("ManufacturingOrder")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); - $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Mo")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); + $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("ManufacturingOrder")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } @@ -657,7 +657,7 @@ class pdf_vinci extends ModelePDFMo * Show payments table * * @param TCPDF $pdf Object PDF - * @param CommandeFournisseur $object Object order + * @param Mo $object Object order * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output * @return int Return integer <0 if KO, >0 if OK @@ -674,7 +674,7 @@ class pdf_vinci extends ModelePDFMo * Show miscellaneous information (payment mode, payment term, ...) * * @param TCPDF $pdf Object PDF - * @param CommandeFournisseur $object Object to show + * @param Mo $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object * @return integer @@ -1016,7 +1016,7 @@ class pdf_vinci extends ModelePDFMo * Show top header of page. * * @param TCPDF $pdf Object PDF - * @param CommandeFournisseur $object Object to show + * @param Mo $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output * @return float|int Return topshift value @@ -1031,7 +1031,7 @@ class pdf_vinci extends ModelePDFMo } // Load translation files required by the page - $outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings")); + $outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings", "mrp")); $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -1074,7 +1074,7 @@ class pdf_vinci extends ModelePDFMo $pdf->SetFont('', 'B', $default_font_size + 3); $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $title = $outputlangs->transnoentities("Mo")." ".$outputlangs->convToOutputCharset($object->ref); + $title = $outputlangs->transnoentities("ManufacturingOrder")." ".$outputlangs->convToOutputCharset($object->ref); $pdf->MultiCell(100, 3, $title, '', 'R'); $posy += 1; @@ -1311,7 +1311,7 @@ class pdf_vinci extends ModelePDFMo * Show footer of page. Need this->emetteur object * * @param TCPDF $pdf PDF - * @param CommandeFournisseur $object Object to show + * @param Mo $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text * @return int Return height of bottom margin including footer text @@ -1323,15 +1323,14 @@ class pdf_vinci extends ModelePDFMo } - /** * Define Array Column Field * - * @param object $object common object + * @param Mo $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 + * @param int $hidedetails Do not show line details + * @param int $hidedesc Do not show desc + * @param int $hideref Do not show ref * @return void */ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) From 0bb1dfca0c2d9c2b6c5c2dd7f3d1dfaab5809705 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 16:09:10 +0100 Subject: [PATCH 1284/1862] FIX the variable type by adding null to the variable document --- htdocs/multicurrency/class/multicurrency.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 57a6c1ee69a..f2ff645052c 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -90,7 +90,7 @@ class MultiCurrency extends CommonObject public $fk_user; /** - * @var CurrencyRate The currency rate + * @var CurrencyRate|null The currency rate */ public $rate; From 98d0ed71107163544cbc2d1e45bb2dddeed40c4d Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 16:14:55 +0100 Subject: [PATCH 1285/1862] FIX assignement variable (PHPStan warnings) --- .../dynamic_price/class/price_global_variable_updater.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index 42030aa290e..c0ec8226e3d 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -456,7 +456,7 @@ class PriceGlobalVariableUpdater $langs->load("errors"); dol_syslog(__METHOD__, LOG_DEBUG); - $this->error = null; + $this->error = ''; $this->checkParameters(); //Try to load the target global variable and abort if fails From 8ae32dd865f29845d7e77f483ff1715b0d1bf631 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 16:19:41 +0100 Subject: [PATCH 1286/1862] FIX variable by casting it with int --- htdocs/product/price.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 747604f0f70..30b9502a78a 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -292,7 +292,7 @@ if (empty($reshook)) { $newlocaltax2_type = GETPOST('localtax2_type', 'array'); //Shall we generate prices using price rules? - $object->price_autogen = GETPOST('usePriceRules') == 'on'; + $object->price_autogen = (int) GETPOST('usePriceRules') == 'on'; for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { if (!isset($newprice[$i])) { From 9acd54b5a73c7dece9d148e1f251bf029ab293f7 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 16:26:43 +0100 Subject: [PATCH 1287/1862] Fix return method by changing boolean to exception in api_warehouse (PHPStan warnings) --- htdocs/product/stock/class/api_warehouses.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/class/api_warehouses.class.php b/htdocs/product/stock/class/api_warehouses.class.php index e39ede65299..1af08af0534 100644 --- a/htdocs/product/stock/class/api_warehouses.class.php +++ b/htdocs/product/stock/class/api_warehouses.class.php @@ -222,9 +222,9 @@ class Warehouses extends DolibarrApi if ($this->warehouse->update($id, DolibarrApiAccess::$user)) { return $this->get($id); + } else { + throw new RestException(500, $this->warehouse->error); } - - return false; } /** From 05a9dc5f72b8a9f45f7d817c27a468399fb0ce15 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 14 Mar 2024 16:33:38 +0100 Subject: [PATCH 1288/1862] Fix: Correction for batches with letters in Takepos --- htdocs/takepos/invoice.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index d0e0d179efc..cf3e3cde9b6 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -3,6 +3,7 @@ * Copyright (C) 2018 Andreu Bisquerra * Copyright (C) 2021 Nicolas ZABOURI * Copyright (C) 2022-2023 Christophe Battarel + * Copyright (C) 2024 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -923,7 +924,7 @@ if (empty($reshook)) { if ($action=="setbatch" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) { $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; - $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set batch=".$db->escape($batch).", fk_warehouse=".getDolGlobalString($constantforkey)." where rowid=".((int) $idoflineadded); + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set batch='".$db->escape($batch)."', fk_warehouse=".getDolGlobalString($constantforkey)." where rowid=".((int) $idoflineadded); $db->query($sql); } From 2670287dd4543035cb4834b22b3cd0a4d093a911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Mar 2024 16:34:41 +0100 Subject: [PATCH 1289/1862] translation --- htdocs/core/modules/mrp/doc/pdf_vinci.modules.php | 2 +- htdocs/langs/en_US/main.lang | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index 1fd7f7d6005..81e910d4e19 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -1421,7 +1421,7 @@ class pdf_vinci extends ModelePDFMo 'status' => true, 'width' => 25, // in mm 'title' => array( - 'textkey' => 'Size' + 'textkey' => 'Dimensions' ), 'border-left' => true, // add left line separator ); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 95042a5cc24..f519e098d01 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -562,6 +562,7 @@ New=New Discount=Discount Unknown=Unknown General=General +Dimensions=Dimensions Size=Size OriginalSize=Original size RotateImage=Rotate 90° From 3f4033a8e22d2925519a56f07d560b4a6548df14 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 14 Mar 2024 16:39:08 +0100 Subject: [PATCH 1290/1862] Fix: Correction for batches with letters in Takepos --- .../class/multicurrency.class.php | 2 - htdocs/multicurrency/multicurrency_rate.php | 38 +------------------ 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 81d85b7c470..5433bb23f28 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -4,7 +4,6 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Pierre-Henry Favre - * Copyright (C) 2024 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -914,7 +913,6 @@ class CurrencyRate extends CommonObjectLine // Update request $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; $sql .= " SET rate = ".((float) $this->rate); - $sql .= ", rate_indirect = ".((float) $this->rate_indirect); if (!empty($this->date_sync)) { $sql .= ", date_sync = '".$this->db->idate($this->date_sync)."'"; } diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 40fb99eba4a..782834bbaa5 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -10,7 +10,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Adolfo segura * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2016-2024 Ferran Marcet + * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2023 Lenin Rivas * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ $search_code = GETPOST('search_code', 'alpha'); $multicurrency_code = GETPOST('multicurrency_code', 'alpha'); $dateinput = dol_mktime(0, 0, 0, GETPOST('dateinputmonth', 'int'), GETPOST('dateinputday', 'int'), GETPOST('dateinputyear', 'int')); $rateinput = price2num(GETPOST('rateinput', 'alpha')); -$rateindirectinput = price2num(GETPOST('rateindirectinput', 'alpha')); +$rateindirectinput = price2num(GETPOST('rateinidirectinput', 'alpha')); $optioncss = GETPOST('optioncss', 'alpha'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -168,7 +168,6 @@ if ($action == 'update') { $currencyRate->date_sync = $dateinput; $currencyRate->fk_multicurrency = $fk_currency; $currencyRate->rate = $rateinput; - $currencyRate->rate_indirect = $rateindirectinput; $res = $currencyRate->update(); if ($res) { setEventMessages($langs->trans('successUpdateRate'), null); @@ -245,7 +244,6 @@ if (empty($reshook)) { $search_date_sync = ""; $search_date_sync_end=""; $search_rate = ""; - $search_rate_indirect = ""; $search_code = ""; $search_array_options = array(); } @@ -349,9 +347,6 @@ if ($search_date_sync && $search_date_sync_end) { if ($search_rate) { $sql .= natural_search('cr.rate', $search_rate, 1); } -if ($search_rate_indirect) { - $sql .= natural_search('cr.rate_indirect', $search_rate_indirect, 1); -} if ($search_code) { $sql .= natural_search('m.code', $search_code); } @@ -413,9 +408,6 @@ if ($resql) { if ($search_rate) { $param = "&search_rate=".urlencode($search_rate); } - if ($search_rate_indirect) { - $param = "&search_rate_indirect=".urlencode($search_rate_indirect); - } if ($search_code != '') { $param.="&search_code=".urlencode($search_code); } @@ -510,12 +502,6 @@ if ($resql) { print ''; print ''; - print ''; - print '' . $form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true) . ''; - if (getDolGlobalString('MULTICURRENCY_USE_RATE_INDIRECT')) { - print ''; - } - print ''; print ''; print ''; From 967c444d8d7bfaf85a0fe64dd302b86eafadc4b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 16:39:12 +0100 Subject: [PATCH 1291/1862] FIX support of multiobject in APIs generated by modulebuilder --- htdocs/core/lib/modulebuilder.lib.php | 139 ++++++++++++++++---------- htdocs/modulebuilder/index.php | 29 ++++-- 2 files changed, 105 insertions(+), 63 deletions(-) diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index 68e8b982cce..bb1ce99fa52 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -839,7 +839,8 @@ function deletePropsAndPermsFromDoc($file, $objectname) /** - * Search a string and return all lines needed from file + * Search a string and return all lines needed from file. Does not include line $start nor $end + * * @param string $file file for searching * @param string $start start line if exist * @param string $end end line if exist @@ -953,106 +954,136 @@ function writePermsInAsciiDoc($file, $destfile) /** * Add Object in ModuleApi File - * @param string $file path of file - * @param array $objects array of objects in the module - * @param string $modulename name of module - * @return int 1 if OK, -1 if KO + * + * @param string $srcfile Source file to use as example + * @param string $file Path of modified file + * @param array $objects Array of objects in the module + * @param string $modulename Name of module + * @return int Return 1 if OK, -1 if KO */ -function addObjectsToApiFile($file, $objects, $modulename) +function addObjectsToApiFile($srcfile, $file, $objects, $modulename) { + global $langs, $user; + if (!file_exists($file)) { return -1; } - $content = file($file); - $includeClass = "dol_include_once('/mymodule/class/myobject.class.php');"; - $props = "public \$myobject;"; - $varcomented = "@var MyObject \$myobject {@type MyObject}"; - $constructObj = "\$this->myobject = new MyObject(\$this->db);"; + + $now = dol_now(); + $content = file($file); // $content is an array + + $includeClass = "dol_include_once\(\'\/\w+\/class\/\w+\.class\.php\'\);"; + $props = 'public\s+\$\w+;'; + $varcommented = '@var\s+\w+\s+\$\w+\s+{@type\s+\w+}'; + $constructObj = '\$this->\w+\s+=\s+new\s+\w+\(\$this->db\);'; // add properties and declare them in constructor foreach ($content as $lineNumber => &$lineContent) { - if (strpos($lineContent, $varcomented) !== false) { + if (preg_match('/'.$varcommented.'/', $lineContent)) { $lineContent = ''; - foreach ($objects as $object) { - $lineContent .= "\t * @var ".$object." \$".strtolower($object)." {@type ".$object."}". PHP_EOL; + foreach ($objects as $objectname) { + $lineContent .= "\t * @var ".$objectname." \$".strtolower($objectname)." {@type ".$objectname."}". PHP_EOL; } //var_dump($lineContent);exit; - } - if (strpos($lineContent, $props) !== false) { + } elseif (preg_match('/'.$props.'/', $lineContent)) { $lineContent = ''; - foreach ($objects as $object) { - $lineContent .= "\tpublic \$".strtolower($object).";". PHP_EOL; + foreach ($objects as $objectname) { + $lineContent .= "\tpublic \$".strtolower($objectname).";". PHP_EOL; } - } - if (strpos($lineContent, $constructObj) !== false) { + } elseif (preg_match('/'.$constructObj.'/', $lineContent)) { $lineContent = ''; - foreach ($objects as $object) { - $lineContent .= "\t\t\$this->".strtolower($object)." = new ".$object."(\$this->db);". PHP_EOL; + foreach ($objects as $objectname) { + $lineContent .= "\t\t\$this->".strtolower($objectname)." = new ".$objectname."(\$this->db);". PHP_EOL; } - } - if (strpos($lineContent, $includeClass) !== false) { + } elseif (preg_match('/'.$includeClass.'/', $lineContent)) { $lineContent = ''; - foreach ($objects as $object) { - $lineContent .= "dol_include_once('/".strtolower($modulename)."/class/".strtolower($object).".class.php');". PHP_EOL; + foreach ($objects as $objectname) { + $lineContent .= "dol_include_once('/".strtolower($modulename)."/class/".strtolower($objectname).".class.php');". PHP_EOL; } } } + $allContent = implode("", $content); file_put_contents($file, $allContent); - //add methods for each object - $allContent = getFromFile($file, '/*begin methods CRUD*/', '/*end methods CRUD*/'); - foreach ($objects as $object) { - $contentReplaced = str_replace(["myobject","MyObject"], [strtolower($object),$object], $allContent); - dolReplaceInFile($file, array('/*end methods CRUD*/' => '/*CRUD FOR '.strtoupper($object).'*/'."\n".$contentReplaced."\n\t".'/*END CRUD FOR '.strtoupper($object).'*/'."\n\t".'/*end methods CRUD*/')); + // Add methods for each object + $allContent = getFromFile($srcfile, '/* BEGIN MODULEBUILDER API MYOBJECT */', '/* END MODULEBUILDER API MYOBJECT */'); + foreach ($objects as $objectname) { + $arrayreplacement = array( + 'mymodule' => strtolower($modulename), + 'MyModule' => $modulename, + 'MYMODULE' => strtoupper($modulename), + 'My module' => $modulename, + 'my module' => $modulename, + 'Mon module' => $modulename, + 'mon module' => $modulename, + 'htdocs/modulebuilder/template' => strtolower($modulename), + 'myobject' => strtolower($objectname), + 'MyObject' => $objectname, + 'MYOBJECT' => strtoupper($objectname), + '---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '') + ); + $contentReplaced = make_substitutions($allContent, $arrayreplacement, null); + //$contentReplaced = str_replace(["myobject","MyObject"], [strtolower($object),$object], $allContent); + + dolReplaceInFile($file, array( + '/* BEGIN MODULEBUILDER API MYOBJECT */' => '/* BEGIN MODULEBUILDER API '.strtoupper($objectname).' */'.$contentReplaced."\t".'/* END MODULEBUILDER API '.strtoupper($objectname).' */'."\n\n\n\t".'/* BEGIN MODULEBUILDER API MYOBJECT */' + )); } - dolReplaceInFile($file, array($allContent => '','MyModule' => ucfirst($modulename))); + + // Remove the block $allContent found in src file + // TODO Replace with a replacement of all text including into /* BEGIN MODULEBUILDER API MYOBJECT */ and /* END MODULEBUILDER API MYOBJECT */ + dolReplaceInFile($file, array($allContent => '')); + return 1; } /** - * Remove Object variables and methods from API_Module File - * @param string $file file api module - * @param string $objectname name of object want to remove - * @param string $modulename name of module - * @return int 1 if OK, -1 if KO + * Remove Object variables and methods from API_Module File + * + * @param string $file File api module + * @param array $objects Array of objects in the module + * @param string $objectname Name of object want to remove + * @return int 1 if OK, -1 if KO */ -function removeObjectFromApiFile($file, $objectname, $modulename) +function removeObjectFromApiFile($file, $objects, $objectname) { - $begin = '/*CRUD FOR '.strtoupper($objectname).'*/'; - $end = '/*END CRUD FOR '.strtoupper($objectname).'*/'; - $includeClass = "dol_include_once('/".strtolower($modulename)."/class/".strtolower($objectname).".class.php');"; - $varcomentedDel = "\t * @var ".$objectname." \$".strtolower($objectname)." {@type ".$objectname."}"; - $propsDel = "\tpublic \$".strtolower($objectname).";"; - $constructObjDel = "\t\t\$this->".strtolower($objectname)." = new ".$objectname."(\$this->db);"; - if (!file_exists($file)) { return -1; } - $content = file($file); - // for delete property and the initialization from the construct + + $content = file($file); // $content is an array + + $includeClass = "dol_include_once\(\'\/\w+\/class\/".strtolower($objectname)."\.class\.php\'\);"; + $props = 'public\s+\$'.strtolower($objectname); + $varcommented = '@var\s+\w+\s+\$'.strtolower($objectname).'\s+{@type\s+\w+}'; + $constructObj = '\$this->'.strtolower($objectname).'\s+=\s+new\s+\w+\(\$this->db\);'; + + // add properties and declare them in constructor foreach ($content as $lineNumber => &$lineContent) { - if (strpos($lineContent, $includeClass) !== false) { + if (preg_match('/'.$varcommented.'/i', $lineContent)) { $lineContent = ''; - } - if (strpos($lineContent, $varcomentedDel) !== false) { + } elseif (preg_match('/'.$props.'/i', $lineContent)) { $lineContent = ''; - } - if (strpos($lineContent, $propsDel) !== false) { + } elseif (preg_match('/'.$constructObj.'/i', $lineContent)) { $lineContent = ''; - } - if (strpos($lineContent, $constructObjDel) !== false) { + } elseif (preg_match('/'.$includeClass.'/i', $lineContent)) { $lineContent = ''; } } + $allContent = implode("", $content); file_put_contents($file, $allContent); + // for delete methods of object + $begin = '/* BEGIN MODULEBUILDER API '.strtoupper($objectname).' */'; + $end = '/* END MODULEBUILDER API '.strtoupper($objectname).' */'; $allContent = getFromFile($file, $begin, $end); $check = dolReplaceInFile($file, array($allContent => '')); if ($check) { dolReplaceInFile($file, array($begin => '', $end => '')); } + return 1; } diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 1e78c341f06..e0acefa2b0e 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -467,13 +467,13 @@ if ($dirins && in_array($action, array('initapi', 'initphpunit', 'initpagecontac '---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '') ); - if (count($objects) > 1) { - addObjectsToApiFile($destfile, $objects, $modulename); + if ($action == 'initapi') { + if (count($objects) >= 1) { + addObjectsToApiFile($srcfile, $destfile, $objects, $modulename); + } } else { // @phan-suppress-next-line PhanPluginSuspiciousParamPosition dolReplaceInFile($destfile, $arrayreplacement); - // @phan-suppress-next-line PhanPluginSuspiciousParamPosition - dolReplaceInFile($destfile, array('/*begin methods CRUD*/' => '/*begin methods CRUD*/'."\n\t".'/*CRUD FOR '.strtoupper($objectname).'*/', '/*end methods CRUD*/' => '/*END CRUD FOR '.strtoupper($objectname).'*/'."\n\t".'/*end methods CRUD*/')); } if ($varnametoupdate) { @@ -952,20 +952,31 @@ if ($dirins && $action == 'confirm_removefile' && !empty($module)) { $filetodelete = $dirins.'/'.$relativefilename; $dirtodelete = $dirins.'/'.$dirnametodelete; - //check when we want delete api_file + // Get list of existing objects + $objects = dolGetListOfObjectClasses($destdir); + + $keyofobjecttodelete = array_search($objectname, $objects); + if ($keyofobjecttodelete !== false) { + unset($objects[$keyofobjecttodelete]); + } + + // Delete or modify the file if (strpos($relativefilename, 'api') !== false) { $file_api = $destdir.'/class/api_'.strtolower($module).'.class.php'; - $removeFile = removeObjectFromApiFile($file_api, $objectname, $module); - $var = getFromFile($file_api, '/*begin methods CRUD*/', '/*end methods CRUD*/'); - if (str_word_count($var) == 0) { + + $removeFile = removeObjectFromApiFile($file_api, $objects, $objectname); + + if (count($objects) == 0) { $result = dol_delete_file($filetodelete); } + if ($removeFile) { setEventMessages($langs->trans("ApiObjectDeleted"), null); } } else { $result = dol_delete_file($filetodelete); } + if (!$result) { setEventMessages($langs->trans("ErrorFailToDeleteFile", basename($filetodelete)), null, 'errors'); } else { @@ -4209,7 +4220,7 @@ if ($module == 'initmodule') { print ''.$langs->trans("ApiExplorer").''; } } else { - print ''.img_picto('AddAPIsForThisObject', 'generate', 'class="paddingleft"').''; + print ''.img_picto($langs->trans('AddAPIsForThisObject'), 'generate', 'class="paddingleft"').''; } } else { print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; From c22a6219ece134d053e6ec54df9a45151a3e31ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 16:40:06 +0100 Subject: [PATCH 1292/1862] Debug v20 --- htdocs/core/lib/functions.lib.php | 4 +++- htdocs/core/modules/modAi.class.php | 2 +- htdocs/core/modules/modBookCal.class.php | 2 +- htdocs/langs/en_US/modulebuilder.lang | 7 ++++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e74be328a4b..40afe9b9dc8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4618,7 +4618,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco if (empty($srconly) && in_array($pictowithouttext, array( '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'accountancy', 'accounting_account', 'account', 'accountline', 'action', 'add', 'address', 'ai', 'angle-double-down', 'angle-double-up', 'asset', - 'bank_account', 'barcode', 'bank', 'bell', 'bill', 'billa', 'billr', 'billd', 'birthday-cake', 'bookmark', 'bom', 'briefcase-medical', 'bug', 'building', + 'bank_account', 'barcode', 'bank', 'bell', 'bill', 'billa', 'billr', 'billd', 'birthday-cake', 'bom', 'bookcal', 'bookmark', 'briefcase-medical', 'bug', 'building', 'card', 'calendarlist', 'calendar', 'calendarmonth', 'calendarweek', 'calendarday', 'calendarperuser', 'calendarpertype', 'cash-register', 'category', 'chart', 'check', 'clock', 'clone', 'close_title', 'code', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'conversation', 'cron', 'cross', 'cubes', 'check-circle', 'check-square', 'currency', 'multicurrency', @@ -4666,6 +4666,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco 'asset' => 'money-check-alt', 'autofill' => 'fill', 'bank_account' => 'university', 'bill' => 'file-invoice-dollar', 'billa' => 'file-excel', 'billr' => 'file-invoice-dollar', 'billd' => 'file-medical', + 'bookcal' => 'calendar-check', 'supplier_invoice' => 'file-invoice-dollar', 'supplier_invoicea' => 'file-excel', 'supplier_invoicer' => 'file-invoice-dollar', 'supplier_invoiced' => 'file-medical', 'bom' => 'shapes', 'card' => 'address-card', 'chart' => 'chart-line', 'company' => 'building', 'contact' => 'address-book', 'contract' => 'suitcase', 'collab' => 'people-arrows', 'conversation' => 'comments', 'country' => 'globe-americas', 'cron' => 'business-time', 'cross' => 'times', @@ -4764,6 +4765,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco 'action' => 'infobox-action', 'account' => 'infobox-bank_account', 'accounting_account' => 'infobox-bank_account', 'accountline' => 'infobox-bank_account', 'accountancy' => 'infobox-bank_account', 'asset' => 'infobox-bank_account', 'bank_account' => 'infobox-bank_account', 'bill' => 'infobox-commande', 'billa' => 'infobox-commande', 'billr' => 'infobox-commande', 'billd' => 'infobox-commande', + 'bookcal' => 'infobox-action', 'margin' => 'infobox-bank_account', 'conferenceorbooth' => 'infobox-project', 'cash-register' => 'infobox-bank_account', 'contract' => 'infobox-contrat', 'check' => 'font-status4', 'collab' => 'infobox-action', 'conversation' => 'infobox-contrat', 'donation' => 'infobox-commande', 'dolly' => 'infobox-commande', 'dollyrevert' => 'flip infobox-order_supplier', diff --git a/htdocs/core/modules/modAi.class.php b/htdocs/core/modules/modAi.class.php index c0a527a6463..3c47eb376d3 100644 --- a/htdocs/core/modules/modAi.class.php +++ b/htdocs/core/modules/modAi.class.php @@ -69,7 +69,7 @@ class modAi extends DolibarrModules $this->descriptionlong = "AiDescriptionLong"; // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' - $this->version = 'development'; + $this->version = 'experimental'; // Key used in llx_const table to save module status enabled/disabled (where BOOKCAL is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); diff --git a/htdocs/core/modules/modBookCal.class.php b/htdocs/core/modules/modBookCal.class.php index a778ac8ffc7..0b2ce6c2c77 100644 --- a/htdocs/core/modules/modBookCal.class.php +++ b/htdocs/core/modules/modBookCal.class.php @@ -78,7 +78,7 @@ class modBookCal extends DolibarrModules // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' // To use a supported fa-xxx css style of font awesome, use this->picto='xxx' - $this->picto = 'fa-calendar-check'; + $this->picto = 'bookcal'; // Define some features supported by module (triggers, login, substitutions, menus, css, etc...) $this->module_parts = array( diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index c59c4271710..9ff542d9799 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -165,7 +165,7 @@ BadValueForType=Bad value for type %s DefinePropertiesFromExistingTable=Define the fields/properties from an existing table DefinePropertiesFromExistingTableDesc=If a table in the database (for the object to create) already exists, you can use it to define the properties of the object. DefinePropertiesFromExistingTableDesc2=Keep empty if the table does not exist yet. The code generator will use different kinds of fields to build an example of table that you can edit later. -GeneratePermissions=I want to manage permissions on this object +GeneratePermissions=I want to manage permissions on this object GeneratePermissionsHelp=If you check this, some code will be added to manage permissions to read, write and delete record of the objects PermissionDeletedSuccesfuly=Permission has been successfully removed PermissionUpdatedSuccesfuly=Permission has been successfully updated @@ -173,6 +173,7 @@ PermissionAddedSuccesfuly=Permission has been successfully added MenuDeletedSuccessfuly=Menu has been successfully deleted MenuAddedSuccessfuly=Menu has been successfully added MenuUpdatedSuccessfuly=Menu has been successfully updated +AddAPIsForThisObject=Add APIs for this object ApiObjectDeleted=API for object %s has been successfully deleted CRUDRead=Read CRUDCreateWrite=Create or Update @@ -181,8 +182,8 @@ DictionariesCreated=Dictionary %s created successfully DictionaryDeleted=Dictionary %s removed successfully PropertyModuleUpdated=Property %s has been update successfully InfoForApiFile=* When you generate file for the first time then all methods will be created for each object.
* When you click in remove you just remove all methods for the selected object. -SetupFile=Page for module setup +SetupFile=Page for module setup EmailingSelectors=Emails selectors EmailingSelectorDesc=You can generate and edit here the class files to provide new email target selectors for the mass emailing module EmailingSelectorFile=Emails selector file -NoEmailingSelector=No emails selector file \ No newline at end of file +NoEmailingSelector=No emails selector file From 7fddff930225e9ca90753967fa76effce2887850 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 14 Mar 2024 16:40:14 +0100 Subject: [PATCH 1293/1862] Fix: Correction for batches with letters in Takepos --- htdocs/multicurrency/class/multicurrency.class.php | 2 +- htdocs/multicurrency/multicurrency_rate.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 5433bb23f28..a7ef2153c9f 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -912,7 +912,7 @@ class CurrencyRate extends CommonObjectLine // Update request $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; - $sql .= " SET rate = ".((float) $this->rate); + $sql .= "SET rate = ".((float) $this->rate); if (!empty($this->date_sync)) { $sql .= ", date_sync = '".$this->db->idate($this->date_sync)."'"; } diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 782834bbaa5..947c5ac3a2b 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -557,7 +557,7 @@ if ($resql) { } print '
' . $form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true) . ''; + print ''; print ''; print ''; From 54bdad710d1b074fe0fd3c0abe2a0748403f33a2 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 14 Mar 2024 16:40:54 +0100 Subject: [PATCH 1294/1862] Fix: Correction for batches with letters in Takepos --- htdocs/multicurrency/multicurrency_rate.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 947c5ac3a2b..94c0438f71e 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -558,7 +558,6 @@ if ($resql) { print '' . $form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true) . ''; - print ''; print ''; print ''; From 9430bebbb1ddf25da9fccc7e175e0c29f263a146 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 14 Mar 2024 16:44:07 +0100 Subject: [PATCH 1295/1862] Fix: Correction so that warehouse does not have to be indicated if it is a service --- htdocs/expedition/class/expedition.class.php | 4 ++-- htdocs/takepos/invoice.php | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 9588e8c9852..0ec2cf6aa77 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2014-2017 Francis Appels * Copyright (C) 2015 Claudio Aschieri - * Copyright (C) 2016-2022 Ferran Marcet + * Copyright (C) 2016-2024 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018-2022 Frédéric France * Copyright (C) 2020 Lenin Rivas @@ -920,7 +920,7 @@ class Expedition extends CommonObject if (isModEnabled('stock') && !empty($orderline->fk_product)) { $fk_product = $orderline->fk_product; - if (!($entrepot_id > 0) && !getDolGlobalString('STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS')) { + if (!($entrepot_id > 0) && !getDolGlobalString('STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS') && !(getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES') && $line->product_type == Product::TYPE_SERVICE)) { $langs->load("errors"); $this->error = $langs->trans("ErrorWarehouseRequiredIntoShipmentLine"); return -1; diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index cf3e3cde9b6..d0e0d179efc 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -3,7 +3,6 @@ * Copyright (C) 2018 Andreu Bisquerra * Copyright (C) 2021 Nicolas ZABOURI * Copyright (C) 2022-2023 Christophe Battarel - * Copyright (C) 2024 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -924,7 +923,7 @@ if (empty($reshook)) { if ($action=="setbatch" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) { $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; - $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set batch='".$db->escape($batch)."', fk_warehouse=".getDolGlobalString($constantforkey)." where rowid=".((int) $idoflineadded); + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set batch=".$db->escape($batch).", fk_warehouse=".getDolGlobalString($constantforkey)." where rowid=".((int) $idoflineadded); $db->query($sql); } From 6b48e098549c3ee0dcf56ae3f8ce7bdab8200ad8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 16:49:29 +0100 Subject: [PATCH 1296/1862] Debug --- htdocs/modulebuilder/template/admin/about.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/admin/about.php b/htdocs/modulebuilder/template/admin/about.php index 7ec1d1f30f3..ecacf04f4c1 100644 --- a/htdocs/modulebuilder/template/admin/about.php +++ b/htdocs/modulebuilder/template/admin/about.php @@ -83,7 +83,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $form = new Form($db); $help_url = ''; -$title = "MyModuleAbout"; +$title = "MyModuleSetup"; llxHeader('', $langs->trans($title), $help_url, '', 0, 0, '', '', '', 'mod-mymodule page-admin_about'); From 1e252dd5871f15181d17dd95194470fde7f4e778 Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 14 Mar 2024 17:05:27 +0100 Subject: [PATCH 1297/1862] Add spelling exception (datee + error in Changelog) --- dev/tools/codespell/codespell-ignore.txt | 1 - dev/tools/codespell/codespell-lines-ignore.txt | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/tools/codespell/codespell-ignore.txt b/dev/tools/codespell/codespell-ignore.txt index 0c84807010b..c71e990a467 100644 --- a/dev/tools/codespell/codespell-ignore.txt +++ b/dev/tools/codespell/codespell-ignore.txt @@ -57,4 +57,3 @@ dur fonction espace methode -datee diff --git a/dev/tools/codespell/codespell-lines-ignore.txt b/dev/tools/codespell/codespell-lines-ignore.txt index 2c0fb95a96f..80e4f25e296 100644 --- a/dev/tools/codespell/codespell-lines-ignore.txt +++ b/dev/tools/codespell/codespell-lines-ignore.txt @@ -79,6 +79,7 @@ $object->periode = $dateperiod; $return .= '
'.$langs->trans("Payement").' : '.$this->type_payment.''; $sortfield = "datea"; + $sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount"; $sql .= " '".$db->escape($conf->currency)."' as currency, 0 as fk_soc, t.date_ech as date, t.periode as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens"; $sql .= " , datee = ".(!empty($obj->datee) ? "'".$this->db->escape($obj->datee)."'" : "null"); $sql .= " AND (".$datefieldname." <= '".$this->db->idate($datee)."' OR ".$datefieldname." IS NULL)"; @@ -325,6 +326,7 @@ $usercanread = (($user->hasRight('stock', 'mouvement', 'lire'))); * The hook contaxt thirdpartycard has been renamed thirdpartycontact * The private array ->status_short, ->statuts and ->status_long are now array ->labelStatusShort and ->labelStatus everywhere. - New: Add proposals into referer page of thirdparty. +NEW: ModuleBuilder: Checkin comments begin and end before each actions for /F "tokens=2 delims=," %%i in ('tasklist /FI "IMAGENAME eq php.exe" /FO CSV /NH') do ( foreach ($TWeek as $week_number) { function checkES($IentOfi, $InumCta) From 587c4eb2ee90d45f058d766f2b2398eab9cb16e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 17:24:52 +0100 Subject: [PATCH 1298/1862] Escape ouput --- htdocs/adherents/ldap.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index edfa8adbb2f..f94cc476321 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -120,12 +120,13 @@ print '
'; print ''; // Login -print ''; +print ''; // If there is a link to the unencrypted password, we show the value in database here so we can compare because it is shown nowhere else +// This is for very old situation. Password are now encrypted and $object->pass is empty. if (getDolGlobalString('LDAP_MEMBER_FIELD_PASSWORD')) { print ''; - print ''; + print ''; print "\n"; } From b6b4acf5f9feaf323d0f2692fd6b5d7f5d9df293 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 17:53:48 +0100 Subject: [PATCH 1299/1862] Complet security file --- SECURITY.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SECURITY.md b/SECURITY.md index 0cc37b96ce6..4d335d63737 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -104,3 +104,6 @@ Scope is the web application (backoffice) and the APIs. * SSL/TLS best practices * Invalid or missing SPF (Sender Policy Framework) records (Incomplete or missing SPF/DKIM/DMARC) * Physical or social engineering attempts or issues that require physical access to a victim’s computer/device +* Ability to include javascript into a page of the website using the website page editor are not qualified (this is the expected behaviour) +* Ability to execute PHP code on the server using the website using the website page editor by a user that own the super permission "add php code into pages" are not qualified (this is the expected behaviour). + From 8da1bc8b74791b9be692095a6fd3bb3467777135 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 17:55:49 +0100 Subject: [PATCH 1300/1862] FIX variable assignment (PHPStan warning) --- htdocs/product/stock/class/productlot.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index f1941283842..f9787f8e3eb 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -1220,7 +1220,7 @@ class Productlot extends CommonObject $this->specimen = 1; $this->entity = $conf->entity; - $this->fk_product = null; + $this->fk_product = 0; $this->batch = ''; $this->eatby = $now - 100000; $this->sellby = $now - 100000; From 2c1be590d9f752ae456f6c6019b44c7c9b64de19 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 18:03:32 +0100 Subject: [PATCH 1301/1862] FIX variables in project class (PHPStan Warnings) --- htdocs/projet/class/project.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 13d4c426bc7..e8911500494 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -2670,10 +2670,10 @@ class Project extends CommonObject $actioncomm->email_sender = ''; $actioncomm->email_to = $to; - $actioncomm->errors_to = $errors_to; + $actioncomm->errors_to = (string) $errors_to; $actioncomm->elementtype = 'project_task'; - $actioncomm->fk_element = $this->element; + $actioncomm->fk_element = (int) $this->element; $actioncomm->create($user); } else { @@ -2704,10 +2704,10 @@ class Project extends CommonObject $actioncomm->email_sender = ''; $actioncomm->email_to = $to; - $actioncomm->errors_to = $errors_to; + $actioncomm->errors_to = (string) $errors_to; $actioncomm->elementtype = 'project_task'; - $actioncomm->fk_element = $this->element; + $actioncomm->fk_element = (int) $this->element; $actioncomm->create($user); } From 385732c12d0eeb4992efed32fab5fa2d4c71eeda Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 14 Mar 2024 10:00:48 +0100 Subject: [PATCH 1302/1862] codespell and datee --- dev/tools/codespell/codespell-ignore.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tools/codespell/codespell-ignore.txt b/dev/tools/codespell/codespell-ignore.txt index c71e990a467..0c84807010b 100644 --- a/dev/tools/codespell/codespell-ignore.txt +++ b/dev/tools/codespell/codespell-ignore.txt @@ -57,3 +57,4 @@ dur fonction espace methode +datee From fb5dab71caa1fec472376b8bd1603c7919cf07c6 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 14 Mar 2024 18:25:47 +0100 Subject: [PATCH 1303/1862] FIX variable assignment for newPayment (PHPStan warnings) --- htdocs/public/payment/newpayment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index d57987f4434..feec219703d 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1619,7 +1619,7 @@ if ($source == 'member' || $source == 'membersubscription') { // Set the new member type $member->typeid = $newtypeid; - $member->type = dol_getIdFromCode($db, $newtypeid, 'adherent_type', 'rowid', 'libelle'); + $member->type = (string) dol_getIdFromCode($db, $newtypeid, 'adherent_type', 'rowid', 'libelle'); // list member type if (!$action) { From 4577a4d43221479f21caeffb4a9d88d63134734c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 14 Mar 2024 18:40:31 +0100 Subject: [PATCH 1304/1862] fix phpstan is incompatible with --- htdocs/core/modules/fichinter/mod_arctic.php | 15 ++++++---- htdocs/core/modules/fichinter/mod_pacific.php | 13 +++++---- .../product/mod_codeproduct_leopard.php | 2 +- .../modules/product/modules_product.class.php | 4 +-- .../modules/project/mod_project_simple.php | 15 ---------- .../modules/project/task/mod_task_simple.php | 21 +++----------- .../project/task/mod_task_universal.php | 24 ++++----------- .../societe/mod_codeclient_elephant.php | 29 ++++++++----------- .../societe/mod_codeclient_leopard.php | 18 ++++++------ .../modules/societe/mod_codeclient_monkey.php | 18 ++++++------ .../societe/mod_codecompta_aquarium.php | 10 +++---- .../societe/mod_codecompta_digitaria.php | 16 +++++----- .../societe/mod_codecompta_panicum.php | 13 +++++---- .../modules/societe/modules_societe.class.php | 10 +++---- .../mod_commande_fournisseur_muguet.php | 4 +-- .../mod_commande_fournisseur_orchidee.php | 4 +-- phpstan.neon.dist | 1 - 17 files changed, 88 insertions(+), 129 deletions(-) diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index e8f79c9c084..33fce191c0e 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -121,11 +121,11 @@ class mod_arctic extends ModeleNumRefFicheinter /** * Return next free value * - * @param Societe $objsoc Object thirdparty - * @param Fichinter $object Object we need next value for - * @return string|0 Value if OK, 0 if KO + * @param Societe|string $objsoc Object thirdparty + * @param Fichinter|string $object Object we need next value for + * @return string|0 Value if OK, 0 if KO */ - public function getNextValue($objsoc = 0, $object = '') + public function getNextValue($objsoc = '', $object = '') { global $db, $conf; @@ -138,8 +138,11 @@ class mod_arctic extends ModeleNumRefFicheinter $this->error = 'NotConfigured'; return 0; } - - $numFinal = get_next_value($db, $mask, 'fichinter', 'ref', '', $objsoc, $object->datec); + $datec = ''; + if (!empty($object->datec)) { + $datec = $object->datec; + } + $numFinal = get_next_value($db, $mask, 'fichinter', 'ref', '', $objsoc, $datec); return $numFinal; } diff --git a/htdocs/core/modules/fichinter/mod_pacific.php b/htdocs/core/modules/fichinter/mod_pacific.php index f05a1ec320f..0f780ee2bb6 100644 --- a/htdocs/core/modules/fichinter/mod_pacific.php +++ b/htdocs/core/modules/fichinter/mod_pacific.php @@ -121,11 +121,11 @@ class mod_pacific extends ModeleNumRefFicheinter /** * Return next free value * - * @param Societe $objsoc Object thirdparty - * @param Fichinter $object Object we need next value for - * @return string Value if KO, <0 if KO + * @param Societe|string $objsoc Object thirdparty + * @param Fichinter|string $object Object we need next value for + * @return string Value if KO, <0 if KO */ - public function getNextValue($objsoc = 0, $object = '') + public function getNextValue($objsoc = '', $object = '') { global $db, $conf; @@ -147,7 +147,10 @@ class mod_pacific extends ModeleNumRefFicheinter } //$date=time(); - $date = $object->datec; + $date = ''; + if (!empty($object->datec)) { + $date = $object->datec; + } $yymm = dol_print_date($date, "%y%m"); if ($max >= (pow(10, 4) - 1)) { diff --git a/htdocs/core/modules/product/mod_codeproduct_leopard.php b/htdocs/core/modules/product/mod_codeproduct_leopard.php index 126527a55bf..990d55b691e 100644 --- a/htdocs/core/modules/product/mod_codeproduct_leopard.php +++ b/htdocs/core/modules/product/mod_codeproduct_leopard.php @@ -85,7 +85,7 @@ class mod_codeproduct_leopard extends ModeleProductCode /** * Return an example of result returned by getNextValue * - * @param Product $objproduct Object product + * @param ?Product $objproduct Object product * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @return string Return next value */ diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index 893dc9dc2dc..6d9e87bf023 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -64,11 +64,11 @@ abstract class ModeleProductCode extends CommonNumRefGenerator /** * Return next value available * - * @param Product $objproduct Object product + * @param ?Product $objproduct Object product * @param int $type Type * @return string Value */ - public function getNextValue($objproduct = 0, $type = -1) + public function getNextValue($objproduct = null, $type = -1) { global $langs; return $langs->trans("Function_getNextValue_InModuleNotWorking"); diff --git a/htdocs/core/modules/project/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php index a153b3a590d..1ef51d36c95 100644 --- a/htdocs/core/modules/project/mod_project_simple.php +++ b/htdocs/core/modules/project/mod_project_simple.php @@ -165,19 +165,4 @@ class mod_project_simple extends ModeleNumRefProjects dol_syslog("mod_project_simple::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next reference not yet used as a reference - * - * @param Societe $objsoc Object third party - * @param Project $project Object project - * @return string|-1 Next not used reference, -1 if KO - */ - public function project_get_num($objsoc = 0, $project = '') - { - // phpcs:enable - return $this->getNextValue($objsoc, $project); - } } diff --git a/htdocs/core/modules/project/task/mod_task_simple.php b/htdocs/core/modules/project/task/mod_task_simple.php index 0eea8129ca3..e75fd1b5e8a 100644 --- a/htdocs/core/modules/project/task/mod_task_simple.php +++ b/htdocs/core/modules/project/task/mod_task_simple.php @@ -1,6 +1,7 @@ * Copyright (C) 2010 Laurent Destailleur + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -122,9 +123,9 @@ class mod_task_simple extends ModeleNumRefTask /** * Return next value * - * @param Societe $objsoc Object third party - * @param Task $object Object Task - * @return string|-1 Value if OK, -1 if KO + * @param Societe|string $objsoc Object third party + * @param Task|string $object Object Task + * @return string|-1 Value if OK, -1 if KO */ public function getNextValue($objsoc, $object) { @@ -161,18 +162,4 @@ class mod_task_simple extends ModeleNumRefTask dol_syslog("mod_task_simple::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next reference not yet used as a reference - * - * @param Societe $objsoc Object third party - * @param Task $object Object task - * @return string|-1 Next not used reference, -1 if KO - */ - public function task_get_num($objsoc = 0, $object = '') - { - return $this->getNextValue($objsoc, $object); - } } diff --git a/htdocs/core/modules/project/task/mod_task_universal.php b/htdocs/core/modules/project/task/mod_task_universal.php index 95c7d392ed0..52b7b9b18d9 100644 --- a/htdocs/core/modules/project/task/mod_task_universal.php +++ b/htdocs/core/modules/project/task/mod_task_universal.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -119,11 +120,11 @@ class mod_task_universal extends ModeleNumRefTask /** * Return next value * - * @param Societe $objsoc Object third party - * @param Task $object Object task - * @return string|0 Value if OK, 0 if KO + * @param Societe|string $objsoc Object third party + * @param Task|string $object Object task + * @return string|0 Value if OK, 0 if KO */ - public function getNextValue($objsoc, $object) + public function getNextValue($objsoc = '', $object = '') { global $db, $conf; @@ -141,19 +142,4 @@ class mod_task_universal extends ModeleNumRefTask return $numFinal; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next reference not yet used as a reference - * - * @param Societe $objsoc Object third party - * @param Task $object Object task - * @return string|0 Next not used reference, 0 if KO - */ - public function project_get_num($objsoc = 0, $object = '') - { - // phpcs:enable - return $this->getNextValue($objsoc, $object); - } } diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index f83ec00dc77..6e1d61e165d 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -124,14 +124,13 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode /** * Return an example of result returned by getNextValue * - * @param Translate $langs Object langs - * @param Societe $objsoc Object thirdparty - * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) - * @return string Return string example + * @param Translate $langs Object langs + * @param Societe|string $objsoc Object thirdparty + * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) + * @return string Return string example */ - public function getExample($langs, $objsoc = 0, $type = -1) + public function getExample($langs, $objsoc = '', $type = -1) { - $error = 0; $examplecust = ''; $examplesup = ''; $errmsg = array( @@ -150,12 +149,10 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode if (!$examplecust && ($cssforerror == 'error' || $this->error != 'NotConfigured')) { $langs->load("errors"); $examplecust = ''.$langs->trans('ErrorBadMask').''; - $error = 1; } if (in_array($examplecust, $errmsg)) { $langs->load("errors"); $examplecust = ''.$langs->trans($examplecust).''; - $error = 1; } } if ($type != 0) { @@ -163,12 +160,10 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode if (!$examplesup && ($cssforerror == 'error' || $this->error != 'NotConfigured')) { $langs->load("errors"); $examplesup = ''.$langs->trans('ErrorBadMask').''; - $error = 1; } if (in_array($examplesup, $errmsg)) { $langs->load("errors"); $examplesup = ''.$langs->trans($examplesup).''; - $error = 1; } } @@ -184,23 +179,23 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode /** * Return next value * - * @param Societe $objsoc Object third party - * @param int $type Client ou fournisseur (0:customer, 1:supplier) - * @return string|-1 Value if OK, '' if module not configured, -1 if KO + * @param Societe|string $objsoc Object third party + * @param int $type Client ou fournisseur (0:customer, 1:supplier) + * @return string|-1 Value if OK, '' if module not configured, -1 if KO */ - public function getNextValue($objsoc = 0, $type = -1) + public function getNextValue($objsoc = '', $type = -1) { - global $db, $conf; + global $db; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // Get Mask value $mask = ''; if ($type == 0) { - $mask = !getDolGlobalString('COMPANY_ELEPHANT_MASK_CUSTOMER') ? '' : $conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER; + $mask = getDolGlobalString('COMPANY_ELEPHANT_MASK_CUSTOMER'); } if ($type == 1) { - $mask = !getDolGlobalString('COMPANY_ELEPHANT_MASK_SUPPLIER') ? '' : $conf->global->COMPANY_ELEPHANT_MASK_SUPPLIER; + $mask = getDolGlobalString('COMPANY_ELEPHANT_MASK_SUPPLIER'); } if (!$mask) { $this->error = 'NotConfigured'; diff --git a/htdocs/core/modules/societe/mod_codeclient_leopard.php b/htdocs/core/modules/societe/mod_codeclient_leopard.php index 98343987765..1f592057adb 100644 --- a/htdocs/core/modules/societe/mod_codeclient_leopard.php +++ b/htdocs/core/modules/societe/mod_codeclient_leopard.php @@ -77,12 +77,12 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode /** * Return an example of result returned by getNextValue * - * @param Translate $langs Object langs - * @param Societe $objsoc Object thirdparty - * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) - * @return string Return string example + * @param Translate $langs Object langs + * @param Societe|string $objsoc Object thirdparty + * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) + * @return string Return string example */ - public function getExample($langs, $objsoc = 0, $type = -1) + public function getExample($langs, $objsoc = '', $type = -1) { return ''; } @@ -90,11 +90,11 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode /** * Return an example of result returned by getNextValue * - * @param Societe $objsoc Object thirdparty - * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) - * @return string Return next value + * @param Societe|string $objsoc Object thirdparty + * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) + * @return string Return next value */ - public function getNextValue($objsoc = 0, $type = -1) + public function getNextValue($objsoc = '', $type = -1) { return ''; } diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index 9019ff44d29..e46b5dc3f7a 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -76,12 +76,12 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode /** * Return an example of result returned by getNextValue * - * @param Translate $langs Object langs - * @param Societe $objsoc Object thirdparty - * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) - * @return string Return string example + * @param Translate $langs Object langs + * @param Societe|string $objsoc Object thirdparty + * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) + * @return string Return string example */ - public function getExample($langs, $objsoc = 0, $type = -1) + public function getExample($langs, $objsoc = '', $type = -1) { return $this->prefixcustomer.'0901-00001
'.$this->prefixsupplier.'0901-00001'; } @@ -90,11 +90,11 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode /** * Return next value * - * @param Societe $objsoc Object third party - * @param int $type Client ou fournisseur (1:client, 2:fournisseur) - * @return string|-1 Value if OK, '' if module not configured, -1 if KO + * @param Societe|string $objsoc Object third party + * @param int $type Client ou fournisseur (1:client, 2:fournisseur) + * @return string|-1 Value if OK, '' if module not configured, -1 if KO */ - public function getNextValue($objsoc = 0, $type = -1) + public function getNextValue($objsoc = '', $type = -1) { global $db; diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index 264ee51741b..64b65be81e5 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -130,12 +130,12 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode /** * Return an example of result returned by getNextValue * - * @param Translate $langs Object langs - * @param Societe $objsoc Object thirdparty - * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) - * @return string Return string example + * @param Translate $langs Object langs + * @param Societe|string $objsoc Object thirdparty + * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) + * @return string Return string example */ - public function getExample($langs, $objsoc = 0, $type = -1) + public function getExample($langs, $objsoc = '', $type = -1) { $s = ''; $s .= $this->prefixcustomeraccountancycode.'CUSTCODE'; diff --git a/htdocs/core/modules/societe/mod_codecompta_digitaria.php b/htdocs/core/modules/societe/mod_codecompta_digitaria.php index fc9feb6b25f..a902fc80ac8 100644 --- a/htdocs/core/modules/societe/mod_codecompta_digitaria.php +++ b/htdocs/core/modules/societe/mod_codecompta_digitaria.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2010 Laurent Destailleur * Copyright (C) 2019 Alexandre Spangaro - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -160,12 +160,12 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode /** * Return an example of result returned by getNextValue * - * @param Translate $langs Object langs - * @param Societe $objsoc Object thirdparty - * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) - * @return string Example + * @param Translate $langs Object langs + * @param Societe|string $objsoc Object thirdparty + * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) + * @return string Example */ - public function getExample($langs, $objsoc = 0, $type = -1) + public function getExample($langs, $objsoc = '', $type = -1) { global $conf, $mysoc; @@ -188,7 +188,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode * * @param DoliDB $db Database handler * @param Societe $societe Third party object - * @param int $type 'customer' or 'supplier' + * @param string $type 'customer' or 'supplier' * @return int >=0 if OK, <0 if KO */ public function get_code($db, $societe, $type = '') @@ -277,7 +277,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode * * @param DoliDB $db Database handler * @param string $code Code of third party - * @param int $type 'customer' or 'supplier' + * @param string $type 'customer' or 'supplier' * @return int >=0 if OK, <0 if KO */ public function checkIfAccountancyCodeIsAlreadyUsed($db, $code, $type = '') diff --git a/htdocs/core/modules/societe/mod_codecompta_panicum.php b/htdocs/core/modules/societe/mod_codecompta_panicum.php index 1cec3d33dad..9dd740313f9 100644 --- a/htdocs/core/modules/societe/mod_codecompta_panicum.php +++ b/htdocs/core/modules/societe/mod_codecompta_panicum.php @@ -1,6 +1,7 @@ * Copyright (C) 2010 Laurent Destailleur + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -71,12 +72,12 @@ class mod_codecompta_panicum extends ModeleAccountancyCode /** * Return an example of result returned by getNextValue * - * @param Translate $langs Object langs - * @param Societe $objsoc Object thirdparty - * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) - * @return string Example + * @param Translate $langs Object langs + * @param Societe|string $objsoc Object thirdparty + * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) + * @return string Example */ - public function getExample($langs, $objsoc = 0, $type = -1) + public function getExample($langs, $objsoc = '', $type = -1) { return ''; } @@ -87,7 +88,7 @@ class mod_codecompta_panicum extends ModeleAccountancyCode * * @param DoliDB $db Database handler * @param Societe $societe Third party object - * @param int $type 'customer' or 'supplier' + * @param string $type 'customer' or 'supplier' * @return int >=0 if OK, <0 if KO */ public function get_code($db, $societe, $type = '') diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index dff42b63e86..8cc1ddd8082 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -72,11 +72,11 @@ abstract class ModeleThirdPartyCode extends CommonNumRefGenerator /** * Return next value available * - * @param Societe $objsoc Object thirdparty - * @param int $type Type - * @return string Value + * @param Societe|string $objsoc Object thirdparty + * @param int $type Type + * @return string Value */ - public function getNextValue($objsoc = 0, $type = -1) + public function getNextValue($objsoc = '', $type = -1) { global $langs; return $langs->trans("Function_getNextValue_InModuleNotWorking"); @@ -254,7 +254,7 @@ abstract class ModeleAccountancyCode extends CommonNumRefGenerator * * @param DoliDB $db Database handler * @param Societe $societe Third party object - * @param int $type 'customer' or 'supplier' + * @param string $type 'customer' or 'supplier' * @return int >=0 if OK, <0 if KO */ public function get_code($db, $societe, $type = '') diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php index 740dbfbfd17..cd6d9f78d0e 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php @@ -131,11 +131,11 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders /** * Return next value * - * @param Societe $objsoc Object third party + * @param Societe|string $objsoc Object third party * @param CommandeFournisseur $object Object * @return string Value if OK, 0 if KO */ - public function getNextValue($objsoc = 0, $object = '') + public function getNextValue($objsoc = '', $object = '') { global $db, $conf; diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php index db138369a53..03f948de1c1 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php @@ -122,11 +122,11 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders /** * Return next value * - * @param Societe $objsoc Object third party + * @param Societe|string $objsoc Object third party * @param CommandeFournisseur $object Object * @return string|0 Value if OK, 0 if KO */ - public function getNextValue($objsoc = 0, $object = '') + public function getNextValue($objsoc = '', $object = '') { global $db, $conf; diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 78867274e30..c354dfd5d84 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -54,7 +54,6 @@ parameters: - '#(\$force_dolibarr_lib|\$dolibarr_main_db).*in empty\(\) is never defined.#' - '#Sprain\\SwissQrBill\\#' - '#Constructor of class .* has an unused parameter #' - - '#Default value of the parameter#' internalErrorsCountLimit: 50 cache: nodesByFileCountMax: 512 From f4c1d824461f66366c5bd040cd4caac264084308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Thu, 14 Mar 2024 18:40:56 +0100 Subject: [PATCH 1305/1862] add hook to list category from external module --- htdocs/categories/viewcat.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index efcd10ddbb9..8466119ffd8 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -102,7 +102,7 @@ if ($confirm == 'no') { } } -$parameters = array(); +$parameters = array('type' => $type, 'id' => $id, 'label' => $label); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks // Remove element from category if ($id > 0 && $removeelem > 0 && $action == 'unlink') { @@ -1355,6 +1355,10 @@ if ($type == Categorie::TYPE_TICKET) { } } +// Note that $action and $object may have been modified by some hooks +$parameters = array('type' => $type, 'id' => $id, 'label' => $label); +$reshook = $hookmanager->executeHooks('addMoreCategorieList', $parameters, $object, $action); + // End of page llxFooter(); $db->close(); From f8eb9da0b57ceeb763d0f1436bd23aec49925364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 14 Mar 2024 18:43:22 +0100 Subject: [PATCH 1306/1862] fix phpstan is incompatible with --- .../doc/doc_generic_supplier_invoice_odt.modules.php | 4 ++-- .../doc/doc_generic_supplier_order_odt.modules.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php index d149b5ff576..e03a9fcb835 100644 --- a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php @@ -4,7 +4,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2019 Philippe Grand - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2019 Tim Otte * * This program is free software; you can redistribute it and/or modify @@ -123,7 +123,7 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices // List of directories area $texte .= '
'; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 7557a9d89ce..f9cde0e1d1a 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1004,6 +1004,8 @@ class FormMail extends Form $out .= ''; $out .= '\n"; $out .= ""; if ($nbofsuggested > 0) { + $quantityToBeDelivered = 0; echo "
".$langs->trans("SearchIntoBatch").": $nbofsuggested

'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Login").' / '.$langs->trans("Id").''.dol_escape_htmltag($object->login).' 
'.$langs->trans("LDAPFieldPasswordNotCrypted").''.$object->pass.''.dol_escape_htmltag($object->pass).'
'; $texttitle = $langs->trans("ListOfDirectories"); - $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH))); + $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim(getDolGlobalString('SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH')))); $listoffiles = array(); diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index a0963e88c04..049683aa1f5 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -4,7 +4,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2019 Philippe Grand - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2019 Tim Otte * * This program is free software; you can redistribute it and/or modify @@ -123,7 +123,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders // List of directories area $texte .= '
'; $texttitle = $langs->trans("ListOfDirectories"); - $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->SUPPLIER_ORDER_ADDON_PDF_ODT_PATH))); + $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim(getDolGlobalString('SUPPLIER_ORDER_ADDON_PDF_ODT_PATH')))); $listoffiles = array(); foreach ($listofdir as $key => $tmpdir) { $tmpdir = trim($tmpdir); From ad13f6fc76d32d363a54dca9142cd67f02500e62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 14 Mar 2024 18:46:17 +0100 Subject: [PATCH 1307/1862] fix phpstan is incompatible with --- htdocs/fourn/class/fournisseur.facture.class.php | 6 +++--- phpstan.neon.dist | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 5130c4ad2bd..cd90cf86179 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2313,13 +2313,13 @@ class FactureFournisseur extends CommonInvoice * @param double $txlocaltax2 LocalTax2 Rate * @param double $qty Quantity * @param int $idproduct Id produit - * @param double $price_base_type HT or TTC + * @param string $price_base_type HT or TTC * @param int $info_bits Miscellaneous information of line * @param int $type Type of line (0=product, 1=service) * @param double $remise_percent Percentage discount of the line * @param int $notrigger Disable triggers - * @param integer $date_start Date start of service - * @param integer $date_end Date end of service + * @param int|string $date_start Date start of service + * @param int|string $date_end Date end of service * @param array $array_options extrafields array * @param int|null $fk_unit Code of the unit to use. Null to use the default one * @param double $pu_devise Amount in currency diff --git a/phpstan.neon.dist b/phpstan.neon.dist index c354dfd5d84..78867274e30 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -54,6 +54,7 @@ parameters: - '#(\$force_dolibarr_lib|\$dolibarr_main_db).*in empty\(\) is never defined.#' - '#Sprain\\SwissQrBill\\#' - '#Constructor of class .* has an unused parameter #' + - '#Default value of the parameter#' internalErrorsCountLimit: 50 cache: nodesByFileCountMax: 512 From a9847bb44c166d25a66df6e39c2d3dfee84cb021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 14 Mar 2024 19:02:16 +0100 Subject: [PATCH 1308/1862] fix phpstan is incompatible with --- .../core/modules/product/mod_codeproduct_elephant.php | 10 +++++----- .../core/modules/product/mod_codeproduct_leopard.php | 8 ++++---- htdocs/core/modules/product/modules_product.class.php | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index 644808826d5..397312fbb5f 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -118,12 +118,12 @@ class mod_codeproduct_elephant extends ModeleProductCode /** * Return an example of result returned by getNextValue * - * @param Translate $langs Object langs - * @param Product $objproduct Object product - * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) - * @return string Return string example + * @param Translate $langs Object langs + * @param Product|string $objproduct Object product + * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) + * @return string Return string example */ - public function getExample($langs, $objproduct = null, $type = -1) + public function getExample($langs, $objproduct = '', $type = -1) { $exampleproduct = $exampleservice = ''; diff --git a/htdocs/core/modules/product/mod_codeproduct_leopard.php b/htdocs/core/modules/product/mod_codeproduct_leopard.php index 990d55b691e..d8ae7f91676 100644 --- a/htdocs/core/modules/product/mod_codeproduct_leopard.php +++ b/htdocs/core/modules/product/mod_codeproduct_leopard.php @@ -85,11 +85,11 @@ class mod_codeproduct_leopard extends ModeleProductCode /** * Return an example of result returned by getNextValue * - * @param ?Product $objproduct Object product - * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) - * @return string Return next value + * @param Product|string $objproduct Object product + * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) + * @return string Return next value */ - public function getNextValue($objproduct = null, $type = -1) + public function getNextValue($objproduct = '', $type = -1) { return ''; } diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index 6d9e87bf023..cfe79891429 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -64,11 +64,11 @@ abstract class ModeleProductCode extends CommonNumRefGenerator /** * Return next value available * - * @param ?Product $objproduct Object product - * @param int $type Type - * @return string Value + * @param Product|string $objproduct Object product + * @param int $type Type + * @return string Value */ - public function getNextValue($objproduct = null, $type = -1) + public function getNextValue($objproduct = '', $type = -1) { global $langs; return $langs->trans("Function_getNextValue_InModuleNotWorking"); From 2a7eac534e481a81a3138bf0c2fbd81682e59526 Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 14 Mar 2024 03:02:54 +0100 Subject: [PATCH 1309/1862] Fix call to rollback (was NOOP property access) --- htdocs/compta/cashcontrol/cashcontrol_card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index fe4d5a15f77..74cce92938d 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -6,6 +6,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Marcos García * Copyright (C) 2018 Andreu Bisquerra + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -68,7 +69,7 @@ if ($contextpage == 'takepos') { $_GET['optioncss'] = 'print'; } -$arrayofpaymentmode = array('cash'=>'Cash', 'cheque'=>'Cheque', 'card'=>'CreditCard'); +$arrayofpaymentmode = array('cash' => 'Cash', 'cheque' => 'Cheque', 'card' => 'CreditCard'); $arrayofposavailable = array(); if (isModEnabled('cashdesk')) { @@ -180,7 +181,7 @@ if ($action == "start") { $db->commit(); $action = "view"; } else { - $db->rollback; + $db->rollback(); $action = "view"; } } From 6d2ad5b180a4d07f8dd6b5e34bddf0b82208fff0 Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 14 Mar 2024 03:04:22 +0100 Subject: [PATCH 1310/1862] Comment NOOP access to unset property --- htdocs/fichinter/card-rec.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 8e7aad352be..4c71562da9b 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -10,6 +10,7 @@ * Copyright (C) 2016-2018 Charlie Benke * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2024 William Mead + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -730,9 +731,7 @@ if ($action == 'create') { // Show product and description if (isset($object->lines[$i]->product_type)) { $type = $object->lines[$i]->product_type; - } else { - $object->lines[$i]->fk_product_type; - } + } // else { $object->lines[$i]->fk_product_type; } // Try to enhance type detection using date_start and date_end for free lines when type // was not saved. if (!empty($objp->date_start)) { From b28f6a2cbad8ebc5e9516a148c868acf8a8721e9 Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 14 Mar 2024 03:06:41 +0100 Subject: [PATCH 1311/1862] Enable PhanNoopProperty --- dev/tools/phan/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 4771e953a36..a80290c1fb0 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -549,7 +549,7 @@ return [ // 'PhanSyntaxReturnValueInVoid', // 'PhanTypeInstantiateTraitStaticOrSelf', // 'PhanUndeclaredInvokeInCallable', - 'PhanNoopProperty', + // 'PhanNoopProperty', 'PhanNoopVariable', // 'PhanPluginPrintfUnusedArgument', // 'PhanSyntaxReturnExpectedValue', From 49416784ce3646fd942d8164e11d8968f74b04fd Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:28:10 +0100 Subject: [PATCH 1312/1862] Fix PhanPluginSuspiciousParamPosition --- dev/tools/phan/baseline.txt | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 68fc0c015e7..c56fd81b5d6 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,8 +9,9 @@ */ return [ // # Issue statistics: - // PhanPluginSuspiciousParamPosition : 45+ occurrences + // PhanPluginDuplicateIfStatements : 30+ occurrences // PhanParamSignatureMismatch : 25+ occurrences + // PhanPluginSuspiciousParamPosition : 15+ occurrences // PhanUndeclaredConstant : 15+ occurrences // PhanPluginDuplicateExpressionBinaryOp : 10+ occurrences // PhanTypeArraySuspiciousNull : 10+ occurrences @@ -33,34 +34,21 @@ return [ 'htdocs/adherents/stats/geo.php' => ['PhanTypeArraySuspiciousNull'], 'htdocs/adherents/type.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/admin/receiptprinter.php' => ['PhanRedefineFunctionInternal'], - 'htdocs/admin/translation.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/categories/class/api_categories.class.php' => ['PhanAccessMethodProtected'], 'htdocs/categories/viewcat.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/collab/index.php' => ['PhanParamTooMany'], - 'htdocs/comm/action/index.php' => ['PhanPluginSuspiciousParamPosition', 'PhanTypeArraySuspiciousNull', 'PhanTypeInvalidUnaryOperandNumeric'], + 'htdocs/comm/action/index.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/comm/mailing/cibles.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/comm/mailing/info.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/accounting-files.php' => ['PhanTypeInvalidUnaryOperandNumeric'], - 'htdocs/compta/bank/various_payment/card.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/bank/various_payment/document.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/bank/various_payment/info.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'], - 'htdocs/compta/facture/agenda-rec.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/facture/card-rec.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/prelevement/class/bonprelevement.class.php' => ['PhanParamTooMany'], 'htdocs/compta/prelevement/create.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/sociales/class/paymentsocialcontribution.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], - 'htdocs/compta/sociales/document.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/sociales/info.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/sociales/note.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], - 'htdocs/compta/tva/document.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/core/actions_massactions.inc.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/class/commondocgenerator.class.php' => ['PhanTypeArraySuspiciousNull'], - 'htdocs/core/class/commonobject.class.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/core/class/evalmath.class.php' => ['PhanPluginUnsafeEval'], 'htdocs/core/class/html.form.class.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/core/class/html.formmail.class.php' => ['PhanNoopArray'], @@ -68,7 +56,6 @@ return [ 'htdocs/core/db/mysqli.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/core/db/pgsql.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/core/db/sqlite3.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/core/filemanagerdol/connectors/php/connector.lib.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/core/get_info.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/core/lib/files.lib.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/core/lib/functions.lib.php' => ['PhanParamTooMany', 'PhanPluginAlwaysReturnFunction', 'PhanPluginUnsafeEval', 'PhanRedefineFunctionInternal'], @@ -78,7 +65,6 @@ return [ 'htdocs/core/menus/standard/eldy_menu.php' => ['PhanParamSuspiciousOrder'], 'htdocs/core/menus/standard/empty.php' => ['PhanParamSuspiciousOrder'], 'htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php' => ['PhanParamSignatureMismatch'], - 'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/core/modules/member/doc/pdf_standard.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/core/modules/movement/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeArraySuspiciousNull'], @@ -87,18 +73,10 @@ return [ 'htdocs/don/class/don.class.php' => ['PhanParamTooMany'], 'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/fourn/class/api_supplier_invoices.class.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/fourn/facture/card-rec.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/intracommreport/list.php' => ['PhanAccessPropertyStaticAsNonStatic'], - 'htdocs/loan/card.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/loan/class/paymentloan.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], - 'htdocs/loan/document.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/loan/info.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/loan/note.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/loan/payment/card.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/loan/schedule.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/mrp/class/mo.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/product/admin/product_tools.php' => ['PhanNoopStringLiteral'], - 'htdocs/product/card.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/projet/tasks/list.php' => ['PhanTypeArraySuspiciousNull'], 'htdocs/public/bookcal/index.php' => ['PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/public/opensurvey/index.php' => ['PhanPluginSuspiciousParamOrder'], From 0efd899509de91afff51d3d828718ee8b6de98a1 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:28:14 +0100 Subject: [PATCH 1313/1862] Fix PhanPluginSuspiciousParamPosition --- htdocs/admin/translation.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 0dbeab0db6d..307f4e3a579 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2020 Laurent Destailleur * Copyright (C) 2009-2017 Regis Houssin * Copyright (C) 2017 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -301,7 +302,9 @@ foreach ($modulesdir as $keydir => $tmpsearchdir) { } //var_dump($i.' - '.$keydir.' - '.$dir_lang_osencoded.' -> '.$moduledirname . ' / ' . $tmpfile.' -> '.$langkey); + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition $result = $newlang->load($langkey, 0, 0, '', 0); // Load translation files + database overwrite + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition $result = $newlangfileonly->load($langkey, 0, 0, '', 1); // Load translation files only if ($result < 0) { print 'Failed to load language file '.$tmpfile.'
'."\n"; @@ -313,6 +316,7 @@ foreach ($modulesdir as $keydir => $tmpsearchdir) { } //print 'After loading lang '.$langkey.', newlang has '.count($newlang->tab_translate).' records
'."\n"; + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition $result = $langsenfileonly->load($langkey, 0, 0, '', 1); // Load translation files only } $i++; From a7274050d205b0cd9d9602987ae44280080eaf37 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:28:17 +0100 Subject: [PATCH 1314/1862] Fix PhanPluginSuspiciousParamPosition --- htdocs/comm/action/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 68e6b4d7169..92bd8159976 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -302,8 +302,8 @@ if (empty($user->conf->AGENDA_DISABLE_EXT)) { 'src' => getDolUserString($source), 'name' => dol_string_nohtmltag(getDolUserString($name)), 'offsettz' => (int) (empty($user->conf->$offsettz) ? 0 : $user->conf->$offsettz), - // @phan-suppress-next-line PhanPluginSuspiciousParamPosition 'color' => dol_string_nohtmltag(getDolUserString($color)), + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition 'default' => dol_string_nohtmltag(getDolUserString($default)), 'buggedfile' => dol_string_nohtmltag(isset($user->conf->buggedfile) ? $user->conf->buggedfile : '') ); From 06cf35634af3cc6f90d2fce63f86ba323eb21085 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:28:19 +0100 Subject: [PATCH 1315/1862] Fix PhanPluginSuspiciousParamPosition --- htdocs/compta/prelevement/create.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 00934b0f0e6..a6b326ac456 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -6,6 +6,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018-2023 Frédéric France * Copyright (C) 2019 Markus Welters + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -241,6 +242,7 @@ if ($type == 'bank-transfer') { llxHeader('', $title); +// @phan-suppress-next-line PhanPluginSuspiciousParamPosition $head = bon_prelevement_prepare_head($bprev, $bprev->nbOfInvoiceToPay($type), $bprev->nbOfInvoiceToPay($type, 'salary')); if ($type) { print dol_get_fiche_head($head, (!GETPOSTISSET('sourcetype') ? 'invoice' : 'salary'), $langs->trans("Invoices"), -1, $bprev->picto); From 27e89df94db179b3e4ecdb45f78f85d6eb29e6be Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:28:20 +0100 Subject: [PATCH 1316/1862] Fix PhanPluginSuspiciousParamPosition --- htdocs/core/class/commonobject.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 6d3d2c65557..dba5ffd306a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9785,6 +9785,7 @@ abstract class CommonObject foreach ($fieldvalues as $k => $v) { $keys[$k] = $k; $value = $this->fields[$k]; + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition $values[$k] = $this->quote($v, $value); // May return string 'NULL' if $value is null } @@ -10087,7 +10088,9 @@ abstract class CommonObject foreach ($fieldvalues as $k => $v) { $keys[$k] = $k; $value = $this->fields[$k]; + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition $values[$k] = $this->quote($v, $value); + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition $tmp[] = $k.'='.$this->quote($v, $this->fields[$k]); } From bd0447a8a3544eea86bdc6bc02d4744111350a85 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:28:22 +0100 Subject: [PATCH 1317/1862] Fix PhanPluginSuspiciousParamPosition --- htdocs/core/filemanagerdol/connectors/php/connector.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php index 656ca060471..afdfa2b6ffd 100644 --- a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php +++ b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php @@ -551,8 +551,8 @@ function GetParentFolder($folderPath) /** * CreateServerFolder * - * @param string $folderPath Folder - * @param string $lastFolder Folder + * @param string $folderPath Folder - Folder to create (recursively) + * @param ?string $lastFolder Internal - Child Folder we are creating, prevents recursion * @return string ''=success, error message otherwise */ function CreateServerFolder($folderPath, $lastFolder = null) @@ -585,6 +585,7 @@ function CreateServerFolder($folderPath, $lastFolder = null) return "Can't create $folderPath directory"; } + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition $sErrorMsg = CreateServerFolder($sParent, $folderPath); if ($sErrorMsg != '') { return $sErrorMsg; From 8ff08adbbfbb6e92642dd9891c1b61ccd3099c9e Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:28:25 +0100 Subject: [PATCH 1318/1862] Fix PhanPluginSuspiciousParamPosition --- htdocs/core/modules/import/import_xlsx.modules.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index def42e03d9c..6a6d33df252 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -3,6 +3,7 @@ * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012-2016 Juanjo Menent + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -519,6 +520,7 @@ class ImportXlsx extends ModeleImports // @phan-suppress-next-line PhanPluginSuspiciousParamPosition $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); } elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) { + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition $this->errors[$error]['lib'] = $langs->trans('ErrorFieldRefNotIn', $key, $newval, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element'])); } else { $this->errors[$error]['lib'] = 'ErrorBadDefinitionOfImportProfile'; From 4d4aa6b4736f5fa942a44f1fe67648064be383d4 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:31:41 +0100 Subject: [PATCH 1319/1862] Fix PhanPluginSuspiciousParamPosition --- htdocs/product/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index d18442094ca..3b028e50d73 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -974,6 +974,7 @@ if (empty($reshook)) { } else { if (count($clone->errors)) { setEventMessages($clone->error, $clone->errors, 'errors'); + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition dol_print_error($db, $clone->errors); } else { setEventMessages($langs->trans($clone->error), null, 'errors'); From 4719e1a28041cdbdaa75f18585a9a42d761df560 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:49:52 +0100 Subject: [PATCH 1320/1862] Fix PhanPluginSuspiciousParamPosition by renaming arg (local assign) --- htdocs/comm/mailing/card.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 559530a6873..216ec9bbdd8 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1023,20 +1023,20 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldval("", 'title', $object->title, $object, $user->hasRight('mailing', 'creer'), 'string', '', null, null, '', 1); $morehtmlref .= ''; - $morehtmlright = ''; + $morehtmlstatus = ''; $nbtry = $nbok = 0; if ($object->status == 2 || $object->status == 3) { $nbtry = $object->countNbOfTargets('alreadysent'); $nbko = $object->countNbOfTargets('alreadysentko'); - $morehtmlright .= ' ('.$nbtry.'/'.$object->nbemail; + $morehtmlstatus .= ' ('.$nbtry.'/'.$object->nbemail; if ($nbko) { - $morehtmlright .= ' - '.$nbko.' '.$langs->trans("Error"); + $morehtmlstatus .= ' - '.$nbko.' '.$langs->trans("Error"); } - $morehtmlright .= ')   '; + $morehtmlstatus .= ')   '; } - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; print '
'; @@ -1345,20 +1345,20 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldval("", 'title', $object->title, $object, $user->hasRight('mailing', 'creer'), 'string', '', null, null, '', 1); $morehtmlref .= '
'; - $morehtmlright = ''; + $morehtmlstatus = ''; $nbtry = $nbok = 0; if ($object->status == 2 || $object->status == 3) { $nbtry = $object->countNbOfTargets('alreadysent'); $nbko = $object->countNbOfTargets('alreadysentko'); - $morehtmlright .= ' ('.$nbtry.'/'.$object->nbemail; + $morehtmlstatus .= ' ('.$nbtry.'/'.$object->nbemail; if ($nbko) { - $morehtmlright .= ' - '.$nbko.' '.$langs->trans("Error"); + $morehtmlstatus .= ' - '.$nbko.' '.$langs->trans("Error"); } - $morehtmlright .= ')   '; + $morehtmlstatus .= ')   '; } - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; print '
'; From 8b00d0c359a4e74cdea9940e9fec6bc4de22b64a Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:49:55 +0100 Subject: [PATCH 1321/1862] Fix PhanPluginSuspiciousParamPosition by renaming arg (local assign) --- htdocs/comm/mailing/cibles.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 95ffc1f0c38..108974d986e 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -278,21 +278,21 @@ if ($object->fetch($id) >= 0) { $morehtmlref .= $form->editfieldval("", 'title', $object->title, $object, 0, 'string', '', null, null, '', 1); $morehtmlref .= '
'; - $morehtmlright = ''; + $morehtmlstatus = ''; $nbtry = $nbok = 0; if ($object->status == $object::STATUS_SENTPARTIALY || $object->status == $object::STATUS_SENTCOMPLETELY) { $nbtry = $object->countNbOfTargets('alreadysent'); $nbko = $object->countNbOfTargets('alreadysentko'); $nbok = ($nbtry - $nbko); - $morehtmlright .= ' ('.$nbtry.'/'.$object->nbemail; + $morehtmlstatus .= ' ('.$nbtry.'/'.$object->nbemail; if ($nbko) { - $morehtmlright .= ' - '.$nbko.' '.$langs->trans("Error"); + $morehtmlstatus .= ' - '.$nbko.' '.$langs->trans("Error"); } - $morehtmlright .= ')   '; + $morehtmlstatus .= ')   '; } - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; print '
'; From 6745fe4a5164060a33fa3166c269967df2ef7967 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:49:59 +0100 Subject: [PATCH 1322/1862] Fix PhanPluginSuspiciousParamPosition by renaming arg (local assign) --- htdocs/comm/mailing/info.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index 0bf7e9cb4ad..08aaad90c2a 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -64,20 +64,20 @@ if ($object->fetch($id) >= 0) { $morehtmlref .= $form->editfieldval("", 'title', $object->title, $object, 0, 'string', '', null, null, '', 1); $morehtmlref .= '
'; - $morehtmlright = ''; + $morehtmlstatus = ''; $nbtry = $nbok = 0; if ($object->status == 2 || $object->status == 3) { $nbtry = $object->countNbOfTargets('alreadysent'); $nbko = $object->countNbOfTargets('alreadysentko'); - $morehtmlright .= ' ('.$nbtry.'/'.$object->nbemail; + $morehtmlstatus .= ' ('.$nbtry.'/'.$object->nbemail; if ($nbko) { - $morehtmlright .= ' - '.$nbko.' '.$langs->trans("Error"); + $morehtmlstatus .= ' - '.$nbko.' '.$langs->trans("Error"); } - $morehtmlright .= ')   '; + $morehtmlstatus .= ')   '; } - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); print '

'; From 715b5ef38e09237ffabe9ec8deb9acc25454718f Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:50:02 +0100 Subject: [PATCH 1323/1862] Fix PhanPluginSuspiciousParamPosition by renaming arg (local assign) --- htdocs/compta/facture/agenda-rec.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/facture/agenda-rec.php b/htdocs/compta/facture/agenda-rec.php index 542dfd8f6c1..3636c91fce7 100644 --- a/htdocs/compta/facture/agenda-rec.php +++ b/htdocs/compta/facture/agenda-rec.php @@ -175,9 +175,9 @@ if ($object->id > 0) { } $morehtmlref .= '
'; - $morehtmlright = ''; + $morehtmlstatus = ''; - dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlright); + dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; print '
'; @@ -211,19 +211,19 @@ if ($object->id > 0) { //$out.=""; } - $morehtmlright = ''; + $morehtmlstatus = ''; //$messagingUrl = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id; - //$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); + //$morehtmlstatus .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); //$messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; - //$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); + //$morehtmlstatus .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); if (isModEnabled('agenda')) { /* if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) { - $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); + $morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } else { - $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0); + $morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0); } */ } @@ -245,8 +245,8 @@ if ($object->id > 0) { $cachekey = 'count_events_facture_'.$object->id; $nbEvent = dol_getcache($cachekey); - print_barre_liste($langs->trans("ActionsOnBillRec").(is_numeric($nbEvent) ? '('.$nbEvent.')' : ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); - //print_barre_liste($langs->trans("ActionsOnBill"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); + print_barre_liste($langs->trans("ActionsOnBillRec").(is_numeric($nbEvent) ? '('.$nbEvent.')' : ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlstatus, '', 0, 1, 1); + //print_barre_liste($langs->trans("ActionsOnBill"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlstatus, '', 0, 1, 1); // List of all actions $filters = array(); From 3874830fc04ebef049c12a8ebe69a10d4d35eba0 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:50:04 +0100 Subject: [PATCH 1324/1862] Fix PhanPluginSuspiciousParamPosition by renaming arg (local assign) --- htdocs/compta/facture/card-rec.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 59318f1a753..3502f31d822 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1282,9 +1282,9 @@ if ($action == 'create') { } $morehtmlref .= '
'; - $morehtmlright = ''; + $morehtmlstatus = ''; - dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlright); + dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; print '
'; From 7ecc9cfc2a3db17b4424771c1927106ca2da79b8 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:50:07 +0100 Subject: [PATCH 1325/1862] Fix PhanPluginSuspiciousParamPosition by renaming arg (local assign) --- htdocs/compta/sociales/document.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index c66056c47ca..0666335cc4d 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -142,9 +142,9 @@ if ($object->id) { $object->totalpaid = $alreadypayed; // To give a chance to dol_banner_tab to use already paid amount to show correct status - $morehtmlright = ''; + $morehtmlstatus = ''; - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; print '
'; From e6c29dacdaffb9e4cdd39a2494eb8f308ff3c0e4 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:50:09 +0100 Subject: [PATCH 1326/1862] Fix PhanPluginSuspiciousParamPosition by renaming arg (local assign) --- htdocs/compta/sociales/info.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index 24181ae4b7b..e6ad4953129 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -111,8 +111,8 @@ $linkback = ''; print '
'; From dabd4e9f8031c65bd5c7252983f59f59a0d084b1 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:50:10 +0100 Subject: [PATCH 1327/1862] Fix PhanPluginSuspiciousParamPosition by renaming arg (local assign) --- htdocs/compta/sociales/note.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/sociales/note.php b/htdocs/compta/sociales/note.php index 2f5487497f6..53c6fe187e6 100644 --- a/htdocs/compta/sociales/note.php +++ b/htdocs/compta/sociales/note.php @@ -116,9 +116,9 @@ if ($id > 0 || !empty($ref)) { //$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status - $morehtmlright = ''; + $morehtmlstatus = ''; - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; From a308f7c178c18d460828eabcfca764f615474c1b Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:50:12 +0100 Subject: [PATCH 1328/1862] Fix PhanPluginSuspiciousParamPosition by renaming arg (local assign) --- htdocs/compta/tva/document.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index f2670861833..b9cf49d5dff 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -126,8 +126,8 @@ if ($object->id) { $linkback = ''.$langs->trans("BackToList").''; - $morehtmlright = ''; - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); + $morehtmlstatus = ''; + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; print '
'; From cbd42a79061889a5caa103354f8608427f4e6d4f Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:50:14 +0100 Subject: [PATCH 1329/1862] Fix PhanPluginSuspiciousParamPosition by renaming arg (local assign) --- htdocs/fourn/facture/card-rec.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index d8f899d7bb1..a5dc3d0eba1 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -1184,9 +1184,9 @@ if ($action == 'create') { } $morehtmlref .= '
'; - $morehtmlright = ''; + $morehtmlstatus = ''; - dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlright); + dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; print '
'; From e90ce779cc0ba07f0b2180aaa9a6c03178603bc1 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:50:16 +0100 Subject: [PATCH 1330/1862] Fix PhanPluginSuspiciousParamPosition by renaming arg (local assign) --- htdocs/loan/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 17fd78aa8c1..803717ae085 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -258,7 +258,7 @@ if (empty($reshook)) { $form = new Form($db); $formproject = new FormProjets($db); -$morehtmlright = ''; +$morehtmlstatus = ''; $outputlangs = $langs; if (isModEnabled('accounting')) { $formaccounting = new FormAccounting($db); @@ -474,7 +474,7 @@ if ($id > 0) { $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; print '
'; From 5d77c882829bccbfc309ed2b3aa04b0fbfd0d867 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:50:17 +0100 Subject: [PATCH 1331/1862] Fix PhanPluginSuspiciousParamPosition by renaming arg (local assign) --- htdocs/loan/payment/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 2afeb25b322..31b71d49a3d 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -103,9 +103,9 @@ if ($action == 'delete') { $linkback = ''; $morehtmlref = ''; -$morehtmlright = ''; +$morehtmlstatus = ''; -dol_banner_tab($payment, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); +dol_banner_tab($payment, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; print '
'; From 4735ff5c278d389d7f5257665d208ed33627e5fb Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 12 Mar 2024 19:50:19 +0100 Subject: [PATCH 1332/1862] Fix PhanPluginSuspiciousParamPosition by renaming arg (local assign) --- htdocs/loan/schedule.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index 1864c309298..ae61486bcfe 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -185,9 +185,9 @@ if (isModEnabled('project')) { } $morehtmlref .= '
'; -$morehtmlright = ''; +$morehtmlstatus = ''; -dol_banner_tab($object, 'loanid', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); +dol_banner_tab($object, 'loanid', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); ?> '; } if ($formmail->withfckeditor) { - $out .= $formmail->getModelEmailTemplate(); + $out .= $formmail->getModelEmailTemplate('bodyemail'); } if ($formmail->withaiprompt && isModEnabled('ai')) { - $out .= $formmail->getSectionForAIPrompt(); + $out .= $formmail->getSectionForAIPrompt('', 'bodyemail'); } print $out; print '
'; + $this->withaiprompt = 'html'; + $this->withlayout = 1; // Add link to add layout if ($this->withlayout && $this->withfckeditor) { $out .= ''; @@ -1440,9 +1442,10 @@ class FormMail extends Form * Return Html code for AI instruction of message and autofill result * * @param string $format Format for output ('', 'html', ...) + * @param string $htmlContent HTML name of WYSIWIG field * @return string HTML code to ask AI instruction and autofill result */ - public function getSectionForAIPrompt($format = '') + public function getSectionForAIPrompt($format = '', $htmlContent = 'message') { global $langs; @@ -1473,8 +1476,8 @@ class FormMail extends Form $('#ai_status_message').show(); //editor on readonly - if (CKEDITOR.instances.message) { - CKEDITOR.instances.message.setReadOnly(1); + if (CKEDITOR.instances.".$htmlContent.") { + CKEDITOR.instances.".$htmlContent.".setReadOnly(1); } $.ajax({ @@ -1486,13 +1489,13 @@ class FormMail extends Form 'instructions': instructions, }), success: function(response) { - console.log('Add response into field message: '+response); + console.log('Add response into field ".$htmlContent.": '+response); - jQuery('#message').val(response); + jQuery('#".$htmlContent."').val(response); - if (CKEDITOR.instances && CKEDITOR.instances.message && ".getDolGlobalInt('FCKEDITOR_ENABLE_MAIL', 0).") { - CKEDITOR.instances.message.setReadOnly(0); - CKEDITOR.instances.message.setData(response); + if (CKEDITOR.instances && CKEDITOR.instances.".$htmlContent." && ".getDolGlobalInt('FCKEDITOR_ENABLE_MAIL', 0).") { + CKEDITOR.instances.".$htmlContent.".setReadOnly(0); + CKEDITOR.instances.".$htmlContent.".setData(response); } // remove readonly @@ -1516,10 +1519,10 @@ class FormMail extends Form /** * Return HTML code for selection of email layout - * + * @param string $htmlContent HTML name of WYSIWIG field * @return string HTML for model email boxes */ - public function getModelEmailTemplate() + public function getModelEmailTemplate($htmlContent = 'message') { require_once DOL_DOCUMENT_ROOT.'/core/lib/emaillayout.lib.php'; @@ -1551,7 +1554,7 @@ class FormMail extends Form var template = $(this).data('template'); var contentHtml = $(this).data('content'); - var editorInstance = CKEDITOR.instances.message; + var editorInstance = CKEDITOR.instances.".$htmlContent."; if (editorInstance) { editorInstance.setData(contentHtml); } From 7d49d0e20b4fcb976ea8884389b5c5bb76684992 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Fri, 15 Mar 2024 18:05:32 +0100 Subject: [PATCH 1514/1862] NEW annimation for display spinner when waiting response --- htdocs/core/class/html.formmail.class.php | 8 +++- htdocs/theme/eldy/global.inc.php | 46 +++++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 7557a9d89ce..290c4ffec6d 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1454,7 +1454,8 @@ class FormMail extends Form $out .= ''; $out .= ''; $out .= ''; - $out .= '
'.$langs->trans("AIProcessingPleaseWait").'
'; + $out .= '
'; + $out .= ''.$langs->trans("AIProcessingPleaseWait").'
'; $out .= "
"; foreach ($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch as $dbatch) { // $dbatch is instance of Productbatch $batchStock = + $dbatch->qty; // To get a numeric @@ -1604,6 +1605,7 @@ if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $categorie = new Categorie($db); $categories = $categorie->get_full_arbo('product'); + $htmlforlines = ''; foreach ($categories as $row) { if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { $htmlforlines .= '
Date: Mon, 18 Mar 2024 13:54:05 +0100 Subject: [PATCH 1757/1862] Fix PhanPossiblyUndeclaredGlobalVariable and PhanPossiblyUndeclaredGlobalVariable --- htdocs/compta/prelevement/factures.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 1fe40efa05e..d100cf59961 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -274,10 +274,10 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; + $param = "&id=".$id; if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); } - $param = "&id=".urlencode((string) ($id)); // Lines of title fields print '
'; @@ -325,10 +325,14 @@ if ($resql) { while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); - if ($salaryBonPl) { + $itemurl = ''; + $partyurl = ''; + if ($salaryBonPl && ($salarytmp instanceof Salary) && ($user instanceof User)) { $salarytmp->fetch($obj->salaryid); $usertmp->fetch($obj->userid); - } else { + $itemurl = $salarytmp->getNomUrl(1); + $partyurl = $usertmp->getNomUrl(1); + } elseif ($invoicetmp instanceof Facture && $invoicetmpsupplier instanceof FactureFournisseur) { if ($obj->type == 'bank-transfer') { $invoicetmp = $invoicetmpsupplier; } else { @@ -337,22 +341,24 @@ if ($resql) { $invoicetmp->fetch($obj->facid); $thirdpartytmp->fetch($obj->socid); + $itemurl = $invoicetmp->getNomUrl(1); + $partyurl = $thirdpartytmp->getNomUrl(1); } print '
'; print '\n"; - if ($object->type == 'bank-transfer' && !$salaryBonPl) { + if ($object->type == 'bank-transfer' && !$salaryBonPl && $invoicetmp instanceof Facture) { print '\n"; } print '\n"; // Amount of invoice From c5b62a4a73631999e7183273266aa43345861815 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 13:55:03 +0100 Subject: [PATCH 1758/1862] Add typing to fix PhanTypeMismatchDimFetch --- htdocs/compta/prelevement/class/bonprelevement.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 2cc21fb215d..e3a3eb07439 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -83,6 +83,9 @@ class BonPrelevement extends CommonObject public $factures = array(); + /** + * @var array + */ public $methodes_trans = array(); public $invoice_in_error = array(); @@ -171,6 +174,9 @@ class BonPrelevement extends CommonObject public $credite; public $note; public $date_trans; + /** + * @var int Current transport method, index to $methodes_trans + */ public $method_trans; public $fk_user_trans; public $date_credit; From 33680415871f97af621095c1503ef7af131c24c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 14:04:10 +0100 Subject: [PATCH 1759/1862] Fix filter --- htdocs/compta/facture/invoicetemplate_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 13a119e35b5..63e01dac397 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -91,7 +91,7 @@ $search_date_when_endmonth = GETPOSTINT('search_date_when_endmonth'); $search_date_when_endyear = GETPOSTINT('search_date_when_endyear'); $search_date_when_start = dol_mktime(0, 0, 0, $search_date_when_startmonth, $search_date_when_startday, $search_date_when_startyear); // Use tzserver $search_date_when_end = dol_mktime(23, 59, 59, $search_date_when_endmonth, $search_date_when_endday, $search_date_when_endyear); -$search_recurring = GETPOSTINT('search_recurring'); +$search_recurring = GETPOST('search_recurring', 'intcomma'); $search_frequency = GETPOST('search_frequency', 'alpha'); $search_unit_frequency = GETPOST('search_unit_frequency', 'alpha'); $search_nb_gen_done = GETPOST('search_nb_gen_done', 'alpha'); From 9913778da0cd573c2f95718c4cb7a8370503918a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 18 Mar 2024 14:04:51 +0100 Subject: [PATCH 1760/1862] fix migration for postgresql 19.0.0 -> 20.0.0 --- htdocs/install/mysql/migration/19.0.0-20.0.0.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql index cbbb6d34cdc..170f02a9ec1 100644 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql @@ -227,8 +227,10 @@ ALTER TABLE llx_product ADD COLUMN last_main_doc varchar(255); ALTER TABLE llx_knowledgemanagement_knowledgerecord MODIFY COLUMN answer longtext; -ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME llx_receptiondet_batch_extrafields; -ALTER TABLE llx_commande_fournisseur_dispatch RENAME llx_receptiondet_batch; +-- VMYSQL4.3 ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME llx_receptiondet_batch_extrafields; +-- VMYSQL4.3 ALTER TABLE llx_commande_fournisseur_dispatch RENAME llx_receptiondet_batch; +-- VPGSQL8.2 ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME TO llx_receptiondet_batch_extrafields; +-- VPGSQL8.2 ALTER TABLE llx_commande_fournisseur_dispatch RENAME TO llx_receptiondet_batch; -- Rename const to add customer categories on not customer/prospect third-party if enabled UPDATE llx_const SET name = 'THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT' WHERE name = 'THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER'; From 1783d68fd4aa9542a4a58006c642287d2021e23d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 18 Mar 2024 14:10:55 +0100 Subject: [PATCH 1761/1862] Update pgsql.class.php --- htdocs/core/db/pgsql.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index a76fbfb6857..ecb9b0f0df9 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -724,7 +724,7 @@ class DoliDBPgsql extends DoliDB */ public function escape($stringtoencode) { - return pg_escape_string($stringtoencode); + return pg_escape_string($this->db, $stringtoencode); } /** From 6640354e79ad6b2b3abed9f16daa50136b1ee84b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 14:32:59 +0100 Subject: [PATCH 1762/1862] Move to use the english key name ofmodule --- htdocs/admin/workflow.php | 2 +- htdocs/core/lib/functions.lib.php | 6 ++-- htdocs/core/menus/init_menu_auguria.sql | 38 ++++++++++++------------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 648f7706ad9..d68b7c054ef 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -158,7 +158,7 @@ $workflowcodes = array( 'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array( 'family' => 'classify_shipping', 'position' => 90, - 'enabled' => isModEnabled("expedition") && isModEnabled("facture"), + 'enabled' => isModEnabled("shipping") && isModEnabled("invoice"), 'picto' => 'shipment', 'deprecated' => 1 ), diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7554f5e5851..bb5abcf9f4c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11765,9 +11765,9 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * @param string $actionType 'default', 'danger', 'email', 'clone', 'cancel', 'delete', ... * @param string|array $url Url for link or array of subbutton description ('label'=>, 'url'=>, 'lang'=>, 'perm'=> ) * Example when an array is used: $arrayforbutaction = array( - * 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - * 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("commande"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - * 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("facture"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + * 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("proposal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + * 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("order"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + * 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("invoice"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), * ); * @param string $id Attribute id of action button. Example 'action-delete'. This can be used for full ajax confirm if this code is reused into the ->formconfirm() method. * @param int|boolean $userRight User action right diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index e661fb3db4c..d177030b841 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -18,7 +18,7 @@ insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, left insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 16__+MAX_llx_menu__, 'bom|mrp', 'isModEnabled("bom") || isModEnabled("mrp")', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'TMenuMRP', -1, 'mrp', '$user->hasRight("bom","read") || $user->hasRight("mrp","read")', '', 0, 31, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 7__+MAX_llx_menu__, 'projet', 'isModEnabled("project")', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->hasRight("projet","lire")', '', 2, 32, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', 'isModEnabled("propal") || isModEnabled("commande") || isModEnabled("supplier_order") || isModEnabled("contrat") || isModEnabled("ficheinter")', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->hasRight("societe","lire") || $user->hasRight("societe","contact","lire")', '', 2, 40, __ENTITY__, ''); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("facture") || isModEnabled("don") || isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("supplier_invoice") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->hasRight("facture","lire") || $user->hasRight("don","lire") || $user->hasRight("tax","charges","lire") || $user->hasRight("salaries","read") || $user->hasRight("loan","read") || $user->hasRight("banque","lire") || $user->hasRight("fournisseur","facture","lire") || $user->hasRight("supplier_invoice","read")', '', 2, 50, __ENTITY__, ''); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("invoice") || isModEnabled("don") || isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("supplier_invoice") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->hasRight("facture","lire") || $user->hasRight("don","lire") || $user->hasRight("tax","charges","lire") || $user->hasRight("salaries","read") || $user->hasRight("loan","read") || $user->hasRight("banque","lire") || $user->hasRight("fournisseur","facture","lire") || $user->hasRight("supplier_invoice","read")', '', 2, 50, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 14__+MAX_llx_menu__, 'banque|prelevement', 'isModEnabled("banque") || isModEnabled("prelevement")', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->hasRight("banque","lire") || $user->hasRight("prelevement","bons","lire")', '', 0, 52, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 9__+MAX_llx_menu__, 'comptabilite|accounting|asset', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("asset")', __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","mouvements","lire") || $user->hasRight("asset","read")', '', 2, 54, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 8__+MAX_llx_menu__, '', '', __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__, ''); @@ -231,23 +231,23 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__); -- Billing - Customer invoice -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?mainmenu=billing&action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?mainmenu=billing&action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_draft&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_notpaid&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_paid&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_canceled&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_draft&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_notpaid&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_paid&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_canceled&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/invoicetemplate_list.php?mainmenu=billing&leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/invoicetemplate_list.php?mainmenu=billing&leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', 'customers_bills_payment', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?mainmenu=billing&leftmenu=customers_bills_payment', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', 'customers_bills_payment', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?mainmenu=billing&leftmenu=customers_bills_payment', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__); -- Billing - Orders to bill -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&leftmenu=orders&search_status=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("order")', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&leftmenu=orders&search_status=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); -- Donations insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("don")', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'billing', 'donations', 6__+MAX_llx_menu__, '/don/index.php?mainmenu=billing&leftmenu=donations', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__); @@ -316,9 +316,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__); -- Binding -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_supplier', 2400__+MAX_llx_menu__, '/accountancy/supplier/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier', 'SuppliersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 7, __ENTITY__); @@ -379,9 +379,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("asset") && $leftmenu=="asset"', __HANDLER__, 'left', 3006__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy', 'MenuListTypeAssets', 3, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->hasRight("asset","model_advance","read"):$user->hasRight("asset","read"))', '', 0, 25, __ENTITY__); -- Check deposit -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->hasRight("banque","lire")', '', 2, 9, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&leftmenu=checks&action=new', 'NewCheckDeposit', 1, 'compta', '$user->hasRight("banque","lire")', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1713__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/list.php?mainmenu=bank&leftmenu=checks', 'List', 1, 'bills', '$user->hasRight("banque","lire")', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("bank") && (isModEnabled("invoice") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->hasRight("banque","lire")', '', 2, 9, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("bank") && (isModEnabled("invoice") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&leftmenu=checks&action=new', 'NewCheckDeposit', 1, 'compta', '$user->hasRight("banque","lire")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("bank") && (isModEnabled("invoice") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1713__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/list.php?mainmenu=bank&leftmenu=checks', 'List', 1, 'bills', '$user->hasRight("banque","lire")', '', 2, 1, __ENTITY__); -- PaymentByDirectDebit insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement")', __HANDLER__, 'left', 2500__+MAX_llx_menu__, 'accountancy', 'withdraw', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&leftmenu=withdraw', 'PaymentByDirectDebit', 0, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 9, __ENTITY__); From 90882d46b2532beff42b1d87add039af46551dc8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 14:36:09 +0100 Subject: [PATCH 1763/1862] Update factures.php --- htdocs/compta/prelevement/factures.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index d100cf59961..1dc1fd3d76d 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -274,7 +274,7 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; - $param = "&id=".$id; + $param = "&id=".((int) $id); if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); } From d73d27466bbd4a8592173d683f95fb861e8e63c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 14:40:47 +0100 Subject: [PATCH 1764/1862] Update 19.0.0-20.0.0.sql --- htdocs/install/mysql/migration/19.0.0-20.0.0.sql | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql index 170f02a9ec1..acd230f65cb 100644 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql @@ -5,7 +5,7 @@ -- -- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y -- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y --- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; -- Note that "RENAME TO" is both compatible mysql/postgesql, not "RENAME" alone. -- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; -- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); -- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; @@ -227,10 +227,8 @@ ALTER TABLE llx_product ADD COLUMN last_main_doc varchar(255); ALTER TABLE llx_knowledgemanagement_knowledgerecord MODIFY COLUMN answer longtext; --- VMYSQL4.3 ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME llx_receptiondet_batch_extrafields; --- VMYSQL4.3 ALTER TABLE llx_commande_fournisseur_dispatch RENAME llx_receptiondet_batch; --- VPGSQL8.2 ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME TO llx_receptiondet_batch_extrafields; --- VPGSQL8.2 ALTER TABLE llx_commande_fournisseur_dispatch RENAME TO llx_receptiondet_batch; +ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME TO llx_receptiondet_batch_extrafields; +ALTER TABLE llx_commande_fournisseur_dispatch RENAME TO llx_receptiondet_batch; -- Rename const to add customer categories on not customer/prospect third-party if enabled UPDATE llx_const SET name = 'THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT' WHERE name = 'THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER'; From 034ce8cb98ac13c01f8fb35eba62c5e37e8626fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 14:44:18 +0100 Subject: [PATCH 1765/1862] Fix trans key code --- htdocs/core/lib/emaillayout.lib.php | 4 ++-- htdocs/langs/en_US/mails.lang | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/emaillayout.lib.php b/htdocs/core/lib/emaillayout.lib.php index 9ae359f26df..75b7b589c44 100644 --- a/htdocs/core/lib/emaillayout.lib.php +++ b/htdocs/core/lib/emaillayout.lib.php @@ -43,10 +43,10 @@ function getHtmlOfLayout($name) } else { $out .= 'Gray rectangle'; } - $out .= ' + $out .= '

'.$langs->trans('TitleOfMailHolder').'

'; if (!(empty($user->signature))) { $out .= '

'.dol_htmlentities($user->signature).'

'; diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 4160930b410..da25fc5a5f9 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -192,4 +192,4 @@ YouCanMakeSomeInstructionForEmail=You can make some instructions for your Email ModelTemplate=Email template YouCanChooseAModelForYouMailContent= You can choose one of template models or generate one with AI TitleOfMailHolder=Title of the e-mail goes here -ContentOfMailHOlder=Content of email goes here... \ No newline at end of file +ContentOfMailHolder=Content of email goes here... From 72d758e05455f94766dd936a4c5e94a29695811b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 14:56:54 +0100 Subject: [PATCH 1766/1862] Doc --- .../interface_99_modMyModule_MyModuleTriggers.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php index db9cb264f7b..c68c6a4f33e 100644 --- a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php +++ b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php @@ -139,7 +139,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'ORDER_DELETE': //case 'ORDER_CANCEL': //case 'ORDER_SENTBYMAIL': - //case 'ORDER_CLASSIFY_BILLED': + //case 'ORDER_CLASSIFY_BILLED': // TODO Replace it with ORDER_MODIFY + //case 'ORDER_CLASSIFY_UNBILLED': // TODO Replace it with ORDER_MODIFY //case 'ORDER_SETDRAFT': //case 'LINEORDER_INSERT': //case 'LINEORDER_UPDATE': @@ -151,6 +152,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'ORDER_SUPPLIER_VALIDATE': //case 'ORDER_SUPPLIER_DELETE': //case 'ORDER_SUPPLIER_APPROVE': + //case 'ORDER_SUPPLIER_CLASSIFY_BILLED': // TODO Replace with ORDER_SUPPLIER_MODIFY + //case 'ORDER_SUPPLIER_CLASSIFY_UNBILLED': // TODO Replace with ORDER_SUPPLIER_MODIFY //case 'ORDER_SUPPLIER_REFUSE': //case 'ORDER_SUPPLIER_CANCEL': //case 'ORDER_SUPPLIER_SENTBYMAIL': @@ -165,6 +168,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'PROPAL_MODIFY': //case 'PROPAL_VALIDATE': //case 'PROPAL_SENTBYMAIL': + //case 'PROPAL_CLASSIFY_BILLED': // TODO Replace it with PROPAL_MODIFY + //case 'PROPAL_CLASSIFY_UNBILLED': // TODO Replace it with PROPAL_MODIFY //case 'PROPAL_CLOSE_SIGNED': //case 'PROPAL_CLOSE_REFUSED': //case 'PROPAL_DELETE': @@ -240,6 +245,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'FICHINTER_CREATE': //case 'FICHINTER_MODIFY': //case 'FICHINTER_VALIDATE': + //case 'FICHINTER_CLASSIFY_BILLED': // TODO Replace it with FICHINTER_MODIFY + //case 'FICHINTER_CLASSIFY_UNBILLED': // TODO Replace it with FICHINTER_MODIFY //case 'FICHINTER_DELETE': //case 'LINEFICHINTER_CREATE': //case 'LINEFICHINTER_UPDATE': From b72b38f5d1b6fc29552e103aec60d4679f2caa9b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 15:03:41 +0100 Subject: [PATCH 1767/1862] Doc --- ...ace_99_modMyModule_MyModuleTriggers.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php index c68c6a4f33e..3ab08016799 100644 --- a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php +++ b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php @@ -139,8 +139,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'ORDER_DELETE': //case 'ORDER_CANCEL': //case 'ORDER_SENTBYMAIL': - //case 'ORDER_CLASSIFY_BILLED': // TODO Replace it with ORDER_MODIFY - //case 'ORDER_CLASSIFY_UNBILLED': // TODO Replace it with ORDER_MODIFY + //case 'ORDER_CLASSIFY_BILLED': // TODO Replace it with ORDER_BILLED + //case 'ORDER_CLASSIFY_UNBILLED': // TODO Replace it with ORDER_UNBILLED //case 'ORDER_SETDRAFT': //case 'LINEORDER_INSERT': //case 'LINEORDER_UPDATE': @@ -152,8 +152,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'ORDER_SUPPLIER_VALIDATE': //case 'ORDER_SUPPLIER_DELETE': //case 'ORDER_SUPPLIER_APPROVE': - //case 'ORDER_SUPPLIER_CLASSIFY_BILLED': // TODO Replace with ORDER_SUPPLIER_MODIFY - //case 'ORDER_SUPPLIER_CLASSIFY_UNBILLED': // TODO Replace with ORDER_SUPPLIER_MODIFY + //case 'ORDER_SUPPLIER_CLASSIFY_BILLED': // TODO Replace with ORDER_SUPPLIER_BILLED + //case 'ORDER_SUPPLIER_CLASSIFY_UNBILLED': // TODO Replace with ORDER_SUPPLIER_UNBILLED //case 'ORDER_SUPPLIER_REFUSE': //case 'ORDER_SUPPLIER_CANCEL': //case 'ORDER_SUPPLIER_SENTBYMAIL': @@ -168,8 +168,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'PROPAL_MODIFY': //case 'PROPAL_VALIDATE': //case 'PROPAL_SENTBYMAIL': - //case 'PROPAL_CLASSIFY_BILLED': // TODO Replace it with PROPAL_MODIFY - //case 'PROPAL_CLASSIFY_UNBILLED': // TODO Replace it with PROPAL_MODIFY + //case 'PROPAL_CLASSIFY_BILLED': // TODO Replace it with PROPAL_BILLED + //case 'PROPAL_CLASSIFY_UNBILLED': // TODO Replace it with PROPAL_UNBILLED //case 'PROPAL_CLOSE_SIGNED': //case 'PROPAL_CLOSE_REFUSED': //case 'PROPAL_DELETE': @@ -245,8 +245,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'FICHINTER_CREATE': //case 'FICHINTER_MODIFY': //case 'FICHINTER_VALIDATE': - //case 'FICHINTER_CLASSIFY_BILLED': // TODO Replace it with FICHINTER_MODIFY - //case 'FICHINTER_CLASSIFY_UNBILLED': // TODO Replace it with FICHINTER_MODIFY + //case 'FICHINTER_CLASSIFY_BILLED': // TODO Replace it with FICHINTER_BILLED + //case 'FICHINTER_CLASSIFY_UNBILLED': // TODO Replace it with FICHINTER_UNBILLED //case 'FICHINTER_DELETE': //case 'LINEFICHINTER_CREATE': //case 'LINEFICHINTER_UPDATE': From d82729e49d5909cc0f80f87156b87d421acdc70e Mon Sep 17 00:00:00 2001 From: Hystepik Date: Mon, 18 Mar 2024 15:11:50 +0100 Subject: [PATCH 1768/1862] New data struture for references field in ticket --- htdocs/install/mysql/migration/19.0.0-20.0.0.sql | 1 + htdocs/install/mysql/tables/llx_ticket-ticket.sql | 1 + htdocs/ticket/class/ticket.class.php | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql index acd230f65cb..53502e05197 100644 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql @@ -242,6 +242,7 @@ ALTER TABLE llx_ticket ADD COLUMN model_pdf varchar(255); ALTER TABLE llx_ticket ADD COLUMN last_main_doc varchar(255); ALTER TABLE llx_ticket ADD COLUMN extraparams varchar(255); ALTER TABLE llx_ticket ADD COLUMN origin_replyto varchar(128); +ALTER TABLE llx_ticket ADD COLUMN origin_references mediumtext; ALTER TABLE llx_expensereport MODIFY COLUMN model_pdf varchar(255) DEFAULT NULL; ALTER TABLE llx_fichinter_rec MODIFY COLUMN modelpdf varchar(255) DEFAULT NULL; diff --git a/htdocs/install/mysql/tables/llx_ticket-ticket.sql b/htdocs/install/mysql/tables/llx_ticket-ticket.sql index cda890c6f69..305b8a1db87 100644 --- a/htdocs/install/mysql/tables/llx_ticket-ticket.sql +++ b/htdocs/install/mysql/tables/llx_ticket-ticket.sql @@ -26,6 +26,7 @@ CREATE TABLE llx_ticket fk_contract integer DEFAULT 0, origin_email varchar(128), origin_replyto varchar(128), + origin_references mediumtext, fk_user_create integer, fk_user_assign integer, subject varchar(255), diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 3d231680b21..716a75672bb 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -193,6 +193,11 @@ class Ticket extends CommonObject */ public $origin_replyto; + /** + * References from origin email + */ + public $origin_references; + /** * @var int Creation date */ @@ -327,7 +332,8 @@ class Ticket extends CommonObject 'fk_user_create' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Author', 'visible' => 1, 'enabled' => 1, 'position' => 15, 'notnull' => 1, 'csslist' => 'tdoverflowmax100 maxwidth150onsmartphone'), 'origin_email' => array('type' => 'mail', 'label' => 'OriginEmail', 'visible' => -2, 'enabled' => 1, 'position' => 16, 'notnull' => 1, 'index' => 1, 'searchall' => 1, 'comment' => "Reference of object", 'csslist' => 'tdoverflowmax150'), 'origin_replyto' => array('type' => 'mail', 'label' => 'EmailReplyto', 'visible' => -2, 'enabled' => 1, 'position' => 17, 'notnull' => 1, 'index' => 1, 'searchall' => 1, 'comment' => "Email to reply to", 'csslist' => 'tdoverflowmax150'), - 'subject' => array('type' => 'varchar(255)', 'label' => 'Subject', 'visible' => 1, 'enabled' => 1, 'position' => 18, 'notnull' => -1, 'searchall' => 1, 'help' => "", 'css' => 'maxwidth200 tdoverflowmax200', 'autofocusoncreate' => 1), + 'origin_references' => array('type' => 'mediumtext', 'label' => 'EmailReferences', 'visible' => -2, 'enabled' => 1, 'position' => 18, 'notnull' => 1, 'index' => 1, 'searchall' => 1, 'comment' => "References from origin email", 'csslist' => 'tdoverflowmax150'), + 'subject' => array('type' => 'varchar(255)', 'label' => 'Subject', 'visible' => 1, 'enabled' => 1, 'position' => 19, 'notnull' => -1, 'searchall' => 1, 'help' => "", 'css' => 'maxwidth200 tdoverflowmax200', 'autofocusoncreate' => 1), 'type_code' => array('type' => 'varchar(32)', 'label' => 'Type', 'visible' => 1, 'enabled' => 1, 'position' => 20, 'notnull' => -1, 'help' => "", 'csslist' => 'maxwidth125 tdoverflowmax50'), 'category_code' => array('type' => 'varchar(32)', 'label' => 'TicketCategory', 'visible' => -1, 'enabled' => 1, 'position' => 21, 'notnull' => -1, 'help' => "", 'css' => 'maxwidth100 tdoverflowmax200'), 'severity_code' => array('type' => 'varchar(32)', 'label' => 'Severity', 'visible' => 1, 'enabled' => 1, 'position' => 22, 'notnull' => -1, 'help' => "", 'css' => 'maxwidth100'), @@ -518,6 +524,7 @@ class Ticket extends CommonObject $sql .= "fk_contract,"; $sql .= "origin_email,"; $sql .= "origin_replyto,"; + $sql .= "origin_references,"; $sql .= "fk_user_create,"; $sql .= "fk_user_assign,"; $sql .= "email_msgid,"; @@ -546,6 +553,7 @@ class Ticket extends CommonObject $sql .= " ".($this->fk_contract > 0 ? $this->db->escape($this->fk_contract) : "null").","; $sql .= " ".(!isset($this->origin_email) ? 'NULL' : "'".$this->db->escape($this->origin_email)."'").","; $sql .= " ".(!isset($this->origin_replyto) ? 'NULL' : "'".$this->db->escape($this->origin_replyto)."'").","; + $sql .= " ".(!isset($this->origin_references) ? 'NULL' : "'".$this->db->escape($this->origin_references)."'").","; $sql .= " ".(!isset($this->fk_user_create) ? ($user->id > 0 ? $user->id : 'NULL') : ($this->fk_user_create > 0 ? $this->fk_user_create : 'NULL')).","; $sql .= " ".($this->fk_user_assign > 0 ? $this->fk_user_assign : 'NULL').","; $sql .= " ".(empty($this->email_msgid) ? 'NULL' : "'".$this->db->escape($this->email_msgid)."'").","; @@ -672,6 +680,7 @@ class Ticket extends CommonObject $sql .= " t.fk_contract,"; $sql .= " t.origin_email,"; $sql .= " t.origin_replyto,"; + $sql .= " t.origin_references,"; $sql .= " t.fk_user_create,"; $sql .= " t.fk_user_assign,"; $sql .= " t.email_msgid,"; @@ -728,6 +737,7 @@ class Ticket extends CommonObject $this->fk_contract = $obj->fk_contract; $this->origin_email = $obj->origin_email; $this->origin_replyto = $obj->origin_replyto; + $this->origin_references = $obj->origin_references; $this->fk_user_create = $obj->fk_user_create; $this->fk_user_assign = $obj->fk_user_assign; $this->email_msgid = $obj->email_msgid; @@ -808,6 +818,7 @@ class Ticket extends CommonObject $sql .= " t.fk_contract,"; $sql .= " t.origin_email,"; $sql .= " t.origin_replyto,"; + $sql .= " t.origin_references,"; $sql .= " t.fk_user_create, uc.lastname as user_create_lastname, uc.firstname as user_create_firstname,"; $sql .= " t.fk_user_assign, ua.lastname as user_assign_lastname, ua.firstname as user_assign_firstname,"; $sql .= " t.subject,"; @@ -926,6 +937,7 @@ class Ticket extends CommonObject $line->fk_contract = $obj->fk_contract; $line->origin_email = $obj->origin_email; $line->origin_replyto = $obj->origin_replyto; + $line->origin_references = $obj->origin_references; $line->fk_user_create = $obj->fk_user_create; $line->fk_user_assign = $obj->fk_user_assign; @@ -1079,6 +1091,7 @@ class Ticket extends CommonObject $sql .= " fk_contract=".(isset($this->fk_contract) ? (int) $this->fk_contract : "null").","; $sql .= " origin_email=".(isset($this->origin_email) ? "'".$this->db->escape($this->origin_email)."'" : "null").","; $sql .= " origin_replyto=".(isset($this->origin_replyto) ? "'".$this->db->escape($this->origin_replyto)."'" : "null").","; + $sql .= " origin_references=".(isset($this->origin_references) ? "'".$this->db->escape($this->origin_references)."'" : "null").","; $sql .= " fk_user_create=".(isset($this->fk_user_create) ? (int) $this->fk_user_create : "null").","; $sql .= " fk_user_assign=".(isset($this->fk_user_assign) ? (int) $this->fk_user_assign : "null").","; $sql .= " subject=".(isset($this->subject) ? "'".$this->db->escape($this->subject)."'" : "null").","; From 20018163e29a67ccdad87c92171a11d23d872539 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 15:13:43 +0100 Subject: [PATCH 1769/1862] Fix restore declaration to avoid to many uncompatibility problems. --- htdocs/core/triggers/dolibarrtriggers.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/dolibarrtriggers.class.php b/htdocs/core/triggers/dolibarrtriggers.class.php index e1eb9be0c0c..fd3004a9c9d 100644 --- a/htdocs/core/triggers/dolibarrtriggers.class.php +++ b/htdocs/core/triggers/dolibarrtriggers.class.php @@ -186,5 +186,5 @@ abstract class DolibarrTriggers * @param conf $conf Object conf * @return int if KO: <0 || if no trigger ran: 0 || if OK: >0 */ - abstract public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf); + abstract public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf); } From f9346a8022c895900ad2a8784b17dce308a65aaf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 15:13:43 +0100 Subject: [PATCH 1770/1862] Fix restore declaration to avoid to many uncompatibility problems. --- htdocs/core/triggers/dolibarrtriggers.class.php | 2 +- htdocs/core/triggers/interface_20_all_Logevents.class.php | 2 +- .../triggers/interface_20_modWorkflow_WorkflowManager.class.php | 2 +- .../core/triggers/interface_50_modAgenda_ActionsAuto.class.php | 2 +- .../interface_50_modBlockedlog_ActionsBlockedLog.class.php | 2 +- ...nterface_50_modEventOrganization_EventOrganization.class.php | 2 +- htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php | 2 +- .../interface_50_modMailmanspip_Mailmanspipsynchro.class.php | 2 +- .../interface_50_modNotification_Notification.class.php | 2 +- .../core/triggers/interface_50_modTicket_TicketEmail.class.php | 2 +- htdocs/core/triggers/interface_80_modStripe_Stripe.class.php | 2 +- .../triggers/interface_90_modSociete_ContactRoles.class.php | 2 +- .../triggers/interface_95_modWebhook_WebhookTriggers.class.php | 2 +- .../triggers/interface_95_modZapier_ZapierTriggers.class.php | 2 +- .../interface_99_modMyModule_MyModuleTriggers.class.php | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/core/triggers/dolibarrtriggers.class.php b/htdocs/core/triggers/dolibarrtriggers.class.php index e1eb9be0c0c..fd3004a9c9d 100644 --- a/htdocs/core/triggers/dolibarrtriggers.class.php +++ b/htdocs/core/triggers/dolibarrtriggers.class.php @@ -186,5 +186,5 @@ abstract class DolibarrTriggers * @param conf $conf Object conf * @return int if KO: <0 || if no trigger ran: 0 || if OK: >0 */ - abstract public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf); + abstract public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf); } diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index 47432eeb75c..adc63815e33 100644 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -88,7 +88,7 @@ class InterfaceLogevents extends DolibarrTriggers * @return int if KO: <0, if no trigger ran: 0, if OK: >0 * @throws Exception dol_syslog can throw Exceptions */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (getDolGlobalString('MAIN_LOGEVENTS_DISABLE_ALL')) { return 0; // Log events is disabled (hidden features) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 96da2886c32..1edea428b6f 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -62,7 +62,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->workflow) || empty($conf->workflow->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 034a052ce0c..4d6a062e38b 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -77,7 +77,7 @@ class InterfaceActionsAuto extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (!isModEnabled('agenda')) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php index 68cfccb49d5..a27ee6b7d66 100644 --- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php +++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php @@ -56,7 +56,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->blockedlog) || empty($conf->blockedlog->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php b/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php index f54615a2aaf..445bbf4ac3c 100644 --- a/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php +++ b/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php @@ -69,7 +69,7 @@ class InterfaceEventOrganization extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->eventorganization) || empty($conf->eventorganization->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index 105739fa5de..1a92bca5b66 100644 --- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -59,7 +59,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->ldap) || empty($conf->ldap->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php index a73a0eb2eb4..5b746b971cb 100644 --- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php @@ -57,7 +57,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->mailmanspip) || empty($conf->mailmanspip->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index 602c3798c97..b9a009f7c0a 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -64,7 +64,7 @@ class InterfaceNotification extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { global $hookmanager; diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index b37bd6ced34..08a24e1fc63 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -59,7 +59,7 @@ class InterfaceTicketEmail extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { global $mysoc; diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index 2d2b6db94c9..7178f29654c 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -64,7 +64,7 @@ class InterfaceStripe extends DolibarrTriggers * @param Conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { // Put here code you want to execute when a Dolibarr business event occurs. // Data and type of action are stored into $object and $action diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php index 7c3047b03d3..6906157f6ef 100644 --- a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php +++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php @@ -65,7 +65,7 @@ class InterfaceContactRoles extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if ($action === 'PROPAL_CREATE' || $action === 'ORDER_CREATE' || $action === 'BILL_CREATE' || $action === 'ORDER_SUPPLIER_CREATE' || $action === 'BILL_SUPPLIER_CREATE' || $action === 'PROPOSAL_SUPPLIER_CREATE' diff --git a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php index 70777a03ed4..c78c99fc304 100644 --- a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php @@ -65,7 +65,7 @@ class InterfaceWebhookTriggers extends DolibarrTriggers * @param Conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->webhook) || empty($conf->webhook->enabled)) { return 0; // If module is not enabled, we do nothing diff --git a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php index 701cfeec3fd..bfb4cf8ada3 100644 --- a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php @@ -58,7 +58,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers * @param Conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->zapier) || empty($conf->zapier->enabled)) { // Module not active, we do nothing diff --git a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php index 3ab08016799..32a980784e1 100644 --- a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php +++ b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php @@ -65,7 +65,7 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers * @param Conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (!isModEnabled('mymodule')) { return 0; // If module is not enabled, we do nothing From 57181e64070233881536f8a8ee2f0c72852a9d81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 15:28:19 +0100 Subject: [PATCH 1771/1862] Typo --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bb5abcf9f4c..9b0d6cfaab4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11765,7 +11765,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * @param string $actionType 'default', 'danger', 'email', 'clone', 'cancel', 'delete', ... * @param string|array $url Url for link or array of subbutton description ('label'=>, 'url'=>, 'lang'=>, 'perm'=> ) * Example when an array is used: $arrayforbutaction = array( - * 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("proposal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + * 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), * 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("order"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), * 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("invoice"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), * ); From 49bd37a72d37448602566dec1c206a792553f2d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 16:02:33 +0100 Subject: [PATCH 1772/1862] Doc --- htdocs/admin/system/database-tables.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index e122150571b..defb52235b7 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -168,7 +168,8 @@ if (!$base) { print '
'; print ''; print ''; From fcff03c66d68d0486a80abc0d032b2eff4f75bc9 Mon Sep 17 00:00:00 2001 From: mrozniecki Date: Mon, 18 Mar 2024 16:10:39 +0100 Subject: [PATCH 1773/1862] Add substitution for mail intro and signature on ticket mail --- htdocs/core/class/html.formticket.class.php | 8 ++++++-- htdocs/ticket/card.php | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 4fa8ee3eac6..471cffd2a84 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1661,10 +1661,14 @@ class FormTicket $texttooltip .= '

'.$langs->trans("ForEmailMessageWillBeCompletedWith").'...'; } if (getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO')) { - $texttooltip .= '
'.$langs->trans("TicketMessageMailIntro").'
'.getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO'); + $mail_intro = make_substitutions(getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO'), $this->substit); + print ''; + $texttooltip .= '
'.$langs->trans("TicketMessageMailIntro").'
'.$mail_intro; } if (getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE')) { - $texttooltip .= '

'.$langs->trans("TicketMessageMailFooter").'
'.getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE'); + $mail_signature = make_substitutions(getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE'), $this->substit); + print ''; + $texttooltip .= '

'.$langs->trans("TicketMessageMailFooter").'
'.$mail_signature; } print $form->textwithpicto('', $texttooltip, 1, 'help'); } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 037ec5c57c4..db416fb7742 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1536,6 +1536,7 @@ if ($action == 'create' || $action == 'presend') { $morehtmlright = ''; $help = ""; $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); $morehtmlright .= $form->textwithpicto(''.$langs->trans("TicketMessageSubstitutionReplacedByGenericValues").'', $help, 1, 'helpclickable', '', 0, 3, 'helpsubstitution'); print '
'; From a9cabe6fe4c5f89b78180b238a8b430199be6519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 18 Mar 2024 16:39:49 +0100 Subject: [PATCH 1774/1862] Update codespell-dict.txt --- dev/tools/codespell/codespell-dict.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tools/codespell/codespell-dict.txt b/dev/tools/codespell/codespell-dict.txt index f6d51c0b68d..047de65a4a8 100644 --- a/dev/tools/codespell/codespell-dict.txt +++ b/dev/tools/codespell/codespell-dict.txt @@ -9,6 +9,7 @@ aploha->alpha aplohanothtml->alphanohtml aplphanothtml->alphanohtml choosed->chosen +cumuled->cumulative dokument->document dolibar->dolibarr dolibarrr->dolibarr From 06ae1deb1b81147fb0f76acb9833ec1cb410d183 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 17:27:06 +0100 Subject: [PATCH 1775/1862] Fix better error message when using bad character_set_client --- htdocs/conf/conf.php.example | 7 +++---- htdocs/core/db/mysqli.class.php | 8 ++++++-- htdocs/website/index.php | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index d0ca5f7142e..4d8c4f8fadd 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -130,8 +130,8 @@ $dolibarr_main_db_user=''; // dolibarr_main_db_pass // ===================== // This parameter contains password used to read and write into Dolibarr database. -// If content is 'crypted:...', the password is encrypted/decrypted with dol_encode/dol_decode. -// If content is 'dolcrypt:...', the password is encrypted/decrypted with dolEncrypt/dolDecrypt. +// If content is 'crypted:...', the password is encrypted/decrypted with dol_encode/dol_decode. +// If content is 'dolcrypt:...', the password is encrypted/decrypted with dolEncrypt/dolDecrypt. // // Examples: // $dolibarr_main_db_pass='myadminpass'; @@ -160,6 +160,7 @@ $dolibarr_main_db_type=''; // Default value: depends on database driver // Examples: // dolibarr_main_db_character_set='utf8'; +// dolibarr_main_db_character_set='utf8mb4'; // $dolibarr_main_db_character_set='utf8'; @@ -455,5 +456,3 @@ $dolibarr_cron_allow_cli='0'; //############################## // External modules //############################## - - diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 8024bb4aa5b..ff63113e47b 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -125,11 +125,15 @@ class DoliDBMysqli extends DoliDB dol_syslog(get_class($this)."::DoliDBMysqli You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database ".$this->db->character_set_name(), LOG_WARNING); $this->db->set_charset($clientmustbe); // This set charset, but with a bad collation } catch (Exception $e) { - print 'Failed to force character set to '.$clientmustbe." according to setup to match the one of the server database.
\n"; + print 'Failed to force character_set_client to '.$clientmustbe." (according to setup) to match the one of the server database.
\n"; print $e->getMessage(); print "
\n"; if ($clientmustbe != 'utf8') { - print 'Edit conf/conf.php file to set a charset "utf8" instead of "'.$clientmustbe.'".'."\n"; + print 'Edit conf/conf.php file to set a charset "utf8"'; + if ($clientmustbe != 'utf8mb4') { + print ' or "utf8mb4"'; + } + print ' instead of "'.$clientmustbe.'".'."\n"; } exit; } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 2b622531dac..d64888743cb 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -683,7 +683,7 @@ if ($action == 'adddir' && $permtouploadfile) } */ -// Add site +// Add a website if ($action == 'addsite' && $usercanedit) { $db->begin(); From 13f7012d401525d80317d484bdca362e402af6c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 18:17:53 +0100 Subject: [PATCH 1776/1862] NEW Add maintenance tool to switch utf8 -> utf8mb4 --- htdocs/admin/system/database-tables.php | 42 +++++++---- htdocs/admin/system/dbtable.php | 94 +++++++++++++++++++++++-- htdocs/core/lib/functions.lib.php | 8 +-- 3 files changed, 120 insertions(+), 24 deletions(-) diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index defb52235b7..14121aebab8 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -39,6 +39,7 @@ if (!$user->admin) { accessforbidden(); } +$table = GETPOST('table', 'aZ09'); $action = GETPOST('action', 'aZ09'); @@ -46,16 +47,20 @@ $action = GETPOST('action', 'aZ09'); * Actions */ -if ($action == 'convert') { - $sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ENGINE=INNODB"; +if ($action == 'convert') { // Convert engine into innodb + $sql = "ALTER TABLE ".$db->sanitize($table)." ENGINE=INNODB"; $db->query($sql); } if ($action == 'convertutf8') { - $sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." CHARACTER SET utf8 COLLATE utf8_unicode_ci"; + $sql = "ALTER TABLE ".$db->sanitize($table)." CHARACTER SET utf8 COLLATE utf8_unicode_ci"; + $db->query($sql); +} +if ($action == 'convertutf8mb4') { + $sql = "ALTER TABLE ".$db->sanitize($table)." CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"; $db->query($sql); } if ($action == 'convertdynamic') { - $sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ROW_FORMAT=DYNAMIC;"; + $sql = "ALTER TABLE ".$db->sanitize($table)." ROW_FORMAT=DYNAMIC;"; $db->query($sql); } @@ -160,17 +165,24 @@ if (!$base) { print '
'.$langs->trans("Convert").' Dynamic'; } print ''; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index c7e7c5baa5e..a47be52e386 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -33,7 +33,57 @@ if (!$user->admin) { accessforbidden(); } -$table = GETPOST('table', 'alpha'); +$table = GETPOST('table', 'aZ09'); +$field = GETPOST('field', 'aZ09'); +$action = GETPOST('action', 'aZ09'); + + +/* + * Actions + */ + +if ($action == 'convertutf8') { + $sql = "SHOW FULL COLUMNS IN ".$db->sanitize($table); + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $row = $db->fetch_row($resql); + if ($row[0] == $field) { + $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' CHARACTER SET utf8'; // We must not sanitize the $row[1] + $db->query($sql); + + $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' COLLATE utf8_unicode_ci'; // We must not sanitize the $row[1] + $db->query($sql); + + break; + } + } + } +} +if ($action == 'convertutf8mb4') { + $sql = "SHOW FULL COLUMNS IN ".$db->sanitize($table); + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $row = $db->fetch_row($resql); + if ($row[0] == $field) { + $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' CHARACTER SET utf8mb4'; // We must not sanitize the $row[1] + $db->query($sql); + + $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' COLLATE utf8mb4_unicode_ci'; // We must not sanitize the $row[1] + $db->query($sql); + + break; + } + } + } +} /* @@ -48,7 +98,7 @@ print load_fiche_titre($langs->trans("Table")." ".$table, '', 'title_setup'); // Define request to get table description $base = 0; if (preg_match('/mysql/i', $conf->db->type)) { - $sql = "SHOW TABLE STATUS LIKE '".$db->escape($table)."'"; + $sql = "SHOW TABLE STATUS LIKE '".$db->escape($db->escapeforlike($table))."'"; $base = 1; } elseif ($conf->db->type == 'pgsql') { $sql = "SELECT conname,contype FROM pg_constraint"; @@ -99,7 +149,7 @@ if (!$base) { print ''; // $sql = "DESCRIBE ".$table; - $sql = "SHOW FULL COLUMNS IN ".$db->escape($table); + $sql = "SHOW FULL COLUMNS IN ".$db->sanitize($table); $resql = $db->query($sql); if ($resql) { @@ -109,12 +159,46 @@ if (!$base) { $row = $db->fetch_row($resql); print ''; + // field print ""; + // type - print ""; + print ""; + // collation - print ""; + print ""; + // null print ""; // key diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9b0d6cfaab4..4a1beee4bcf 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5437,7 +5437,7 @@ function img_mime($file, $titlealt = '', $morecss = '') */ function img_search($titlealt = 'default', $other = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') { $titlealt = $langs->trans('Search'); @@ -5460,7 +5460,7 @@ function img_search($titlealt = 'default', $other = '') */ function img_searchclear($titlealt = 'default', $other = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') { $titlealt = $langs->trans('Search'); @@ -5682,7 +5682,7 @@ function dol_print_error($db = null, $error = '', $errors = null) */ function dol_print_error_email($prefixcode, $errormessage = '', $errormessages = array(), $morecss = 'error', $email = '') { - global $langs, $conf; + global $langs; if (empty($email)) { $email = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL'); @@ -5745,7 +5745,7 @@ function print_liste_field_titre($name, $file = "", $field = "", $begin = "", $m */ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin = "", $moreparam = "", $moreattrib = "", $sortfield = "", $sortorder = "", $prefix = "", $disablesortlink = 0, $tooltip = '', $forcenowrapcolumntitle = 0) { - global $conf, $langs, $form; + global $langs, $form; //print "$name, $file, $field, $begin, $options, $moreattrib, $sortfield, $sortorder
\n"; if ($moreattrib == 'class="right"') { From 244da63a1cb2e75caa180b1a0ce2722ecb77bead Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Mon, 18 Mar 2024 18:22:19 +0100 Subject: [PATCH 1777/1862] NEW functionality for salaries with massactions --- htdocs/salaries/class/salary.class.php | 1 + htdocs/salaries/list.php | 91 ++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index 0e242e38b39..b8cac236746 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -128,6 +128,7 @@ class Salary extends CommonObject const STATUS_UNPAID = 0; const STATUS_PAID = 1; + public $resteapayer; /** * Constructor diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 7af81d47d6e..f88783a1f49 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -166,6 +166,93 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } +//credit transfer request +if ($massaction == 'withdrawrequest') { + $langs->load("withdrawals"); + + if (!$user->hasRight('paymentbybanktransfer', 'create')) { + $error++; + setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors'); + } else { + //Checking error + $error = 0; + $listofSalries = array(); + $arrayofselected = is_array($toselect) ? $toselect : array(); + foreach ($arrayofselected as $toselectid) { + $objecttmp = new Salary($db); + $result = $objecttmp->fetch($toselectid); + if ($result > 0) { + $totalpaid = $objecttmp->getSommePaiement(); + $objecttmp->resteapayer = price2num($objecttmp->amount - $totalpaid, 'MT'); + + // hook to finalize the remaining amount, considering e.g. cash discount agreements + $parameters = array('remaintopay' => $objecttmp->resteapayer); + $reshook = $hookmanager->executeHooks('finalizeAmountOfInvoice', $parameters, $objecttmp, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + if (!empty($remaintopay = $hookmanager->resArray['remaintopay'])) { + $objecttmp->resteapayer = $remaintopay; + } + } elseif ($reshook < 0) { + $error++; + setEventMessages($objecttmp->ref.' '.$langs->trans("ProcessingError"), $hookmanager->errors, 'errors'); + } + + if ($objecttmp->status == Salary::STATUS_PAID || $objecttmp->resteapayer == 0) { + $error++; + setEventMessages($objecttmp->ref.' '.$langs->trans("AlreadyPaid"), $objecttmp->errors, 'errors'); + } elseif ($resteapayer < 0) { + $error++; + setEventMessages($objecttmp->ref.' '.$langs->trans("AmountMustBePositive"), $objecttmp->errors, 'errors'); + } + + $rsql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande"; + $rsql .= " , pfd.date_traite as date_traite"; + $rsql .= " , pfd.amount"; + $rsql .= " , u.rowid as user_id, u.lastname, u.firstname, u.login"; + $rsql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; + $rsql .= " , ".MAIN_DB_PREFIX."user as u"; + $rsql .= " WHERE fk_salary = ".((int) $objecttmp->id); + $rsql .= " AND pfd.fk_user_demande = u.rowid"; + $rsql .= " AND pfd.traite = 0"; + $rsql .= " ORDER BY pfd.date_demande DESC"; + + $result_sql = $db->query($rsql); + if ($result_sql) { + $numprlv = $db->num_rows($result_sql); + } + + if ($numprlv > 0) { + $error++; + setEventMessages($objecttmp->ref.' '.$langs->trans("RequestAlreadyDone"), $objecttmp->errors, 'warnings'); + } elseif (!empty($objecttmp->type_payment) && $objecttmp->type_payment != '2') { + $error++; + setEventMessages($objecttmp->ref.' '.$langs->trans("BadPaymentMethod"), $objecttmp->errors, 'errors'); + } else { + $listofSalries[] = $objecttmp; + } + } + } + + if (!empty($listofSalries)) { + $nbwithdrawrequestok = 0; + foreach ($listofSalries as $salary) { + $db->begin(); + $result = $salary->demande_prelevement($user, (float) $salary->resteapayer, 'salaire'); + if ($result > 0) { + $db->commit(); + $nbwithdrawrequestok++; + } else { + $db->rollback(); + setEventMessages($aBill->error, $aBill->errors, 'errors'); + } + } + if ($nbwithdrawrequestok > 0) { + setEventMessages($langs->trans("WithdrawRequestsDone", $nbwithdrawrequestok), null, 'mesgs'); + } + } + } +} + $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -413,6 +500,10 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } +if (isModEnabled('prelevement') && $user->hasRight('prelevement', 'bons', 'creer')) { + $langs->load("withdrawals"); + $arrayofmassactions['withdrawrequest'] = img_picto('', 'payment', 'class="pictofixedwidth"').$langs->trans("MakeBankTransferOrder"); +} if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } From b1758520ea9f1d98ef38d7a1e689753c2bfa9c40 Mon Sep 17 00:00:00 2001 From: xbloq Date: Mon, 18 Mar 2024 18:28:49 +0100 Subject: [PATCH 1778/1862] Update card.php #28938 --- htdocs/compta/prelevement/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index c9f2401513b..920aaa36885 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -460,7 +460,7 @@ if ($id > 0 || $ref) { if ($salaryBonPl) { $sql = "SELECT pl.rowid, pl.statut, pl.amount, pl.fk_user,"; $sql .= " u.rowid as socid, u.login as name"; - $sql .= " FROM llx_prelevement_lignes as pl"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql .= ", ".MAIN_DB_PREFIX."prelevement_bons as pb"; $sql .= ", ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE pl.fk_prelevement_bons = ".((int) $id); From d98b7210715351fff0086e3f90da9dc739e04f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 18 Mar 2024 18:42:09 +0100 Subject: [PATCH 1779/1862] fix phpstan --- htdocs/compta/prelevement/class/bonprelevement.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index e3a3eb07439..6a7d5a774ee 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -7,6 +7,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2019 JC Prieto * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -672,7 +673,7 @@ class BonPrelevement extends CommonObject * * @param User $user Id of user * @param int $date Date of action - * @param string $method Method of transmission to bank (0=Internet, 1=Api...) + * @param int $method Method of transmission to bank (0=Internet, 1=Api...) * @return int >0 if OK, <0 if KO */ public function set_infotrans($user, $date, $method) From 62cf3ab098682dccfd78ad4aecdbcb5b1573764f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 19:27:52 +0100 Subject: [PATCH 1780/1862] Enhance error message --- htdocs/core/class/CMailFile.class.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 2ba41c28f43..11e25c2c741 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -275,8 +275,9 @@ class CMailFile // Search into the body for errors)); // Output errors set by findHtmlImagesInSrcData $this->error = 'ErrorInAddAttachementsImageBaseOnMedia'; return; } @@ -1900,8 +1901,6 @@ class CMailFile */ private function findHtmlImagesIsSrcData($images_dir) { - global $conf; - // Build the array of image extensions $extensions = array_keys($this->image_types); @@ -1927,7 +1926,7 @@ class CMailFile if (!empty($matches) && !empty($matches[1])) { if (empty($images_dir)) { // No temp directory provided, so we are not able to support convertion of data:image into physical images. - $this->error = 'NoTempDirProvidedInCMailConstructorSoCantConvertDataImgOnDisk'; + $this->errors[] = 'NoTempDirProvidedInCMailConstructorSoCantConvertDataImgOnDisk'; return -1; } @@ -1949,7 +1948,7 @@ class CMailFile dolChmod($destfiletmp); } else { $this->errors[] = "Failed to open file '".$destfiletmp."' for write"; - return -1; + return -2; } } From 04ae0f776d4d05b534e70331c9e1dec7157252b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 20:02:08 +0100 Subject: [PATCH 1781/1862] FIX trackid and temp dir on payment confirmation of event registration --- htdocs/public/payment/paymentok.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index ca5db265610..62f9797d833 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1378,7 +1378,10 @@ if ($ispaymentok) { $listofmimes = array(dol_mimetype($file)); } - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, $ishtml); + $trackid = 'inv'.$object->id; + $upload_dir_tmp = $conf->admin->dir_output.'/temp/'.uniqid('cmailfile'); + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, $ishtml, '', '', $trackid, '', 'standard', '', $upload_dir_tmp); $result = $mailfile->sendfile(); if ($result) { From a0b7cb90d86c2f7a740654dd8a7576193929d899 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 20:02:08 +0100 Subject: [PATCH 1782/1862] FIX trackid and temp dir on payment confirmation of event registration --- htdocs/core/class/CMailFile.class.php | 6 ++++++ htdocs/public/payment/paymentok.php | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 11e25c2c741..3539c62b6cf 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1901,9 +1901,15 @@ class CMailFile */ private function findHtmlImagesIsSrcData($images_dir) { + global $conf; + // Build the array of image extensions $extensions = array_keys($this->image_types); + if (empty($images_dir)) { + $images_dir = $conf->admin->dir_output.'/temp/'.uniqid('cmailfile'); + } + if ($images_dir && !dol_is_dir($images_dir)) { dol_mkdir($images_dir, DOL_DATA_ROOT); } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index ca5db265610..3c710691bdd 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1378,7 +1378,9 @@ if ($ispaymentok) { $listofmimes = array(dol_mimetype($file)); } - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, $ishtml); + $trackid = 'inv'.$object->id; + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, $ishtml, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { @@ -1569,8 +1571,9 @@ if ($ispaymentok) { $urlback = $_SERVER["REQUEST_URI"]; $ishtml = dol_textishtml($texttosend); // May contain urls + $trackid = 'inv'.$invoice->id; - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { @@ -1777,10 +1780,7 @@ if ($ispaymentok) { print $conf->global->$key; } - $sendemail = ''; - if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { - $sendemail = $conf->global->ONLINE_PAYMENT_SENDEMAIL; - } + $sendemail = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL'); $tmptag = dolExplodeIntoArray($fulltag, '.', '='); @@ -1860,9 +1860,10 @@ if ($ispaymentok) { $ishtml = dol_textishtml($content); // May contain urls + $trackid = ''; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml); + $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { @@ -1941,9 +1942,10 @@ if ($ispaymentok) { $ishtml = dol_textishtml($content); // May contain urls + $trackid = ''; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml); + $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { From 1a82c5e8ced5270313c6391787490fd891d1d9bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 20:38:51 +0100 Subject: [PATCH 1783/1862] Fix warnings --- htdocs/admin/mails_templates.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index ae1f8bf67d1..546427463da 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -681,7 +681,7 @@ if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu // Confirm deletion of record if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((int) $rowid).'&code='.urlencode($code).'&id='.((int) $id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((int) $rowid).'&id='.((int) $id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } @@ -1101,7 +1101,7 @@ if ($num) { } print "\n"; - print ''; + print ''; print '\n"; - print ''; + print ''; print '"; // Date start print ''; // Date end print ''; // Status From 7e44ab47ca3ed2a67e49380ab763abf1a8ebc4fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Mar 2024 00:48:51 +0100 Subject: [PATCH 1807/1862] FIX Manual deletion of a bookkeeping line --- .../accountancy/class/bookkeeping.class.php | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 5c07b8f637f..44f28bae658 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -738,11 +738,10 @@ class BookKeeping extends CommonObject /** * Load object in memory from the database * - * @param int $id Id object - * @param string $ref Ref - * @param string $mode Mode - * - * @return int Return integer <0 if KO, 0 if not found, >0 if OK + * @param int $id Id object + * @param string $ref Ref + * @param string $mode Mode ('' or 'tmp_') + * @return int Return integer <0 if KO, 0 if not found, >0 if OK */ public function fetch($id, $ref = null, $mode = '') { @@ -1545,15 +1544,16 @@ class BookKeeping extends CommonObject * * @param User $user User that deletes * @param int $notrigger false=launch triggers after, true=disable triggers - * @param string $mode Mode + * @param string $mode Mode ('' or 'tmp_') * @return int Return integer <0 if KO, >0 if OK */ public function delete(User $user, $notrigger = 0, $mode = '') { global $langs; + dol_syslog(__METHOD__, LOG_DEBUG); - $result = $this->canModifyBookkeeping($this->id); + $result = $this->canModifyBookkeeping($this->id, $mode); if ($result < 0) { return -1; } elseif ($result == 0) { @@ -2357,9 +2357,10 @@ class BookKeeping extends CommonObject * Is the bookkeeping can be modified or deleted ? * * @param int $id Bookkeeping ID + * @param string $mode Mode ('' or 'tmp_') * @return int Return integer <0 if KO, == 0 if No, == 1 if Yes */ - public function canModifyBookkeeping($id) + public function canModifyBookkeeping($id, $mode = '') { global $conf; @@ -2371,7 +2372,7 @@ class BookKeeping extends CommonObject } $bookkeeping = new BookKeeping($this->db); - $result = $bookkeeping->fetch($id); + $result = $bookkeeping->fetch($id, null, $mode); if ($result <= 0) { return $result; } @@ -2392,7 +2393,7 @@ class BookKeeping extends CommonObject } $bookkeeping = new BookKeeping($this->db); - $result = $bookkeeping->fetch($id); + $result = $bookkeeping->fetch($id, null, $mode); if ($result <= 0) { return $result; } From 2fce8f1d461d71ff5bf2f0638d822fff9028cd70 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Mar 2024 00:49:45 +0100 Subject: [PATCH 1808/1862] FIX Bad management on error creation of bookkeeping --- htdocs/accountancy/bookkeeping/card.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 79f7c44cda9..3469e8e994c 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -94,6 +94,7 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) { /* * Actions */ + $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); if ($reshook < 0) { @@ -229,7 +230,7 @@ if (empty($reshook)) { if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { - $result = $object->delete($user, false, $mode); + $result = $object->delete($user, 0, $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -269,6 +270,8 @@ if (empty($reshook)) { $result = $object->createStd($user, 0, $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); + + $action = 'create'; } else { $reshook = $hookmanager->executeHooks('afterCreateBookkeeping', $parameters, $object, $action); @@ -411,6 +414,7 @@ if ($action == 'create') { print ''; } else { $object = new BookKeeping($db); + $result = $object->fetchPerMvt($piece_num, $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -811,7 +815,7 @@ if ($action == 'create') { } } - print dol_get_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); From 79334dbbe4178efd0e41b73dd1c285fca3b6cfb2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Mar 2024 00:49:55 +0100 Subject: [PATCH 1809/1862] Fix regression in GETPOST --- htdocs/accountancy/bookkeeping/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 7ac6bc27cea..f776fb43b9e 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -53,7 +53,7 @@ $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookkeepinglist'; // Search Parameters -$search_mvt_num = GETPOSTINT('search_mvt_num'); +$search_mvt_num = GETPOST('search_mvt_num', 'intcomma'); $search_doc_type = GETPOST("search_doc_type", 'alpha'); $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); $search_date_startyear = GETPOSTINT('search_date_startyear'); From f5259cee654cbfb3d3ca444bd1adab215375950b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Mar 2024 01:02:24 +0100 Subject: [PATCH 1810/1862] Fix regression of GETPOSTINT --- htdocs/accountancy/bookkeeping/export.php | 62 +++++++++---------- htdocs/accountancy/bookkeeping/list.php | 4 +- .../accountancy/bookkeeping/listbyaccount.php | 38 ++++++------ 3 files changed, 52 insertions(+), 52 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index 16923e5ebbd..cb9e8ea09d4 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -50,48 +50,48 @@ $massaction = GETPOST('massaction', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookkeepinglist'; -$search_mvt_num = GETPOSTINT('search_mvt_num'); +$search_mvt_num = GETPOST('search_mvt_num', 'alpha'); $search_doc_type = GETPOST("search_doc_type", 'alpha'); $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); -$search_date_startyear = GETPOSTINT('search_date_startyear'); -$search_date_startmonth = GETPOSTINT('search_date_startmonth'); -$search_date_startday = GETPOSTINT('search_date_startday'); -$search_date_endyear = GETPOSTINT('search_date_endyear'); -$search_date_endmonth = GETPOSTINT('search_date_endmonth'); -$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endday = GETPOSTINT('search_date_endday'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_doc_date = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); -$search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); -$search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); -$search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); -$search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); -$search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); -$search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); +$search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); +$search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); +$search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); +$search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); +$search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); +$search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); $search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); $search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); -$search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); -$search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); -$search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); -$search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); -$search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); -$search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); +$search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); +$search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); +$search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); +$search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); +$search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); +$search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); $search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear); $search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear); -$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); -$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); -$search_date_export_startday = GETPOSTINT('search_date_export_startday'); -$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); -$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); -$search_date_export_endday = GETPOSTINT('search_date_export_endday'); +$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); +$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); +$search_date_export_startday = GETPOSTINT('search_date_export_startday'); +$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); +$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); +$search_date_export_endday = GETPOSTINT('search_date_export_endday'); $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); -$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); -$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); -$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); -$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); -$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); -$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); +$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); +$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); +$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); +$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); +$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); +$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); $search_import_key = GETPOST("search_import_key", 'alpha'); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index f776fb43b9e..a9931ab2ccb 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -53,7 +53,7 @@ $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookkeepinglist'; // Search Parameters -$search_mvt_num = GETPOST('search_mvt_num', 'intcomma'); +$search_mvt_num = GETPOST('search_mvt_num', 'alpha'); $search_doc_type = GETPOST("search_doc_type", 'alpha'); $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); $search_date_startyear = GETPOSTINT('search_date_startyear'); @@ -154,7 +154,7 @@ $hookmanager->initHooks(array('bookkeepinglist')); $formaccounting = new FormAccounting($db); $form = new Form($db); -if (!in_array($action, array('delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOSTINT('page') == '' && !GETPOSTINT('noreset') && $user->hasRight('accounting', 'mouvements', 'export')) { +if (!in_array($action, array('delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'alpha') == '' && !GETPOSTINT('noreset') && $user->hasRight('accounting', 'mouvements', 'export')) { if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values') && !GETPOST('search_accountancy_code_start')) { $query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; $query .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1"; diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index bb549a3bc6d..338ca12e5f0 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -52,29 +52,29 @@ if ($type == 'sub') { $context_default = 'bookkeepingbyaccountlist'; } $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : $context_default; -$search_date_startyear = GETPOSTINT('search_date_startyear'); -$search_date_startmonth = GETPOSTINT('search_date_startmonth'); -$search_date_startday = GETPOSTINT('search_date_startday'); -$search_date_endyear = GETPOSTINT('search_date_endyear'); -$search_date_endmonth = GETPOSTINT('search_date_endmonth'); -$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endday = GETPOSTINT('search_date_endday'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_doc_date = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); -$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); -$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); -$search_date_export_startday = GETPOSTINT('search_date_export_startday'); -$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); -$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); -$search_date_export_endday = GETPOSTINT('search_date_export_endday'); +$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); +$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); +$search_date_export_startday = GETPOSTINT('search_date_export_startday'); +$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); +$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); +$search_date_export_endday = GETPOSTINT('search_date_export_endday'); $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); -$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); -$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); -$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); -$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); -$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); -$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); +$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); +$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); +$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); +$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); +$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); +$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); $search_import_key = GETPOST("search_import_key", 'alpha'); @@ -91,7 +91,7 @@ if ($search_accountancy_code_end == - 1) { } $search_doc_ref = GETPOST('search_doc_ref', 'alpha'); $search_label_operation = GETPOST('search_label_operation', 'alpha'); -$search_mvt_num = GETPOSTINT('search_mvt_num'); +$search_mvt_num = GETPOST('search_mvt_num', 'alpha'); $search_direction = GETPOST('search_direction', 'alpha'); $search_ledger_code = GETPOST('search_ledger_code', 'array'); $search_debit = GETPOST('search_debit', 'alpha'); From 6506a547341f1edc7e44ff0fdc1d53b9b59b22f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Mar 2024 01:12:35 +0100 Subject: [PATCH 1811/1862] Fix regression --- htdocs/accountancy/class/bookkeeping.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 44f28bae658..2dc381808fc 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -2055,6 +2055,7 @@ class BookKeeping extends CommonObject $error = 0; $sql_filter = $this->getCanModifyBookkeepingSQL(); + if (!isset($sql_filter)) { return -1; } @@ -2344,10 +2345,11 @@ class BookKeeping extends CommonObject $sql_list = array(); if (!empty($conf->cache['active_fiscal_period_cached']) && is_array($conf->cache['active_fiscal_period_cached'])) { foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) { - $sql_list[] = "('" . $this->db->idate($fiscal_period['date_start']) . "' <= {$alias}doc_date AND {$alias}doc_date <= '" . $this->db->idate($fiscal_period['date_end']) . "')"; + $sql_list[] = "('" . $this->db->idate($fiscal_period['date_start']) . "' <= ".$this->db->sanitize($alias)."doc_date AND ".$this->db->sanitize($alias)."doc_date <= '" . $this->db->idate($fiscal_period['date_end']) . "')"; } } - self::$can_modify_bookkeeping_sql_cached[$alias] = !empty($sql_list) ? ' AND (' . $this->db->sanitize(implode(' OR ', $sql_list), 1, 1, 1) . ')' : ''; + $sqlsanitized = implode(' OR ', $sql_list); + self::$can_modify_bookkeeping_sql_cached[$alias] = !empty($sql_list) ? " AND (".$sqlsanitized.")" : ""; } return self::$can_modify_bookkeeping_sql_cached[$alias]; From d9a114e63d98619b4f00434d29e33022fe2dca25 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Mar 2024 01:29:57 +0100 Subject: [PATCH 1812/1862] Look and feel --- htdocs/accountancy/closure/index.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index b33efc256e3..378c5a18778 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -309,7 +309,7 @@ if (isset($current_fiscal_period)) { $head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id']; $head[0][1] = $langs->trans("AccountancyClosureStep1"); $head[0][2] = 'step1'; - print dol_get_fiche_head($head, 'step1', '', -1, 'title_accountancy'); + print dol_get_fiche_head($head, 'step1', '', -1, ''); print '' . $langs->trans("AccountancyClosureStep1Desc") . '
'; @@ -355,12 +355,14 @@ if (isset($current_fiscal_period)) { print "
'; - print($salaryBonPl ? $salarytmp->getNomUrl(1) : $invoicetmp->getNomUrl(1)); + print $itemurl; print "'; print dol_escape_htmltag($invoicetmp->ref_supplier); print "'; - print($salaryBonPl ? $usertmp->getNomUrl(-1) : $thirdpartytmp->getNomUrl(1)); + print $partyurl; print "'.$obj->Auto_increment.''.$obj->Check_time.''.$obj->Collation; - if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "utf8mb4_unicode_ci", "latin1_swedish_ci")))) { + // Accept utf8, utf8mb3_unicode_ci, utf8mb4_unicode_ci + if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "latin1_swedish_ci")))) { print '
'.$langs->trans("Convert").' UTF8'; } print '
'.$obj->Rows.''.$obj->Avg_row_length.''.$obj->Data_length.''.$obj->Max_data_length.''.$obj->Index_length.''.$obj->Auto_increment.''.$obj->Check_time.''.$obj->Collation; - // Accept utf8, utf8mb3_unicode_ci, utf8mb4_unicode_ci - if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "latin1_swedish_ci")))) { - print '
'.$langs->trans("Convert").' UTF8'; + print '
'.$obj->Rows.''.$obj->Avg_row_length.''.$obj->Data_length.''.$obj->Max_data_length.''.$obj->Index_length.''.$obj->Auto_increment.''.$obj->Check_time.''.$obj->Collation; + // Link to convert collation + if (isset($obj->Collation)) { + print '
'.$langs->trans("ConvertInto"); + if (!in_array($obj->Collation, array("utf8_unicode_ci"))) { + print ' utf8'; + } + if (!in_array($obj->Collation, array("utf8mb4_unicode_ci"))) { + print ' utf8mb4'; + } + print ''; } print '
".$row[0]."".$row[1].""; + $proptype = $row[1]; + $pictoType = ''; + $matches = array(); + if (preg_match('/^varchar/', $proptype, $matches)) { + $pictoType = 'varchar'; + } elseif (strpos($proptype, 'int') === 0 || strpos($proptype, 'tinyint') === 0 || strpos($proptype, 'bigint') === 0) { + $pictoType = 'int'; + } elseif (strpos($proptype, 'timestamp') === 0) { + $pictoType = 'datetime'; + } elseif (strpos($proptype, 'real') === 0) { + $pictoType = 'double'; + } + print(!empty($pictoType) ? getPictoForType($pictoType) : getPictoForType($proptype)).''.dol_escape_htmltag($proptype).''; + print "".$row[2]."".(empty($row[2]) ? ' ' : $row[2]); + + // Link to convert collation + if (isset($row[2])) { + print '
'.$langs->trans("ConvertInto"); + if (!in_array($row[2], array("utf8_unicode_ci"))) { + print ' utf8'; + } + if (!in_array($row[2], array("utf8mb4_unicode_ci"))) { + print ' utf8mb4'; + } + print ''; + } else { + print '
 '; + } + + print "
".$row[3]."
'; $fieldsforcontent = array('topic', 'email_from','joinfiles', 'content'); From ae41b07b705aad3f99fdc7eb997c0bbfd2ad35d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 20:51:47 +0100 Subject: [PATCH 1784/1862] Fix trans --- htdocs/langs/en_US/admin.lang | 3 ++- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/eventorganization/attendee_new.php | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f20f46f5c03..ed6431ff1d6 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1666,7 +1666,7 @@ LDAPDescUsers=This page allows you to define LDAP attributes name in LDAP tree f LDAPDescGroups=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr groups. LDAPDescMembers=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr members module. LDAPDescMembersTypes=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr members types. -LDAPDescValues=Example values are designed for OpenLDAP with following loaded schemas: core.schema, cosine.schema, inetorgperson.schema). If you use thoose values and OpenLDAP, modify your LDAP config file slapd.conf to have all thoose schemas loaded. +LDAPDescValues=Example values are designed for OpenLDAP with following loaded schemas: core.schema, cosine.schema, inetorgperson.schema). If you use those values and OpenLDAP, modify your LDAP config file slapd.conf to have all those schemas loaded. ForANonAnonymousAccess=For an authenticated access (for a write access for example) PerfDolibarr=Performance setup/optimizing report YouMayFindPerfAdviceHere=This page provides some checks or advice related to performance. @@ -2452,3 +2452,4 @@ VideoGeneration=Video generation AudioText=Audio - Text AIPromptForFeatures=AI custom prompts for features EnterAnIP=Enter an IP address +ConvertInto=Convert into diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 9d3b5c5fb08..e0e26dc460b 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -27,6 +27,7 @@ EventOrganizationMenuLeft = Organized events EventOrganizationConferenceOrBoothMenuLeft = Conference Or Booth PaymentEvent=Payment of event +EventFee=Event fee # # Admin page diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 3d6db67046d..3eb22bceb3a 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -510,6 +510,8 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // TODO Use default language of $thirdparty->default_lang to build $outputlang + $outputlangs->loadLangs(array("eventorganization")); + // Get product to use for invoice $productforinvoicerow = new Product($db); $productforinvoicerow->id = 0; @@ -629,7 +631,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "eventorganization")); // Get email content from template $arraydefaultmessage = null; From dfa9ed67d07b9af4a4f7cf3e3e23f15c5519f170 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 20:38:51 +0100 Subject: [PATCH 1785/1862] Fix warnings --- htdocs/admin/mails_templates.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index cabbe69c319..7a6d513c589 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -681,7 +681,7 @@ if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu // Confirm deletion of record if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((int) $rowid).'&code='.urlencode($code).'&id='.((int) $id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((int) $rowid).'&id='.((int) $id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } @@ -1096,7 +1096,7 @@ if ($num) { } print "
'; $fieldsforcontent = array('topic', 'email_from','joinfiles', 'content'); From 08ed8f9aaffba580ba2519d4700a4f7bed55e096 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 20:51:47 +0100 Subject: [PATCH 1786/1862] Fix trans --- htdocs/langs/en_US/admin.lang | 5 +++-- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/eventorganization/attendee_new.php | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 931cb74aa11..2d89a39b03a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1669,7 +1669,7 @@ LDAPDescUsers=This page allows you to define LDAP attributes name in LDAP tree f LDAPDescGroups=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr groups. LDAPDescMembers=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr members module. LDAPDescMembersTypes=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr members types. -LDAPDescValues=Example values are designed for OpenLDAP with following loaded schemas: core.schema, cosine.schema, inetorgperson.schema). If you use thoose values and OpenLDAP, modify your LDAP config file slapd.conf to have all thoose schemas loaded. +LDAPDescValues=Example values are designed for OpenLDAP with following loaded schemas: core.schema, cosine.schema, inetorgperson.schema). If you use those values and OpenLDAP, modify your LDAP config file slapd.conf to have all those schemas loaded. ForANonAnonymousAccess=For an authenticated access (for a write access for example) PerfDolibarr=Performance setup/optimizing report YouMayFindPerfAdviceHere=This page provides some checks or advice related to performance. @@ -2442,4 +2442,5 @@ RecommendedForProduction=Recommended for Production RecommendedForDebug=Recommended for Debug ExportUseForce=Use the parameter -f ExportUseForceHelp=Force to continue the export even when an error is found (Backup may not be reliable) -EnterAnIP=Enter an IP address \ No newline at end of file +EnterAnIP=Enter an IP address +ConvertInto=Convert into diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 30c3f5d6b59..4dda951377a 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -27,6 +27,7 @@ EventOrganizationMenuLeft = Organized events EventOrganizationConferenceOrBoothMenuLeft = Conference Or Booth PaymentEvent=Payment of event +EventFee=Event fee # # Admin page diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index a2175e26ae3..154cac787c5 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -510,6 +510,8 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // TODO Use default language of $thirdparty->default_lang to build $outputlang + $outputlangs->loadLangs(array("eventorganization")); + // Get product to use for invoice $productforinvoicerow = new Product($db); $productforinvoicerow->id = 0; @@ -629,7 +631,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "eventorganization")); // Get email content from template $arraydefaultmessage = null; From 8e372094ac20bae9f3e1a8d067fda4d977df70d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 18 Mar 2024 22:11:22 +0100 Subject: [PATCH 1787/1862] fix warning --- htdocs/admin/system/dbtable.php | 52 ++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index c7e7c5baa5e..c42067da6ce 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,6 +28,9 @@ // Load Dolibarr environment require '../../main.inc.php'; +/** @var Conf $conf */ +/** @var DoliDB $db */ + $langs->load("admin"); if (!$user->admin) { @@ -43,12 +47,12 @@ $table = GETPOST('table', 'alpha'); llxHeader(); -print load_fiche_titre($langs->trans("Table")." ".$table, '', 'title_setup'); +print load_fiche_titre($langs->trans("Table") . " " . $table, '', 'title_setup'); // Define request to get table description $base = 0; if (preg_match('/mysql/i', $conf->db->type)) { - $sql = "SHOW TABLE STATUS LIKE '".$db->escape($table)."'"; + $sql = "SHOW TABLE STATUS LIKE '" . $db->escape($table) . "'"; $base = 1; } elseif ($conf->db->type == 'pgsql') { $sql = "SELECT conname,contype FROM pg_constraint"; @@ -87,19 +91,19 @@ if (!$base) { print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; // $sql = "DESCRIBE ".$table; - $sql = "SHOW FULL COLUMNS IN ".$db->escape($table); + $sql = "SHOW FULL COLUMNS IN " . $db->escape($table); $resql = $db->query($sql); if ($resql) { @@ -110,27 +114,27 @@ if (!$base) { print ''; // field - print ""; + print ""; // type - print ""; + print ""; // collation - print ""; + print ""; // null - print ""; + print ""; // key - print ""; + print ""; // default - print ""; + print ""; // extra - print ""; + print ""; // privileges - print ""; + print ""; - print ""; + print ""; - print ''; - print ''; + print ''; + print ''; print ''; $i++; } From 03cda2dcc81148bf8abf39e8003beb6198d77908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 18 Mar 2024 22:25:13 +0100 Subject: [PATCH 1788/1862] fix --- htdocs/admin/system/dbtable.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index dde9adccea0..a47be52e386 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -226,4 +226,3 @@ if (!$base) { // End of page llxFooter(); $db->close(); - From defd044a747295564f79ea4b7011bfb1b927de8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 23:34:08 +0100 Subject: [PATCH 1789/1862] Fix phpunit --- htdocs/admin/system/dbtable.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index a47be52e386..2cec477994f 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -52,10 +52,10 @@ if ($action == 'convertutf8') { while ($i < $num) { $row = $db->fetch_row($resql); if ($row[0] == $field) { - $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' CHARACTER SET utf8'; // We must not sanitize the $row[1] + $sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." CHARACTER SET utf8"; // We must not sanitize the $row[1] $db->query($sql); - $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' COLLATE utf8_unicode_ci'; // We must not sanitize the $row[1] + $sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." COLLATE utf8_unicode_ci"; // We must not sanitize the $row[1] $db->query($sql); break; @@ -73,10 +73,10 @@ if ($action == 'convertutf8mb4') { while ($i < $num) { $row = $db->fetch_row($resql); if ($row[0] == $field) { - $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' CHARACTER SET utf8mb4'; // We must not sanitize the $row[1] + $sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." CHARACTER SET utf8mb4"; // We must not sanitize the $row[1] $db->query($sql); - $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' COLLATE utf8mb4_unicode_ci'; // We must not sanitize the $row[1] + $sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." COLLATE utf8mb4_unicode_ci"; // We must not sanitize the $row[1] $db->query($sql); break; From a08f330ca72fb62f72ea2bd634593dd981d23443 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 17:59:44 +0100 Subject: [PATCH 1790/1862] Qual: Always run phpcin pre-commit workflow # Qual: Always run phpcs in pre-commit workflow Developers are prioritizing the Travis Run because the pre-commit workflow only runs the phpcs checks if the other pre-commit checks did not fail. This modifies the action so that the phpcs checks are also run if the previous step failed. That should help limit travis load and delays. --- .github/workflows/pre-commit.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 384ef39880e..ff99f5bdd74 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -67,13 +67,16 @@ jobs: uses: shivammathur/setup-php@v2 # Install when we're going to run phpcs if: | - steps.changed-php.outputs.any_changed == 'true' - || + ! cancelled() && ( - github.event_name == 'push' - && ( - github.event.ref == 'refs/heads/develop' - || endsWith(github.event.ref, '.0') + steps.changed-php.outputs.any_changed == 'true' + || + ( + github.event_name == 'push' + && ( + github.event.ref == 'refs/heads/develop' + || endsWith(github.event.ref, '.0') + ) ) ) with: @@ -82,7 +85,7 @@ jobs: tools: phpcs - name: Run some pre-commit hooks on selected changed files only - if: steps.changed-php.outputs.any_changed == 'true' + if: "! cancelled() && steps.changed-php.outputs.any_changed == 'true'" env: ALL_CHANGED_FILES: ${{ steps.changed-php.outputs.all_changed_files }} run: | From c9e7fc0ca426705cebc2693c931357daf79aec4f Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 21:40:23 +0100 Subject: [PATCH 1791/1862] Qual: Update logToCheckStyle to version that extracts PHP Fatal Errors --- .github/workflows/windows-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-ci.yaml b/.github/workflows/windows-ci.yaml index defb42e0148..643c96bb21f 100644 --- a/.github/workflows/windows-ci.yaml +++ b/.github/workflows/windows-ci.yaml @@ -152,7 +152,7 @@ jobs: echo "PHPUNIT seems to have completed with a test result, reuse the exit code" for /f "tokens=2 delims==" %%A in ('doskey /m:err') do EXIT /B %%A - name: Convert Raw Log to Annotations - uses: mdeweerd/logToCheckStyle@v2024.2.9 + uses: mdeweerd/logToCheckStyle@v2024.3.2 if: ${{ failure() }} with: in: ${{ env.PHPUNIT_LOG }} From 1a863a374d29a3ad98f9e8c96716e37ca2b03021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Tue, 19 Mar 2024 00:09:33 +0100 Subject: [PATCH 1792/1862] fix --- htdocs/public/stripe/ipn.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 9dcbc1248fa..ceba4a94a41 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -1,9 +1,8 @@ - * Copyright (C) 2018 Fédéric France - * Copyright (C) 2023 Laurent Destailleur +/* Copyright (C) 2018-2020 Thibault FOUCART + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2023 Laurent Destailleur * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 4500672cb4222fc5b8b6808931004b385577ae37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Mar 2024 00:11:59 +0100 Subject: [PATCH 1793/1862] Rename hooks --- htdocs/accountancy/bookkeeping/card.php | 11 ++++++----- htdocs/accountancy/class/bookkeeping.class.php | 10 ---------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index a05e4e1bcef..79f7c44cda9 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -95,11 +95,11 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) { * Actions */ $parameters = array(); -$reshook_onBeforeActions = $hookmanager->executeHooks('doActions', $parameters, $object, $action); -if ($reshook_onBeforeActions < 0) { +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); +if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } -if (empty($reshook_onBeforeActions)) { +if (empty($reshook)) { if ($cancel) { header("Location: ".DOL_URL_ROOT.'/accountancy/bookkeeping/list.php'); exit; @@ -267,10 +267,11 @@ if (empty($reshook_onBeforeActions)) { $object->amount = 0; $result = $object->createStd($user, 0, $mode); - $reshook = $hookmanager->executeHooks('onConfirmCreate_onAfterCreateEmptyLine', $parameters, $object, $action); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { + $reshook = $hookmanager->executeHooks('afterCreateBookkeeping', $parameters, $object, $action); + if ($mode != '_tmp') { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } @@ -399,7 +400,7 @@ if ($action == 'create') { print ''; print ''; */ - $reshook_onCreate_onAfterShowFields = $hookmanager->executeHooks('onCreate_onAfterShowFields', $parameters, $object, $action); + $reshookAddLine = $hookmanager->executeHooks('bookkeepingAddLine', $parameters, $object, $action); print '
'.$langs->trans("Fields").''.$langs->trans("Type").''.$langs->trans("Collation").''.$langs->trans("Null").''.$langs->trans("Index").''.$langs->trans("Default").''.$langs->trans("Extra").''.$langs->trans("Privileges").''.$langs->trans("FieldsLinked").'' . $langs->trans("Fields") . '' . $langs->trans("Type") . '' . $langs->trans("Collation") . '' . $langs->trans("Null") . '' . $langs->trans("Index") . '' . $langs->trans("Default") . '' . $langs->trans("Extra") . '' . $langs->trans("Privileges") . '' . $langs->trans("FieldsLinked") . '
".$row[0]."" . $row[0] . "".$row[1]."" . $row[1] . "".$row[2]."" . $row[2] . "".$row[3]."" . $row[3] . "".(empty($row[4]) ? '' : $row[4])."" . (empty($row[4]) ? '' : $row[4]) . "".(empty($row[5]) ? '' : $row[5])."" . (empty($row[5]) ? '' : $row[5]) . "".(empty($row[6]) ? '' : $row[6])."" . (empty($row[6]) ? '' : $row[6]) . "".(empty($row[7]) ? '' : $row[7])."" . (empty($row[7]) ? '' : $row[7]) . "".(isset($link[$row[0]][0]) ? $link[$row[0]][0] : '')."."; - print(isset($link[$row[0]][1]) ? $link[$row[0]][1] : '')."" . (isset($link[$row[0]][0]) ? $link[$row[0]][0] : '') . "."; + print (isset($link[$row[0]][1]) ? $link[$row[0]][1] : '') . "
'; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 6a261a146cd..5c07b8f637f 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -721,16 +721,6 @@ class BookKeeping extends CommonObject if (!$error) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element.$mode); - - // Uncomment this and change MYOBJECT to your own tag if you - // want this action to call a trigger. - //if (! $notrigger) { - - // // Call triggers - // $result=$this->call_trigger('MYOBJECT_CREATE',$user); - // if ($result < 0) $error++; - // // End call triggers - //} } // Commit or rollback From 87ac6e2f686edbf4f69c3a478d9c2b2d19072fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Tue, 19 Mar 2024 00:28:08 +0100 Subject: [PATCH 1794/1862] fix sql --- htdocs/compta/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 57748c27950..b17520685ad 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -9,7 +9,7 @@ * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2020 Josep Lluís Amador - * Copyright (C) 2021-2023 Frédéric France + * Copyright (C) 2021-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -137,7 +137,7 @@ if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $sql .= ", s.rowid as socid"; $sql .= ", s.code_client, s.code_compta, s.email"; $sql .= ", cc.rowid as country_id, cc.code as country_code"; - $sql .= ", (SELECT SUM(pf.amount) FROM llx_paiement_facture as pf WHERE pf.fk_facture = f.rowid) as am"; + $sql .= ", (SELECT SUM(pf.amount) FROM ".MAIN_DB_PREFIX."paiement_facture as pf WHERE pf.fk_facture = f.rowid) as am"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays"; @@ -283,7 +283,7 @@ if ((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMO $sql .= ", s.nom as name"; $sql .= ", s.rowid as socid"; $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.email"; - $sql .= ", (SELECT SUM(pf.amount) FROM llx_paiementfourn_facturefourn as pf WHERE pf.fk_facturefourn = ff.rowid) as am"; + $sql .= ", (SELECT SUM(pf.amount) FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf WHERE pf.fk_facturefourn = ff.rowid) as am"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql .= " WHERE s.rowid = ff.fk_soc"; $sql .= " AND ff.entity IN (".getEntity('facture_fourn').")"; From 2917b3451927f7811d9221ab87259ee92d3c2a42 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 18:42:43 +0100 Subject: [PATCH 1795/1862] Fix phpstan $fields property issue Fix Property FactureFournisseur::$fields (array) does not accept default value of type array{rowid: array --- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index beb2a0d3564..845053a4d89 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -254,7 +254,7 @@ class FactureFournisseur extends CommonInvoice 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), 'ref' => array('type' => 'varchar(255)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'showoncombobox' => 1, 'position' => 15), 'ref_supplier' => array('type' => 'varchar(255)', 'label' => 'RefSupplier', 'enabled' => 1, 'visible' => -1, 'position' => 20), - 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 25, 'index' => 1), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 25, 'index' => 1), 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 30), 'type' => array('type' => 'smallint(6)', 'label' => 'Type', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 35), 'subtype' => array('type' => 'smallint(6)', 'label' => 'InvoiceSubtype', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 36), From fd9d48faacb6fda2ec4c67d579c1fee79c3d8e51 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 18:59:41 +0100 Subject: [PATCH 1796/1862] Fix phpstan CommonObject->fields - notnull is optional field --- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/adherents/class/subscription.class.php | 2 +- htdocs/asset/class/asset.class.php | 2 +- htdocs/asset/class/assetdepreciationoptions.class.php | 2 +- htdocs/asset/class/assetmodel.class.php | 2 +- htdocs/bom/class/bom.class.php | 4 ++-- htdocs/bookcal/class/availabilities.class.php | 2 +- htdocs/bookcal/class/calendar.class.php | 2 +- htdocs/comm/action/class/actioncommreminder.class.php | 2 +- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/commande/class/commande.class.php | 2 +- htdocs/compta/bank/class/account.class.php | 2 +- htdocs/compta/bank/class/paymentvarious.class.php | 2 +- htdocs/compta/facture/class/facture-rec.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/compta/prelevement/class/bonprelevement.class.php | 2 +- htdocs/contact/class/contact.class.php | 2 +- htdocs/contrat/class/contrat.class.php | 4 ++-- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/defaultvalues.class.php | 2 +- htdocs/core/class/emailsenderprofile.class.php | 2 +- htdocs/core/class/timespent.class.php | 2 +- htdocs/emailcollector/class/emailcollector.class.php | 2 +- htdocs/emailcollector/class/emailcollectoraction.class.php | 2 +- htdocs/emailcollector/class/emailcollectorfilter.class.php | 2 +- htdocs/eventorganization/class/conferenceorbooth.class.php | 2 +- .../class/conferenceorboothattendee.class.php | 2 +- htdocs/expedition/class/expedition.class.php | 2 +- htdocs/expensereport/class/expensereport_ik.class.php | 2 +- htdocs/expensereport/class/expensereport_rule.class.php | 2 +- htdocs/fourn/class/fournisseur.facture-rec.class.php | 2 +- htdocs/hrm/class/evaluation.class.php | 2 +- htdocs/hrm/class/evaluationdet.class.php | 2 +- htdocs/hrm/class/job.class.php | 2 +- htdocs/hrm/class/position.class.php | 2 +- htdocs/hrm/class/skill.class.php | 2 +- htdocs/hrm/class/skilldet.class.php | 2 +- htdocs/hrm/class/skillrank.class.php | 2 +- htdocs/knowledgemanagement/class/knowledgerecord.class.php | 2 +- htdocs/modulebuilder/template/class/myobject.class.php | 2 +- htdocs/mrp/class/mo.class.php | 2 +- htdocs/opensurvey/class/opensurveysondage.class.php | 2 +- htdocs/partnership/class/partnership.class.php | 2 +- htdocs/product/class/product.class.php | 2 +- htdocs/product/class/productcustomerprice.class.php | 2 +- htdocs/product/class/productfournisseurprice.class.php | 2 +- htdocs/product/inventory/class/inventory.class.php | 4 ++-- htdocs/product/stock/class/entrepot.class.php | 2 +- htdocs/product/stock/class/productlot.class.php | 2 +- .../product/stock/stocktransfer/class/stocktransfer.class.php | 2 +- .../stock/stocktransfer/class/stocktransferline.class.php | 2 +- htdocs/projet/class/project.class.php | 2 +- htdocs/recruitment/class/recruitmentcandidature.class.php | 2 +- htdocs/recruitment/class/recruitmentjobposition.class.php | 2 +- htdocs/salaries/class/paymentsalary.class.php | 2 +- htdocs/societe/class/companybankaccount.class.php | 2 +- htdocs/societe/class/companypaymentmode.class.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- htdocs/societe/class/societeaccount.class.php | 2 +- htdocs/ticket/class/cticketcategory.class.php | 2 +- htdocs/variants/class/ProductAttribute.class.php | 2 +- htdocs/variants/class/ProductAttributeValue.class.php | 2 +- htdocs/webhook/class/target.class.php | 2 +- htdocs/webportal/class/webportalinvoice.class.php | 2 +- htdocs/webportal/class/webportalmember.class.php | 2 +- htdocs/webportal/class/webportalorder.class.php | 2 +- htdocs/webportal/class/webportalpartnership.class.php | 2 +- htdocs/webportal/class/webportalpropal.class.php | 2 +- htdocs/website/class/websitepage.class.php | 2 +- htdocs/workstation/class/workstation.class.php | 2 +- htdocs/workstation/class/workstationresource.class.php | 2 +- htdocs/workstation/class/workstationusergroup.class.php | 2 +- htdocs/zapier/class/hook.class.php | 2 +- 73 files changed, 76 insertions(+), 76 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index b5f319bb70c..c6ce7429708 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -316,7 +316,7 @@ class Adherent extends CommonObject /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index c268ac3ab6e..c34420b67f2 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -104,7 +104,7 @@ class Subscription extends CommonObject public $fk_bank; /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 3d62ba4c91a..8666a469aee 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -94,7 +94,7 @@ class Asset extends CommonObject */ /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/asset/class/assetdepreciationoptions.class.php b/htdocs/asset/class/assetdepreciationoptions.class.php index 0aa62c55919..dac2d1ad194 100644 --- a/htdocs/asset/class/assetdepreciationoptions.class.php +++ b/htdocs/asset/class/assetdepreciationoptions.class.php @@ -65,7 +65,7 @@ class AssetDepreciationOptions extends CommonObject */ /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index 8576e5ee37e..51243277071 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -100,7 +100,7 @@ class AssetModel extends CommonObject */ /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index c49f4a4cc89..72aab83ac21 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -111,7 +111,7 @@ class BOM extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), @@ -1714,7 +1714,7 @@ class BOMLine extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'LineID', 'enabled' => 1, 'visible' => -1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 3582ea707ec..ad34e08abcd 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -112,7 +112,7 @@ class Availabilities extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 2, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index 539ef39e5ed..b66f950fd12 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -112,7 +112,7 @@ class Calendar extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'right', 'comment' => "Id"), diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index 1c8dd2b5b95..711e890e02d 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/htdocs/comm/action/class/actioncommreminder.class.php @@ -76,7 +76,7 @@ class ActionCommReminder extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 69d3e5b59c9..9ea34ae4d3a 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -308,7 +308,7 @@ class Propal extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 8f89a1bb336..931fbbd94d6 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -297,7 +297,7 @@ class Commande extends CommonOrder // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 67a067854f1..1dd17795fcc 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -307,7 +307,7 @@ class Account extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 6e3a2f28c67..7bb567f1536 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -198,7 +198,7 @@ class PaymentVarious extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( // TODO: fill this array diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index bb7a8ab2ace..e8d007be1fa 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -172,7 +172,7 @@ class FactureRec extends CommonInvoice // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9b3e6733698..17cc796ff97 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -291,7 +291,7 @@ class Facture extends CommonInvoice // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 1), diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index e3a3eb07439..f94983bb234 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -148,7 +148,7 @@ class BonPrelevement extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => 0,), diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 1c800456b76..54a9983a6d9 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -98,7 +98,7 @@ class Contact extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 6110150e731..1202e840bd7 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -249,7 +249,7 @@ class Contrat extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), @@ -3148,7 +3148,7 @@ class ContratLigne extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 285e3915a79..f67471ee76e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -140,7 +140,7 @@ abstract class CommonObject /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index 9a47a8843e8..0b54bd8fb79 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -87,7 +87,7 @@ class DefaultValues extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index f3e1c04be92..abbd39f54e3 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -89,7 +89,7 @@ class EmailSenderProfile extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id',), diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index e0ca486ad9e..927dbed57ca 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -112,7 +112,7 @@ class TimeSpent extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index da23932c66b..281c658297a 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -120,7 +120,7 @@ class EmailCollector extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => 2, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1), diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index 85c9ad7dc83..bb139c8be38 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -79,7 +79,7 @@ class EmailCollectorAction extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index 0089e5f0b6c..37e4cf4525c 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -81,7 +81,7 @@ class EmailCollectorFilter extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 683a8d016fe..16c91a9114f 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -112,7 +112,7 @@ class ConferenceOrBooth extends ActionComm // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'id' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'csslist' => 'left', 'comment' => "Id"), diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 7b898c6cc12..f6e4bff74cd 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -100,7 +100,7 @@ class ConferenceOrBoothAttendee extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 90da7555450..7454e0b7832 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -92,7 +92,7 @@ class Expedition extends CommonObject /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index 14727b498e7..96626648b24 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -72,7 +72,7 @@ class ExpenseReportIk extends CommonObject /** * Attribute object linked with database - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'index' => 1) diff --git a/htdocs/expensereport/class/expensereport_rule.class.php b/htdocs/expensereport/class/expensereport_rule.class.php index 7c640527055..418623df567 100644 --- a/htdocs/expensereport/class/expensereport_rule.class.php +++ b/htdocs/expensereport/class/expensereport_rule.class.php @@ -110,7 +110,7 @@ class ExpenseReportRule extends CommonObject /** * Attribute object linked with database - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'index' => 1) diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 900ee4d014a..e1669cedc99 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -190,7 +190,7 @@ class FactureFournisseurRec extends CommonInvoice // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 7bf46c30b86..6668df2a2f3 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -103,7 +103,7 @@ class Evaluation extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index ad7c91c86d9..992e7fa4ce0 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -102,7 +102,7 @@ class EvaluationLine extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index e1a355b54cd..c38157e7133 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -101,7 +101,7 @@ class Job extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index f96cb1539a2..bcd91410fda 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -100,7 +100,7 @@ class Position extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 2, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index 256956d55de..b696a8ecdaa 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -106,7 +106,7 @@ class Skill extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index 12258e08025..6c02ca26c50 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -100,7 +100,7 @@ class Skilldet extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 4c599235f72..3cde6ae6476 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -104,7 +104,7 @@ class SkillRank extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 21168aea09f..1bb1040553a 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -99,7 +99,7 @@ class KnowledgeRecord extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index fbf37e0e025..4ff7f9ff232 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -116,7 +116,7 @@ class MyObject extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 082a27a1ead..c8589a3f4ba 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -94,7 +94,7 @@ class Mo extends CommonObject */ /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 8e57437c2cd..91e62bdd414 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -101,7 +101,7 @@ class Opensurveysondage extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'id_sondage' => array('type' => 'varchar(16)', 'label' => 'Idsondage', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => -1,), diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index b03747a8129..7d26d35cb44 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -104,7 +104,7 @@ class Partnership extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 8f419c64607..17aa0d9a6bb 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -584,7 +584,7 @@ class Product extends CommonObject */ /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 8a02380b629..6eda4aaf297 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class ProductCustomerPrice extends CommonObject { /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 4, 'position' => 10, 'notnull' => 1, 'default' => '(PROV)', 'index' => 1, 'searchall' => 1, 'comment' => "Reference of object", 'showoncombobox' => 1, 'noteditable' => 1), diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index d5f64ad5e0f..6e3b15405d0 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -92,7 +92,7 @@ class ProductFournisseurPrice extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => 0,), diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index e793d442313..71de87fbb6a 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -96,7 +96,7 @@ class Inventory extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id',), @@ -841,7 +841,7 @@ class InventoryLine extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id',), diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 2ffb55706f8..a062d053ed9 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -121,7 +121,7 @@ class Entrepot extends CommonObject /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'ID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index a51b3d26d9c..3d46b4ff41e 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -99,7 +99,7 @@ class Productlot extends CommonObject */ /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index f29ae639830..4bf107d58f3 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -124,7 +124,7 @@ class StockTransfer extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'comment' => "Id"), diff --git a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php index af7e7946e72..b030daca098 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php @@ -94,7 +94,7 @@ class StockTransferLine extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'comment' => "Id"), diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 08c54b13fce..3c1d3ff67cb 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -293,7 +293,7 @@ class Project extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'ID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index 8ded276c054..f80911e4381 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -107,7 +107,7 @@ class RecruitmentCandidature extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'comment' => "Id"), diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 219c2503053..90fe44b212d 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -113,7 +113,7 @@ class RecruitmentJobPosition extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'comment' => "Id"), diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index c099b10c41e..96d414b1d12 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -153,7 +153,7 @@ class PaymentSalary extends CommonObject public $datev = ''; /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index a30927fafb3..de22b6d4ea7 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -86,7 +86,7 @@ class CompanyBankAccount extends Account // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => -1,), diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index fae5b162b2e..20526bb32d9 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -83,7 +83,7 @@ class CompanyPaymentMode extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'Rowid', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 42bae7b3096..1bc51f9a903 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -188,7 +188,7 @@ class Societe extends CommonObject */ /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 29819dbfdcc..97a07189c5f 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -76,7 +76,7 @@ class SocieteAccount extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index e4bcccb7e5e..c96779054ce 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -98,7 +98,7 @@ class CTicketCategory extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/variants/class/ProductAttribute.class.php b/htdocs/variants/class/ProductAttribute.class.php index 255a1428386..38fa0793305 100644 --- a/htdocs/variants/class/ProductAttribute.class.php +++ b/htdocs/variants/class/ProductAttribute.class.php @@ -98,7 +98,7 @@ class ProductAttribute extends CommonObject * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. */ /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/variants/class/ProductAttributeValue.class.php b/htdocs/variants/class/ProductAttributeValue.class.php index a6ddfcd9570..1c291476d9e 100644 --- a/htdocs/variants/class/ProductAttributeValue.class.php +++ b/htdocs/variants/class/ProductAttributeValue.class.php @@ -76,7 +76,7 @@ class ProductAttributeValue extends CommonObjectLine * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. */ /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 4b6db01486a..ef405bfadea 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -101,7 +101,7 @@ class Target extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/webportal/class/webportalinvoice.class.php b/htdocs/webportal/class/webportalinvoice.class.php index ddb7e7bec8a..751bb28e10f 100644 --- a/htdocs/webportal/class/webportalinvoice.class.php +++ b/htdocs/webportal/class/webportalinvoice.class.php @@ -97,7 +97,7 @@ class WebPortalInvoice extends Facture // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 1,), diff --git a/htdocs/webportal/class/webportalmember.class.php b/htdocs/webportal/class/webportalmember.class.php index c4954e4886d..803a405fd5d 100644 --- a/htdocs/webportal/class/webportalmember.class.php +++ b/htdocs/webportal/class/webportalmember.class.php @@ -113,7 +113,7 @@ class WebPortalMember extends Adherent // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 10,), diff --git a/htdocs/webportal/class/webportalorder.class.php b/htdocs/webportal/class/webportalorder.class.php index e9cd8757b61..157dcb25775 100644 --- a/htdocs/webportal/class/webportalorder.class.php +++ b/htdocs/webportal/class/webportalorder.class.php @@ -98,7 +98,7 @@ class WebPortalOrder extends Commande // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 10,), diff --git a/htdocs/webportal/class/webportalpartnership.class.php b/htdocs/webportal/class/webportalpartnership.class.php index 78b87cc04dd..c72ae9397f0 100644 --- a/htdocs/webportal/class/webportalpartnership.class.php +++ b/htdocs/webportal/class/webportalpartnership.class.php @@ -97,7 +97,7 @@ class WebPortalPartnership extends Partnership // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id",), diff --git a/htdocs/webportal/class/webportalpropal.class.php b/htdocs/webportal/class/webportalpropal.class.php index c49d8bfd686..47669b08c55 100644 --- a/htdocs/webportal/class/webportalpropal.class.php +++ b/htdocs/webportal/class/webportalpropal.class.php @@ -98,7 +98,7 @@ class WebPortalPropal extends Propal // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id",), diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 2da0b7f5390..7d9d21357ed 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -163,7 +163,7 @@ class WebsitePage extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index f7542c226f1..fe291337135 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -96,7 +96,7 @@ class Workstation extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/workstation/class/workstationresource.class.php b/htdocs/workstation/class/workstationresource.class.php index 83a326ead04..1b92e15ed02 100644 --- a/htdocs/workstation/class/workstationresource.class.php +++ b/htdocs/workstation/class/workstationresource.class.php @@ -36,7 +36,7 @@ class WorkstationResource extends CommonObject public $element = 'workstationresource'; /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'fk_workstation' => array('type' => 'integer'), diff --git a/htdocs/workstation/class/workstationusergroup.class.php b/htdocs/workstation/class/workstationusergroup.class.php index 290b6d34714..56c17415242 100644 --- a/htdocs/workstation/class/workstationusergroup.class.php +++ b/htdocs/workstation/class/workstationusergroup.class.php @@ -35,7 +35,7 @@ class WorkstationUserGroup extends CommonObject public $element = 'workstationusergroup'; /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'fk_workstation' => array('type' => 'integer'), diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index edd9e77cb70..c7e07e39989 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -81,7 +81,7 @@ class Hook extends CommonObject */ /** - * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array( From 9c21e214d13f0894ac64263428d5b21d9d837f51 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 19:21:46 +0100 Subject: [PATCH 1797/1862] Fix return type for Categorie::getListForItem() --- htdocs/categories/class/categorie.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 57365ce5f50..0af6aa2953f 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -970,7 +970,7 @@ class Categorie extends CommonObject * @param string $sortorder Sort order * @param int $limit Limit for list * @param int $page Page number - * @return int<-1,0>|array,visible:int,ref_ext:string,picto:string,multilangs?:string}> Array of categories, 0 if no cat, -1 on error + * @return int<-1,0>|array,visible:int,ref_ext:string,picto:string,multilangs?:string}> Array of categories, 0 if no cat, -1 on error */ public function getListForItem($id, $type = 'customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) { From bd14c051333086dd4b8a757acad599000162ad21 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 19:24:48 +0100 Subject: [PATCH 1798/1862] Fix type for argument $method_trans of set_infotrans --- htdocs/compta/prelevement/class/bonprelevement.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index f94983bb234..3e8e629fc7b 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -672,7 +672,7 @@ class BonPrelevement extends CommonObject * * @param User $user Id of user * @param int $date Date of action - * @param string $method Method of transmission to bank (0=Internet, 1=Api...) + * @param int $method Method of transmission to bank (0=Internet, 1=Api...) * @return int >0 if OK, <0 if KO */ public function set_infotrans($user, $date, $method) From d30b2d03627d7ec999f2d9912b66f59ddb1f69d6 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 19:28:28 +0100 Subject: [PATCH 1799/1862] Fix default in $fields init --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 5e69aaba3df..2a4a830d124 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1165,7 +1165,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'visible' => 3, 'position' => 35), 'role' => array('type' => 'checkbox', 'label' => 'Role', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 4, 'index' => 1, 'position' => 40), 'birthday' => array('type' => 'date', 'label' => 'Birthday', 'enabled' => 1, 'visible' => -1, 'notnull' => 0, 'position' => 45), - 'statut' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => 0, 'index' => 1, 'position' => 50, 'arrayofkeyval' => array(0 => $contactstatic->LibStatut(0, 1), 1 => $contactstatic->LibStatut(1, 1))), + 'statut' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 50, 'arrayofkeyval' => array(0 => $contactstatic->LibStatut(0, 1), 1 => $contactstatic->LibStatut(1, 1))), ); // Definition of fields for list From 4c8b9784951ebe795b68142568364e26dbff60f0 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 19:29:57 +0100 Subject: [PATCH 1800/1862] Fix typing for childtablesoncascade --- htdocs/emailcollector/class/emailcollector.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 281c658297a..ef98b294f70 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -94,7 +94,7 @@ class EmailCollector extends CommonObject protected $childtables = array(); /** - * @var array List of child tables. To know object to delete on cascade. + * @var string[] List of child tables. To know object to delete on cascade. */ protected $childtablesoncascade = array('emailcollector_emailcollectorfilter', 'emailcollector_emailcollectoraction'); From a46dfec5c6595a7712915ec696cac2df501fed1b Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 19:31:28 +0100 Subject: [PATCH 1801/1862] Fix return type for deleteLine --- htdocs/expensereport/class/expensereport.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 7fc5a866eec..c8372f95d95 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2346,7 +2346,7 @@ class ExpenseReport extends CommonObject * @param int $rowid Row id * @param User|string $fuser User * @param int<0,1> $notrigger 1=No trigger - * @return int<0,1> Return integer <0 if KO, >0 if OK + * @return int<-1,1> Return integer <0 if KO, >0 if OK */ public function deleteLine($rowid, $fuser = '', $notrigger = 0) { From 9730149fab6da07f28ea2aed802e47026e2bf5d9 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 19:35:43 +0100 Subject: [PATCH 1802/1862] Fix typing: childtables can also be list of strings --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f67471ee76e..892fd02fcdb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -786,7 +786,7 @@ abstract class CommonObject public $extraparams = array(); /** - * @var array List of child tables. To test if we can delete object. + * @var string[]|array List of child tables. To test if we can delete object. */ protected $childtables = array(); From c266bdb042ef00ead0f8184c26cbb7be3a9b28a0 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 19:50:22 +0100 Subject: [PATCH 1803/1862] Fix assignement to 'userassigned' --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 3d231680b21..1d4f5412ff2 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1818,7 +1818,7 @@ class Ticket extends CommonObject $actioncomm->socid = $this->socid; $actioncomm->label = $this->subject; $actioncomm->note_private = $this->message; - $actioncomm->userassigned = array($user->id); + $actioncomm->userassigned = array($user->id => array('id' => $user->id,'transparency' => 0)); $actioncomm->userownerid = $user->id; $actioncomm->datep = $now; $actioncomm->percentage = -1; // percentage is not relevant for punctual events From f892b3a27cc906d26635dafe3743a5ad09b4b3aa Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 19:51:57 +0100 Subject: [PATCH 1804/1862] Fix configuration --- htdocs/user/class/usergroup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 25a188fa8ee..401d661e5b7 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -113,7 +113,7 @@ class UserGroup extends CommonObject public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), - 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'default' => 1, 'index' => 1, 'position' => 5), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'default' => '1', 'index' => 1, 'position' => 5), 'nom' => array('type' => 'varchar(180)', 'label' => 'Name', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 1, 'index' => 1, 'position' => 10, 'searchall' => 1, 'comment' => 'Group name'), 'note' => array('type' => 'html', 'label' => 'Description', 'enabled' => 1, 'visible' => 1, 'position' => 20, 'notnull' => -1, 'searchall' => 1), 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'position' => 50, 'notnull' => 1,), From c8172c65ae73168bb0858708bc223d3faa354f77 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 20:01:36 +0100 Subject: [PATCH 1805/1862] Fix typing for Categorie::getListForItem() return value --- htdocs/categories/class/categorie.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 0af6aa2953f..78bfbb8bb4f 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -271,7 +271,7 @@ class Categorie extends CommonObject public $childs = array(); /** - * @var array multilangs + * @var array{string,array{label:string,description:string,note?:string}} multilangs */ public $multilangs; @@ -970,7 +970,7 @@ class Categorie extends CommonObject * @param string $sortorder Sort order * @param int $limit Limit for list * @param int $page Page number - * @return int<-1,0>|array,visible:int,ref_ext:string,picto:string,multilangs?:string}> Array of categories, 0 if no cat, -1 on error + * @return int<-1,0>|array,visible:int,ref_ext:string,multilangs?:array{string,array{label:string,description:string,note?:string}}}> Array of categories, 0 if no cat, -1 on error */ public function getListForItem($id, $type = 'customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) { From 2b4e2cdbb43481cd92fa6711daa08dd6c2ce36dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Mar 2024 00:47:32 +0100 Subject: [PATCH 1806/1862] FIX Inline edition not implemented --- htdocs/accountancy/admin/fiscalyear_card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 70eb459efda..447dcaab4c9 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -313,23 +313,23 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Label print '
'; - print $form->editfieldkey("Label", 'label', $object->label, $object, 1, 'alpha:32'); + print $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'alpha:32'); print ''; - print $form->editfieldval("Label", 'label', $object->label, $object, 1, 'alpha:32'); + print $form->editfieldval("Label", 'label', $object->label, $object, 0, 'alpha:32'); print "
'; - print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, 1, 'datepicker'); + print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, 0, 'datepicker'); print ''; - print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, 1, 'datepicker'); + print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, 0, 'datepicker'); print '
'; - print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, 1, 'datepicker'); + print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, 0, 'datepicker'); print ''; - print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, 1, 'datepicker'); + print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, 0, 'datepicker'); print '
\n"; print ''; + print '
'; + // Step 2 $head = array(); $head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id']; $head[0][1] = $langs->trans("AccountancyClosureStep2"); $head[0][2] = 'step2'; - print dol_get_fiche_head($head, 'step2', '', -1, 'title_accountancy'); + print dol_get_fiche_head($head, 'step2', '', -1, ''); // print '' . $langs->trans("AccountancyClosureStep2Desc") . '
'; @@ -371,12 +373,14 @@ if (isset($current_fiscal_period)) { } print_barre_liste('', '', '', '', '', '', '', -1, '', '', 0, $button, '', 0, 1, 0); + print '
'; + // Step 3 $head = array(); $head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id']; $head[0][1] = $langs->trans("AccountancyClosureStep3"); $head[0][2] = 'step3'; - print dol_get_fiche_head($head, 'step3', '', -1, 'title_accountancy'); + print dol_get_fiche_head($head, 'step3', '', -1, ''); // print '' . $langs->trans("AccountancyClosureStep3Desc") . '
'; From 35670de57c3cf88398ff94bbd7c2085939b949a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 00:45:11 +0000 Subject: [PATCH 1813/1862] Bump mdeweerd/logToCheckStyle from 2024.2.9 to 2024.3.2 Bumps [mdeweerd/logToCheckStyle](https://github.com/mdeweerd/logtocheckstyle) from 2024.2.9 to 2024.3.2. - [Commits](https://github.com/mdeweerd/logtocheckstyle/compare/v2024.2.9...2024.3.2) --- updated-dependencies: - dependency-name: mdeweerd/logToCheckStyle dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/pre-commit.yml | 2 +- .github/workflows/windows-ci.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index ff99f5bdd74..ac6a5c23954 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -106,7 +106,7 @@ jobs: ls -l ~/.cache/pre-commit/ - name: Convert Raw Log to Annotations - uses: mdeweerd/logToCheckStyle@v2024.2.9 + uses: mdeweerd/logToCheckStyle@2024.3.2 if: ${{ failure() }} with: in: ${{ env.RAW_LOG }} diff --git a/.github/workflows/windows-ci.yaml b/.github/workflows/windows-ci.yaml index 643c96bb21f..927378fab59 100644 --- a/.github/workflows/windows-ci.yaml +++ b/.github/workflows/windows-ci.yaml @@ -152,7 +152,7 @@ jobs: echo "PHPUNIT seems to have completed with a test result, reuse the exit code" for /f "tokens=2 delims==" %%A in ('doskey /m:err') do EXIT /B %%A - name: Convert Raw Log to Annotations - uses: mdeweerd/logToCheckStyle@v2024.3.2 + uses: mdeweerd/logToCheckStyle@2024.3.2 if: ${{ failure() }} with: in: ${{ env.PHPUNIT_LOG }} From 67e5e95fde871082b20b38870c3865cadee234fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Mar 2024 01:51:35 +0100 Subject: [PATCH 1814/1862] Update 19.0.0-20.0.0.sql --- htdocs/install/mysql/migration/19.0.0-20.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql index 53502e05197..491b563a502 100644 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql @@ -242,7 +242,7 @@ ALTER TABLE llx_ticket ADD COLUMN model_pdf varchar(255); ALTER TABLE llx_ticket ADD COLUMN last_main_doc varchar(255); ALTER TABLE llx_ticket ADD COLUMN extraparams varchar(255); ALTER TABLE llx_ticket ADD COLUMN origin_replyto varchar(128); -ALTER TABLE llx_ticket ADD COLUMN origin_references mediumtext; +ALTER TABLE llx_ticket ADD COLUMN origin_references text DEFAULT NULL; ALTER TABLE llx_expensereport MODIFY COLUMN model_pdf varchar(255) DEFAULT NULL; ALTER TABLE llx_fichinter_rec MODIFY COLUMN modelpdf varchar(255) DEFAULT NULL; From 57e2aea2557672243de9e42ee5ff7bd9c452280f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Mar 2024 01:52:03 +0100 Subject: [PATCH 1815/1862] Update llx_ticket-ticket.sql --- htdocs/install/mysql/tables/llx_ticket-ticket.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_ticket-ticket.sql b/htdocs/install/mysql/tables/llx_ticket-ticket.sql index 305b8a1db87..7614bcc1ad7 100644 --- a/htdocs/install/mysql/tables/llx_ticket-ticket.sql +++ b/htdocs/install/mysql/tables/llx_ticket-ticket.sql @@ -26,7 +26,7 @@ CREATE TABLE llx_ticket fk_contract integer DEFAULT 0, origin_email varchar(128), origin_replyto varchar(128), - origin_references mediumtext, + origin_references text, fk_user_create integer, fk_user_assign integer, subject varchar(255), From 66faa6dd0e3e62edd7595fafb97d1b5958bad76e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Mar 2024 01:52:57 +0100 Subject: [PATCH 1816/1862] Update ticket.class.php --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 716a75672bb..fe795deac90 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -332,7 +332,7 @@ class Ticket extends CommonObject 'fk_user_create' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Author', 'visible' => 1, 'enabled' => 1, 'position' => 15, 'notnull' => 1, 'csslist' => 'tdoverflowmax100 maxwidth150onsmartphone'), 'origin_email' => array('type' => 'mail', 'label' => 'OriginEmail', 'visible' => -2, 'enabled' => 1, 'position' => 16, 'notnull' => 1, 'index' => 1, 'searchall' => 1, 'comment' => "Reference of object", 'csslist' => 'tdoverflowmax150'), 'origin_replyto' => array('type' => 'mail', 'label' => 'EmailReplyto', 'visible' => -2, 'enabled' => 1, 'position' => 17, 'notnull' => 1, 'index' => 1, 'searchall' => 1, 'comment' => "Email to reply to", 'csslist' => 'tdoverflowmax150'), - 'origin_references' => array('type' => 'mediumtext', 'label' => 'EmailReferences', 'visible' => -2, 'enabled' => 1, 'position' => 18, 'notnull' => 1, 'index' => 1, 'searchall' => 1, 'comment' => "References from origin email", 'csslist' => 'tdoverflowmax150'), + 'origin_references' => array('type' => 'text', 'label' => 'EmailReferences', 'visible' => -2, 'enabled' => 1, 'position' => 18, 'notnull' => 1, 'index' => 1, 'searchall' => 1, 'comment' => "References from origin email", 'csslist' => 'tdoverflowmax150'), 'subject' => array('type' => 'varchar(255)', 'label' => 'Subject', 'visible' => 1, 'enabled' => 1, 'position' => 19, 'notnull' => -1, 'searchall' => 1, 'help' => "", 'css' => 'maxwidth200 tdoverflowmax200', 'autofocusoncreate' => 1), 'type_code' => array('type' => 'varchar(32)', 'label' => 'Type', 'visible' => 1, 'enabled' => 1, 'position' => 20, 'notnull' => -1, 'help' => "", 'csslist' => 'maxwidth125 tdoverflowmax50'), 'category_code' => array('type' => 'varchar(32)', 'label' => 'TicketCategory', 'visible' => -1, 'enabled' => 1, 'position' => 21, 'notnull' => -1, 'help' => "", 'css' => 'maxwidth100 tdoverflowmax200'), From 16eee4775fa365ac1d391695f1841a0cd4da573f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Mar 2024 02:30:05 +0100 Subject: [PATCH 1817/1862] Fix warning --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 6da542ab668..f82945c5abb 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -603,7 +603,7 @@ function CloseBill() { if ($("#idcustomer").val() == "") { alert("trans('TakePosCustomerMandatory'); ?>"); - global->TAKEPOS_CHOOSE_CONTACT) { ?> + Contact(); Customer(); From 0a1cec7e9bca853c414225baf8b7b61ddb69ce0f Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 02:09:12 +0100 Subject: [PATCH 1818/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/admin/system/database.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index 1f95458a8b2..01e1c5f28b6 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,6 +54,7 @@ print '
'.$langs->trans("DatabaseServer").''.$langs->trans("DatabasePort").''.(empty($conf->db->port) ? $langs->trans("Default") : $conf->db->port).'
'.$langs->trans("DatabaseName").''.$conf->db->name.'
'.$langs->trans("DriverType").''.$conf->db->type.($db->getDriverInfo() ? ' ('.$db->getDriverInfo().')' : '').'
'.$langs->trans("User").''.$conf->db->user.'
'.$langs->trans("Password").''.preg_replace('/./i', '*', $dolibarr_main_db_pass).'
'.$langs->trans("DBStoringCharset").''.$db->getDefaultCharacterSetDatabase().'
'.$langs->trans('CustomerCode'); if (!empty($array_query['cust_code'])) { print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); + $cust_code_str = (string) $array_query['cust_code']; +} else { + $cust_code_str = "null"; } -print ''."\n"; +print ''."\n"; print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); print '
".$company->getNomUrl(1)."".$obj->societe."".((string) $obj->societe)."".$obj->societe."".((string) $obj->societe)."".$donationstatic->getFullName($langs)."'.dol_print_date($db->jdate($obj->datedon), 'day').'
'."\n"; } @@ -295,7 +294,7 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo // Show box lines if ($nblines) { // Loop on each record - for ($i = 0, $n = $nblines; $i < $n; $i++) { + foreach (array_keys($contents) as $i) { if (isset($contents[$i])) { // TR if (isset($contents[$i][0]['tr'])) { @@ -306,7 +305,7 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo // Loop on each TD $nbcolthisline = count($contents[$i]); - for ($j = 0; $j < $nbcolthisline; $j++) { + foreach (array_keys($contents[$i]) as $j) { // Define tdparam $tdparam = ''; if (!empty($contents[$i][$j]['td'])) { @@ -417,7 +416,7 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo * Return list of widget. Function used by admin page htdoc/admin/widget. * List is sorted by widget filename so by priority to run. * - * @param array $forcedirwidget null=All default directories. This parameter is used by modulebuilder module only. + * @param ?string[] $forcedirwidget null=All default directories. This parameter is used by modulebuilder module only. * @return array Array list of widget */ public static function getWidgetsList($forcedirwidget = null) From 378bb482c7bb044852bc81cde8d20fcbe0924d47 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 20:51:00 +0100 Subject: [PATCH 1838/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/lib/modulebuilder.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index 54107b65144..95e4711b396 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -606,10 +606,11 @@ function reWriteAllPermissions($file, $permissions, $key, $right, $objectname, $ } else { $error++; } + '@phan-var-force array $permissions'; if (!$error) { // prepare permissions array $count_perms = count($permissions); - for ($i = 0;$i < $count_perms;$i++) { + foreach (array_keys($permissions) as $i) { $permissions[$i][0] = "\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1)"; $permissions[$i][1] = "\$this->rights[\$r][1] = '".$permissions[$i][1]."'"; $permissions[$i][4] = "\$this->rights[\$r][4] = '".$permissions[$i][4]."'"; From c6d0cb3f5b39b33867e64b7441f1970df7c78169 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 20:51:02 +0100 Subject: [PATCH 1839/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/menus/standard/empty.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 3d70364cbf9..1a5fea91f01 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -377,7 +377,7 @@ class MenuManager $altok = 0; $blockvmenuopened = false; $num = count($menu_array); - for ($i = 0; $i < $num; $i++) { + foreach (array_keys($menu_array) as $i) { $alt++; if (empty($menu_array[$i]['level'])) { $altok++; From 5c007eede4e95722ddc6ae9c8294ff4cec35b5c1 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 20:51:04 +0100 Subject: [PATCH 1840/1862] Fix PhanTypeSuspiciousStringExpression --- ...ce_20_modWorkflow_WorkflowManager.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 3aaff1fe943..785aac5f0fc 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -135,7 +135,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers $totalonlinkedelements += $element->total_ht; } } - dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of order = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht)); + dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of order = ".$object->total_ht.", egality is ".json_encode($totalonlinkedelements == $object->total_ht)); if ($this->shouldClassify($conf, $totalonlinkedelements, $object->total_ht)) { foreach ($object->linkedObjects['propal'] as $element) { $ret = $element->classifyBilled($user); @@ -160,7 +160,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers $totalonlinkedelements += $element->total_ht; } } - dol_syslog("Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht)); + dol_syslog("Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".json_encode($totalonlinkedelements == $object->total_ht)); if ($this->shouldClassify($conf, $totalonlinkedelements, $object->total_ht)) { foreach ($object->linkedObjects['commande'] as $element) { $ret = $element->classifyBilled($user); @@ -179,7 +179,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers $totalonlinkedelements += $element->total_ht; } } - dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht)); + dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".json_encode($totalonlinkedelements == $object->total_ht)); if ($this->shouldClassify($conf, $totalonlinkedelements, $object->total_ht)) { foreach ($object->linkedObjects['propal'] as $element) { $ret = $element->classifyBilled($user); @@ -198,7 +198,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers $totalonlinkedelements += $element->total_ht; } } - dol_syslog("Amount of linked shipment = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG); + dol_syslog("Amount of linked shipment = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".json_encode($totalonlinkedelements == $object->total_ht), LOG_DEBUG); if ($totalonlinkedelements == $object->total_ht) { foreach ($object->linkedObjects['shipping'] as $element) { $ret = $element->setClosed(); @@ -219,7 +219,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers $totalonlinkedelements += $element->total_ht; } } - dol_syslog("Amount of linked shipment = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG); + dol_syslog("Amount of linked shipment = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".json_encode($totalonlinkedelements == $object->total_ht), LOG_DEBUG); if ($totalonlinkedelements == $object->total_ht) { foreach ($object->linkedObjects['shipping'] as $element) { $ret = $element->setBilled(); @@ -249,7 +249,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers $totalonlinkedelements += $element->total_ht; } } - dol_syslog("Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht)); + dol_syslog("Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".json_encode($totalonlinkedelements == $object->total_ht)); if ($this->shouldClassify($conf, $totalonlinkedelements, $object->total_ht)) { foreach ($object->linkedObjects['order_supplier'] as $element) { $ret = $element->classifyBilled($user); @@ -271,7 +271,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers $totalonlinkedelements += $element->total_ht; } } - dol_syslog("Amount of linked supplier proposals = ".$totalonlinkedelements.", of supplier invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht)); + dol_syslog("Amount of linked supplier proposals = ".$totalonlinkedelements.", of supplier invoice = ".$object->total_ht.", egality is ".json_encode($totalonlinkedelements == $object->total_ht)); if ($this->shouldClassify($conf, $totalonlinkedelements, $object->total_ht)) { foreach ($object->linkedObjects['supplier_proposal'] as $element) { $ret = $element->classifyBilled($user); @@ -317,7 +317,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers $totalonlinkedelements += $element->total_ht; } } - dol_syslog("Amount of linked reception = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG); + dol_syslog("Amount of linked reception = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".json_encode($totalonlinkedelements == $object->total_ht), LOG_DEBUG); if ($totalonlinkedelements == $object->total_ht) { foreach ($object->linkedObjects['reception'] as $element) { $ret = $element->setBilled(); @@ -345,7 +345,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers $totalonlinkedelements += $element->total_ht; } } - dol_syslog("Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht)); + dol_syslog("Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".json_encode($totalonlinkedelements == $object->total_ht)); if ($this->shouldClassify($conf, $totalonlinkedelements, $object->total_ht)) { foreach ($object->linkedObjects['commande'] as $element) { $ret = $element->classifyBilled($user); From 702976afaba49864422c7ed6211af812c31353f8 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 21:43:26 +0100 Subject: [PATCH 1841/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/install/repair.php | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 553796f7c6f..4f2b8adb94f 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -5,6 +5,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2021 Frédéric France * Copyright (C) 2023 Gauthier VERDOL + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -234,15 +235,15 @@ if ($ok && GETPOST('standard', 'alpha')) { $extrafields = new ExtraFields($db); // List of tables that has an extrafield table - $listofmodulesextra = array('societe'=>'societe', 'adherent'=>'adherent', 'product'=>'product', - 'socpeople'=>'socpeople', 'propal'=>'propal', 'commande'=>'commande', - 'facture'=>'facture', 'facturedet'=>'facturedet', 'facture_rec'=>'facture_rec', 'facturedet_rec'=>'facturedet_rec', - 'supplier_proposal'=>'supplier_proposal', 'commande_fournisseur'=>'commande_fournisseur', - 'facture_fourn'=>'facture_fourn', 'facture_fourn_rec'=>'facture_fourn_rec', 'facture_fourn_det'=>'facture_fourn_det', 'facture_fourn_det_rec'=>'facture_fourn_det_rec', - 'fichinter'=>'fichinter', 'fichinterdet'=>'fichinterdet', - 'inventory'=>'inventory', - 'actioncomm'=>'actioncomm', 'bom_bom'=>'bom_bom', 'mrp_mo'=>'mrp_mo', - 'adherent_type'=>'adherent_type', 'user'=>'user', 'partnership'=>'partnership', 'projet'=>'projet', 'projet_task'=>'projet_task', 'ticket'=>'ticket'); + $listofmodulesextra = array('societe' => 'societe', 'adherent' => 'adherent', 'product' => 'product', + 'socpeople' => 'socpeople', 'propal' => 'propal', 'commande' => 'commande', + 'facture' => 'facture', 'facturedet' => 'facturedet', 'facture_rec' => 'facture_rec', 'facturedet_rec' => 'facturedet_rec', + 'supplier_proposal' => 'supplier_proposal', 'commande_fournisseur' => 'commande_fournisseur', + 'facture_fourn' => 'facture_fourn', 'facture_fourn_rec' => 'facture_fourn_rec', 'facture_fourn_det' => 'facture_fourn_det', 'facture_fourn_det_rec' => 'facture_fourn_det_rec', + 'fichinter' => 'fichinter', 'fichinterdet' => 'fichinterdet', + 'inventory' => 'inventory', + 'actioncomm' => 'actioncomm', 'bom_bom' => 'bom_bom', 'mrp_mo' => 'mrp_mo', + 'adherent_type' => 'adherent_type', 'user' => 'user', 'partnership' => 'partnership', 'projet' => 'projet', 'projet_task' => 'projet_task', 'ticket' => 'ticket'); //$listofmodulesextra = array('fichinter'=>'fichinter'); print ''; @@ -275,7 +276,7 @@ if ($ok && GETPOST('standard', 'alpha')) { if (in_array($fieldname, array('rowid', 'tms', 'fk_object', 'import_key'))) { continue; } - $arrayoffieldsfound[$fieldname] = array('type'=>$fieldtype); + $arrayoffieldsfound[$fieldname] = array('type' => $fieldtype); } print ' - Found '.count($arrayoffieldsfound).' fields into table'; if (count($arrayoffieldsfound) > 0) { @@ -318,12 +319,12 @@ if ($ok && GETPOST('standard', 'alpha')) { } $field_desc = array( - 'type'=>$typedb, - 'value'=>$lengthdb, - 'attribute'=>$attribute, - 'default'=>$default, - 'extra'=>$extra, - 'null'=>$null + 'type' => $typedb, + 'value' => $lengthdb, + 'attribute' => $attribute, + 'default' => $default, + 'extra' => $extra, + 'null' => $null ); //var_dump($field_desc);exit; @@ -510,7 +511,7 @@ if ($ok && GETPOST('restore_thirdparties_logos')) { if (!empty($name)) { $filetotest = $dolibarr_main_data_root.'/societe/logos/'.$name.$ext; $filetotestsmall = $dolibarr_main_data_root.'/societe/logos/thumbs/'.$name.'_small'.$ext; - $exists = dol_is_file($filetotest); + $exists = (int) dol_is_file($filetotest); print 'Check thirdparty '.$obj->rowid.' name='.$obj->name.' logo='.$obj->logo.' file '.$filetotest." exists=".$exists."
\n"; if ($exists) { $filetarget = $dolibarr_main_data_root.'/societe/'.$obj->rowid.'/logos/'.$name.$ext; @@ -585,7 +586,7 @@ if ($ok && GETPOST('restore_user_pictures', 'alpha')) { $filetotest = $dolibarr_main_data_root.'/users/'.substr(sprintf('%08d', $obj->rowid), -1, 1).'/'.substr(sprintf('%08d', $obj->rowid), -2, 1).'/'.$name.$ext; $filetotestsmall = $dolibarr_main_data_root.'/users/'.substr(sprintf('%08d', $obj->rowid), -1, 1).'/'.substr(sprintf('%08d', $obj->rowid), -2, 1).'/thumbs/'.$name.'_small'.$ext; $filetotestmini = $dolibarr_main_data_root.'/users/'.substr(sprintf('%08d', $obj->rowid), -1, 1).'/'.substr(sprintf('%08d', $obj->rowid), -2, 1).'/thumbs/'.$name.'_mini'.$ext; - $exists = dol_is_file($filetotest); + $exists = (int) dol_is_file($filetotest); print 'Check user '.$obj->rowid.' lastname='.$obj->lastname.' firstname='.$obj->firstname.' photo='.$obj->photo.' file '.$filetotest." exists=".$exists."
\n"; if ($exists) { $filetarget = $dolibarr_main_data_root.'/users/'.$obj->rowid.'/'.$name.$ext; From a9ac98f6c75ca5e3a51cb09f9f9bc181c59c9b7b Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 21:43:29 +0100 Subject: [PATCH 1842/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/install/step1.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index 85e77bbbd79..cc16184788e 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -264,8 +264,7 @@ if (!$error) { $db = getDoliDBInstance($db_type, $db_host, $userroot, $passroot, $databasefortest, (int) $db_port); - dol_syslog("databasefortest=".$databasefortest." connected=".$db->connected." database_selected=".$db->database_selected, LOG_DEBUG); - //print "databasefortest=".$databasefortest." connected=".$db->connected." database_selected=".$db->database_selected; + dol_syslog("databasefortest=".$databasefortest." connected=".json_encode($db->connected)." database_selected=".json_encode($db->database_selected), LOG_DEBUG); if (empty($db_create_database) && $db->connected && !$db->database_selected) { print '
'.$langs->trans("ErrorConnectedButDatabaseNotFound", $db_name).'
'; From 3e1aaf8195251f6ade5d71f96160d386d74d285d Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 21:43:32 +0100 Subject: [PATCH 1843/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/install/step2.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index 99170d4c9c6..f62e793beab 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2015 Cedric GROSS * Copyright (C) 2015-2016 Raphaël Doursenaud + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -171,7 +172,7 @@ if ($action == "set") { $ok = 0; $handle = opendir($dir); - dolibarr_install_syslog("step2: open tables directory ".$dir." handle=".$handle); + dolibarr_install_syslog("step2: open tables directory ".$dir." handle=".(is_bool($handle) ? json_encode($handle) : $handle)); $tablefound = 0; $tabledata = array(); if (is_resource($handle)) { @@ -269,7 +270,7 @@ if ($action == "set") { $okkeys = 0; $handle = opendir($dir); - dolibarr_install_syslog("step2: open keys directory ".$dir." handle=".$handle); + dolibarr_install_syslog("step2: open keys directory ".$dir." handle=".(is_bool($handle) ? json_encode($handle) : $handle)); $tablefound = 0; $tabledata = array(); if (is_resource($handle)) { @@ -400,7 +401,7 @@ if ($action == "set") { $file = "functions.sql"; if (file_exists($dir.$file)) { $fp = fopen($dir.$file, "r"); - dolibarr_install_syslog("step2: open function file ".$dir.$file." handle=".$fp); + dolibarr_install_syslog("step2: open function file ".$dir.$file." handle=".(is_bool($fp) ? json_encode($fp) : $fp)); if ($fp) { $buffer = ''; while (!feof($fp)) { @@ -467,7 +468,7 @@ if ($action == "set") { // Insert data $handle = opendir($dir); - dolibarr_install_syslog("step2: open directory data ".$dir." handle=".$handle); + dolibarr_install_syslog("step2: open directory data ".$dir." handle=".(is_bool($handle) ? json_encode($handle) : $handle)); $tablefound = 0; $tabledata = array(); if (is_resource($handle)) { @@ -492,7 +493,7 @@ if ($action == "set") { foreach ($tabledata as $file) { $name = substr($file, 0, dol_strlen($file) - 4); $fp = fopen($dir.$file, "r"); - dolibarr_install_syslog("step2: open data file ".$dir.$file." handle=".$fp); + dolibarr_install_syslog("step2: open data file ".$dir.$file." handle=".(is_bool($fp) ? json_encode($fp) : $fp)); if ($fp) { $arrayofrequests = array(); $linefound = 0; From c543f1b0021912d19aad1eef095241dc8863e219 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 21:43:35 +0100 Subject: [PATCH 1844/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/install/upgrade.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 60055abf65e..d80205028c8 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2015-2016 Raphaël Doursenaud + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -417,7 +418,7 @@ if (!$ok && isset($argv[1])) { } dolibarr_install_syslog("Exit ".$ret); -dolibarr_install_syslog("--- upgrade: end ".(!$ok && empty($_GET["ignoreerrors"]))." dirmodule=".$dirmodule); +dolibarr_install_syslog("--- upgrade: end ".((int) (!$ok && empty($_GET["ignoreerrors"])))." dirmodule=".$dirmodule); $nonext = (!$ok && empty($_GET["ignoreerrors"])) ? 2 : 0; if ($dirmodule) { From 794dc257c759e38303c227f806f2e0b863e42851 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 21:43:38 +0100 Subject: [PATCH 1845/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/mrp/class/api_mos.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index 2951c1069eb..a67d23b6877 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2019 Maxime Kohlhaas + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -628,8 +629,7 @@ class Mos extends DolibarrApi } // Update status of MO - dol_syslog("consumptioncomplete = ".$consumptioncomplete." productioncomplete = ".$productioncomplete); - //var_dump("consumptioncomplete = ".$consumptioncomplete." productioncomplete = ".$productioncomplete); + dol_syslog("consumptioncomplete = ".json_encode($consumptioncomplete)." productioncomplete = ".json_encode($productioncomplete)); if ($consumptioncomplete && $productioncomplete) { $result = $this->mo->setStatut(Mo::STATUS_PRODUCED, 0, '', 'MRP_MO_PRODUCED'); } else { From 0ce51708f3e8f7eeac98179051fe29d8151db65a Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 21:43:40 +0100 Subject: [PATCH 1846/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/mrp/mo_production.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index c13813c342f..7926ba1cfcf 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -3,6 +3,7 @@ * Copyright (C) 2023 Christian Humpel * Copyright (C) 2023 Vincent de Grandpré * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -422,8 +423,7 @@ if (empty($reshook)) { } // Update status of MO - dol_syslog("consumptioncomplete = ".$consumptioncomplete." productioncomplete = ".$productioncomplete); - //var_dump("consumptioncomplete = ".$consumptioncomplete." productioncomplete = ".$productioncomplete); + dol_syslog("consumptioncomplete = ".json_encode($consumptioncomplete)." productioncomplete = ".json_encode($productioncomplete)); if ($consumptioncomplete && $productioncomplete) { $result = $object->setStatut($object::STATUS_PRODUCED, 0, '', 'MRP_MO_PRODUCED'); } else { @@ -823,7 +823,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $url = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addconsumeline&token='.newToken(); $permissiontoaddaconsumeline = $object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED; - $parameters = array('morecss'=>'reposition'); + $parameters = array('morecss' => 'reposition'); $newcardbutton = ''; if ($action != 'consumeorproduce' && $action != 'consumeandproduceall') { @@ -1432,7 +1432,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $newcardbutton = ''; $url = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addproduceline&token='.newToken(); $permissiontoaddaproductline = $object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED; - $parameters = array('morecss'=>'reposition'); + $parameters = array('morecss' => 'reposition'); if ($action != 'consumeorproduce' && $action != 'consumeandproduceall') { if ($nblinetoproduce == 0 || $object->mrptype == 1) { $newcardbutton = dolGetButtonTitle($langs->trans('AddNewProduceLines'), '', 'fa fa-plus-circle size15x', $url, '', $permissiontoaddaproductline, $parameters); From 31a6a3c9fc38245b4cfbefe66610601164baefa0 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 21:43:43 +0100 Subject: [PATCH 1847/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/product/stock/class/mouvementstock.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index a6ad446ecbe..d9cb5fb5812 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -194,7 +194,7 @@ class MouvementStock extends CommonObject require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; $error = 0; - dol_syslog(get_class($this)."::_create start userid=$user->id, fk_product=$fk_product, warehouse_id=$entrepot_id, qty=$qty, type=$type, price=$price, label=$label, inventorycode=$inventorycode, datem=".$datem.", eatby=".$eatby.", sellby=".$sellby.", batch=".$batch.", skip_batch=".$skip_batch); + dol_syslog(get_class($this)."::_create start userid=$user->id, fk_product=$fk_product, warehouse_id=$entrepot_id, qty=$qty, type=$type, price=$price, label=$label, inventorycode=$inventorycode, datem=".$datem.", eatby=".$eatby.", sellby=".$sellby.", batch=".$batch.", skip_batch=".json_encode($skip_batch)); // Call hook at beginning global $action, $hookmanager; From 18600215a15b0d0408c2e6fa6cf6032ec6e1c59b Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 21:43:45 +0100 Subject: [PATCH 1848/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/projet/class/project.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index b07a0981387..c8ded1e1b76 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1688,7 +1688,7 @@ class Project extends CommonObject * @param bool $clone_task_file Clone file of task (if task are copied) * @param bool $clone_note Clone note of project * @param bool $move_date Move task date on clone - * @param integer $notrigger No trigger flag + * @param int $notrigger No trigger flag * @param int $newthirdpartyid New thirdparty id * @return int New id of clone */ @@ -1698,7 +1698,7 @@ class Project extends CommonObject $error = 0; - dol_syslog("createFromClone clone_contact=".$clone_contact." clone_task=".$clone_task." clone_project_file=".$clone_project_file." clone_note=".$clone_note." move_date=".$move_date, LOG_DEBUG); + dol_syslog("createFromClone clone_contact=".json_encode($clone_contact)." clone_task=".json_encode($clone_task)." clone_project_file=".json_encode($clone_project_file)." clone_note=".json_encode($clone_note)." move_date=".json_encode($move_date), LOG_DEBUG); $now = dol_mktime(0, 0, 0, idate('m', dol_now()), idate('d', dol_now()), idate('Y', dol_now())); From 58c7c9acb4fb7bba6a3171b647a2d2802f2e6667 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 21:43:47 +0100 Subject: [PATCH 1849/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/public/webportal/lib/webportal.lib.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/public/webportal/lib/webportal.lib.php b/htdocs/public/webportal/lib/webportal.lib.php index cc2ba9ec532..f15b59af5d9 100644 --- a/htdocs/public/webportal/lib/webportal.lib.php +++ b/htdocs/public/webportal/lib/webportal.lib.php @@ -1,4 +1,6 @@ + */ /** * \file htdocs/public/webportal/lib/webportal.lib.php @@ -9,7 +11,7 @@ /** * Get nav menu * - * @param array $Tmenu Array of menu + * @param array,children?:array}>}> $Tmenu Array of menu * @return string */ function getNav($Tmenu) @@ -27,7 +29,7 @@ function getNav($Tmenu) * Get nav item * * TODO : Dropdown is actually not css implemented - * @param array $item Item of menu + * @param array{id:string,rank:int,url:string,name:string,group:string,override?:int<0,1>,children?:array,active?:bool,separator?:bool}>} $item Item of menu * @param int $deep Level of deep * @return string */ @@ -53,14 +55,15 @@ function getNavItem($item, $deep = 0) } - if (!empty($item['overrride'])) { - $menu .= $item['overrride']; + if (!empty($item['override'])) { + $menu .= $item['override']; } elseif (!empty($item['children'])) { $menuChildren = ''; $haveChildActive = false; foreach ($item['children'] as $child) { $item = array_replace($itemDefault, $item); // applique les valeurs par default + '@phan-var-force array{id:string,rank:int,url:string,name:string,group:string,override?:int<0,1>,active?:bool,separator?:bool} $child'; if (!empty($child['separator'])) { $menuChildren .= ''; @@ -100,9 +103,9 @@ function getNavItem($item, $deep = 0) * Sort menu * uasort callback function to Sort menu fields * - * @param array $a PDF lines array fields configs - * @param array $b PDF lines array fields configs - * @return int Return compare result + * @param array{rank?:int} $a PDF lines array fields configs + * @param array{rank?:int} $b PDF lines array fields configs + * @return int<-1,1> Return compare result * * // Sorting * uasort ( $this->cols, array( $this, 'menuSort' ) ); From 16e5ca0b1ed7fc45dd94c8b9aed12ee22f90821e Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 22:53:07 +0100 Subject: [PATCH 1850/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/stripe/class/stripe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index ca71a510a1b..e6881132167 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -668,7 +668,7 @@ class Stripe extends CommonObject { global $conf; - dol_syslog("getSetupIntent description=".$description.' confirmnow='.$confirmnow, LOG_INFO, 1); + dol_syslog("getSetupIntent description=".$description.' confirmnow='.json_encode($confirmnow), LOG_INFO, 1); $error = 0; From fe5c6484d4e27b0d18d907e4efa7f5e533f30f39 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 22:53:10 +0100 Subject: [PATCH 1851/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 3d614e9fdd7..1d2430e5d55 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1507,7 +1507,7 @@ if (!empty($conf->use_javascript_ajax)) { $usediv = (GETPOST('format') == 'div'); -print ''."\n"; +print ''."\n"; print '
'; if ($usediv) { print '
'; From 439839f1aa888e8cafed2b9a547d0beb52280d62 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 22:53:12 +0100 Subject: [PATCH 1852/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/webservices/server_actioncomm.php | 156 ++++++++++++----------- 1 file changed, 79 insertions(+), 77 deletions(-) diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index 6bd2c21a0b1..4347affafb2 100644 --- a/htdocs/webservices/server_actioncomm.php +++ b/htdocs/webservices/server_actioncomm.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Florian Henry + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,11 +83,11 @@ $server->wsdl->addComplexType( 'all', '', array( - 'dolibarrkey' => array('name'=>'dolibarrkey', 'type'=>'xsd:string'), - 'sourceapplication' => array('name'=>'sourceapplication', 'type'=>'xsd:string'), - 'login' => array('name'=>'login', 'type'=>'xsd:string'), - 'password' => array('name'=>'password', 'type'=>'xsd:string'), - 'entity' => array('name'=>'entity', 'type'=>'xsd:string'), + 'dolibarrkey' => array('name' => 'dolibarrkey', 'type' => 'xsd:string'), + 'sourceapplication' => array('name' => 'sourceapplication', 'type' => 'xsd:string'), + 'login' => array('name' => 'login', 'type' => 'xsd:string'), + 'password' => array('name' => 'password', 'type' => 'xsd:string'), + 'entity' => array('name' => 'entity', 'type' => 'xsd:string'), ) ); @@ -98,37 +99,37 @@ $server->wsdl->addComplexType( 'all', '', array( - 'result_code' => array('name'=>'result_code', 'type'=>'xsd:string'), - 'result_label' => array('name'=>'result_label', 'type'=>'xsd:string'), + 'result_code' => array('name' => 'result_code', 'type' => 'xsd:string'), + 'result_label' => array('name' => 'result_label', 'type' => 'xsd:string'), ) ); $actioncomm_fields = array( - 'id' => array('name'=>'id', 'type'=>'xsd:string'), - 'ref' => array('name'=>'ref', 'type'=>'xsd:string'), - 'ref_ext' => array('name'=>'ref_ext', 'type'=>'xsd:string'), - 'type_id' => array('name'=>'type_id', 'type'=>'xsd:string'), - 'type_code' => array('name'=>'type_code', 'type'=>'xsd:string'), - 'type' => array('name'=>'type', 'type'=>'xsd:string'), - 'label' => array('name'=>'label', 'type'=>'xsd:string'), - 'datep' => array('name'=>'datep', 'type'=>'xsd:dateTime'), - 'datef' => array('name'=>'datef', 'type'=>'xsd:dateTime'), - 'datec' => array('name'=>'datec', 'type'=>'xsd:dateTime'), - 'datem' => array('name'=>'datem', 'type'=>'xsd:dateTime'), - 'note' => array('name'=>'note', 'type'=>'xsd:string'), - 'percentage' => array('name'=>'percentage', 'type'=>'xsd:string'), - 'author' => array('name'=>'author', 'type'=>'xsd:string'), - 'usermod' => array('name'=>'usermod', 'type'=>'xsd:string'), - 'userownerid' => array('name'=>'userownerid', 'type'=>'xsd:string'), - 'priority' => array('name'=>'priority', 'type'=>'xsd:string'), - 'fulldayevent' => array('name'=>'fulldayevent', 'type'=>'xsd:string'), - 'location' => array('name'=>'location', 'type'=>'xsd:string'), - 'socid' => array('name'=>'socid', 'type'=>'xsd:string'), - 'contactid' => array('name'=>'contactid', 'type'=>'xsd:string'), - 'projectid' => array('name'=>'projectid', 'type'=>'xsd:string'), - 'fk_element' => array('name'=>'fk_element', 'type'=>'xsd:string'), - 'elementtype' => array('name'=>'elementtype', 'type'=>'xsd:string')); + 'id' => array('name' => 'id', 'type' => 'xsd:string'), + 'ref' => array('name' => 'ref', 'type' => 'xsd:string'), + 'ref_ext' => array('name' => 'ref_ext', 'type' => 'xsd:string'), + 'type_id' => array('name' => 'type_id', 'type' => 'xsd:string'), + 'type_code' => array('name' => 'type_code', 'type' => 'xsd:string'), + 'type' => array('name' => 'type', 'type' => 'xsd:string'), + 'label' => array('name' => 'label', 'type' => 'xsd:string'), + 'datep' => array('name' => 'datep', 'type' => 'xsd:dateTime'), + 'datef' => array('name' => 'datef', 'type' => 'xsd:dateTime'), + 'datec' => array('name' => 'datec', 'type' => 'xsd:dateTime'), + 'datem' => array('name' => 'datem', 'type' => 'xsd:dateTime'), + 'note' => array('name' => 'note', 'type' => 'xsd:string'), + 'percentage' => array('name' => 'percentage', 'type' => 'xsd:string'), + 'author' => array('name' => 'author', 'type' => 'xsd:string'), + 'usermod' => array('name' => 'usermod', 'type' => 'xsd:string'), + 'userownerid' => array('name' => 'userownerid', 'type' => 'xsd:string'), + 'priority' => array('name' => 'priority', 'type' => 'xsd:string'), + 'fulldayevent' => array('name' => 'fulldayevent', 'type' => 'xsd:string'), + 'location' => array('name' => 'location', 'type' => 'xsd:string'), + 'socid' => array('name' => 'socid', 'type' => 'xsd:string'), + 'contactid' => array('name' => 'contactid', 'type' => 'xsd:string'), + 'projectid' => array('name' => 'projectid', 'type' => 'xsd:string'), + 'fk_element' => array('name' => 'fk_element', 'type' => 'xsd:string'), + 'elementtype' => array('name' => 'elementtype', 'type' => 'xsd:string')); $elementtype = 'actioncomm'; @@ -150,7 +151,7 @@ if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafie $type = 'xsd:string'; } - $extrafield_array['options_'.$key] = array('name'=>'options_'.$key, 'type'=>$type); + $extrafield_array['options_'.$key] = array('name' => 'options_'.$key, 'type' => $type); } } if (is_array($extrafield_array)) { @@ -175,8 +176,8 @@ $server->wsdl->addComplexType( 'sequence', '', array( - 'code' => array('name'=>'code', 'type'=>'xsd:string'), - 'libelle' => array('name'=>'libelle', 'type'=>'xsd:string') + 'code' => array('name' => 'code', 'type' => 'xsd:string'), + 'libelle' => array('name' => 'libelle', 'type' => 'xsd:string') ) ); @@ -209,9 +210,9 @@ $styleuse = 'encoded'; // encoded/literal/literal wrapped $server->register( 'getListActionCommType', // Entry values - array('authentication'=>'tns:authentication'), + array('authentication' => 'tns:authentication'), // Exit values - array('result'=>'tns:result', 'actioncommtypes'=>'tns:actioncommtypes'), + array('result' => 'tns:result', 'actioncommtypes' => 'tns:actioncommtypes'), $ns, $ns.'#getListActionCommType', $styledoc, @@ -223,9 +224,9 @@ $server->register( $server->register( 'getActionComm', // Entry values - array('authentication'=>'tns:authentication', 'id'=>'xsd:string'), + array('authentication' => 'tns:authentication', 'id' => 'xsd:string'), // Exit values - array('result'=>'tns:result', 'actioncomm'=>'tns:actioncomm'), + array('result' => 'tns:result', 'actioncomm' => 'tns:actioncomm'), $ns, $ns.'#getActionComm', $styledoc, @@ -237,9 +238,9 @@ $server->register( $server->register( 'createActionComm', // Entry values - array('authentication'=>'tns:authentication', 'actioncomm'=>'tns:actioncomm'), + array('authentication' => 'tns:authentication', 'actioncomm' => 'tns:actioncomm'), // Exit values - array('result'=>'tns:result', 'id'=>'xsd:string'), + array('result' => 'tns:result', 'id' => 'xsd:string'), $ns, $ns.'#createActionComm', $styledoc, @@ -251,9 +252,9 @@ $server->register( $server->register( 'updateActionComm', // Entry values - array('authentication'=>'tns:authentication', 'actioncomm'=>'tns:actioncomm'), + array('authentication' => 'tns:authentication', 'actioncomm' => 'tns:actioncomm'), // Exit values - array('result'=>'tns:result', 'id'=>'xsd:string'), + array('result' => 'tns:result', 'id' => 'xsd:string'), $ns, $ns.'#updateActionComm', $styledoc, @@ -303,29 +304,29 @@ function getActionComm($authentication, $id) if ($result > 0) { $actioncomm_result_fields = array( 'id' => $actioncomm->id, - 'ref'=> $actioncomm->ref, - 'ref_ext'=> $actioncomm->ref_ext, - 'type_id'=> $actioncomm->type_id, - 'type_code'=> $actioncomm->type_code, - 'type'=> $actioncomm->type, - 'label'=> $actioncomm->label, - 'datep'=> dol_print_date($actioncomm->datep, 'dayhourrfc'), - 'datef'=> dol_print_date($actioncomm->datef, 'dayhourrfc'), - 'datec'=> dol_print_date($actioncomm->datec, 'dayhourrfc'), - 'datem'=> dol_print_date($actioncomm->datem, 'dayhourrfc'), - 'note'=> $actioncomm->note_private, - 'percentage'=> $actioncomm->percentage, - 'author'=> $actioncomm->authorid, - 'usermod'=> $actioncomm->usermodid, - 'userownerid'=> $actioncomm->userownerid, - 'priority'=> $actioncomm->priority, - 'fulldayevent'=> $actioncomm->fulldayevent, - 'location'=> $actioncomm->location, - 'socid'=> $actioncomm->socid, - 'contactid'=> $actioncomm->contact_id, - 'projectid'=> $actioncomm->fk_project, - 'fk_element'=> $actioncomm->fk_element, - 'elementtype'=> $actioncomm->elementtype + 'ref' => $actioncomm->ref, + 'ref_ext' => $actioncomm->ref_ext, + 'type_id' => $actioncomm->type_id, + 'type_code' => $actioncomm->type_code, + 'type' => $actioncomm->type, + 'label' => $actioncomm->label, + 'datep' => dol_print_date($actioncomm->datep, 'dayhourrfc'), + 'datef' => dol_print_date($actioncomm->datef, 'dayhourrfc'), + 'datec' => dol_print_date($actioncomm->datec, 'dayhourrfc'), + 'datem' => dol_print_date($actioncomm->datem, 'dayhourrfc'), + 'note' => $actioncomm->note_private, + 'percentage' => $actioncomm->percentage, + 'author' => $actioncomm->authorid, + 'usermod' => $actioncomm->usermodid, + 'userownerid' => $actioncomm->userownerid, + 'priority' => $actioncomm->priority, + 'fulldayevent' => $actioncomm->fulldayevent, + 'location' => $actioncomm->location, + 'socid' => $actioncomm->socid, + 'contactid' => $actioncomm->contact_id, + 'projectid' => $actioncomm->fk_project, + 'fk_element' => $actioncomm->fk_element, + 'elementtype' => $actioncomm->elementtype ); $elementtype = 'actioncomm'; @@ -345,8 +346,8 @@ function getActionComm($authentication, $id) // Create $objectresp = array( - 'result'=>array('result_code'=>'OK', 'result_label'=>''), - 'actioncomm'=>$actioncomm_result_fields); + 'result' => array('result_code' => 'OK', 'result_label' => ''), + 'actioncomm' => $actioncomm_result_fields); } else { $error++; $errorcode = 'NOT_FOUND'; @@ -360,7 +361,7 @@ function getActionComm($authentication, $id) } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; @@ -399,12 +400,12 @@ function getListActionCommType($authentication) if ($result > 0) { $resultarray = array(); foreach ($cactioncomm->liste_array as $code => $libeller) { - $resultarray[] = array('code'=>$code, 'libelle'=>$libeller); + $resultarray[] = array('code' => $code, 'libelle' => $libeller); } $objectresp = array( - 'result'=>array('result_code'=>'OK', 'result_label'=>''), - 'actioncommtypes'=>$resultarray); + 'result' => array('result_code' => 'OK', 'result_label' => ''), + 'actioncommtypes' => $resultarray); } else { $error++; $errorcode = 'NOT_FOUND'; @@ -418,7 +419,7 @@ function getListActionCommType($authentication) } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; @@ -493,7 +494,7 @@ function createActionComm($authentication, $actioncomm) if (!$error) { $db->commit(); - $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id); + $objectresp = array('result' => array('result_code' => 'OK', 'result_label' => ''), 'id' => $newobject->id); } else { $db->rollback(); $error++; @@ -503,7 +504,7 @@ function createActionComm($authentication, $actioncomm) } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; @@ -586,12 +587,13 @@ function updateActionComm($authentication, $actioncomm) $error++; } } + '@phan-var-force array{id:string} $actioncomm'; if ((!$error) && ($objectfound)) { $db->commit(); $objectresp = array( - 'result'=>array('result_code'=>'OK', 'result_label'=>''), - 'id'=>$object->id + 'result' => array('result_code' => 'OK', 'result_label' => ''), + 'id' => $object->id ); } elseif ($objectfound) { $db->rollback(); @@ -606,7 +608,7 @@ function updateActionComm($authentication, $actioncomm) } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; From a19b3b20569eefbf81899c89da3ca787a401db1d Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 22:53:16 +0100 Subject: [PATCH 1853/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/webservices/server_contact.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index 388fe0392c2..0089b625dfe 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 JF FERRY + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -706,6 +707,7 @@ function updateContact($authentication, $contact) $error++; } } + '@phan-var-force array{id:string} $contact'; if ((!$error) && ($objectfound)) { $db->commit(); From 187e715bc5750362bc69308439be879f58da9dd3 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 22:53:19 +0100 Subject: [PATCH 1854/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/core/lib/ws.lib.php | 5 +- htdocs/webservices/server_invoice.php | 215 +++++++++++++------------- 2 files changed, 111 insertions(+), 109 deletions(-) diff --git a/htdocs/core/lib/ws.lib.php b/htdocs/core/lib/ws.lib.php index a0150d403c8..34d1c8059ab 100644 --- a/htdocs/core/lib/ws.lib.php +++ b/htdocs/core/lib/ws.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,14 +20,14 @@ /** * \file htdocs/core/lib/ws.lib.php * \ingroup webservices - * \brief Set of function for manipulating web services + * \brief Set of functions for manipulating web services */ /** * Check authentication array and set error, errorcode, errorlabel * - * @param array $authentication Array with authentication information ('login'=>,'password'=>,'entity'=>,'dolibarrkey'=>) + * @param array{login:string,password:string,entity:?int,dolibarrkey:string} $authentication Array with authentication information ('login'=>,'password'=>,'entity'=>,'dolibarrkey'=>) * @param int $error Number of errors * @param string $errorcode Error string code * @param string $errorlabel Error string label diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index 90d916e72b0..bb4d104c18d 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -1,6 +1,7 @@ * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -83,11 +84,11 @@ $server->wsdl->addComplexType( 'all', '', array( - 'dolibarrkey' => array('name'=>'dolibarrkey', 'type'=>'xsd:string'), - 'sourceapplication' => array('name'=>'sourceapplication', 'type'=>'xsd:string'), - 'login' => array('name'=>'login', 'type'=>'xsd:string'), - 'password' => array('name'=>'password', 'type'=>'xsd:string'), - 'entity' => array('name'=>'entity', 'type'=>'xsd:string') + 'dolibarrkey' => array('name' => 'dolibarrkey', 'type' => 'xsd:string'), + 'sourceapplication' => array('name' => 'sourceapplication', 'type' => 'xsd:string'), + 'login' => array('name' => 'login', 'type' => 'xsd:string'), + 'password' => array('name' => 'password', 'type' => 'xsd:string'), + 'entity' => array('name' => 'entity', 'type' => 'xsd:string') ) ); // Define WSDL Return object @@ -98,8 +99,8 @@ $server->wsdl->addComplexType( 'all', '', array( - 'result_code' => array('name'=>'result_code', 'type'=>'xsd:string'), - 'result_label' => array('name'=>'result_label', 'type'=>'xsd:string'), + 'result_code' => array('name' => 'result_code', 'type' => 'xsd:string'), + 'result_label' => array('name' => 'result_label', 'type' => 'xsd:string'), ) ); @@ -111,22 +112,22 @@ $server->wsdl->addComplexType( 'all', '', array( - 'id' => array('name'=>'id', 'type'=>'xsd:string'), - 'type' => array('name'=>'type', 'type'=>'xsd:int'), - 'desc' => array('name'=>'desc', 'type'=>'xsd:string'), - 'vat_rate' => array('name'=>'vat_rate', 'type'=>'xsd:double'), - 'qty' => array('name'=>'qty', 'type'=>'xsd:double'), - 'unitprice' => array('name'=>'unitprice', 'type'=>'xsd:double'), - 'total_net' => array('name'=>'total_net', 'type'=>'xsd:double'), - 'total_vat' => array('name'=>'total_vat', 'type'=>'xsd:double'), - 'total' => array('name'=>'total', 'type'=>'xsd:double'), - 'date_start' => array('name'=>'date_start', 'type'=>'xsd:date'), - 'date_end' => array('name'=>'date_end', 'type'=>'xsd:date'), + 'id' => array('name' => 'id', 'type' => 'xsd:string'), + 'type' => array('name' => 'type', 'type' => 'xsd:int'), + 'desc' => array('name' => 'desc', 'type' => 'xsd:string'), + 'vat_rate' => array('name' => 'vat_rate', 'type' => 'xsd:double'), + 'qty' => array('name' => 'qty', 'type' => 'xsd:double'), + 'unitprice' => array('name' => 'unitprice', 'type' => 'xsd:double'), + 'total_net' => array('name' => 'total_net', 'type' => 'xsd:double'), + 'total_vat' => array('name' => 'total_vat', 'type' => 'xsd:double'), + 'total' => array('name' => 'total', 'type' => 'xsd:double'), + 'date_start' => array('name' => 'date_start', 'type' => 'xsd:date'), + 'date_end' => array('name' => 'date_end', 'type' => 'xsd:date'), // From product - 'product_id' => array('name'=>'product_id', 'type'=>'xsd:int'), - 'product_ref' => array('name'=>'product_ref', 'type'=>'xsd:string'), - 'product_label' => array('name'=>'product_label', 'type'=>'xsd:string'), - 'product_desc' => array('name'=>'product_desc', 'type'=>'xsd:string') + 'product_id' => array('name' => 'product_id', 'type' => 'xsd:int'), + 'product_ref' => array('name' => 'product_ref', 'type' => 'xsd:string'), + 'product_label' => array('name' => 'product_label', 'type' => 'xsd:string'), + 'product_desc' => array('name' => 'product_desc', 'type' => 'xsd:string') ) ); @@ -168,29 +169,29 @@ $server->wsdl->addComplexType( 'all', '', array( - 'id' => array('name'=>'id', 'type'=>'xsd:string'), - 'ref' => array('name'=>'ref', 'type'=>'xsd:string'), - 'ref_ext' => array('name'=>'ref_ext', 'type'=>'xsd:string'), - 'thirdparty_id' => array('name'=>'thirdparty_id', 'type'=>'xsd:int'), - 'fk_user_author' => array('name'=>'fk_user_author', 'type'=>'xsd:string'), - 'fk_user_valid' => array('name'=>'fk_user_valid', 'type'=>'xsd:string'), - 'date' => array('name'=>'date', 'type'=>'xsd:date'), - 'date_due' => array('name'=>'date_due', 'type'=>'xsd:date'), - 'date_creation' => array('name'=>'date_creation', 'type'=>'xsd:dateTime'), - 'date_validation' => array('name'=>'date_validation', 'type'=>'xsd:dateTime'), - 'date_modification' => array('name'=>'date_modification', 'type'=>'xsd:dateTime'), - 'payment_mode_id' => array('name'=>'payment_mode_id', 'type'=>'xsd:string'), - 'type' => array('name'=>'type', 'type'=>'xsd:int'), - 'total_net' => array('name'=>'type', 'type'=>'xsd:double'), - 'total_vat' => array('name'=>'type', 'type'=>'xsd:double'), - 'total' => array('name'=>'type', 'type'=>'xsd:double'), - 'note_private' => array('name'=>'note_private', 'type'=>'xsd:string'), - 'note_public' => array('name'=>'note_public', 'type'=>'xsd:string'), - 'status' => array('name'=>'status', 'type'=>'xsd:int'), - 'close_code' => array('name'=>'close_code', 'type'=>'xsd:string'), - 'close_note' => array('name'=>'close_note', 'type'=>'xsd:string'), - 'project_id' => array('name'=>'project_id', 'type'=>'xsd:string'), - 'lines' => array('name'=>'lines', 'type'=>'tns:LinesArray2') + 'id' => array('name' => 'id', 'type' => 'xsd:string'), + 'ref' => array('name' => 'ref', 'type' => 'xsd:string'), + 'ref_ext' => array('name' => 'ref_ext', 'type' => 'xsd:string'), + 'thirdparty_id' => array('name' => 'thirdparty_id', 'type' => 'xsd:int'), + 'fk_user_author' => array('name' => 'fk_user_author', 'type' => 'xsd:string'), + 'fk_user_valid' => array('name' => 'fk_user_valid', 'type' => 'xsd:string'), + 'date' => array('name' => 'date', 'type' => 'xsd:date'), + 'date_due' => array('name' => 'date_due', 'type' => 'xsd:date'), + 'date_creation' => array('name' => 'date_creation', 'type' => 'xsd:dateTime'), + 'date_validation' => array('name' => 'date_validation', 'type' => 'xsd:dateTime'), + 'date_modification' => array('name' => 'date_modification', 'type' => 'xsd:dateTime'), + 'payment_mode_id' => array('name' => 'payment_mode_id', 'type' => 'xsd:string'), + 'type' => array('name' => 'type', 'type' => 'xsd:int'), + 'total_net' => array('name' => 'type', 'type' => 'xsd:double'), + 'total_vat' => array('name' => 'type', 'type' => 'xsd:double'), + 'total' => array('name' => 'type', 'type' => 'xsd:double'), + 'note_private' => array('name' => 'note_private', 'type' => 'xsd:string'), + 'note_public' => array('name' => 'note_public', 'type' => 'xsd:string'), + 'status' => array('name' => 'status', 'type' => 'xsd:int'), + 'close_code' => array('name' => 'close_code', 'type' => 'xsd:string'), + 'close_note' => array('name' => 'close_note', 'type' => 'xsd:string'), + 'project_id' => array('name' => 'project_id', 'type' => 'xsd:string'), + 'lines' => array('name' => 'lines', 'type' => 'tns:LinesArray2') ) ); /* @@ -237,9 +238,9 @@ $styleuse = 'encoded'; // encoded/literal/literal wrapped $server->register( 'getInvoice', // Entry values - array('authentication'=>'tns:authentication', 'id'=>'xsd:string', 'ref'=>'xsd:string', 'ref_ext'=>'xsd:string'), + array('authentication' => 'tns:authentication', 'id' => 'xsd:string', 'ref' => 'xsd:string', 'ref_ext' => 'xsd:string'), // Exit values - array('result'=>'tns:result', 'invoice'=>'tns:invoice'), + array('result' => 'tns:result', 'invoice' => 'tns:invoice'), $ns, $ns.'#getInvoice', $styledoc, @@ -249,9 +250,9 @@ $server->register( $server->register( 'getInvoicesForThirdParty', // Entry values - array('authentication'=>'tns:authentication', 'idthirdparty'=>'xsd:string'), + array('authentication' => 'tns:authentication', 'idthirdparty' => 'xsd:string'), // Exit values - array('result'=>'tns:result', 'invoices'=>'tns:InvoicesArray2'), + array('result' => 'tns:result', 'invoices' => 'tns:InvoicesArray2'), $ns, $ns.'#getInvoicesForThirdParty', $styledoc, @@ -261,9 +262,9 @@ $server->register( $server->register( 'createInvoice', // Entry values - array('authentication'=>'tns:authentication', 'invoice'=>'tns:invoice'), + array('authentication' => 'tns:authentication', 'invoice' => 'tns:invoice'), // Exit values - array('result'=>'tns:result', 'id'=>'xsd:string', 'ref'=>'xsd:string', 'ref_ext'=>'xsd:string'), + array('result' => 'tns:result', 'id' => 'xsd:string', 'ref' => 'xsd:string', 'ref_ext' => 'xsd:string'), $ns, $ns.'#createInvoice', $styledoc, @@ -273,9 +274,9 @@ $server->register( $server->register( 'createInvoiceFromOrder', // Entry values - array('authentication'=>'tns:authentication', 'id_order'=>'xsd:string', 'ref_order'=>'xsd:string', 'ref_ext_order'=>'xsd:string'), + array('authentication' => 'tns:authentication', 'id_order' => 'xsd:string', 'ref_order' => 'xsd:string', 'ref_ext_order' => 'xsd:string'), // Exit values - array('result'=>'tns:result', 'id'=>'xsd:string', 'ref'=>'xsd:string', 'ref_ext'=>'xsd:string'), + array('result' => 'tns:result', 'id' => 'xsd:string', 'ref' => 'xsd:string', 'ref_ext' => 'xsd:string'), $ns, $ns.'#createInvoiceFromOrder', $styledoc, @@ -285,9 +286,9 @@ $server->register( $server->register( 'updateInvoice', // Entry values - array('authentication'=>'tns:authentication', 'invoice'=>'tns:invoice'), + array('authentication' => 'tns:authentication', 'invoice' => 'tns:invoice'), // Exit values - array('result'=>'tns:result', 'id'=>'xsd:string', 'ref'=>'xsd:string', 'ref_ext'=>'xsd:string'), + array('result' => 'tns:result', 'id' => 'xsd:string', 'ref' => 'xsd:string', 'ref_ext' => 'xsd:string'), $ns, $ns.'#updateInvoice', $styledoc, @@ -340,29 +341,29 @@ function getInvoice($authentication, $id = 0, $ref = '', $ref_ext = '') foreach ($invoice->lines as $line) { //var_dump($line); exit; $linesresp[] = array( - 'id'=>$line->id, - 'type'=>$line->product_type, - 'desc'=>dol_htmlcleanlastbr($line->desc), - 'total_net'=>$line->total_ht, - 'total_vat'=>$line->total_tva, - 'total'=>$line->total_ttc, - 'vat_rate'=>$line->tva_tx, - 'qty'=>$line->qty, - 'unitprice'=> $line->subprice, - 'date_start'=> $line->date_start ? dol_print_date($line->date_start, 'dayrfc') : '', - 'date_end'=> $line->date_end ? dol_print_date($line->date_end, 'dayrfc') : '', - 'product_id'=>$line->fk_product, - 'product_ref'=>$line->product_ref, - 'product_label'=>$line->product_label, - 'product_desc'=>$line->product_desc, + 'id' => $line->id, + 'type' => $line->product_type, + 'desc' => dol_htmlcleanlastbr($line->desc), + 'total_net' => $line->total_ht, + 'total_vat' => $line->total_tva, + 'total' => $line->total_ttc, + 'vat_rate' => $line->tva_tx, + 'qty' => $line->qty, + 'unitprice' => $line->subprice, + 'date_start' => $line->date_start ? dol_print_date($line->date_start, 'dayrfc') : '', + 'date_end' => $line->date_end ? dol_print_date($line->date_end, 'dayrfc') : '', + 'product_id' => $line->fk_product, + 'product_ref' => $line->product_ref, + 'product_label' => $line->product_label, + 'product_desc' => $line->product_desc, ); $i++; } // Create invoice $objectresp = array( - 'result'=>array('result_code'=>'OK', 'result_label'=>''), - 'invoice'=>array( + 'result' => array('result_code' => 'OK', 'result_label' => ''), + 'invoice' => array( 'id' => $invoice->id, 'ref' => $invoice->ref, 'ref_ext' => $invoice->ref_ext ? $invoice->ref_ext : '', // If not defined, field is not added into soap @@ -400,7 +401,7 @@ function getInvoice($authentication, $id = 0, $ref = '', $ref_ext = '') } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; @@ -475,20 +476,20 @@ function getInvoicesForThirdParty($authentication, $idthirdparty) $linesresp = array(); foreach ($invoice->lines as $line) { $linesresp[] = array( - 'id'=>$line->id, - 'type'=>$line->product_type, - 'total_net'=>$line->total_ht, - 'total_vat'=>$line->total_tva, - 'total'=>$line->total_ttc, - 'vat_rate'=>$line->tva_tx, - 'qty'=>$line->qty, - 'unitprice'=> $line->subprice, - 'date_start'=> $line->date_start ? dol_print_date($line->date_start, 'dayrfc') : '', - 'date_end'=> $line->date_end ? dol_print_date($line->date_end, 'dayrfc') : '', - 'product_id'=>$line->fk_product, - 'product_ref'=>$line->product_ref, - 'product_label'=>$line->product_label, - 'product_desc'=>$line->product_desc, + 'id' => $line->id, + 'type' => $line->product_type, + 'total_net' => $line->total_ht, + 'total_vat' => $line->total_tva, + 'total' => $line->total_ttc, + 'vat_rate' => $line->tva_tx, + 'qty' => $line->qty, + 'unitprice' => $line->subprice, + 'date_start' => $line->date_start ? dol_print_date($line->date_start, 'dayrfc') : '', + 'date_end' => $line->date_end ? dol_print_date($line->date_end, 'dayrfc') : '', + 'product_id' => $line->fk_product, + 'product_ref' => $line->product_ref, + 'product_label' => $line->product_label, + 'product_desc' => $line->product_desc, ); } @@ -510,7 +511,7 @@ function getInvoicesForThirdParty($authentication, $idthirdparty) 'total' => $invoice->total_ttc, 'note_private' => $invoice->note_private ? $invoice->note_private : '', 'note_public' => $invoice->note_public ? $invoice->note_public : '', - 'status'=> $invoice->statut, + 'status' => $invoice->statut, 'project_id' => $invoice->fk_project, 'close_code' => $invoice->close_code ? $invoice->close_code : '', 'close_note' => $invoice->close_note ? $invoice->close_note : '', @@ -523,8 +524,8 @@ function getInvoicesForThirdParty($authentication, $idthirdparty) } $objectresp = array( - 'result'=>array('result_code'=>'OK', 'result_label'=>''), - 'invoices'=>$linesinvoice + 'result' => array('result_code' => 'OK', 'result_label' => ''), + 'invoices' => $linesinvoice ); } else { @@ -535,7 +536,7 @@ function getInvoicesForThirdParty($authentication, $idthirdparty) } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; @@ -641,8 +642,8 @@ function createInvoice($authentication, $invoice) if (!$error) { $db->commit(); - $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$new_invoice->id, - 'ref'=>$new_invoice->ref, 'ref_ext'=>$new_invoice->ref_ext); + $objectresp = array('result' => array('result_code' => 'OK', 'result_label' => ''), 'id' => $new_invoice->id, + 'ref' => $new_invoice->ref, 'ref_ext' => $new_invoice->ref_ext); } else { $db->rollback(); $error++; @@ -653,7 +654,7 @@ function createInvoice($authentication, $invoice) } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; @@ -662,11 +663,11 @@ function createInvoice($authentication, $invoice) /** * Create an invoice from an order * - * @param array $authentication Array of authentication information + * @param array{login:string,password:string,entity:?int,dolibarrkey:string} $authentication Array of authentication information * @param string $id_order id of order to copy invoice from * @param string $ref_order ref of order to copy invoice from * @param string $ref_ext_order ref_ext of order to copy invoice from - * @return array Array result + * @return array{result:array{result_code:string,result_label:string},id?:int,ref?:string,ref_ext?:string} Array result */ function createInvoiceFromOrder($authentication, $id_order = '', $ref_order = '', $ref_ext_order = '') { @@ -732,20 +733,20 @@ function createInvoiceFromOrder($authentication, $id_order = '', $ref_order = '' } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } else { - $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref, 'ref_ext'=>$newobject->ref_ext); + $objectresp = array('result' => array('result_code' => 'OK', 'result_label' => ''), 'id' => $newobject->id, 'ref' => $newobject->ref, 'ref_ext' => $newobject->ref_ext); } return $objectresp; } /** - * Uddate an invoice, only change the state of an invoice + * Update an invoice, only change the state of an invoice * - * @param array $authentication Array of authentication information - * @param array $invoice Invoice - * @return array Array result + * @param array{login:string,password:string,entity:?int,dolibarrkey:string} $authentication Array of authentication information + * @param array{id:string,ref:string,ref_ext:string,status?:string} $invoice Invoice + * @return array{result:array{result_code:string,result_label:string},id?:int,ref?:string,ref_ext?:string} Array result */ function updateInvoice($authentication, $invoice) { @@ -808,10 +809,10 @@ function updateInvoice($authentication, $invoice) if ((!$error) && ($objectfound)) { $db->commit(); $objectresp = array( - 'result'=>array('result_code'=>'OK', 'result_label'=>''), - 'id'=>$object->id, - 'ref'=>$object->ref, - 'ref_ext'=>$object->ref_ext + 'result' => array('result_code' => 'OK', 'result_label' => ''), + 'id' => $object->id, + 'ref' => $object->ref, + 'ref_ext' => $object->ref_ext ); } elseif ($objectfound) { $db->rollback(); @@ -826,7 +827,7 @@ function updateInvoice($authentication, $invoice) } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; From aa4b84a01874143fc3025dcba9aed217a84923f3 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 22:53:22 +0100 Subject: [PATCH 1855/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/webservices/server_order.php | 251 ++++++++++++++-------------- 1 file changed, 126 insertions(+), 125 deletions(-) diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 792f7a5889b..11b375e0211 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -2,6 +2,7 @@ /* Copyright (C) 2006-2016 Laurent Destailleur * Copyright (C) 2012 JF FERRY * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,11 +83,11 @@ $server->wsdl->addComplexType( 'all', '', array( - 'dolibarrkey' => array('name'=>'dolibarrkey', 'type'=>'xsd:string'), - 'sourceapplication' => array('name'=>'sourceapplication', 'type'=>'xsd:string'), - 'login' => array('name'=>'login', 'type'=>'xsd:string'), - 'password' => array('name'=>'password', 'type'=>'xsd:string'), - 'entity' => array('name'=>'entity', 'type'=>'xsd:string') + 'dolibarrkey' => array('name' => 'dolibarrkey', 'type' => 'xsd:string'), + 'sourceapplication' => array('name' => 'sourceapplication', 'type' => 'xsd:string'), + 'login' => array('name' => 'login', 'type' => 'xsd:string'), + 'password' => array('name' => 'password', 'type' => 'xsd:string'), + 'entity' => array('name' => 'entity', 'type' => 'xsd:string') ) ); // Define WSDL Return object @@ -97,37 +98,37 @@ $server->wsdl->addComplexType( 'all', '', array( - 'result_code' => array('name'=>'result_code', 'type'=>'xsd:string'), - 'result_label' => array('name'=>'result_label', 'type'=>'xsd:string'), + 'result_code' => array('name' => 'result_code', 'type' => 'xsd:string'), + 'result_label' => array('name' => 'result_label', 'type' => 'xsd:string'), ) ); $line_fields = array( - 'id' => array('name'=>'id', 'type'=>'xsd:string'), - 'type' => array('name'=>'type', 'type'=>'xsd:int'), - 'fk_commande' => array('name'=>'fk_commande', 'type'=>'xsd:int'), - 'fk_parent_line' => array('name'=>'fk_parent_line', 'type'=>'xsd:int'), - 'desc' => array('name'=>'desc', 'type'=>'xsd:string'), - 'qty' => array('name'=>'qty', 'type'=>'xsd:double'), - 'price' => array('name'=>'price', 'type'=>'xsd:double'), - 'unitprice' => array('name'=>'unitprice', 'type'=>'xsd:double'), - 'vat_rate' => array('name'=>'vat_rate', 'type'=>'xsd:double'), + 'id' => array('name' => 'id', 'type' => 'xsd:string'), + 'type' => array('name' => 'type', 'type' => 'xsd:int'), + 'fk_commande' => array('name' => 'fk_commande', 'type' => 'xsd:int'), + 'fk_parent_line' => array('name' => 'fk_parent_line', 'type' => 'xsd:int'), + 'desc' => array('name' => 'desc', 'type' => 'xsd:string'), + 'qty' => array('name' => 'qty', 'type' => 'xsd:double'), + 'price' => array('name' => 'price', 'type' => 'xsd:double'), + 'unitprice' => array('name' => 'unitprice', 'type' => 'xsd:double'), + 'vat_rate' => array('name' => 'vat_rate', 'type' => 'xsd:double'), - 'remise' => array('name'=>'remise', 'type'=>'xsd:double'), - 'remise_percent' => array('name'=>'remise_percent', 'type'=>'xsd:double'), + 'remise' => array('name' => 'remise', 'type' => 'xsd:double'), + 'remise_percent' => array('name' => 'remise_percent', 'type' => 'xsd:double'), - 'total_net' => array('name'=>'total_net', 'type'=>'xsd:double'), - 'total_vat' => array('name'=>'total_vat', 'type'=>'xsd:double'), - 'total' => array('name'=>'total', 'type'=>'xsd:double'), + 'total_net' => array('name' => 'total_net', 'type' => 'xsd:double'), + 'total_vat' => array('name' => 'total_vat', 'type' => 'xsd:double'), + 'total' => array('name' => 'total', 'type' => 'xsd:double'), - 'date_start' => array('name'=>'date_start', 'type'=>'xsd:date'), - 'date_end' => array('name'=>'date_end', 'type'=>'xsd:date'), + 'date_start' => array('name' => 'date_start', 'type' => 'xsd:date'), + 'date_end' => array('name' => 'date_end', 'type' => 'xsd:date'), // From product - 'product_id' => array('name'=>'product_id', 'type'=>'xsd:int'), - 'product_ref' => array('name'=>'product_ref', 'type'=>'xsd:string'), - 'product_label' => array('name'=>'product_label', 'type'=>'xsd:string'), - 'product_desc' => array('name'=>'product_desc', 'type'=>'xsd:string') + 'product_id' => array('name' => 'product_id', 'type' => 'xsd:int'), + 'product_ref' => array('name' => 'product_ref', 'type' => 'xsd:string'), + 'product_label' => array('name' => 'product_label', 'type' => 'xsd:string'), + 'product_desc' => array('name' => 'product_desc', 'type' => 'xsd:string') ); $elementtype = 'commandedet'; @@ -149,7 +150,7 @@ if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafie } else { $type = 'xsd:string'; } - $extrafield_line_array['options_'.$key] = array('name'=>'options_'.$key, 'type'=>$type); + $extrafield_line_array['options_'.$key] = array('name' => 'options_'.$key, 'type' => $type); } } if (is_array($extrafield_line_array)) { @@ -198,39 +199,39 @@ $server->wsdl->addComplexType( ); $order_fields = array( - 'id' => array('name'=>'id', 'type'=>'xsd:string'), - 'ref' => array('name'=>'ref', 'type'=>'xsd:string'), - 'ref_client' => array('name'=>'ref_client', 'type'=>'xsd:string'), - 'ref_ext' => array('name'=>'ref_ext', 'type'=>'xsd:string'), - 'thirdparty_id' => array('name'=>'thirdparty_id', 'type'=>'xsd:int'), - 'status' => array('name'=>'status', 'type'=>'xsd:int'), - 'billed' => array('name'=>'billed', 'type'=>'xsd:string'), - 'total_net' => array('name'=>'total_net', 'type'=>'xsd:double'), - 'total_vat' => array('name'=>'total_vat', 'type'=>'xsd:double'), - 'total_localtax1' => array('name'=>'total_localtax1', 'type'=>'xsd:double'), - 'total_localtax2' => array('name'=>'total_localtax2', 'type'=>'xsd:double'), - 'total' => array('name'=>'total', 'type'=>'xsd:double'), - 'date' => array('name'=>'date', 'type'=>'xsd:date'), - 'date_creation' => array('name'=>'date_creation', 'type'=>'xsd:dateTime'), - 'date_validation' => array('name'=>'date_validation', 'type'=>'xsd:dateTime'), - 'date_modification' => array('name'=>'date_modification', 'type'=>'xsd:dateTime'), - 'source' => array('name'=>'source', 'type'=>'xsd:string'), - 'note_private' => array('name'=>'note_private', 'type'=>'xsd:string'), - 'note_public' => array('name'=>'note_public', 'type'=>'xsd:string'), - 'project_id' => array('name'=>'project_id', 'type'=>'xsd:string'), + 'id' => array('name' => 'id', 'type' => 'xsd:string'), + 'ref' => array('name' => 'ref', 'type' => 'xsd:string'), + 'ref_client' => array('name' => 'ref_client', 'type' => 'xsd:string'), + 'ref_ext' => array('name' => 'ref_ext', 'type' => 'xsd:string'), + 'thirdparty_id' => array('name' => 'thirdparty_id', 'type' => 'xsd:int'), + 'status' => array('name' => 'status', 'type' => 'xsd:int'), + 'billed' => array('name' => 'billed', 'type' => 'xsd:string'), + 'total_net' => array('name' => 'total_net', 'type' => 'xsd:double'), + 'total_vat' => array('name' => 'total_vat', 'type' => 'xsd:double'), + 'total_localtax1' => array('name' => 'total_localtax1', 'type' => 'xsd:double'), + 'total_localtax2' => array('name' => 'total_localtax2', 'type' => 'xsd:double'), + 'total' => array('name' => 'total', 'type' => 'xsd:double'), + 'date' => array('name' => 'date', 'type' => 'xsd:date'), + 'date_creation' => array('name' => 'date_creation', 'type' => 'xsd:dateTime'), + 'date_validation' => array('name' => 'date_validation', 'type' => 'xsd:dateTime'), + 'date_modification' => array('name' => 'date_modification', 'type' => 'xsd:dateTime'), + 'source' => array('name' => 'source', 'type' => 'xsd:string'), + 'note_private' => array('name' => 'note_private', 'type' => 'xsd:string'), + 'note_public' => array('name' => 'note_public', 'type' => 'xsd:string'), + 'project_id' => array('name' => 'project_id', 'type' => 'xsd:string'), - 'mode_reglement_id' => array('name'=>'mode_reglement_id', 'type'=>'xsd:string'), - 'mode_reglement_code' => array('name'=>'mode_reglement_code', 'type'=>'xsd:string'), - 'mode_reglement' => array('name'=>'mode_reglement', 'type'=>'xsd:string'), - 'cond_reglement_id' => array('name'=>'cond_reglement_id', 'type'=>'xsd:string'), - 'cond_reglement_code' => array('name'=>'cond_reglement_code', 'type'=>'xsd:string'), - 'cond_reglement' => array('name'=>'cond_reglement', 'type'=>'xsd:string'), - 'cond_reglement_doc' => array('name'=>'cond_reglement_doc', 'type'=>'xsd:string'), + 'mode_reglement_id' => array('name' => 'mode_reglement_id', 'type' => 'xsd:string'), + 'mode_reglement_code' => array('name' => 'mode_reglement_code', 'type' => 'xsd:string'), + 'mode_reglement' => array('name' => 'mode_reglement', 'type' => 'xsd:string'), + 'cond_reglement_id' => array('name' => 'cond_reglement_id', 'type' => 'xsd:string'), + 'cond_reglement_code' => array('name' => 'cond_reglement_code', 'type' => 'xsd:string'), + 'cond_reglement' => array('name' => 'cond_reglement', 'type' => 'xsd:string'), + 'cond_reglement_doc' => array('name' => 'cond_reglement_doc', 'type' => 'xsd:string'), - 'date_livraison' => array('name'=>'date_livraison', 'type'=>'xsd:date'), - 'demand_reason_id' => array('name'=>'demand_reason_id', 'type'=>'xsd:string'), + 'date_livraison' => array('name' => 'date_livraison', 'type' => 'xsd:date'), + 'demand_reason_id' => array('name' => 'demand_reason_id', 'type' => 'xsd:string'), - 'lines' => array('name'=>'lines', 'type'=>'tns:LinesArray2') + 'lines' => array('name' => 'lines', 'type' => 'tns:LinesArray2') ); $elementtype = 'commande'; @@ -252,7 +253,7 @@ if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafie } else { $type = 'xsd:string'; } - $extrafield_array['options_'.$key] = array('name'=>'options_'.$key, 'type'=>$type); + $extrafield_array['options_'.$key] = array('name' => 'options_'.$key, 'type' => $type); } } if (is_array($extrafield_array)) { @@ -312,8 +313,8 @@ $styleuse = 'encoded'; // encoded/literal/literal wrapped // Register WSDL $server->register( 'getOrder', - array('authentication'=>'tns:authentication', 'id'=>'xsd:string', 'ref'=>'xsd:string', 'ref_ext'=>'xsd:string'), // Entry values - array('result'=>'tns:result', 'order'=>'tns:order'), // Exit values + array('authentication' => 'tns:authentication', 'id' => 'xsd:string', 'ref' => 'xsd:string', 'ref_ext' => 'xsd:string'), // Entry values + array('result' => 'tns:result', 'order' => 'tns:order'), // Exit values $ns, $ns.'#getOrder', $styledoc, @@ -323,8 +324,8 @@ $server->register( $server->register( 'getOrdersForThirdParty', - array('authentication'=>'tns:authentication', 'idthirdparty'=>'xsd:string'), // Entry values - array('result'=>'tns:result', 'orders'=>'tns:OrdersArray2'), // Exit values + array('authentication' => 'tns:authentication', 'idthirdparty' => 'xsd:string'), // Entry values + array('result' => 'tns:result', 'orders' => 'tns:OrdersArray2'), // Exit values $ns, $ns.'#getOrdersForThirdParty', $styledoc, @@ -334,8 +335,8 @@ $server->register( $server->register( 'createOrder', - array('authentication'=>'tns:authentication', 'order'=>'tns:order'), // Entry values - array('result'=>'tns:result', 'id'=>'xsd:string', 'ref'=>'xsd:string'), // Exit values + array('authentication' => 'tns:authentication', 'order' => 'tns:order'), // Entry values + array('result' => 'tns:result', 'id' => 'xsd:string', 'ref' => 'xsd:string'), // Exit values $ns, $ns.'#createOrder', $styledoc, @@ -345,8 +346,8 @@ $server->register( $server->register( 'updateOrder', - array('authentication'=>'tns:authentication', 'order'=>'tns:order'), // Entry values - array('result'=>'tns:result', 'id'=>'xsd:string', 'ref'=>'xsd:string', 'ref_ext'=>'xsd:string'), // Exit values + array('authentication' => 'tns:authentication', 'order' => 'tns:order'), // Entry values + array('result' => 'tns:result', 'id' => 'xsd:string', 'ref' => 'xsd:string', 'ref_ext' => 'xsd:string'), // Exit values $ns, $ns.'#updateOrder', $styledoc, @@ -356,8 +357,8 @@ $server->register( $server->register( 'validOrder', - array('authentication'=>'tns:authentication', 'id'=>'xsd:string', 'id_warehouse'=>'xsd:string'), // Entry values - array('result'=>'tns:result'), // Exit values + array('authentication' => 'tns:authentication', 'id' => 'xsd:string', 'id_warehouse' => 'xsd:string'), // Entry values + array('result' => 'tns:result'), // Exit values $ns, $ns.'#validOrder', $styledoc, @@ -424,34 +425,34 @@ function getOrder($authentication, $id = 0, $ref = '', $ref_ext = '') foreach ($order->lines as $line) { //var_dump($line); exit; $linesresp[] = array( - 'id'=>$line->rowid, - 'fk_commande'=>$line->fk_commande, - 'fk_parent_line'=>$line->fk_parent_line, - 'desc'=>$line->desc, - 'qty'=>$line->qty, - 'price'=>$line->price, - 'unitprice'=>$line->subprice, - 'vat_rate'=>$line->tva_tx, - 'remise'=>$line->remise, - 'remise_percent'=>$line->remise_percent, - 'product_id'=>$line->fk_product, - 'product_type'=>$line->product_type, - 'total_net'=>$line->total_ht, - 'total_vat'=>$line->total_tva, - 'total'=>$line->total_ttc, - 'date_start'=>$line->date_start, - 'date_end'=>$line->date_end, - 'product_ref'=>$line->product_ref, - 'product_label'=>$line->product_label, - 'product_desc'=>$line->product_desc + 'id' => $line->rowid, + 'fk_commande' => $line->fk_commande, + 'fk_parent_line' => $line->fk_parent_line, + 'desc' => $line->desc, + 'qty' => $line->qty, + 'price' => $line->price, + 'unitprice' => $line->subprice, + 'vat_rate' => $line->tva_tx, + 'remise' => $line->remise, + 'remise_percent' => $line->remise_percent, + 'product_id' => $line->fk_product, + 'product_type' => $line->product_type, + 'total_net' => $line->total_ht, + 'total_vat' => $line->total_tva, + 'total' => $line->total_ttc, + 'date_start' => $line->date_start, + 'date_end' => $line->date_end, + 'product_ref' => $line->product_ref, + 'product_label' => $line->product_label, + 'product_desc' => $line->product_desc ); $i++; } // Create order $objectresp = array( - 'result'=>array('result_code'=>'OK', 'result_label'=>''), - 'order'=>array( + 'result' => array('result_code' => 'OK', 'result_label' => ''), + 'order' => array( 'id' => $order->id, 'ref' => $order->ref, 'ref_client' => $order->ref_client, @@ -503,7 +504,7 @@ function getOrder($authentication, $id = 0, $ref = '', $ref_ext = '') } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; @@ -579,26 +580,26 @@ function getOrdersForThirdParty($authentication, $idthirdparty) $linesresp = array(); foreach ($order->lines as $line) { $linesresp[] = array( - 'id'=>$line->rowid, - 'type'=>$line->product_type, - 'fk_commande'=>$line->fk_commande, - 'fk_parent_line'=>$line->fk_parent_line, - 'desc'=>$line->desc, - 'qty'=>$line->qty, - 'price'=>$line->price, - 'unitprice'=>$line->subprice, - 'tva_tx'=>$line->tva_tx, - 'remise'=>$line->remise, - 'remise_percent'=>$line->remise_percent, - 'total_net'=>$line->total_ht, - 'total_vat'=>$line->total_tva, - 'total'=>$line->total_ttc, - 'date_start'=>$line->date_start, - 'date_end'=>$line->date_end, - 'product_id'=>$line->fk_product, - 'product_ref'=>$line->product_ref, - 'product_label'=>$line->product_label, - 'product_desc'=>$line->product_desc + 'id' => $line->rowid, + 'type' => $line->product_type, + 'fk_commande' => $line->fk_commande, + 'fk_parent_line' => $line->fk_parent_line, + 'desc' => $line->desc, + 'qty' => $line->qty, + 'price' => $line->price, + 'unitprice' => $line->subprice, + 'tva_tx' => $line->tva_tx, + 'remise' => $line->remise, + 'remise_percent' => $line->remise_percent, + 'total_net' => $line->total_ht, + 'total_vat' => $line->total_tva, + 'total' => $line->total_ttc, + 'date_start' => $line->date_start, + 'date_end' => $line->date_end, + 'product_id' => $line->fk_product, + 'product_ref' => $line->product_ref, + 'product_label' => $line->product_label, + 'product_desc' => $line->product_desc ); } @@ -644,8 +645,8 @@ function getOrdersForThirdParty($authentication, $idthirdparty) } $objectresp = array( - 'result'=>array('result_code'=>'OK', 'result_label'=>''), - 'orders'=>$linesorders + 'result' => array('result_code' => 'OK', 'result_label' => ''), + 'orders' => $linesorders ); } else { @@ -656,7 +657,7 @@ function getOrdersForThirdParty($authentication, $idthirdparty) } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; @@ -786,7 +787,7 @@ function createOrder($authentication, $order) if ($result >= 0) { dol_syslog("Webservice server_order:: order creation & validation succeeded, commit", LOG_DEBUG); $db->commit(); - $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref); + $objectresp = array('result' => array('result_code' => 'OK', 'result_label' => ''), 'id' => $newobject->id, 'ref' => $newobject->ref); } else { dol_syslog("Webservice server_order:: order creation or validation failed, rollback", LOG_ERR); $db->rollback(); @@ -797,7 +798,7 @@ function createOrder($authentication, $order) } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; @@ -865,10 +866,10 @@ function validOrder($authentication, $id = 0, $id_warehouse = 0) } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } else { $db->commit(); - $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>'')); + $objectresp = array('result' => array('result_code' => 'OK', 'result_label' => '')); } return $objectresp; @@ -878,7 +879,7 @@ function validOrder($authentication, $id = 0, $id_warehouse = 0) * Update an order * * @param array $authentication Array of authentication information - * @param array $order Order info + * @param array{id:string,ref:string,refext:string} $order Order info * @return array Array result */ function updateOrder($authentication, $order) @@ -969,10 +970,10 @@ function updateOrder($authentication, $order) if ((!$error) && ($objectfound)) { $db->commit(); $objectresp = array( - 'result'=>array('result_code'=>'OK', 'result_label'=>''), - 'id'=>$object->id, - 'ref'=>$object->ref, - 'ref_ext'=>$object->ref_ext + 'result' => array('result_code' => 'OK', 'result_label' => ''), + 'id' => $object->id, + 'ref' => $object->ref, + 'ref_ext' => $object->ref_ext ); } elseif ($objectfound) { $db->rollback(); @@ -987,7 +988,7 @@ function updateOrder($authentication, $order) } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; From 5b2758327d0bf3085ee76f19ab94a81569b05fb5 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 22:53:25 +0100 Subject: [PATCH 1856/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/webservices/server_thirdparty.php | 165 ++++++++++++----------- 1 file changed, 84 insertions(+), 81 deletions(-) diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 353387f7681..a768b970652 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -81,11 +82,11 @@ $server->wsdl->addComplexType( 'all', '', array( - 'dolibarrkey' => array('name'=>'dolibarrkey', 'type'=>'xsd:string'), - 'sourceapplication' => array('name'=>'sourceapplication', 'type'=>'xsd:string'), - 'login' => array('name'=>'login', 'type'=>'xsd:string'), - 'password' => array('name'=>'password', 'type'=>'xsd:string'), - 'entity' => array('name'=>'entity', 'type'=>'xsd:string'), + 'dolibarrkey' => array('name' => 'dolibarrkey', 'type' => 'xsd:string'), + 'sourceapplication' => array('name' => 'sourceapplication', 'type' => 'xsd:string'), + 'login' => array('name' => 'login', 'type' => 'xsd:string'), + 'password' => array('name' => 'password', 'type' => 'xsd:string'), + 'entity' => array('name' => 'entity', 'type' => 'xsd:string'), ) ); // Define WSDL Return object @@ -96,48 +97,48 @@ $server->wsdl->addComplexType( 'all', '', array( - 'result_code' => array('name'=>'result_code', 'type'=>'xsd:string'), - 'result_label' => array('name'=>'result_label', 'type'=>'xsd:string'), + 'result_code' => array('name' => 'result_code', 'type' => 'xsd:string'), + 'result_label' => array('name' => 'result_label', 'type' => 'xsd:string'), ) ); $thirdparty_fields = array( - 'id' => array('name'=>'id', 'type'=>'xsd:string'), - 'ref' => array('name'=>'name', 'type'=>'xsd:string'), - 'ref_ext' => array('name'=>'ref_ext', 'type'=>'xsd:string'), - 'fk_user_author' => array('name'=>'fk_user_author', 'type'=>'xsd:string'), - 'status' => array('name'=>'status', 'type'=>'xsd:string'), - 'client' => array('name'=>'client', 'type'=>'xsd:string'), - 'supplier' => array('name'=>'supplier', 'type'=>'xsd:string'), - 'customer_code' => array('name'=>'customer_code', 'type'=>'xsd:string'), - 'supplier_code' => array('name'=>'supplier_code', 'type'=>'xsd:string'), - 'customer_code_accountancy' => array('name'=>'customer_code_accountancy', 'type'=>'xsd:string'), - 'supplier_code_accountancy' => array('name'=>'supplier_code_accountancy', 'type'=>'xsd:string'), - 'date_creation' => array('name'=>'date_creation', 'type'=>'xsd:dateTime'), - 'date_modification' => array('name'=>'date_modification', 'type'=>'xsd:dateTime'), - 'note_private' => array('name'=>'note_private', 'type'=>'xsd:string'), - 'note_public' => array('name'=>'note_public', 'type'=>'xsd:string'), - 'address' => array('name'=>'address', 'type'=>'xsd:string'), - 'zip' => array('name'=>'zip', 'type'=>'xsd:string'), - 'town' => array('name'=>'town', 'type'=>'xsd:string'), - 'region_code' => array('name'=>'region_code', 'type'=>'xsd:string'), - 'country_id' => array('name'=>'country_id', 'type'=>'xsd:string'), - 'country_code' => array('name'=>'country_code', 'type'=>'xsd:string'), - 'country' => array('name'=>'country', 'type'=>'xsd:string'), - 'phone' => array('name'=>'phone', 'type'=>'xsd:string'), - 'fax' => array('name'=>'fax', 'type'=>'xsd:string'), - 'email' => array('name'=>'email', 'type'=>'xsd:string'), - 'url' => array('name'=>'url', 'type'=>'xsd:string'), - 'profid1' => array('name'=>'profid1', 'type'=>'xsd:string'), - 'profid2' => array('name'=>'profid2', 'type'=>'xsd:string'), - 'profid3' => array('name'=>'profid3', 'type'=>'xsd:string'), - 'profid4' => array('name'=>'profid4', 'type'=>'xsd:string'), - 'profid5' => array('name'=>'profid5', 'type'=>'xsd:string'), - 'profid6' => array('name'=>'profid6', 'type'=>'xsd:string'), - 'capital' => array('name'=>'capital', 'type'=>'xsd:string'), - 'vat_used' => array('name'=>'vat_used', 'type'=>'xsd:string'), - 'vat_number' => array('name'=>'vat_number', 'type'=>'xsd:string')); + 'id' => array('name' => 'id', 'type' => 'xsd:string'), + 'ref' => array('name' => 'name', 'type' => 'xsd:string'), + 'ref_ext' => array('name' => 'ref_ext', 'type' => 'xsd:string'), + 'fk_user_author' => array('name' => 'fk_user_author', 'type' => 'xsd:string'), + 'status' => array('name' => 'status', 'type' => 'xsd:string'), + 'client' => array('name' => 'client', 'type' => 'xsd:string'), + 'supplier' => array('name' => 'supplier', 'type' => 'xsd:string'), + 'customer_code' => array('name' => 'customer_code', 'type' => 'xsd:string'), + 'supplier_code' => array('name' => 'supplier_code', 'type' => 'xsd:string'), + 'customer_code_accountancy' => array('name' => 'customer_code_accountancy', 'type' => 'xsd:string'), + 'supplier_code_accountancy' => array('name' => 'supplier_code_accountancy', 'type' => 'xsd:string'), + 'date_creation' => array('name' => 'date_creation', 'type' => 'xsd:dateTime'), + 'date_modification' => array('name' => 'date_modification', 'type' => 'xsd:dateTime'), + 'note_private' => array('name' => 'note_private', 'type' => 'xsd:string'), + 'note_public' => array('name' => 'note_public', 'type' => 'xsd:string'), + 'address' => array('name' => 'address', 'type' => 'xsd:string'), + 'zip' => array('name' => 'zip', 'type' => 'xsd:string'), + 'town' => array('name' => 'town', 'type' => 'xsd:string'), + 'region_code' => array('name' => 'region_code', 'type' => 'xsd:string'), + 'country_id' => array('name' => 'country_id', 'type' => 'xsd:string'), + 'country_code' => array('name' => 'country_code', 'type' => 'xsd:string'), + 'country' => array('name' => 'country', 'type' => 'xsd:string'), + 'phone' => array('name' => 'phone', 'type' => 'xsd:string'), + 'fax' => array('name' => 'fax', 'type' => 'xsd:string'), + 'email' => array('name' => 'email', 'type' => 'xsd:string'), + 'url' => array('name' => 'url', 'type' => 'xsd:string'), + 'profid1' => array('name' => 'profid1', 'type' => 'xsd:string'), + 'profid2' => array('name' => 'profid2', 'type' => 'xsd:string'), + 'profid3' => array('name' => 'profid3', 'type' => 'xsd:string'), + 'profid4' => array('name' => 'profid4', 'type' => 'xsd:string'), + 'profid5' => array('name' => 'profid5', 'type' => 'xsd:string'), + 'profid6' => array('name' => 'profid6', 'type' => 'xsd:string'), + 'capital' => array('name' => 'capital', 'type' => 'xsd:string'), + 'vat_used' => array('name' => 'vat_used', 'type' => 'xsd:string'), + 'vat_number' => array('name' => 'vat_number', 'type' => 'xsd:string')); $elementtype = 'societe'; @@ -159,7 +160,7 @@ if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafie $type = 'xsd:string'; } - $extrafield_array['options_'.$key] = array('name'=>'options_'.$key, 'type'=>$type); + $extrafield_array['options_'.$key] = array('name' => 'options_'.$key, 'type' => $type); } } @@ -186,9 +187,9 @@ $server->wsdl->addComplexType( '', array( //'limit' => array('name'=>'limit','type'=>'xsd:string'), - 'client' => array('name'=>'client', 'type'=>'xsd:string'), - 'supplier' => array('name'=>'supplier', 'type'=>'xsd:string'), - 'category' => array('name'=>'category', 'type'=>'xsd:string') + 'client' => array('name' => 'client', 'type' => 'xsd:string'), + 'supplier' => array('name' => 'supplier', 'type' => 'xsd:string'), + 'category' => array('name' => 'category', 'type' => 'xsd:string') ) ); @@ -200,7 +201,7 @@ $server->wsdl->addComplexType( 'SOAP-ENC:Array', array(), array( - array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType'=>'tns:thirdparty[]') + array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:thirdparty[]') ), 'tns:thirdparty' ); @@ -232,9 +233,9 @@ $styleuse = 'encoded'; // encoded/literal/literal wrapped $server->register( 'getThirdParty', // Entry values - array('authentication'=>'tns:authentication', 'id'=>'xsd:string', 'ref'=>'xsd:string', 'ref_ext'=>'xsd:string', 'barcode'=>'xsd:string', 'profid1'=>'xsd:string', 'profid2'=>'xsd:string'), + array('authentication' => 'tns:authentication', 'id' => 'xsd:string', 'ref' => 'xsd:string', 'ref_ext' => 'xsd:string', 'barcode' => 'xsd:string', 'profid1' => 'xsd:string', 'profid2' => 'xsd:string'), // Exit values - array('result'=>'tns:result', 'thirdparty'=>'tns:thirdparty'), + array('result' => 'tns:result', 'thirdparty' => 'tns:thirdparty'), $ns, $ns.'#getThirdParty', $styledoc, @@ -246,9 +247,9 @@ $server->register( $server->register( 'createThirdParty', // Entry values - array('authentication'=>'tns:authentication', 'thirdparty'=>'tns:thirdparty'), + array('authentication' => 'tns:authentication', 'thirdparty' => 'tns:thirdparty'), // Exit values - array('result'=>'tns:result', 'id'=>'xsd:string', 'ref'=>'xsd:string'), + array('result' => 'tns:result', 'id' => 'xsd:string', 'ref' => 'xsd:string'), $ns, $ns.'#createThirdParty', $styledoc, @@ -260,9 +261,9 @@ $server->register( $server->register( 'updateThirdParty', // Entry values - array('authentication'=>'tns:authentication', 'thirdparty'=>'tns:thirdparty'), + array('authentication' => 'tns:authentication', 'thirdparty' => 'tns:thirdparty'), // Exit values - array('result'=>'tns:result', 'id'=>'xsd:string'), + array('result' => 'tns:result', 'id' => 'xsd:string'), $ns, $ns.'#updateThirdParty', $styledoc, @@ -275,9 +276,9 @@ $server->register( $server->register( 'getListOfThirdParties', // Entry values - array('authentication'=>'tns:authentication', 'filterthirdparty'=>'tns:filterthirdparty'), + array('authentication' => 'tns:authentication', 'filterthirdparty' => 'tns:filterthirdparty'), // Exit values - array('result'=>'tns:result', 'thirdparties'=>'tns:ThirdPartiesArray2'), + array('result' => 'tns:result', 'thirdparties' => 'tns:ThirdPartiesArray2'), $ns, $ns.'#getListOfThirdParties', $styledoc, @@ -289,9 +290,9 @@ $server->register( $server->register( 'deleteThirdParty', // Entry values - array('authentication'=>'tns:authentication', 'id'=>'xsd:string', 'ref'=>'xsd:string', 'ref_ext'=>'xsd:string'), + array('authentication' => 'tns:authentication', 'id' => 'xsd:string', 'ref' => 'xsd:string', 'ref_ext' => 'xsd:string'), // Exit values - array('result'=>'tns:result', 'id'=>'xsd:string'), + array('result' => 'tns:result', 'id' => 'xsd:string'), $ns, $ns.'#deleteThirdParty', $styledoc, @@ -401,8 +402,8 @@ function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '', $bar // Create $objectresp = array( - 'result'=>array('result_code'=>'OK', 'result_label'=>''), - 'thirdparty'=>$thirdparty_result_fields); + 'result' => array('result_code' => 'OK', 'result_label' => ''), + 'thirdparty' => $thirdparty_result_fields); } elseif ($result == -2) { $error++; $errorcode = 'DUPLICATE_FOUND'; @@ -420,7 +421,7 @@ function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '', $bar } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; @@ -544,7 +545,7 @@ function createThirdParty($authentication, $thirdparty) $newobject->add_commercial($fuser, $thirdparty["commid"]); } - $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref); + $objectresp = array('result' => array('result_code' => 'OK', 'result_label' => ''), 'id' => $newobject->id, 'ref' => $newobject->ref); } else { $db->rollback(); $error++; @@ -554,7 +555,7 @@ function createThirdParty($authentication, $thirdparty) } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; @@ -669,11 +670,13 @@ function updateThirdParty($authentication, $thirdparty) } } + '@phan-var-force array{id:string} $thirdparty'; + if ((!$error) && ($objectfound)) { $db->commit(); $objectresp = array( - 'result'=>array('result_code'=>'OK', 'result_label'=>''), - 'id'=>$object->id + 'result' => array('result_code' => 'OK', 'result_label' => ''), + 'id' => $object->id ); } elseif ($objectfound) { $db->rollback(); @@ -688,7 +691,7 @@ function updateThirdParty($authentication, $thirdparty) } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; @@ -769,16 +772,16 @@ function getListOfThirdParties($authentication, $filterthirdparty) } } - $arraythirdparties[] = array('id'=>$obj->socRowid, - 'ref'=>$obj->ref, - 'ref_ext'=>$obj->ref_ext, - 'address'=>$obj->address, - 'zip'=>$obj->zip, - 'town'=>$obj->town, - 'country'=>$obj->country, - 'phone'=>$obj->phone, - 'fax'=>$obj->fax, - 'url'=>$obj->url + $arraythirdparties[] = array('id' => $obj->socRowid, + 'ref' => $obj->ref, + 'ref_ext' => $obj->ref_ext, + 'address' => $obj->address, + 'zip' => $obj->zip, + 'town' => $obj->town, + 'country' => $obj->country, + 'phone' => $obj->phone, + 'fax' => $obj->fax, + 'url' => $obj->url ); $arraythirdparties[$i] = array_merge($arraythirdparties[$i], $extrafieldsOptions); @@ -793,13 +796,13 @@ function getListOfThirdParties($authentication, $filterthirdparty) if ($error) { $objectresp = array( - 'result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel), - 'thirdparties'=>$arraythirdparties + 'result' => array('result_code' => $errorcode, 'result_label' => $errorlabel), + 'thirdparties' => $arraythirdparties ); } else { $objectresp = array( - 'result'=>array('result_code' => 'OK', 'result_label' => ''), - 'thirdparties'=>$arraythirdparties + 'result' => array('result_code' => 'OK', 'result_label' => ''), + 'thirdparties' => $arraythirdparties ); } @@ -855,7 +858,7 @@ function deleteThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') if ($result > 0) { $db->commit(); - $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>'')); + $objectresp = array('result' => array('result_code' => 'OK', 'result_label' => '')); } else { $db->rollback(); $error++; @@ -876,7 +879,7 @@ function deleteThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') } if ($error) { - $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)); } return $objectresp; From 0538db746883cbbb7a52817cc79d460fff115b45 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 22:53:28 +0100 Subject: [PATCH 1857/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/website/class/website.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index e77e4b5b3c9..bd5e25f1932 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -1319,7 +1319,7 @@ class Website extends CommonObject dol_syslog("In sql source file, we have the page ID ".$oldid." to replace with the new ID ".$newid.", and we must create the shortcut aliases: ".$reg[3]); //dol_move($conf->website->dir_output.'/'.$object->ref.'/page'.$oldid.'.tpl.php', $conf->website->dir_output.'/'.$object->ref.'/page'.$newid.'.tpl.php', 0, 1, 0, 0); - } elseif (preg_match('/^-- Page ID (\d+).*Aliases\s(.*)\s--;/i', $buf, $reg)) { + } elseif (preg_match('/^-- Page ID (\d+).*Aliases\s(.*)\s--;/i', $buf, /** @var string[] $reg */ $reg)) { // Example of line: "-- Page ID 1__+MAX_llx_website_page__ - Aliases about-us --;" $newid = ($reg[1] + $maxrowid); $aliasesarray = explode(',', $reg[2]); From 10b260a31dfebf220e5ea6112b117f49cd11c341 Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 23:38:50 +0100 Subject: [PATCH 1858/1862] Fix PhanTypeSuspiciousStringExpression --- htdocs/projet/class/task.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index ca0feede6c8..45dcad80025 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1207,7 +1207,7 @@ class Task extends CommonObjectLine { $arrayroles = array(); - dol_syslog(get_class($this)."::getUserRolesForProjectsOrTasks userp=".is_object($userp)." usert=".is_object($usert)." projectid=".$projectid." taskid=".$taskid); + dol_syslog(get_class($this)."::getUserRolesForProjectsOrTasks userp=".json_encode(is_object($userp))." usert=".json_encode(is_object($usert))." projectid=".$projectid." taskid=".$taskid); // We want role of user for a projet or role of user for a task. Both are not possible. if (empty($userp) && empty($usert)) { From 921431dbdcf95421b070cd62c75e4bdb6a96ae7f Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Mar 2024 19:58:26 +0100 Subject: [PATCH 1859/1862] Qual: Enable PhanTypeSuspiciousStringExpression --- dev/tools/phan/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 59853f259ac..4e7977ec76f 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -468,7 +468,7 @@ return [ 'PhanPluginUnknownArrayFunctionParamType', // 'PhanPluginDescriptionlessCommentOnPublicProperty', // 'PhanPluginUnknownFunctionParamType', // Finds certain errors in PHPdoc typing - 'PhanTypeSuspiciousStringExpression', + // 'PhanTypeSuspiciousStringExpression', // 'PhanPluginRedundantAssignment', 'PhanTypeExpectedObjectPropAccess', From 3c968477cbe93d77388860073ed0b64a9aac4559 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 16:37:58 +0100 Subject: [PATCH 1860/1862] Change type of global $website to string --- dev/tools/phan/config.php | 2 +- dev/tools/phan/config_extended.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 4e7977ec76f..9c084b8e0ad 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -179,7 +179,7 @@ $VALID_MODULE_MAPPING = array( 'webportal' => 'WebPortal', 'webservices' => 'WebServices', 'webservicesclient' => 'WebServicesClient', - 'website' => 'Website', + 'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334 'workflow' => 'Workflow', 'workstation' => 'Workstation', 'zapier' => 'Zapier', diff --git a/dev/tools/phan/config_extended.php b/dev/tools/phan/config_extended.php index fc9fe8f6fd9..253032345ae 100644 --- a/dev/tools/phan/config_extended.php +++ b/dev/tools/phan/config_extended.php @@ -178,7 +178,7 @@ $VALID_MODULE_MAPPING = array( 'webportal' => 'WebPortal', 'webservices' => 'WebServices', 'webservicesclient' => 'WebServicesClient', - 'website' => 'Website', + 'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334 'workflow' => 'Workflow', 'workstation' => 'Workstation', 'zapier' => 'Zapier', From 9647c463713cdd76f4205b0e6e4996cfdbd4704b Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 18:20:15 +0100 Subject: [PATCH 1861/1862] Add empty lines to avoid comment alignments --- htdocs/core/lib/functions.lib.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0931f402eb1..f9ce010b82f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11763,12 +11763,14 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * @param string $label Label or tooltip of button if $text is provided. Also used as tooltip in title attribute. Can be escaped HTML content or full simple text. * @param string $text Optional : short label on button. Can be escaped HTML content or full simple text. * @param string $actionType 'default', 'danger', 'email', 'clone', 'cancel', 'delete', ... - * @param string|array $url Url for link or array of subbutton description ('label'=>, 'url'=>, 'lang'=>, 'perm'=> ) - * Example when an array is used: $arrayforbutaction = array( - * 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - * 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("order"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - * 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("invoice"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - * ); + * + * @param string|array $url Url for link or array of subbutton description + * + * Example when an array is used: $arrayforbutaction = array( + * 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + * 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("order"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + * 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("invoice"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + * ); * @param string $id Attribute id of action button. Example 'action-delete'. This can be used for full ajax confirm if this code is reused into the ->formconfirm() method. * @param int|boolean $userRight User action right * // phpcs:disable @@ -13989,7 +13991,7 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show $hookmanager->initHooks(array('main')); } - $parameters = array('message'=>$message, 'params'=>$params); + $parameters = array('message' => $message, 'params' => $params); $reshook = $hookmanager->executeHooks('getErrorRecordNotFound', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks print $hookmanager->resPrint; } From cd3ea72f96eebb23059b1a06468c2d4a9474d443 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 18:35:45 +0100 Subject: [PATCH 1862/1862] Qual: Disable global variable suggestion for $website --- dev/tools/phan/config.php | 4 ++-- dev/tools/phan/config_extended.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 9c084b8e0ad..2bf21dfadab 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -179,7 +179,7 @@ $VALID_MODULE_MAPPING = array( 'webportal' => 'WebPortal', 'webservices' => 'WebServices', 'webservicesclient' => 'WebServicesClient', - 'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334 + 'website' => 'Website', 'workflow' => 'Workflow', 'workstation' => 'Workstation', 'zapier' => 'Zapier', @@ -278,7 +278,7 @@ return [ 'objectoffield' => '\CommonObject', 'senderissupplier' => 'int<0,1,2>', 'user' => '\User', - 'website' => '\WebSite', + 'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334 // Disable because Phan infers Website type 'websitepage' => '\WebSitePage', 'websitepagefile' => 'string', // 'object' => '\CommonObject', // Deprecated, not enabled because conflicts with $object assignments diff --git a/dev/tools/phan/config_extended.php b/dev/tools/phan/config_extended.php index 253032345ae..7a2b4e8238d 100644 --- a/dev/tools/phan/config_extended.php +++ b/dev/tools/phan/config_extended.php @@ -178,7 +178,7 @@ $VALID_MODULE_MAPPING = array( 'webportal' => 'WebPortal', 'webservices' => 'WebServices', 'webservicesclient' => 'WebServicesClient', - 'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334 + 'website' => 'Website', 'workflow' => 'Workflow', 'workstation' => 'Workstation', 'zapier' => 'Zapier', @@ -218,7 +218,7 @@ return [ 'disablemove' => 'int<0,1>', 'disableremove' => 'int<0,1>', // Found in dol_eval - 'website' => '\WebSite', + 'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334 // Disable because Phan infers Website type 'websitepage' => '\WebSitePage', 'websitepagefile' => 'string', 'action' => 'string',

*** Check fields into extra table structure match table of definition. If not add column into table