From afd49868d57022e69967401802eda8e8f2fea02a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 16:32:44 +0100 Subject: [PATCH 01/15] Fix bad route --- htdocs/adherents/class/api_members.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 5225ccb4e93..000ecc26f2b 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -26,6 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; + /** * API class for members * @@ -723,7 +724,7 @@ class Members extends DolibarrApi * @param array $request_data Request data * @return int ID of member type * - * @url POST /types/{id} + * @url POST /types/ * * @throws RestException 403 Access denied * @throws RestException 500 Error when creating Member Type From 6df4a5eded603ef6ff51fae451b70eca7fe0acd4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 16:41:33 +0100 Subject: [PATCH 02/15] Use a better name for thirdparties site account --- ChangeLog | 2 +- htdocs/core/lib/company.lib.php | 3 -- .../societe/class/api_thirdparties.class.php | 46 +++++++++---------- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a123336552..25688ef0ccb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,7 +29,7 @@ The following changes may create regressions for some external modules, but were * Use of dol_eval with parameter $returnvalue=0 is deprecated. * The signature for all ->delete() method has been modified to match the modulebuilder template (so first paramis now always $user), except the delete for thirdparty (still accept the id of thirdparty to delete as first parameter). Will probably be modified into another version. - +* Route for API /thirdparties/gateways has been renamed into /thirdparties/accounts ***** ChangeLog for 19.0.1 compared to 19.0.0 ***** diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 7fca6289c95..7c7fc412669 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -197,9 +197,6 @@ function societe_prepare_head(Societe $object) $title = $langs->trans("PaymentModes"); if (isModEnabled('stripe')) { - //$langs->load("stripe"); - //$title = $langs->trans("BankAccountsAndGateways"); - $servicestatus = 0; if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) { $servicestatus = 1; diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 0f88fefbd2c..612c9c7852c 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1371,7 +1371,7 @@ class Thirdparties extends DolibarrApi } /** - * Get a specific gateway attached to a thirdparty (by specifying the site key) + * Get a specific account attached to a thirdparty (by specifying the site key) * * @param int $id ID of thirdparty * @param string $site Site key @@ -1380,7 +1380,7 @@ class Thirdparties extends DolibarrApi * @throws RestException 401 Unauthorized: User does not have permission to read thirdparties * @throws RestException 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty * - * @url GET {id}/gateways/ + * @url GET {id}/accounts/ */ public function getSocieteAccounts($id, $site = null) { @@ -1404,7 +1404,7 @@ class Thirdparties extends DolibarrApi $result = $this->db->query($sql); if ($result && $this->db->num_rows($result) == 0) { - throw new RestException(404, 'This thirdparty does not have any gateway attached or does not exist.'); + throw new RestException(404, 'This thirdparty does not have any account attached or does not exist.'); } $i = 0; @@ -1440,7 +1440,7 @@ class Thirdparties extends DolibarrApi } /** - * Create and attach a new gateway to an existing thirdparty + * Create and attach a new account to an existing thirdparty * * Possible fields for request_data (request body) are specified in llx_societe_account table.
* See Table llx_societe_account wiki page for more information

@@ -1452,11 +1452,11 @@ class Thirdparties extends DolibarrApi * @return array|mixed * * @throws RestException 401 Unauthorized: User does not have permission to read thirdparties - * @throws RestException 409 Conflict: A SocieteAccount entity (gateway) already exists for this company and site. + * @throws RestException 409 Conflict: An Account already exists for this company and site. * @throws RestException 422 Unprocessable Entity: You must pass the site attribute in your request data ! * @throws RestException 500 Internal Server Error: Error creating SocieteAccount account * - * @url POST {id}/gateways + * @url POST {id}/accounts */ public function createSocieteAccount($id, $request_data = null) { @@ -1501,10 +1501,10 @@ class Thirdparties extends DolibarrApi } /** - * Create and attach a new (or replace an existing) specific site gateway to a thirdparty + * Create and attach a new (or replace an existing) specific site account to a thirdparty * * You MUST pass all values to keep (otherwise, they will be deleted) !
- * If you just need to update specific fields prefer PATCH /thirdparties/{id}/gateways/{site} endpoint.

+ * If you just need to update specific fields prefer PATCH /thirdparties/{id}/accounts/{site} endpoint.

* When a SocieteAccount entity does not exist for the id and site * supplied, a new one will be created. In that case fk_soc and site members form * request body payload will be ignored and id and site query strings parameters @@ -1520,7 +1520,7 @@ class Thirdparties extends DolibarrApi * @throws RestException 422 Unprocessable Entity: You must pass the site attribute in your request data ! * @throws RestException 500 Internal Server Error: Error updating SocieteAccount entity * - * @url PUT {id}/gateways/{site} + * @url PUT {id}/accounts/{site} */ public function putSocieteAccount($id, $site, $request_data = null) { @@ -1564,7 +1564,7 @@ class Thirdparties extends DolibarrApi $result = $this->db->query($sql); if ($result && $this->db->num_rows($result) !== 0) { - throw new RestException(409, "You are trying to update this thirdparty SocieteAccount (gateway record) from $site to ".$request_data['site']." but another SocieteAccount entity already exists with this site key."); + throw new RestException(409, "You are trying to update this thirdparty Account for $site to ".$request_data['site']." but another Account already exists with this site key."); } } @@ -1601,7 +1601,7 @@ class Thirdparties extends DolibarrApi } /** - * Update specified values of a specific gateway attached to a thirdparty + * Update specified values of a specific account attached to a thirdparty * * @param int $id Id of thirdparty * @param string $site Site key @@ -1614,7 +1614,7 @@ class Thirdparties extends DolibarrApi * @throws RestException 409 Conflict: Another SocieteAccount entity already exists for this thirdparty with this site key. * @throws RestException 500 Internal Server Error: Error updating SocieteAccount entity * - * @url PATCH {id}/gateways/{site} + * @url PATCH {id}/accounts/{site} */ public function patchSocieteAccount($id, $site, $request_data = null) { @@ -1626,7 +1626,7 @@ class Thirdparties extends DolibarrApi $result = $this->db->query($sql); if ($result && $this->db->num_rows($result) == 0) { - throw new RestException(404, "This thirdparty does not have $site gateway attached or does not exist."); + throw new RestException(404, "This thirdparty does not have $site account attached or does not exist."); } else { // If the user tries to edit the site member, we check first if if (isset($request_data['site']) && $request_data['site'] !== $site) { @@ -1634,7 +1634,7 @@ class Thirdparties extends DolibarrApi $result = $this->db->query($sql); if ($result && $this->db->num_rows($result) !== 0) { - throw new RestException(409, "You are trying to update this thirdparty SocieteAccount (gateway record) site member from ".$site." to ".$request_data['site']." but another SocieteAccount entity already exists for this thirdparty with this site key."); + throw new RestException(409, "You are trying to update this thirdparty Account for ".$site." to ".$request_data['site']." but another Account already exists for this thirdparty with this site key."); } } @@ -1663,17 +1663,17 @@ class Thirdparties extends DolibarrApi } /** - * Delete a specific site gateway attached to a thirdparty (by gateway id) + * Delete a specific site account attached to a thirdparty (by account id) * * @param int $id ID of thirdparty * @param int $site Site key * * @return void - * @throws RestException 401 Unauthorized: User does not have permission to delete thirdparties gateways + * @throws RestException 401 Unauthorized: User does not have permission to delete thirdparties accounts * @throws RestException 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty * @throws RestException 500 Internal Server Error: Error deleting SocieteAccount entity * - * @url DELETE {id}/gateways/{site} + * @url DELETE {id}/accounts/{site} */ public function deleteSocieteAccount($id, $site) { @@ -1692,22 +1692,22 @@ class Thirdparties extends DolibarrApi $account->fetch($obj->rowid); if ($account->delete(DolibarrApiAccess::$user) < 0) { - throw new RestException(500, "Error while deleting $site gateway attached to this third party"); + throw new RestException(500, "Error while deleting $site account attached to this third party"); } } } /** - * Delete all gateways attached to a thirdparty + * Delete all accounts attached to a thirdparty * * @param int $id ID of thirdparty * * @return void - * @throws RestException 401 Unauthorized: User does not have permission to delete thirdparties gateways + * @throws RestException 401 Unauthorized: User does not have permission to delete thirdparties accounts * @throws RestException 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty * @throws RestException 500 Internal Server Error: Error deleting SocieteAccount entity * - * @url DELETE {id}/gateways + * @url DELETE {id}/accounts */ public function deleteSocieteAccounts($id) { @@ -1725,7 +1725,7 @@ class Thirdparties extends DolibarrApi $result = $this->db->query($sql); if ($result && $this->db->num_rows($result) == 0) { - throw new RestException(404, 'This third party does not have any gateway attached or does not exist.'); + throw new RestException(404, 'This third party does not have any account attached or does not exist.'); } else { $i = 0; @@ -1736,7 +1736,7 @@ class Thirdparties extends DolibarrApi $account->fetch($obj->rowid); if ($account->delete(DolibarrApiAccess::$user) < 0) { - throw new RestException(500, 'Error while deleting gateways attached to this third party'); + throw new RestException(500, 'Error while deleting account attached to this third party'); } $i++; } From 7ab339e97f4034f6696ba0e18f25920b6193c6f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 17:52:34 +0100 Subject: [PATCH 03/15] Fix regression --- htdocs/comm/propal/class/propal.class.php | 2 -- htdocs/contact/list.php | 2 +- htdocs/core/lib/company.lib.php | 2 +- htdocs/product/stock/list.php | 2 +- htdocs/societe/list.php | 6 +++--- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 39c01663d93..868a16ed304 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -409,8 +409,6 @@ class Propal extends CommonObject */ public function __construct($db, $socid = 0, $propalid = 0) { - global $conf, $langs; - $this->db = $db; $this->socid = $socid; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 96e58140742..8501ef26165 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -101,7 +101,7 @@ $search_sale = GETPOSTINT('search_sale'); $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_status = GETPOST("search_status", "intcomma"); $search_type = GETPOST('search_type', 'alpha'); $search_address = GETPOST('search_address', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 7c7fc412669..7caa6533194 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 $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); - $search_status = GETPOSTINT("search_status"); + $search_status = GETPOST("search_status", "intcomma"); if ($search_status == '') { $search_status = 1; // always display active customer first } diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index ca5bcb5fded..787cc14f779 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -52,7 +52,7 @@ $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hier $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_ref = GETPOST("sref", "alpha") ? GETPOST("sref", "alpha") : GETPOST("search_ref", "alpha"); $search_label = GETPOST("snom", "alpha") ? GETPOST("snom", "alpha") : GETPOST("search_label", "alpha"); -$search_status = GETPOSTINT("search_status"); +$search_status = GETPOST("search_status", "intcomma"); $search_category_list = array(); if (isModEnabled('category')) { diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 19e620f7b8a..099106056b8 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -120,7 +120,7 @@ $search_country = GETPOST("search_country", 'intcomma'); $search_type_thirdparty = GETPOSTINT("search_type_thirdparty"); $search_price_level = GETPOSTINT('search_price_level'); $search_staff = GETPOSTINT("search_staff"); -$search_status = GETPOSTINT("search_status"); +$search_status = GETPOST("search_status", 'intcomma'); $search_type = GETPOST('search_type', 'alpha'); $search_level = GETPOST("search_level", "array:alpha"); $search_stcomm = GETPOST('search_stcomm', "array:int"); @@ -472,8 +472,8 @@ if (empty($reshook)) { } } -if ($search_status == '') { - $search_status = 1; // always display active thirdparty first +if ($search_status == '' && empty($search_all)) { + $search_status = 1; // display active thirdparty only by default } From 4ca754205c008003805d4a35154abc25829c21cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 19:37:00 +0100 Subject: [PATCH 04/15] Fix serch_all --- htdocs/societe/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 099106056b8..c0baeb41882 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -446,6 +446,8 @@ if (empty($reshook)) { $search_level = ''; $search_parent_name = ''; $search_import_key = ''; + + $search_all = ''; $toselect = array(); $search_array_options = array(); } From 4f5c400870d0d0ecf39d908dc91c418ac3f8212a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 19:39:33 +0100 Subject: [PATCH 05/15] Fix missing search_all --- htdocs/modulebuilder/template/myobject_list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 476a429d972..d1bde9d79c5 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -249,6 +249,7 @@ if (empty($reshook)) { $search[$key.'_dtend'] = ''; } } + $search_all = ''; $toselect = array(); $search_array_options = array(); } From a9cae438a60586b9a880f4b3964aa0f4c128701e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 19:43:57 +0100 Subject: [PATCH 06/15] Fix regression --- htdocs/product/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 28af89a6246..f2668099f9f 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; -$type = GETPOSTINT("type"); +$type = GETPOST("type", 'intcomma'); if ($type == '' && !$user->hasRight('produit', 'lire') && $user->hasRight('service', 'lire')) { $type = '1'; // Force global page on service page only } From 65899433fe1cd4e74e187e4ea90af90d030caff7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 19:47:05 +0100 Subject: [PATCH 07/15] Qual: remove $_GET use. --- htdocs/product/index.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index f2668099f9f..9abf9bd5326 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -69,15 +69,15 @@ if ($type == '0') { $transAreaType = $langs->trans("ProductsAndServicesArea"); $helpurl = ''; -if (!isset($_GET["type"])) { +if (!GETPOSTISSET("type")) { $transAreaType = $langs->trans("ProductsAndServicesArea"); $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; } -if ((isset($_GET["type"]) && $_GET["type"] == 0) || !isModEnabled("service")) { +if ((GETPOSTISSET("type") && GETPOST("type") == '0') || !isModEnabled("service")) { $transAreaType = $langs->trans("ProductsArea"); $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; } -if ((isset($_GET["type"]) && $_GET["type"] == 1) || !isModEnabled("product")) { +if ((GETPOSTISSET("type") && GETPOST("type") == '1') || !isModEnabled("product")) { $transAreaType = $langs->trans("ServicesArea"); $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } @@ -310,10 +310,10 @@ if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight("pr if ($num > 0) { $transRecordedType = $langs->trans("LastModifiedProductsAndServices", $max); - if (isset($_GET["type"]) && $_GET["type"] == 0) { + if (GETPOSTISSET("type") && GETPOST("type") == '0') { $transRecordedType = $langs->trans("LastRecordedProducts", $max); } - if (isset($_GET["type"]) && $_GET["type"] == 1) { + if (GETPOSTISSET("type") && GETPOST("type") == '1') { $transRecordedType = $langs->trans("LastRecordedServices", $max); } From 9a281ed2647544824699a4f3ef03b53c6168b418 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 21:21:27 +0100 Subject: [PATCH 08/15] Fix undefined property --- htdocs/adherents/class/api_members.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 000ecc26f2b..889f1212547 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -432,7 +432,12 @@ class Members extends DolibarrApi private function _validate($data) { $member = array(); - foreach (Members::$FIELDS as $field) { + + $mandatoryfields = array( + 'morphy', + 'typeid' + ); + foreach ($mandatoryfields as $field) { if (!isset($data[$field])) { throw new RestException(400, "$field field missing"); } @@ -857,7 +862,10 @@ class Members extends DolibarrApi private function _validateType($data) { $membertype = array(); - foreach (MembersTypes::$FIELDS as $field) { + + $mandatoryfields = array('label'); + + foreach ($mandatoryfields as $field) { if (!isset($data[$field])) { throw new RestException(400, "$field field missing"); } From 826d72d04be5e1e8a4f5f96abeb2352af961c460 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 21:25:15 +0100 Subject: [PATCH 09/15] Qual: Reduce phan baseline (thanks to 'fixes') (#28715) # Qual: Reduce phan baseline (thanks to 'fixes') The number of phan exceptions has been reduced, the baseline is updated accordingly. --- dev/tools/phan/baseline.txt | 246 ++++-------------------------------- 1 file changed, 26 insertions(+), 220 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index dad508e8cf6..3ccb13ee599 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,231 +9,100 @@ */ return [ // # Issue statistics: - // PhanPluginSuspiciousParamPosition : 160+ occurrences - // PhanPluginSuspiciousParamOrder : 130+ occurrences - // PhanParamSignatureMismatch : 45+ occurrences - // PhanPluginDuplicateIfStatements : 40+ occurrences - // PhanPluginDuplicateExpressionBinaryOp : 15+ occurrences + // PhanPluginSuspiciousParamPosition : 45+ occurrences + // PhanPluginDuplicateIfStatements : 30+ occurrences + // PhanParamSignatureMismatch : 25+ occurrences // PhanUndeclaredConstant : 15+ occurrences - // PhanUnreferencedUseNormal : 15+ occurrences - // PhanParamSuspiciousOrder : 10+ occurrences - // PhanPluginSuspiciousParamOrderInternal : 10+ occurrences + // PhanPluginDuplicateExpressionBinaryOp : 10+ occurrences // PhanTypeArraySuspiciousNull : 10+ occurrences - // PhanTypeInvalidUnaryOperandNumeric : 10+ occurrences - // PhanRedefineFunctionInternal : 9 occurrences - // PhanPluginUnsafeEval : 7 occurrences + // PhanTypeInvalidUnaryOperandNumeric : 8 occurrences // PhanPluginDuplicateIfCondition : 6 occurrences - // PhanUndeclaredTypeParameter : 6 occurrences + // PhanRedefineFunctionInternal : 6 occurrences + // PhanPluginUnsafeEval : 5 occurrences + // PhanParamSuspiciousOrder : 4 occurrences // PhanParamTooMany : 4 occurrences - // PhanPluginDuplicateArrayKey : 4 occurrences - // PhanPluginInvalidPregRegexReplacement : 4 occurrences + // PhanPluginSuspiciousParamOrder : 4 occurrences // PhanUndeclaredFunctionInCallable : 4 occurrences - // PhanNoopArrayAccess : 2 occurrences - // PhanTypeMismatchForeach : 2 occurrences // PhanAccessMethodProtected : 1 occurrence // PhanAccessPropertyStaticAsNonStatic : 1 occurrence // PhanNoopArray : 1 occurrence + // PhanNoopArrayAccess : 1 occurrence // PhanNoopStringLiteral : 1 occurrence - // PhanParamTooFew : 1 occurrence - // PhanPowerOfZero : 1 occurrence - // PhanUnextractableAnnotationSuffix : 1 occurrence + // PhanPluginAlwaysReturnFunction : 1 occurrence // Currently, file_suppressions and directory_suppressions are the only supported suppressions 'file_suppressions' => [ - 'htdocs/accountancy/admin/account.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/accountancy/class/bookkeeping.class.php' => ['PhanUndeclaredTypeParameter'], - 'htdocs/accountancy/class/lettering.class.php' => ['PhanParamSuspiciousOrder'], - 'htdocs/accountancy/customer/lines.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/accountancy/customer/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/accountancy/expensereport/lines.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/accountancy/expensereport/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/accountancy/journal/purchasesjournal.php' => ['PhanPluginDuplicateExpressionBinaryOp'], - 'htdocs/accountancy/journal/sellsjournal.php' => ['PhanPluginDuplicateExpressionBinaryOp'], - 'htdocs/accountancy/supplier/lines.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/accountancy/supplier/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/adherents/card.php' => ['PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamOrder'], - 'htdocs/adherents/list.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/adherents/card.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/adherents/stats/geo.php' => ['PhanTypeArraySuspiciousNull'], - 'htdocs/adherents/subscription.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/adherents/type.php' => ['PhanPluginDuplicateExpressionBinaryOp'], - 'htdocs/admin/agenda_extsites.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/admin/dict.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/admin/emailcollector_card.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/admin/mails_templates.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], 'htdocs/admin/receiptprinter.php' => ['PhanRedefineFunctionInternal'], - 'htdocs/admin/system/database.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/admin/system/modules.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/admin/tools/listevents.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/admin/translation.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/admin/triggers.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/api/class/api.class.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanUnreferencedUseNormal'], + 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/bom/bom_list.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/categories/class/api_categories.class.php' => ['PhanAccessMethodProtected'], - 'htdocs/categories/viewcat.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginSuspiciousParamOrder'], + 'htdocs/categories/viewcat.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/collab/index.php' => ['PhanParamTooMany'], - 'htdocs/comm/action/card.php' => ['PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamOrder'], + 'htdocs/comm/action/card.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/comm/action/index.php' => ['PhanPluginSuspiciousParamPosition', 'PhanTypeArraySuspiciousNull', 'PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/comm/action/pertype.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/comm/action/peruser.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/comm/action/rapport/index.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/comm/mailing/advtargetemailing.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/comm/mailing/card.php' => ['PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/comm/mailing/cibles.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], + 'htdocs/comm/mailing/cibles.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/comm/mailing/info.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/comm/propal/list.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/commande/list.php' => ['PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamOrder'], - 'htdocs/commande/list_det.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/commande/list.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/compta/accounting-files.php' => ['PhanTypeInvalidUnaryOperandNumeric'], - 'htdocs/compta/bank/bankentries_list.php' => ['PhanPluginSuspiciousParamOrder'], '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/cashcontrol/class/cashcontrol.class.php' => ['PhanUndeclaredTypeParameter'], - 'htdocs/compta/deplacement/class/deplacementstats.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/compta/facture/agenda-rec.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/facture/card-rec.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/facture/card.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/facture/class/facture.class.php' => ['PhanPluginDuplicateExpressionBinaryOp'], - 'htdocs/compta/facture/invoicetemplate_list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/compta/facture/list.php' => ['PhanPluginDuplicateIfCondition', 'PhanPluginSuspiciousParamOrder'], - 'htdocs/compta/facture/prelevement.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/paiement/cheque/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/compta/paiement/class/paiement.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], - 'htdocs/compta/paiement/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/compta/prelevement/card.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/compta/facture/list.php' => ['PhanPluginDuplicateIfCondition'], 'htdocs/compta/prelevement/class/bonprelevement.class.php' => ['PhanParamTooMany'], 'htdocs/compta/prelevement/create.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/prelevement/fiche-rejet.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/compta/sociales/class/paymentsocialcontribution.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/compta/sociales/document.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/sociales/info.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/sociales/list.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/compta/sociales/note.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/compta/tva/document.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/tva/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/compta/tva/payments.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/actions_massactions.inc.php' => ['PhanParamTooFew', 'PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], + 'htdocs/core/actions_massactions.inc.php' => ['PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamOrder'], 'htdocs/core/class/commondocgenerator.class.php' => ['PhanTypeArraySuspiciousNull'], 'htdocs/core/class/commonobject.class.php' => ['PhanPluginDuplicateIfCondition', 'PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/core/class/commonstickergenerator.class.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/class/dolreceiptprinter.class.php' => ['PhanUnreferencedUseNormal'], 'htdocs/core/class/evalmath.class.php' => ['PhanPluginUnsafeEval'], 'htdocs/core/class/html.form.class.php' => ['PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamPosition'], 'htdocs/core/class/html.formmail.class.php' => ['PhanNoopArray'], 'htdocs/core/class/rssparser.class.php' => ['PhanPluginDuplicateIfStatements', 'PhanUndeclaredFunctionInCallable'], - 'htdocs/core/class/translate.class.php' => ['PhanTypeMismatchForeach'], - 'htdocs/core/class/utils.class.php' => ['PhanPluginSuspiciousParamPosition', 'PhanUnextractableAnnotationSuffix'], 'htdocs/core/db/mysqli.class.php' => ['PhanParamSignatureMismatch', 'PhanPluginDuplicateIfStatements'], '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/company.lib.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/lib/files.lib.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginDuplicateIfCondition','PhanDeprecatedFunctionInternal'], + 'htdocs/core/lib/files.lib.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginDuplicateIfCondition'], 'htdocs/core/lib/ftp.lib.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/core/lib/functions.lib.php' => ['PhanParamTooMany', 'PhanPluginDuplicateIfCondition', 'PhanPluginInvalidPregRegexReplacement', 'PhanPluginUnsafeEval', 'PhanRedefineFunctionInternal'], - 'htdocs/core/lib/functions2.lib.php' => ['PhanParamSuspiciousOrder', 'PhanPluginUnsafeEval'], - 'htdocs/core/lib/json.lib.php' => ['PhanPluginUnsafeEval', 'PhanRedefineFunctionInternal'], - 'htdocs/core/lib/modulebuilder.lib.php' => ['PhanPluginSuspiciousParamPosition'], + 'htdocs/core/lib/functions.lib.php' => ['PhanParamTooMany', 'PhanPluginAlwaysReturnFunction', 'PhanPluginDuplicateIfCondition', 'PhanPluginUnsafeEval', 'PhanRedefineFunctionInternal'], 'htdocs/core/lib/price.lib.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/core/lib/usergroups.lib.php' => ['PhanNoopArrayAccess'], - 'htdocs/core/lib/website.lib.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/login/functions_ldap.php' => ['PhanPluginSuspiciousParamOrderInternal'], 'htdocs/core/menus/standard/auguria_menu.php' => ['PhanParamSuspiciousOrder', 'PhanPluginDuplicateIfStatements'], 'htdocs/core/menus/standard/eldy_menu.php' => ['PhanParamSuspiciousOrder', 'PhanPluginDuplicateIfStatements'], 'htdocs/core/menus/standard/empty.php' => ['PhanParamSuspiciousOrder', 'PhanPluginDuplicateIfStatements'], - 'htdocs/core/modules/bank/doc/pdf_ban.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredTypeParameter'], - 'htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php' => ['PhanParamSignatureMismatch'], - 'htdocs/core/modules/cheque/doc/pdf_blochet.class.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanUndeclaredTypeParameter'], - 'htdocs/core/modules/expedition/doc/pdf_espadon.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/expensereport/doc/pdf_standard.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/facture/doc/pdf_crabe.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/hrm/doc/pdf_standard.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPluginSuspiciousParamPosition'], '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', 'PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal', 'PhanTypeArraySuspiciousNull'], - 'htdocs/core/modules/oauth/generic_oauthcallback.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/core/modules/oauth/google_oauthcallback.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/core/modules/oauth/microsoft_oauthcallback.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/core/modules/oauth/stripelive_oauthcallback.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/core/modules/oauth/stripetest_oauthcallback.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/core/modules/printing/printgcp.modules.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/project/doc/pdf_baleine.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/project/doc/pdf_beluga.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/core/modules/rapport/pdf_paiement.class.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/core/modules/movement/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp'], + 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeArraySuspiciousNull'], 'htdocs/core/modules/societe/mod_codecompta_aquarium.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/core/modules/societe/modules_societe.class.php' => ['PhanPluginDuplicateIfCondition'], - 'htdocs/core/modules/stock/doc/pdf_standard.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredTypeParameter'], - 'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanParamSignatureMismatch', 'PhanParamSuspiciousOrder', 'PhanPluginDuplicateArrayKey'], + 'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanParamSignatureMismatch', 'PhanParamSuspiciousOrder'], 'htdocs/core/modules/syslog/mod_syslog_syslog.php' => ['PhanParamSignatureMismatch'], - 'htdocs/core/tpl/objectline_create.tpl.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/debugbar/class/DataCollector/DolPhpCollector.php' => ['PhanPowerOfZero'], - 'htdocs/debugbar/class/DataCollector/DolQueryCollector.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/debugbar/class/DataCollector/DolibarrCollector.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/don/card.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/don/class/api_donations.class.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/don/class/don.class.php' => ['PhanParamTooMany', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/don/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/don/paiement/list.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/don/class/don.class.php' => ['PhanParamTooMany'], 'htdocs/ecm/index_auto.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/eventorganization/class/conferenceorbooth.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/expedition/list.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/expensereport/card.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/expensereport/class/expensereportstats.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], - 'htdocs/expensereport/payment/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/exports/export.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/exports/index.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/fichinter/card-rec.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/fichinter/list.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/fourn/class/api_supplier_invoices.class.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/fourn/commande/card.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/fourn/facture/card-rec.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/fourn/facture/card.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/fourn/facture/list-rec.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/fourn/facture/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/fourn/paiement/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/holiday/view_log.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/imports/import.php' => ['PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/imports/index.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/install/doctemplates/websites/website_template-corporate/containers/wrapper.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/wrapper.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/install/doctemplates/websites/website_template-noimg/containers/wrapper.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/wrapper.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/install/doctemplates/websites/website_template-restaurant/containers/wrapper.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/install/doctemplates/websites/website_template-stellar/containers/wrapper.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/install/fileconf.php' => ['PhanParamSuspiciousOrder'], 'htdocs/intracommreport/list.php' => ['PhanAccessPropertyStaticAsNonStatic'], 'htdocs/loan/card.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/loan/class/paymentloan.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], @@ -242,86 +111,23 @@ return [ 'htdocs/loan/note.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/loan/payment/card.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/loan/schedule.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/main.inc.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/margin/agentMargins.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/margin/checkMargins.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/margin/customerMargins.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/margin/productMargins.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/margin/tabs/thirdpartyMargins.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/master.inc.php' => ['PhanRedefineFunctionInternal'], - 'htdocs/modulebuilder/index.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/mrp/class/mo.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/product/admin/product_tools.php' => ['PhanNoopStringLiteral'], - 'htdocs/product/agenda.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/product/card.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/product/class/product.class.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/product/inventory/inventory.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/product/popuprop.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/product/price.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], 'htdocs/product/stats/card.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/product/stats/commande.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/commande_fournisseur.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/contrat.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/facture.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/facture_fournisseur.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/facturerec.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/mo.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/propal.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/supplier_proposal.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stock/class/mouvementstock.class.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/product/stock/movement_list.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/product/stock/product.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/product/stock/stats/commande_fournisseur.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stock/stats/expedition.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stock/stats/mo.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stock/stats/reception.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/projet/list.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/projet/tasks/list.php' => ['PhanTypeArraySuspiciousNull'], - 'htdocs/projet/tasks/time.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/public/bookcal/index.php' => ['PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/public/opensurvey/index.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/public/payment/newpayment.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/public/payment/paymentok.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/public/recruitment/index.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/public/webportal/webportal.main.inc.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/public/website/index.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/reception/list.php' => ['PhanNoopArrayAccess', 'PhanPluginSuspiciousParamOrder'], - 'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/salaries/class/salary.class.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/salaries/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/societe/class/companybankaccount.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/societe/class/societe.class.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/societe/list.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/societe/notify/card.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/societe/paymentmodes.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/societe/price.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/takepos/invoice.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/ticket/class/ticketstats.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/ticket/list.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/user/agenda_extsites.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/user/bank.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/user/card.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/user/class/user.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/user/list.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/user/notify/card.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/variants/class/ProductAttribute.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/variants/class/ProductCombination.class.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/webportal/class/html.formwebportal.class.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/webportal/controllers/default.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/webportal/controllers/document.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/webportal/controllers/invoicelist.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/webportal/controllers/login.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/webportal/controllers/membercard.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/webportal/controllers/orderlist.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/webportal/controllers/partnershipcard.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/webportal/controllers/propallist.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/website/class/website.class.php' => ['PhanPluginSuspiciousParamOrder', 'PhanTypeArraySuspiciousNull'], - 'htdocs/website/index.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/website/samples/wrapper.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/lib/json.lib.php' => ['PhanCompatibleNegativeStringOffset'], + 'internal' => ['PhanUndeclaredConstant'], ], // 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed. // (directory_suppressions will currently be ignored by subsequent calls to --save-baseline, but may be preserved in future Phan releases) From 9cc3476765c5590ae19938ef9a4b522f519ca237 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 21:27:09 +0100 Subject: [PATCH 10/15] Fix: PHPDoc annotations in unappropriate comment (#28713) * Fix: PHPDoc annotations in unappropriate comment # Fix: PHPDoc annotations in unappropriate comment PHPDoc annotations need to be in /** */ or // comments. Fixed that (change type, move comment, add suppress directive) * Fix: PHPDoc annotations in unappropriate comment # Fix: PHPDoc annotations in unappropriate comment PHPDoc annotations need to be in /** */ or // comments. Fixed that (change type, move comment, add suppress directive) * Fix: PHPDoc annotations in unappropriate comment # Fix: PHPDoc annotations in unappropriate comment PHPDoc annotations need to be in /** */ or // comments. Fixed that (change type, move comment, add suppress directive) * Fix: PHPDoc annotations in unappropriate comment # Fix: PHPDoc annotations in unappropriate comment PHPDoc annotations need to be in /** */ or // comments. Fixed that (change type, move comment, add suppress directive) * Update dolreceiptprinter.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/api/admin/explorer_withredoc.php | 4 +-- .../class/bonprelevement.class.php | 34 +++++++++---------- htdocs/core/class/dolreceiptprinter.class.php | 6 ++-- htdocs/core/class/rssparser.class.php | 16 ++++----- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/htdocs/api/admin/explorer_withredoc.php b/htdocs/api/admin/explorer_withredoc.php index 8c94e7a6f62..fa370d54c9c 100644 --- a/htdocs/api/admin/explorer_withredoc.php +++ b/htdocs/api/admin/explorer_withredoc.php @@ -14,14 +14,14 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * @deprecated Old explorer. Not using Swagger. See instead explorer in htdocs/api/index.php. */ /** * \defgroup api Module DolibarrApi * \brief API explorer using the swagger.json file * \file htdocs/api/admin/explorer_withredoc.php + * + * @deprecated Old explorer. Not using Swagger. See instead explorer in htdocs/api/index.php. */ require_once '../../main.inc.php'; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 9b3b16b60fc..abda85280a0 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -92,7 +92,7 @@ class BonPrelevement extends CommonObject */ public $file; - /* + /** * @var string filename */ public $filename; @@ -146,21 +146,21 @@ class BonPrelevement 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'=>10, 'notnull'=>1, 'visible'=>0,), - 'ref' => array('type'=>'varchar(12)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>15, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflowmax150', 'showoncombobox'=>'1',), - 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>25, 'notnull'=>0, 'visible'=>-1,), - 'amount' => array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>-1,), - 'statut' => array('type'=>'smallint(6)', 'label'=>'Statut', 'enabled'=>'1', 'position'=>500, 'notnull'=>0, 'visible'=>-1, 'arrayofkeyval'=>array(0=>'Wait', 1=>'Transfered', 2=>'Credited')), - 'credite' => array('type'=>'smallint(6)', 'label'=>'Credite', 'enabled'=>'1', 'position'=>40, 'notnull'=>0, 'visible'=>-1,), - 'note' => array('type'=>'text', 'label'=>'Note', 'enabled'=>'1', 'position'=>45, 'notnull'=>0, 'visible'=>-1,), - 'date_trans' => array('type'=>'datetime', 'label'=>'Datetrans', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>-1,), - 'method_trans' => array('type'=>'smallint(6)', 'label'=>'Methodtrans', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1,), - 'fk_user_trans' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fkusertrans', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>-1, 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150',), - 'date_credit' => array('type'=>'datetime', 'label'=>'Datecredit', 'enabled'=>'1', 'position'=>65, 'notnull'=>0, 'visible'=>-1,), - 'fk_user_credit' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fkusercredit', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>-1, 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150',), - 'type' => array('type'=>'varchar(16)', 'label'=>'Type', 'enabled'=>'1', 'position'=>75, 'notnull'=>0, 'visible'=>-1,), - 'fk_bank_account' => array('type'=>'integer', 'label'=>'Fkbankaccount', 'enabled'=>'1', 'position'=>80, 'notnull'=>0, 'visible'=>-1, 'css'=>'maxwidth500 widthcentpercentminusxx',), + public $fields = array( + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => 0,), + 'ref' => array('type' => 'varchar(12)', 'label' => 'Ref', 'enabled' => '1', 'position' => 15, 'notnull' => 0, 'visible' => -1, 'csslist' => 'tdoverflowmax150', 'showoncombobox' => '1',), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 25, 'notnull' => 0, 'visible' => -1,), + 'amount' => array('type' => 'double(24,8)', 'label' => 'Amount', 'enabled' => '1', 'position' => 30, 'notnull' => 0, 'visible' => -1,), + 'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => '1', 'position' => 500, 'notnull' => 0, 'visible' => -1, 'arrayofkeyval' => array(0 => 'Wait', 1 => 'Transfered', 2 => 'Credited')), + 'credite' => array('type' => 'smallint(6)', 'label' => 'Credite', 'enabled' => '1', 'position' => 40, 'notnull' => 0, 'visible' => -1,), + 'note' => array('type' => 'text', 'label' => 'Note', 'enabled' => '1', 'position' => 45, 'notnull' => 0, 'visible' => -1,), + 'date_trans' => array('type' => 'datetime', 'label' => 'Datetrans', 'enabled' => '1', 'position' => 50, 'notnull' => 0, 'visible' => -1,), + 'method_trans' => array('type' => 'smallint(6)', 'label' => 'Methodtrans', 'enabled' => '1', 'position' => 55, 'notnull' => 0, 'visible' => -1,), + 'fk_user_trans' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fkusertrans', 'enabled' => '1', 'position' => 60, 'notnull' => 0, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150',), + 'date_credit' => array('type' => 'datetime', 'label' => 'Datecredit', 'enabled' => '1', 'position' => 65, 'notnull' => 0, 'visible' => -1,), + 'fk_user_credit' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fkusercredit', 'enabled' => '1', 'position' => 70, 'notnull' => 0, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150',), + 'type' => array('type' => 'varchar(16)', 'label' => 'Type', 'enabled' => '1', 'position' => 75, 'notnull' => 0, 'visible' => -1,), + 'fk_bank_account' => array('type' => 'integer', 'label' => 'Fkbankaccount', 'enabled' => '1', 'position' => 80, 'notnull' => 0, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx',), ); public $rowid; public $ref; @@ -1565,7 +1565,7 @@ class BonPrelevement extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('banktransferdao')); - $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/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 4d8c8b0f785..bc5d8fc9d4e 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -129,7 +129,7 @@ class dolReceiptPrinter extends Printer */ public $db; - /* + /** * @var string[] array of tags */ public $tags; @@ -800,7 +800,7 @@ class dolReceiptPrinter extends Printer $this->printer->text($title.$spaces.str_pad(price($object->total_ttc), 10, ' ', STR_PAD_LEFT)."\n"); break; case 'DOL_PRINT_CURR_DATE': - if (strlen($vals[$tplline]['value'])<2) { + if (strlen($vals[$tplline]['value']) < 2) { $this->printer->text(date('d/m/Y H:i:s')."\n"); } else { $this->printer->text(date($vals[$tplline]['value'])."\n"); @@ -1056,7 +1056,7 @@ class dolReceiptPrinter extends Printer $this->connector = new CupsPrintConnector($parameter); break; default: - $found = false;; + $found = false; break; } if ($found) { diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index d8ae597f9d3..c16cc2d3007 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -503,13 +503,13 @@ class RssParser // Add record to result array $this->_rssarray[$i] = array( - 'link'=>$itemLink, - 'title'=>$itemTitle, - 'description'=>$itemDescription, - 'pubDate'=>$itemPubDate, - 'category'=>$itemCategory, - 'id'=>$itemId, - 'author'=>$itemAuthor + 'link' => $itemLink, + 'title' => $itemTitle, + 'description' => $itemDescription, + 'pubDate' => $itemPubDate, + 'category' => $itemCategory, + 'id' => $itemId, + 'author' => $itemAuthor ); //var_dump($this->_rssarray); @@ -812,7 +812,7 @@ class RssParser } } - +// @phan-suppress PhanPluginPHPDocInWrongComment /* * A method for the xml_set_external_entity_ref_handler() * From d846044e386fa87732181e5191dc1db8474dcdcc Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 21:30:04 +0100 Subject: [PATCH 11/15] Fix: $form argument to price() must be int (#28699) * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 --- htdocs/comm/propal/card.php | 30 +++++++------- htdocs/comm/propal/list.php | 4 +- htdocs/commande/card.php | 40 +++++++++---------- htdocs/commande/list.php | 4 +- htdocs/commande/list_det.php | 4 +- htdocs/compta/bank/releve.php | 4 +- htdocs/compta/facture/card-rec.php | 14 +++---- htdocs/compta/facture/card.php | 26 ++++++------ htdocs/compta/facture/list.php | 4 +- htdocs/compta/facture/prelevement.php | 6 +-- htdocs/compta/paiement/card.php | 6 +-- htdocs/compta/paymentbybanktransfer/index.php | 4 +- htdocs/compta/prelevement/index.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formmargin.class.php | 12 +++--- htdocs/don/card.php | 4 +- .../conferenceorbooth_card.php | 2 +- .../conferenceorbooth_contact.php | 2 +- .../conferenceorbooth_document.php | 2 +- .../conferenceorbooth_list.php | 2 +- .../conferenceorboothattendee_card.php | 2 +- .../conferenceorboothattendee_list.php | 2 +- htdocs/expedition/shipment.php | 8 ++-- htdocs/fourn/commande/card.php | 20 +++++----- htdocs/fourn/facture/card-rec.php | 6 +-- htdocs/fourn/facture/card.php | 12 +++--- htdocs/fourn/paiement/card.php | 2 +- htdocs/fourn/paiement/document.php | 2 +- htdocs/product/composition/card.php | 8 ++-- htdocs/projet/comment.php | 2 +- htdocs/projet/element.php | 6 +-- htdocs/projet/ganttview.php | 2 +- htdocs/projet/tasks.php | 2 +- htdocs/projet/tasks/comment.php | 2 +- htdocs/projet/tasks/contact.php | 2 +- htdocs/projet/tasks/document.php | 2 +- htdocs/projet/tasks/note.php | 2 +- htdocs/projet/tasks/task.php | 2 +- htdocs/projet/tasks/time.php | 2 +- htdocs/societe/card.php | 23 ++++++----- htdocs/supplier_proposal/card.php | 20 +++++----- htdocs/user/bank.php | 6 +-- htdocs/user/card.php | 10 ++--- 43 files changed, 160 insertions(+), 159 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 7a3b3c13cba..6d6ac13c58d 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -834,7 +834,7 @@ if (empty($reshook)) { } elseif ($action == 'import_lines_from_object' && $user->hasRight('propal', 'creer') && $object->statut == Propal::STATUS_DRAFT - ) { + ) { // add lines from objectlinked $fromElement = GETPOST('fromelement'); $fromElementid = GETPOST('fromelementid'); @@ -964,7 +964,7 @@ if (empty($reshook)) { // Define margin $margin_rate = (GETPOST('marginforalllines') ? GETPOST('marginforalllines') : 0); foreach ($object->lines as &$line) { - $subprice = price2num($line->pa_ht * (1 + $margin_rate/100), 'MU'); + $subprice = price2num($line->pa_ht * (1 + $margin_rate / 100), 'MU'); $prod = new Product($db); $prod->fetch($line->fk_product); if ($prod->price_min > $subprice) { @@ -1083,7 +1083,7 @@ if (empty($reshook)) { $pu_ttc_devise = 0; $price_min = 0; $price_min_ttc = 0; - $tva_npr=0; + $tva_npr = 0; $price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT'); $db->begin(); @@ -1245,8 +1245,8 @@ if (empty($reshook)) { } //If text set in desc is the same as product description (as now it's preloaded) we add it only one time - if ($product_desc==$desc && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) { - $product_desc=''; + if ($product_desc == $desc && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) { + $product_desc = ''; } if (!empty($product_desc) && getDolGlobalString('MAIN_NO_CONCAT_DESCRIPTION')) { @@ -2884,35 +2884,35 @@ if ($action == 'create') { print ''; print '' . $langs->trans('AmountHT') . ''; - print '' . price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->multicurrency_total_ht, '', $langs, 1, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . ''; } print ''; print ''; print '' . $langs->trans('AmountVAT') . ''; - print '' . price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency) . ''; + print '' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->multicurrency_total_tva, '', $langs, 1, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . ''; } print ''; if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { print ''; print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ''; - print '' . price($object->total_localtax1, '', $langs, 1, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_localtax1, '', $langs, 1, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . ''; } print ''; if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print ''; print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; - print '' . price($object->total_localtax2, '', $langs, 1, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_localtax2, '', $langs, 1, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . ''; } print ''; } @@ -2920,9 +2920,9 @@ if ($action == 'create') { print ''; print '' . $langs->trans('AmountTTC') . ''; - print '' . price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->multicurrency_total_ttc, '', $langs, 1, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . ''; } print ''; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 0a03d0cc1cd..2bc33b37f3f 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -2256,14 +2256,14 @@ if ($search_date_signature_endyear) { } // Total margin rate if (!empty($arrayfields['total_margin_rate']['checked'])) { - print ''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').''; + print ''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, null, null, null, 2).'%').''; if (!$i) { $totalarray['nbfield']++; } } // Total mark rate if (!empty($arrayfields['total_mark_rate']['checked'])) { - print ''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').''; + print ''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, null, null, null, 2).'%').''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 92621cdfcac..9722ca53344 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -933,8 +933,8 @@ 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 ($product_desc==$desc && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) { - $product_desc=''; + if ($product_desc == $desc && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) { + $product_desc = ''; } if (!empty($product_desc) && getDolGlobalString('MAIN_NO_CONCAT_DESCRIPTION')) { @@ -1523,7 +1523,7 @@ if (empty($reshook)) { if ($action == 'import_lines_from_object' && $usercancreate && $object->statut == Commande::STATUS_DRAFT - ) { + ) { $fromElement = GETPOST('fromelement'); $fromElementid = GETPOST('fromelementid'); $importLines = GETPOST('line_checkbox'); @@ -2782,19 +2782,19 @@ if ($action == 'create' && $usercancreate) { print ''; print '' . $langs->trans('AmountHT') . ''; - print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; print ''; print '' . $langs->trans('AmountVAT') . ''; - print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount VAT - print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; @@ -2802,9 +2802,9 @@ if ($action == 'create' && $usercancreate) { if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { print ''; print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ''; - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; @@ -2812,9 +2812,9 @@ if ($action == 'create' && $usercancreate) { if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print ''; print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; } @@ -2963,7 +2963,7 @@ if ($action == 'create' && $usercancreate) { $arrayforbutaction = array(); // Create a purchase order - $arrayforbutaction[] = array('lang'=>'orders', 'enabled'=>(isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT && $object->getNbOfServicesLines() > 0), 'perm'=>$usercancreatepurchaseorder, 'label'=>'AddPurchaseOrder', 'url'=>'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id); + $arrayforbutaction[] = array('lang' => 'orders', 'enabled' => (isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT && $object->getNbOfServicesLines() > 0), 'perm' => $usercancreatepurchaseorder, 'label' => 'AddPurchaseOrder', 'url' => '/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id); /*if (isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT && $object->getNbOfServicesLines() > 0) { if ($usercancreatepurchaseorder) { print dolGetButtonAction('', $langs->trans('AddPurchaseOrder'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id, ''); @@ -2971,7 +2971,7 @@ if ($action == 'create' && $usercancreate) { }*/ // Create intervention - $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); + $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("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); + $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"); @@ -3002,7 +3002,7 @@ if ($action == 'create' && $usercancreate) { // 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("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); + $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, ''); @@ -3017,11 +3017,11 @@ if ($action == 'create' && $usercancreate) { // Create bill $arrayforbutaction[] = array( - 'lang'=>'bills', - '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 + 'lang' => 'bills', + '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 ); /* if (isModEnabled('facture') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index ea017fbef3b..b84de3413f5 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2554,7 +2554,7 @@ while ($i < $imaxinloop) { // Total margin rate if (!empty($arrayfields['total_margin_rate']['checked'])) { - print ''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').''; + print ''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, null, null, null, 2).'%').''; if (!$i) { $totalarray['nbfield']++; } @@ -2562,7 +2562,7 @@ while ($i < $imaxinloop) { // Total mark rate if (!empty($arrayfields['total_mark_rate']['checked'])) { - print ''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').''; + print ''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, null, null, null, 2).'%').''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 3c0f25f74ac..0eec5b4bb58 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -1997,14 +1997,14 @@ if ($resql) { } // Total margin rate if (!empty($arrayfields['total_margin_rate']['checked'])) { - print ''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').''; + print ''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, null, null, null, 2).'%').''; if (!$i) { $totalarray['nbfield']++; } } // Total mark rate if (!empty($arrayfields['total_mark_rate']['checked'])) { - print ''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').''; + print ''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, null, null, null, 2).'%').''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 97e855217a6..56eb4e93a6c 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -387,7 +387,7 @@ if (empty($numref)) { $balancestart[$objp->numr] = $obj->amount; $db->free($resql); } - print ''.price($balancestart[$objp->numr], '', $langs, 1, -1, -1, empty($object->currency_code) ? $conf->currency : $object->currency_code).''; + print ''.price($balancestart[$objp->numr], 0, $langs, 1, -1, -1, empty($object->currency_code) ? $conf->currency : $object->currency_code).''; // Calculate end amount $sql = "SELECT sum(b.amount) as amount"; @@ -400,7 +400,7 @@ if (empty($numref)) { $content[$objp->numr] = $obj->amount; $db->free($resql); } - print ''.price(($balancestart[$objp->numr] + $content[$objp->numr]), '', $langs, 1, -1, -1, empty($object->currency_code) ? $conf->currency : $object->currency_code).''; + print ''.price(($balancestart[$objp->numr] + $content[$objp->numr]), 0, $langs, 1, -1, -1, empty($object->currency_code) ? $conf->currency : $object->currency_code).''; print ''; if ($user->hasRight('banque', 'consolidate') && $action != 'editbankreceipt') { diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index ab544c4ff70..954b0eb3077 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1129,7 +1129,7 @@ if ($action == 'create') { // Frequency + unit print ''.$form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')).""; print " "; - print $form->selectarray('unit_frequency', array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm')); + print $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm')); print ""; // Date next run @@ -1145,14 +1145,14 @@ if ($action == 'create') { // Auto validate the invoice print "".$langs->trans("StatusOfAutoGeneratedInvoices").""; - $select = array('0'=>$langs->trans('BillStatusDraft'), '1'=>$langs->trans('BillStatusValidated')); + $select = array('0' => $langs->trans('BillStatusDraft'), '1' => $langs->trans('BillStatusValidated')); print $form->selectarray('auto_validate', $select, GETPOST('auto_validate')); print ""; // Auto generate document if (getDolGlobalString('INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION')) { print "".$langs->trans("StatusOfGeneratedDocuments").""; - $select = array('0'=>$langs->trans('DoNotGenerateDoc'), '1'=>$langs->trans('AutoGenerateDoc')); + $select = array('0' => $langs->trans('DoNotGenerateDoc'), '1' => $langs->trans('AutoGenerateDoc')); print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf')); print ""; } else { @@ -1308,11 +1308,11 @@ if ($action == 'create') { // Amount (excl. tax) print ''.$langs->trans("AmountHT").''; - print ''.price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency).''; + print ''.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).''; print ''; // Amount tax - print ''.$langs->trans("AmountVAT").''.price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency).''; + print ''.$langs->trans("AmountVAT").''.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).''; print ''; // Amount Local Taxes @@ -1325,7 +1325,7 @@ if ($action == 'create') { print ''.price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).''; } - print ''.$langs->trans("AmountTTC").''.price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency).''; + print ''.$langs->trans("AmountTTC").''.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).''; print ''; @@ -1543,7 +1543,7 @@ if ($action == 'create') { print ''; print ''; print ''; print '
'; print " "; - print $form->selectarray('unit_frequency', array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm')); + print $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm')); print '
'; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 7127c824434..9d277f17bc3 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1625,7 +1625,7 @@ if (empty($reshook)) { $descline = '(DEPOSIT)'; //$descline.= ' - '.$langs->trans($arraylist[$typeamount]); if ($typeamount == 'amount') { - $descline .= ' ('.price($valuedeposit, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')'; + $descline .= ' ('.price($valuedeposit, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')'; } elseif ($typeamount == 'variable') { $descline .= ' ('.$valuedeposit.'%)'; } @@ -3356,12 +3356,12 @@ if ($action == 'create') { $arrayoutstandingbills = $soc->getOutstandingBills(); $outstandingBills = $arrayoutstandingbills['opened']; print ' - '.$langs->trans('CurrentOutstandingBill').': '; - print ''.price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency).''; + print ''.price($outstandingBills, 0, $langs, 0, 0, -1, $conf->currency).''; if ($soc->outstanding_limit != '') { if ($outstandingBills > $soc->outstanding_limit) { print img_warning($langs->trans("OutstandingBillReached")); } - print ' / '.price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency); + print ' / '.price($soc->outstanding_limit, 0, $langs, 0, 0, -1, $conf->currency); } print ''; print ''."\n"; @@ -4987,20 +4987,20 @@ if ($action == 'create') { print ''; // Amount HT print '' . $langs->trans('AmountHT') . ''; - print '' . price($sign * $object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print '' . price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; print ''; // Amount VAT print '' . $langs->trans('AmountVAT') . ''; - print '' . price($sign * $object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount VAT - print '' . price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; @@ -5008,18 +5008,18 @@ if ($action == 'create') { if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { print ''; print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ''; - print '' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { print ''; print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; - print '' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; } @@ -5082,10 +5082,10 @@ if ($action == 'create') { print ''; // Amount TTC print '' . $langs->trans('AmountTTC') . ''; - print '' . price($sign * $object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount TTC - print '' . price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 6155dfd9c8a..e897ebd198b 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -2614,14 +2614,14 @@ if ($num > 0) { } // Total margin rate if (!empty($arrayfields['total_margin_rate']['checked'])) { - print ''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').''; + print ''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, null, null, null, 2).'%').''; if (!$i) { $totalarray['nbfield']++; } } // Total mark rate if (!empty($arrayfields['total_mark_rate']['checked'])) { - print ''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').''; + print ''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, null, null, null, 2).'%').''; if (!$i) { $totalarray['nbfield']++; $totalarray['pos'][$totalarray['nbfield']] = 'total_mark_rate'; diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 7912337feeb..33ec278f646 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -640,17 +640,17 @@ if ($object->id > 0) { if (isModEnabled('multicurrency') && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ''.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''; - print ''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_ht, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount VAT print ''.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''; - print ''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_tva, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount TTC print ''.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''; - print ''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_ttc, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; } diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 34b08386bca..535d07b84dd 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -97,7 +97,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'); @@ -314,7 +314,7 @@ print $object->num_payment ? ' - '.$object->num_payment : ''; print ''; // Amount -print ''.$langs->trans('Amount').''.price($object->amount, '', $langs, 0, -1, -1, $conf->currency).''; +print ''.$langs->trans('Amount').''.price($object->amount, 0, $langs, 0, -1, -1, $conf->currency).''; $disable_delete = 0; // Bank account @@ -563,7 +563,7 @@ if ($resql) { // Status print ''.$invoice->getLibStatut(5, $alreadypayed).''; - $parameters = array('fk_paiement'=> (int) $object->id); + $parameters = array('fk_paiement' => (int) $object->id); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook print "\n"; diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index 8848d70c325..9b42490727d 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -113,7 +113,7 @@ if (isModEnabled('salaries')) { print ''.$langs->trans("Total").''; print ''; -print price($totaltoshow, '', '', 1, -1, -1, 'auto'); +print price($totaltoshow, 0, '', 1, -1, -1, 'auto'); print '
'; @@ -226,7 +226,7 @@ if (isModEnabled('salaries')) { print ''.$langs->trans("SalaryInvoiceWaitingWithdraw").' ('.$numRow.')'; if ($numRow) { - while ($j < $numRow && $j<10) { + while ($j < $numRow && $j < 10) { $objSalary = $db->fetch_object($resql2); $user->fetch($objSalary->fk_user); diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index b8c75847372..e123c7692f6 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -93,7 +93,7 @@ print ''; print ''.$langs->trans("AmountToWithdraw").''; print ''; -print price($bprev->SommeAPrelever('direct-debit'), '', '', 1, -1, -1, 'auto'); +print price($bprev->SommeAPrelever('direct-debit'), 0, '', 1, -1, -1, 'auto'); print '
'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 630602e2c75..4a43106e8dc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -349,7 +349,7 @@ class Form } elseif (preg_match('/^url/', $typeofdata)) { $ret .= dol_print_url($value, '_blank', 32, 1); } elseif (preg_match('/^(amount|numeric)/', $typeofdata)) { - $ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : ''); + $ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : ''); } elseif (preg_match('/^checkbox/', $typeofdata)) { $tmp = explode(':', $typeofdata); $ret .= ''; diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 1d3e3330032..c99648c9993 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -272,10 +272,10 @@ class FormMargin print '' . price($marginInfo['pa_products']) . ''; print '' . price($marginInfo['margin_on_products']) . ''; if (getDolGlobalString('DISPLAY_MARGIN_RATES')) { - print '' . (($marginInfo['margin_rate_products'] == '') ? '' : price($marginInfo['margin_rate_products'], null, null, null, null, 2) . '%') . ''; + print '' . (($marginInfo['margin_rate_products'] == '') ? '' : price($marginInfo['margin_rate_products'], 0, null, null, null, 2) . '%') . ''; } if (getDolGlobalString('DISPLAY_MARK_RATES')) { - print '' . (($marginInfo['mark_rate_products'] == '') ? '' : price($marginInfo['mark_rate_products'], null, null, null, null, 2) . '%') . ''; + print '' . (($marginInfo['mark_rate_products'] == '') ? '' : price($marginInfo['mark_rate_products'], 0, null, null, null, 2) . '%') . ''; } print ''; } @@ -287,10 +287,10 @@ class FormMargin print '' . price($marginInfo['pa_services']) . ''; print '' . price($marginInfo['margin_on_services']) . ''; if (getDolGlobalString('DISPLAY_MARGIN_RATES')) { - print '' . (($marginInfo['margin_rate_services'] == '') ? '' : price($marginInfo['margin_rate_services'], null, null, null, null, 2) . '%') . ''; + print '' . (($marginInfo['margin_rate_services'] == '') ? '' : price($marginInfo['margin_rate_services'], 0, null, null, null, 2) . '%') . ''; } if (getDolGlobalString('DISPLAY_MARK_RATES')) { - print '' . (($marginInfo['mark_rate_services'] == '') ? '' : price($marginInfo['mark_rate_services'], null, null, null, null, 2) . '%') . ''; + print '' . (($marginInfo['mark_rate_services'] == '') ? '' : price($marginInfo['mark_rate_services'], 0, null, null, null, 2) . '%') . ''; } print ''; } @@ -302,10 +302,10 @@ class FormMargin print '' . price($marginInfo['pa_total']) . ''; print '' . price($marginInfo['total_margin']) . ''; if (getDolGlobalString('DISPLAY_MARGIN_RATES')) { - print '' . (($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2) . '%') . ''; + print '' . (($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, null, null, null, 2) . '%') . ''; } if (getDolGlobalString('DISPLAY_MARK_RATES')) { - print '' . (($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2) . '%') . ''; + print '' . (($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, null, null, null, 2) . '%') . ''; } print ''; } diff --git a/htdocs/don/card.php b/htdocs/don/card.php index d925aa68368..06546f208d1 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -453,12 +453,12 @@ if ($action == 'create') { $arrayoutstandingbills = $soc->getOutstandingBills(); $outstandingBills = $arrayoutstandingbills['opened']; print ' ('.$langs->trans('CurrentOutstandingBill').': '; - print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency); + print price($outstandingBills, 0, $langs, 0, 0, -1, $conf->currency); if ($soc->outstanding_limit != '') { if ($outstandingBills > $soc->outstanding_limit) { print img_warning($langs->trans("OutstandingBillReached")); } - print ' / '.price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency); + print ' / '.price($soc->outstanding_limit, 0, $langs, 0, 0, -1, $conf->currency); } print ')'; print ''; diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 06fb0af4299..77ee9b6abd5 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -273,7 +273,7 @@ if (!empty($withproject)) { // Budget print ''.$langs->trans("Budget").''; if (strcmp($projectstatic->budget_amount, '')) { - print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + print ''.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print ''; diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index bb19456cd2c..201dc52710b 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -261,7 +261,7 @@ if (!empty($withproject)) { // Budget print ''.$langs->trans("Budget").''; if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index 16ab981af3b..788128a6906 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -234,7 +234,7 @@ if (!empty($withproject)) { // Budget print ''.$langs->trans("Budget").''; if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index a2b370ba6f4..9ee0be54b58 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -389,7 +389,7 @@ if ($projectid > 0) { // Budget print ''.$langs->trans("Budget").''; if (strcmp($project->budget_amount, '')) { - print ''.price($project->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + print ''.price($project->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print ''; diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index a83218f0a12..b57b5180bf5 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -309,7 +309,7 @@ if (!empty($withproject)) { // Budget print ''.$langs->trans("Budget").''; if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index afb8f29d942..cbaf93a8f45 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -488,7 +488,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { // Budget print ''.$langs->trans("Budget").''; if (strcmp($projectstatic->budget_amount, '')) { - print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + print ''.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print ''; diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 7a3347098ab..fe20c6ed008 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -547,17 +547,17 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled("multicurrency") && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ''.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''; - print ''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_ht, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount VAT print ''.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''; - print ''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_tva, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount TTC print ''.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''; - print ''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_ttc, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; } @@ -772,7 +772,7 @@ if ($id > 0 || !empty($ref)) { // Qty remains to ship print ''; - if ($type == 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')|| getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) { + if ($type == 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES') || getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) { $toBeShipped[$objp->fk_product] = $objp->qty - $qtyAlreadyShipped; $toBeShippedTotal += $toBeShipped[$objp->fk_product]; print $toBeShipped[$objp->fk_product]; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 0171b5d597d..85de2e7fb6f 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2340,20 +2340,20 @@ if ($action == 'create') { print ''; // Amount HT print '' . $langs->trans('AmountHT') . ''; - print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; print ''; // Amount VAT print '' . $langs->trans('AmountVAT') . ''; - print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount VAT - print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; @@ -2361,18 +2361,18 @@ if ($action == 'create') { if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { print ''; print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ''; - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print ''; print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; } @@ -2386,10 +2386,10 @@ if ($action == 'create') { print ''; // Amount TTC print '' . $langs->trans('AmountTTC') . ''; - print '' . price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . $alert . ''; + print '' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . $alert . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount TTC - print '' . price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index d4581c706b3..c3d748e81d1 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -1205,10 +1205,10 @@ if ($action == 'create') { print ''; print '' . $langs->trans('AmountHT') . ''; - print '' . price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . ''; print ''; - print '' . $langs->trans("AmountVAT") . '' . price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency) . ''; + print '' . $langs->trans("AmountVAT") . '' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . ''; print ''; // Amount Local Taxes @@ -1221,7 +1221,7 @@ if ($action == 'create') { print '' . price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency) . ''; } - print '' . $langs->trans("AmountTTC") . '' . price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency) . ''; + print '' . $langs->trans("AmountTTC") . '' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . ''; print ''; // Payment term diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index c6b9c6457e5..8244ed6e8af 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1224,7 +1224,7 @@ if (empty($reshook)) { $descline = '(DEPOSIT)'; //$descline.= ' - '.$langs->trans($arraylist[$typeamount]); if ($typeamount == 'amount') { - $descline .= ' ('.price($valuedeposit, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')'; + $descline .= ' ('.price($valuedeposit, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')'; } elseif ($typeamount == 'variable') { $descline .= ' ('.$valuedeposit.'%)'; } @@ -3535,9 +3535,9 @@ if ($action == 'create') { print ''; print '' . $langs->trans('AmountHT') . ''; - print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; @@ -3568,7 +3568,7 @@ if ($action == 'create') { print price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency); print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; @@ -3587,9 +3587,9 @@ if ($action == 'create') { print ''; print '' . $langs->trans('AmountTTC') . ''; - print '' . price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 0987ec11c6f..966cde2511b 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -221,7 +221,7 @@ if ($result > 0) { // Amount print ''.$langs->trans('Amount').''; - print ''.price($object->amount, '', $langs, 0, 0, -1, $conf->currency).''; + print ''.price($object->amount, 0, $langs, 0, 0, -1, $conf->currency).''; // Status of validation of payment if (getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION')) { diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index b407c489822..db152d3eb47 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -126,7 +126,7 @@ if ($object->id > 0) { $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); // Amount - $morehtmlref .= '
'.$langs->trans('Amount').' : '. price($object->amount, '', $langs, 0, 0, -1, $conf->currency); + $morehtmlref .= '
'.$langs->trans('Amount').' : '. price($object->amount, 0, $langs, 0, 0, -1, $conf->currency); $allow_delete = 1; // Bank account diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 54310e0d759..0292732aefc 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -446,7 +446,7 @@ if ($id > 0 || !empty($ref)) { $total += $totalline; print ''; - print($notdefined ? '' : ($value['nb'] > 1 ? $value['nb'].'x ' : '').''.price($unitline, '', '', 0, 0, -1, $conf->currency)).''; + print($notdefined ? '' : ($value['nb'] > 1 ? $value['nb'].'x ' : '').''.price($unitline, 0, '', 0, 0, -1, $conf->currency)).''; print ''; // Best selling price @@ -460,7 +460,7 @@ if ($id > 0 || !empty($ref)) { print ''; print($notdefined ? '' : ($value['nb'] > 1 ? $value['nb'].'x ' : '')); if (is_numeric($pricesell)) { - print ''.price($pricesell, '', '', 0, 0, -1, $conf->currency).''; + print ''.price($pricesell, 0, '', 0, 0, -1, $conf->currency).''; } else { print ''.$langs->trans($pricesell).''; } @@ -567,7 +567,7 @@ if ($id > 0 || !empty($ref)) { if ($atleastonenotdefined) { print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')'; } - print($atleastonenotdefined ? '' : price($total, '', '', 0, 0, -1, $conf->currency)); + print($atleastonenotdefined ? '' : price($total, 0, '', 0, 0, -1, $conf->currency)); print ''; // Minimum selling price @@ -579,7 +579,7 @@ if ($id > 0 || !empty($ref)) { if ($atleastonenotdefined) { print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')'; } - print($atleastonenotdefined ? '' : price($totalsell, '', '', 0, 0, -1, $conf->currency)); + print($atleastonenotdefined ? '' : price($totalsell, 0, '', 0, 0, -1, $conf->currency)); print ''; // Stock diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index 48803930572..299b15c12fa 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -143,7 +143,7 @@ print ''; // Budget print ''.$langs->trans("Budget").''; if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) { - print price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index dd053b04549..310ecd4704e 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -306,14 +306,14 @@ if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { // Opportunity percent print ''.$langs->trans("OpportunityProbability").''; if (!is_null($object->opp_percent) && strcmp($object->opp_percent, '')) { - print price($object->opp_percent, '', $langs, 1, 0).' %'; + print price($object->opp_percent, 0, $langs, 1, 0).' %'; } print ''; // Opportunity Amount print ''.$langs->trans("OpportunityAmount").''; if (!is_null($object->opp_amount) && strcmp($object->opp_amount, '')) { - print ''.price($object->opp_amount, '', $langs, 1, 0, 0, $conf->currency).''; + print ''.price($object->opp_amount, 0, $langs, 1, 0, 0, $conf->currency).''; if (strcmp($object->opp_percent, '')) { print '       '.$langs->trans("Weighted").': '.price($object->opp_amount * $object->opp_percent / 100, 0, $langs, 1, 0, -1, $conf->currency).''; } @@ -324,7 +324,7 @@ if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { // Budget print ''.$langs->trans("Budget").''; if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) { - print ''.price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + print ''.price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print ''; diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 63bbbc3ff6e..6b0e853937f 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -188,7 +188,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) { // Budget print ''.$langs->trans("Budget").''; if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) { - print price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 4ae290dcf7a..c5b496273f9 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -638,7 +638,7 @@ if ($id > 0 || !empty($ref)) { // Budget print ''.$langs->trans("Budget").''; if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) { - print ''.price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + print ''.price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print ''; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 8363c284ba2..4656f02dbed 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -224,7 +224,7 @@ if ($id > 0 || !empty($ref)) { // Budget print ''.$langs->trans("Budget").''; if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 3ae0f6d39e5..f8cc28e05a2 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -260,7 +260,7 @@ if ($id > 0 || !empty($ref)) { // Budget print ''.$langs->trans("Budget").''; if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 207f331d327..7507cafa4b3 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -217,7 +217,7 @@ if ($object->id > 0) { // Budget print ''.$langs->trans("Budget").''; if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 5ef996d2ae5..dfd36d12df7 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -207,7 +207,7 @@ if ($object->id > 0) { // Budget print ''.$langs->trans("Budget").''; if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index d9face5c16a..39a8f5dd7db 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -332,7 +332,7 @@ if ($id > 0 || !empty($ref)) { // Budget print ''.$langs->trans("Budget").''; if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { - print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + print ''.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print ''; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index d4a18ca5fcc..5f079bb44e9 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1009,7 +1009,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Budget print '' . $langs->trans("Budget") . ''; if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { - print '' . price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency) . ''; + print '' . price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency) . ''; } print ''; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index aa8e03f9d5e..134d68a3eab 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -93,7 +93,8 @@ if (isModEnabled('accounting')) { $langs->load("products"); } -$error = 0; $errors = array(); +$error = 0; +$errors = array(); // Get parameters @@ -171,7 +172,7 @@ $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'ro * Actions */ -$parameters = array('id'=>$socid, 'objcanvas'=>$objcanvas); +$parameters = array('id' => $socid, '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'); @@ -292,12 +293,12 @@ if (empty($reshook)) { $error++; } - if (isModEnabled('mailing') && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && GETPOSTINT('contact_no_email')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (isModEnabled('mailing') && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && GETPOSTINT('contact_no_email') == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")), null, 'errors'); } - if (isModEnabled('mailing') && GETPOSTINT("private") == 1 && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && GETPOSTINT('contact_no_email')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (isModEnabled('mailing') && GETPOSTINT("private") == 1 && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && GETPOSTINT('contact_no_email') == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")), null, 'errors'); } @@ -1413,7 +1414,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Status print ''.$form->editfieldkey('Status', 'status', '', $object, 0).''; - print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), 1, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1); + print $form->selectarray('status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), 1, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1); print ''; // Barcode @@ -1728,7 +1729,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Other attributes - $parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); + $parameters = array('socid' => $socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; // Parent company @@ -2167,7 +2168,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Status print ''.$form->editfieldkey('Status', 'status', '', $object, 0).''; - print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $object->status, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1); + print $form->selectarray('status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), $object->status, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1); print ''; // Address @@ -2487,7 +2488,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Other attributes - $parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); + $parameters = array('socid' => $socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; // Parent company @@ -2945,9 +2946,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print ''.$langs->trans('Capital').''; if ($object->capital) { if (isModEnabled("multicurrency") && !empty($object->multicurrency_code)) { - print price($object->capital, '', $langs, 0, -1, -1, $object->multicurrency_code); + print price($object->capital, 0, $langs, 0, -1, -1, $object->multicurrency_code); } else { - print price($object->capital, '', $langs, 0, -1, -1, $conf->currency); + print price($object->capital, 0, $langs, 0, -1, -1, $conf->currency); } } else { print ' '; @@ -3048,7 +3049,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Other attributes - $parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); + $parameters = array('socid' => $socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Parent company diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index e8fc5bf25d1..f072cf540c4 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1825,20 +1825,20 @@ if ($action == 'create') { print ''; // Amount HT print '' . $langs->trans('AmountHT') . ''; - print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; print ''; // Amount VAT print '' . $langs->trans('AmountVAT') . ''; - print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount VAT - print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; @@ -1846,18 +1846,18 @@ if ($action == 'create') { if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { print ''; print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ''; - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print ''; print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; } @@ -1866,10 +1866,10 @@ if ($action == 'create') { print ''; // Amount TTC print '' . $langs->trans('AmountTTC') . ''; - print '' . price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount TTC - print '' . price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 535452175f1..20fa770194a 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -441,7 +441,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac // Salary print ''.$langs->trans("Salary").''; print ''; - print($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''.price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : '').''; + print($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''.price($object->salary, 0, $langs, 1, -1, -1, $conf->currency) : '').''; print ''; print "\n"; @@ -451,7 +451,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm'); print ''; print ''; - print($object->thm != '' ? price($object->thm, '', $langs, 1, -1, -1, $conf->currency) : ''); + print($object->thm != '' ? price($object->thm, 0, $langs, 1, -1, -1, $conf->currency) : ''); print ''; print "\n"; @@ -461,7 +461,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classtjm'); print ''; print ''; - print($object->tjm != '' ? price($object->tjm, '', $langs, 1, -1, -1, $conf->currency) : ''); + print($object->tjm != '' ? price($object->tjm, 0, $langs, 1, -1, -1, $conf->currency) : ''); print ''; print "\n"; } diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 94447146dbf..984bed16d5c 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1657,7 +1657,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Salary print ''.$langs->trans("Salary").''; print ''; - print($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''.price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : '').''; + print($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''.price($object->salary, 0, $langs, 1, -1, -1, $conf->currency) : '').''; print ''; print "\n"; @@ -1667,7 +1667,7 @@ if ($action == 'create' || $action == 'adduserldap') { print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm'); print ''; print ''; - print($object->thm != '' ? price($object->thm, '', $langs, 1, -1, -1, $conf->currency) : ''); + print($object->thm != '' ? price($object->thm, 0, $langs, 1, -1, -1, $conf->currency) : ''); print ''; print "\n"; @@ -1677,7 +1677,7 @@ if ($action == 'create' || $action == 'adduserldap') { print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classtjm'); print ''; print ''; - print($object->tjm != '' ? price($object->tjm, '', $langs, 1, -1, -1, $conf->currency) : ''); + print($object->tjm != '' ? price($object->tjm, 0, $langs, 1, -1, -1, $conf->currency) : ''); print ''; print "\n"; } @@ -2861,7 +2861,7 @@ if ($action == 'create' || $action == 'adduserldap') { if ($caneditfield) { print ''; } else { - print($object->thm != '' ? price($object->thm, '', $langs, 1, -1, -1, $conf->currency) : ''); + print($object->thm != '' ? price($object->thm, 0, $langs, 1, -1, -1, $conf->currency) : ''); } print ''; print "\n"; @@ -2875,7 +2875,7 @@ if ($action == 'create' || $action == 'adduserldap') { if ($caneditfield) { print ''; } else { - print($object->tjm != '' ? price($object->tjm, '', $langs, 1, -1, -1, $conf->currency) : ''); + print($object->tjm != '' ? price($object->tjm, 0, $langs, 1, -1, -1, $conf->currency) : ''); } print ''; print "\n"; From f309d1634cd4ff4765a8db6bbbfe0182b4f5ace8 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 21:30:46 +0100 Subject: [PATCH 12/15] Qual: Better hint for index value for phan (#28712) # Qual: Better hint for index value for phan. ($i - 1) must be >= 0, so update test from $i>0 to $i>=1 . This helps static analysis. --- htdocs/core/lib/json.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index b5a53c7f888..15f54b75f97 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -267,7 +267,7 @@ function dol_json_decode($json, $assoc = false) } else { $out .= $json[$i]; } - if ($i > 0 && $json[$i] == '"' && $json[($i - 1)] != "\\") { + if ($i >= 1 && $json[$i] == '"' && $json[$i - 1] != "\\") { $comment = !$comment; } } From 3d0a85608b0cc884d8b593b9c79544c6e21cfc33 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 21:34:18 +0100 Subject: [PATCH 13/15] Qual: Fix and enable alias deprecation detection (#28716) * Qual: Ignore some false positives for deprecated functions # Qual: Ignore some false positives for deprecated functions The Phan Deprecation Plugin for internal functions has mixed up some mail functions and lists them as deprecated, this ignores that * Qual: Enable detection and fixing of internal deprecations * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Update codespell lines ignore list after format # Qual: Update codespell lines ignore list after forma Done using latest library, so also adds some exceptions that are needed in the future; --------- Co-authored-by: Laurent Destailleur --- .../codespell/codespell-lines-ignore.txt | 16 ++- dev/tools/phan/config.php | 2 +- dev/tools/phan/config_fixer.php | 6 +- htdocs/asset/class/asset.class.php | 64 +++++----- htdocs/asset/class/assetmodel.class.php | 30 ++--- htdocs/bom/class/bom.class.php | 92 +++++++-------- htdocs/bookcal/class/availabilities.class.php | 44 +++---- htdocs/bookcal/class/calendar.class.php | 36 +++--- htdocs/categories/class/categorie.class.php | 16 +-- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/defaultvalues.class.php | 16 +-- htdocs/core/class/timespent.class.php | 42 +++---- htdocs/core/lib/functions.lib.php | 1 + .../class/conferenceorbooth.class.php | 36 +++--- .../class/conferenceorboothattendee.class.php | 2 +- .../fournisseur.commande.dispatch.class.php | 4 +- htdocs/hrm/class/evaluation.class.php | 44 +++---- htdocs/hrm/class/evaluationdet.class.php | 26 ++--- htdocs/hrm/class/job.class.php | 26 ++--- htdocs/hrm/class/position.class.php | 32 ++--- htdocs/hrm/class/skill.class.php | 41 ++++--- htdocs/hrm/class/skilldet.class.php | 18 +-- htdocs/hrm/class/skillrank.class.php | 24 ++-- htdocs/mrp/class/mo.class.php | 110 +++++++++--------- .../class/opensurveysondage.class.php | 40 +++---- .../class/partnership_type.class.php | 16 +-- .../class/stocktransfer.class.php | 58 ++++----- .../class/stocktransferline.class.php | 26 ++--- .../class/recruitmentcandidature.class.php | 52 ++++----- .../class/recruitmentjobposition.class.php | 52 ++++----- htdocs/ticket/class/cticketcategory.class.php | 28 ++--- htdocs/user/class/user.class.php | 24 ++-- htdocs/webhook/class/target.class.php | 34 +++--- htdocs/website/class/websitepage.class.php | 48 ++++---- .../workstation/class/workstation.class.php | 42 +++---- htdocs/zapier/class/hook.class.php | 2 +- 36 files changed, 585 insertions(+), 567 deletions(-) diff --git a/dev/tools/codespell/codespell-lines-ignore.txt b/dev/tools/codespell/codespell-lines-ignore.txt index 5ddee3b9244..94c67e08f75 100644 --- a/dev/tools/codespell/codespell-lines-ignore.txt +++ b/dev/tools/codespell/codespell-lines-ignore.txt @@ -56,7 +56,7 @@ $this->datea = $this->db->jdate($obj->datea); $this->datee = $this->db->jdate($obj->datee); $this->periode = $this->db->jdate($obj->period); - $tmp = array('id_users'=>$obj->id_users, 'nom'=>$obj->name, 'reponses'=>$obj->reponses); + $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", 'alpha'), @@ -73,6 +73,8 @@ $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; + $field = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:).*$/', '', $tmpcrit); // the name of the field + $newcrit = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '', $tmpcrit); $object->datee = $datee; $object->periode = $dateperiod; $return .= '
'.$langs->trans("Payement").' : '.$this->type_payment.''; @@ -97,16 +99,19 @@ $taskstatic->datee = $db->jdate($obj->date_end); $this->category->childs = array(); $this->datea = dol_now(); + $tmpcrit = preg_replace('/^.*(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '\1', $tmpcrit); // the condition after the name of the field 'datee' => $date_end, // mise a jour des reponses utilisateurs dans la base if (!empty($arrayfields['t.datee']['checked'])) { if ($user->hasRight('stock', 'mouvement', 'lire')) { if (empty($reyear) || empty($remonth) || empty($reday)) { jQuery("#mouvement").change(function() { + preg_match('/:([!<>=\s]+|in|notin|like|notlike):/', $tmpcrit, $reg); print $form->selectDate($object->periode, 'period', 0, 0, 0, 'charge', 1); print ''.$langs->trans("TransferStock").''; print ''.$langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")).''; print ''.dol_print_date($db->jdate($obj->periode), 'day').''; + print ''.$langs->trans("AddIn").''; print dol_print_date($object->periode, "day"); $TWeek[$week_number] = $week_number; $action = 'transfert'; @@ -174,6 +179,8 @@ if (in_array('01', $TWeek) && in_array('52', $TWeek) && $weekNb == '01') { print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0); print $object->datee ? dol_print_date($object->datee, 'daytext') : ' '; + print ''; + print ''.$langs->trans("AddIn").''; print ''.$langs->trans("Datee").''; print_liste_field_titre($arrayfields['t.datee']['label'], $_SERVER["PHP_SELF"], "t.datee", '', $param, '', $sortfield, $sortorder, 'center '); * @param string $datee End date (ex 23:59:59) @@ -189,6 +196,8 @@ $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'); + $inj += preg_match('/on(dblclick|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)[a-z]*\s*=/i', $tmpval); + $inj += preg_match('/on(dblclick|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)[a-z]*\s*=/i', $val); $morewherefilterarray[] = " t.datee <= '".$db->idate($search_date_end_end)."'"; $morewherefilterarray[] = " t.datee >= '".$db->idate($search_date_end_start)."'"; $opensurveysondage->mail_admin = $_SESSION['adresse']; @@ -221,7 +230,8 @@ $sql2 .= " s.logo, s.email, s.entity, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_percent, p.opp_amount, p.dateo, p.datee"; $title = $langs->trans('Batch')." ".$shortlabel." - ".$langs->trans('Referers'); $totalforvisibletasks = projectLinesPerMonth($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $isavailable, 0, $TWeek); - 'cs.periode' =>array('label'=>"PeriodEndDate", 'checked'=>1, 'position'=>50), + $value = preg_replace('/([a-z\.]+)\s*([!<>=]+|in|notin|like|notlike)\s*/', '\1:\2:', $value); // Clean string 'x < 10' into 'x:<:10' so we can then explode on space to get all AND tests to do + 'cs.periode' => array('label' => "PeriodEndDate", 'checked' => 1, 'position' => 50), 't.datee'=>array('label'=>"Deadline", 'checked'=>1, 'position'=>101), 't.datee'=>array('label'=>"Deadline", 'checked'=>1, 'position'=>5), // Ligne de la periode d'analyse du rapport @@ -233,6 +243,7 @@ foreach ($TWeek as $week_number) { if (!empty($arrayfields['t.datee']['checked'])) { if ($action == "transfert") { + if ($object->id > 0 && $action == 'addin') { 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")); @@ -240,6 +251,7 @@ print ''; if ($default == '' || $notNull != 1) { $out .= ''; @@ -771,7 +772,7 @@ class FormWebPortal extends Form } $out .= ''; break; - case 'sellist' : + case 'sellist': $out = ''; break; - case 'link' : + case 'link': $param_list = array_keys($param['options']); // $param_list='ObjectName:classPath[:AddCreateButtonOrNot[:Filter[:Sortfield]]]' $showempty = (($required && $default != '') ? 0 : 1); @@ -931,7 +932,7 @@ class FormWebPortal extends Form break; - default : + default: if (!empty($hidden)) { $out = $this->inputType('hidden', $htmlName, $value, $htmlId); } From d93fd1839c3fda968475d8ac1d239dcffca1c777 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 21:40:18 +0100 Subject: [PATCH 15/15] Fix typing for showOutputFieldForObject (#28709) # Fix typing for showOutputFieldForObject Type hint that $value can also be a list of strings. Also updated the "else-if" sequence so that a static tool checker can still appropriately detect when $value is a string and when it is a list of strings so that it provides correct feedback. Added an error message to the syslog in case we got an array but not "array" as the value for "$type" --- .../class/html.formwebportal.class.php | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/htdocs/webportal/class/html.formwebportal.class.php b/htdocs/webportal/class/html.formwebportal.class.php index 6634426f2df..6b6c73e9944 100644 --- a/htdocs/webportal/class/html.formwebportal.class.php +++ b/htdocs/webportal/class/html.formwebportal.class.php @@ -948,7 +948,7 @@ class FormWebPortal extends Form * @param CommonObject $object Common object * @param array $val Array of properties of field to show * @param string $key Key of attribute - * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) + * @param string|string[] $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) * @param string $moreparam To add more parameters on html input tag * @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names) * @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names) @@ -1026,6 +1026,9 @@ class FormWebPortal extends Form } // Format output value differently according to properties of field + // + // First the cases that do not use $value from the arguments: + // if (in_array($key, array('rowid', 'ref'))) { if (property_exists($object, 'ref')) { $value = $object->ref; @@ -1036,6 +1039,20 @@ class FormWebPortal extends Form } } elseif ($key == 'status' && method_exists($object, 'getLibStatut')) { $value = $object->getLibStatut(3); + // + // Then the cases where $value is an array + // + } elseif (is_array($value)) { + // Handle array early to get type identification solve for static + // analysis + if ($type == 'array') { + $value = implode('
', $value); + } else { + dol_syslog(__METHOD__ . 'ERROR unexpected type=$type for array value='.((string) json_encode($value)), LOG_ERR); + } + // + // Then the cases where $value is not an array (hence string) + // } elseif ($type == 'date') { if (!empty($value)) { $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) @@ -1305,8 +1322,6 @@ class FormWebPortal extends Form } } elseif ($type == 'password') { $value = preg_replace('/./i', '*', $value); - } elseif ($type == 'array') { - $value = implode('
', $value); } else { // text|html|varchar $value = dol_htmlentitiesbr($value); }