diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index d18289fe1a8..c72f2a64df6 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,16 +9,16 @@ */ return [ // # Issue statistics: - // PhanTypeMismatchArgument : 490+ occurrences // PhanUndeclaredProperty : 460+ occurrences - // PhanTypeMismatchArgumentNullable : 170+ occurrences - // PhanTypeMismatchProperty : 130+ occurrences + // PhanTypeMismatchArgument : 440+ occurrences + // PhanTypeMismatchArgumentNullable : 160+ occurrences + // PhanTypeMismatchProperty : 110+ occurrences // PhanUndeclaredGlobalVariable : 100+ occurrences // PhanTypeExpectedObjectPropAccess : 20+ occurrences // PhanTypeInvalidDimOffset : 20+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 15+ occurrences // PhanTypeMismatchDimFetch : 15+ occurrences // PhanUndeclaredConstant : 15+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 10+ occurrences // PhanUndeclaredMethod : 9 occurrences // PhanPossiblyUndeclaredGlobalVariable : 8 occurrences // PhanTypeMismatchArgumentNullableInternal : 7 occurrences @@ -38,10 +38,8 @@ return [ // Currently, file_suppressions and directory_suppressions are the only supported suppressions 'file_suppressions' => [ 'htdocs/accountancy/admin/account.php' => ['PhanTypeMismatchArgument'], - 'htdocs/accountancy/admin/card.php' => ['PhanTypeMismatchArgument'], 'htdocs/accountancy/admin/categories.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/accountancy/admin/categories_list.php' => ['PhanTypeMismatchArgumentNullable'], - 'htdocs/accountancy/admin/fiscalyear_card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/accountancy/admin/productaccount.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/accountancy/admin/subaccount.php' => ['PhanTypeMismatchArgument'], 'htdocs/accountancy/class/accountancycategory.class.php' => ['PhanTypeMismatchArgument'], @@ -62,8 +60,6 @@ return [ 'htdocs/accountancy/supplier/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/accountancy/tpl/export_journal.tpl.php' => ['PhanTypeMismatchArgument'], 'htdocs/adherents/admin/member.php' => ['PhanTypeMismatchArgument'], - 'htdocs/adherents/canvas/actions_adherentcard_common.class.php' => ['PhanTypeMismatchArgument'], - 'htdocs/adherents/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], 'htdocs/adherents/class/adherent.class.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/adherents/class/adherent_type.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/adherents/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], @@ -99,7 +95,6 @@ return [ 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/api/class/api_setup.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchReturn'], 'htdocs/asset/admin/setup.php' => ['PhanTypeMismatchArgument'], - 'htdocs/asset/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], 'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/asset/class/assetmodel.class.php' => ['PhanUndeclaredProperty'], @@ -149,7 +144,6 @@ return [ 'htdocs/compta/bank/account_statement_document.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/compta/bank/annuel.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/bank/bankentries_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], - 'htdocs/compta/bank/card.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/bank/categ.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/bank/class/account.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/compta/bank/class/paymentvarious.class.php' => ['PhanTypeMismatchArgument'], @@ -166,7 +160,6 @@ return [ 'htdocs/compta/cashcontrol/cashcontrol_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], 'htdocs/compta/charges/index.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/deplacement/card.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/deplacement/class/deplacement.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/deplacement/class/deplacementstats.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/deplacement/stats/index.php' => ['PhanTypeMismatchArgument'], @@ -181,14 +174,14 @@ return [ 'htdocs/compta/localtax/index.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/localtax/list.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/compta/paiement.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch'], - 'htdocs/compta/paiement/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/compta/paiement/card.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/paiement/cheque/card.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/paiement/cheque/class/remisecheque.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/paiement/cheque/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/compta/paiement/class/paiement.class.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/compta/paiement/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], 'htdocs/compta/paiement/rapport.php' => ['PhanTypeMismatchArgument'], - 'htdocs/compta/prelevement/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], + 'htdocs/compta/prelevement/card.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/prelevement/class/bonprelevement.class.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/compta/prelevement/class/rejetprelevement.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/prelevement/demandes.php' => ['PhanTypeMismatchArgumentNullable'], @@ -197,13 +190,12 @@ return [ 'htdocs/compta/resultat/index.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/resultat/projects.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/resultat/result.php' => ['PhanTypeMismatchArgument'], - 'htdocs/compta/sociales/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/compta/sociales/card.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/sociales/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/sociales/payments.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/compta/stats/cabyprodserv.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/compta/stats/supplier_turnover_by_prodserv.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/compta/stats/supplier_turnover_by_thirdparty.php' => ['PhanTypeMismatchArgument'], - 'htdocs/compta/tva/card.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/tva/class/tva.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/tva/clients.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument'], @@ -212,8 +204,6 @@ return [ 'htdocs/compta/tva/payments.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument'], 'htdocs/contact/ajax/contact.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], - 'htdocs/contact/canvas/actions_contactcard_common.class.php' => ['PhanTypeMismatchArgument'], - 'htdocs/contact/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], 'htdocs/contact/class/contact.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/contact/consumption.php' => ['PhanTypeMismatchArgument'], 'htdocs/contact/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], @@ -344,10 +334,8 @@ return [ 'htdocs/datapolicy/class/datapolicycron.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/dav/dav.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/debugbar/class/TraceableDB.php' => ['PhanTypeMismatchArgument'], - 'htdocs/delivery/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/delivery/class/delivery.class.php' => ['PhanUndeclaredProperty'], 'htdocs/don/admin/donation.php' => ['PhanUndeclaredMethod'], - 'htdocs/don/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/don/class/don.class.php' => ['PhanParamTooMany'], 'htdocs/don/document.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/don/info.php' => ['PhanUndeclaredGlobalVariable'], @@ -355,8 +343,6 @@ return [ 'htdocs/don/note.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/ecm/class/ecmdirectory.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/ecm/class/ecmfiles.class.php' => ['PhanTypeMismatchArgument'], - 'htdocs/ecm/dir_add_card.php' => ['PhanTypeMismatchArgument'], - 'htdocs/ecm/file_card.php' => ['PhanTypeMismatchArgument'], 'htdocs/ecm/file_note.php' => ['PhanTypeMismatchArgument'], 'htdocs/ecm/search.php' => ['PhanTypeMismatchArgument'], 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'], @@ -369,13 +355,13 @@ return [ 'htdocs/eventorganization/conferenceorboothattendee_list.php' => ['PhanTypeMismatchArgument'], 'htdocs/eventorganization/core/actions_massactions_mail.inc.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/expedition/ajax/searchfrombarcode.php' => ['PhanTypeMismatchArgument'], - 'htdocs/expedition/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/expedition/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/expedition/class/expedition.class.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/expedition/class/expeditionlinebatch.class.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/expedition/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/expedition/shipment.php' => ['PhanTypeMismatchProperty'], 'htdocs/expensereport/ajax/ajaxik.php' => ['PhanTypeMismatchArgument'], - 'htdocs/expensereport/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/expensereport/card.php' => ['PhanUndeclaredProperty'], 'htdocs/expensereport/class/expensereport.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/expensereport/class/expensereportline.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/expensereport/class/expensereportstats.class.php' => ['PhanTypeMismatchArgument'], @@ -389,7 +375,6 @@ return [ 'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/fichinter/agenda.php' => ['PhanTypeMismatchArgument'], 'htdocs/fichinter/card-rec.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/fichinter/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/fichinter/class/api_interventions.class.php' => ['PhanUndeclaredProperty'], 'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'], 'htdocs/fichinter/contact.php' => ['PhanTypeMismatchArgument'], @@ -407,7 +392,6 @@ return [ 'htdocs/fourn/facture/paiement.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/fourn/facture/rapport.php' => ['PhanTypeMismatchArgument'], 'htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/holiday/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/holiday/card_group.php' => ['PhanTypeMismatchArgument'], 'htdocs/holiday/list.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/hrm/class/evaluation.class.php' => ['PhanUndeclaredProperty'], @@ -440,7 +424,6 @@ return [ 'htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/partnership/partnership_card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/partnership/partnership_list.php' => ['PhanUndeclaredProperty'], - 'htdocs/product/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/product/class/api_products.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchReturn', 'PhanUndeclaredProperty'], 'htdocs/product/class/html.formproduct.class.php' => ['PhanUndeclaredProperty'], 'htdocs/product/class/productfournisseurprice.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], @@ -448,7 +431,6 @@ return [ 'htdocs/product/price.php' => ['PhanUndeclaredProperty'], 'htdocs/product/price_suppliers.php' => ['PhanTypeMismatchProperty'], 'htdocs/product/reassort.php' => ['PhanTypeExpectedObjectPropAccessButGotNull'], - 'htdocs/product/stock/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/product/stock/info.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/list.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/movement_card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -463,7 +445,7 @@ return [ 'htdocs/product/stock/tpl/stockcorrection.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/tpl/stocktransfer.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/projet/admin/project.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/card.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/projet/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/projet/tasks.php' => ['PhanTypeMismatchArgument'], 'htdocs/projet/tasks/time.php' => ['PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], @@ -477,7 +459,7 @@ return [ 'htdocs/public/project/viewandvote.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/public/recruitment/view.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/reception/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/reception/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/reception/class/reception.class.php' => ['PhanUndeclaredProperty'], 'htdocs/reception/list.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanUndeclaredProperty'], @@ -495,10 +477,9 @@ return [ 'htdocs/salaries/paiement_salary.php' => ['PhanUndeclaredProperty'], 'htdocs/salaries/virement_request.php' => ['PhanUndeclaredProperty'], 'htdocs/societe/ajax/company.php' => ['PhanUndeclaredProperty'], - 'htdocs/societe/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/societe/class/societe.class.php' => ['PhanTypeMismatchProperty'], 'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument'], - 'htdocs/supplier_proposal/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanUndeclaredProperty'], 'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'], 'htdocs/takepos/index.php' => ['PhanPluginUndeclaredVariableIsset'], diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index ca95f8fac4f..81a5e24588f 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -3,6 +3,7 @@ * Copyright (C) 2013-2024 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -250,7 +251,7 @@ if ($action == 'create') { // Account parent print ''.$langs->trans("Accountparent").''; print ''; - print $formaccounting->select_account($object->account_parent, 'account_parent', 1, [], 0, 0, 'minwidth200'); + print $formaccounting->select_account((string) $object->account_parent, 'account_parent', 1, [], 0, 0, 'minwidth200'); print ''; // Chart of accounts type @@ -327,7 +328,7 @@ if ($action == 'create') { print ''.$langs->trans("Accountparent").''; print ''; // Note: We accept disabled account as parent account so we can build a hierarchy and use only children - print $formaccounting->select_account($object->account_parent, 'account_parent', 1, array(), 0, 0, 'minwidth100 maxwidth300 maxwidthonsmartphone', 1, ''); + print $formaccounting->select_account((string) $object->account_parent, 'account_parent', 1, array(), 0, 0, 'minwidth100 maxwidth300 maxwidthonsmartphone', '1', ''); print ''; // Chart of accounts type diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 2d4940a8cd4..b51c96b31b4 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -1,6 +1,7 @@ * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -356,14 +357,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Date start print ''; - print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, 0, 'datepicker'); + print $form->editfieldkey("DateStart", 'date_start', (string) $object->date_start, $object, 0, 'datepicker'); print ''; print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, 0, 'datepicker'); print ''; // Date end print ''; - print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, 0, 'datepicker'); + print $form->editfieldkey("DateEnd", 'date_end', (string) $object->date_end, $object, 0, 'datepicker'); print ''; print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, 0, 'datepicker'); print ''; @@ -384,7 +385,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; if (getDolGlobalString('ACCOUNTING_CAN_REOPEN_CLOSED_PERIOD') && $object->status == $object::STATUS_CLOSED) { - print dolGetButtonAction($langs->trans("ReOpen"), '', 'reopen', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken(), 'reopen', $permissiontoadd); + print dolGetButtonAction($langs->trans("ReOpen"), '', 'reopen', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken(), 'reopen', (int) $permissiontoadd); } print ''.$langs->trans('Modify').''; diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index 58a9c4d7b2a..5b408fc094b 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2012 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -169,7 +169,7 @@ abstract class ActionsAdherentCardCommon } // Country - $this->tpl['select_country'] = $form->select_country($this->object->country_id, 'country_id'); + $this->tpl['select_country'] = $form->select_country((string) $this->object->country_id, 'country_id'); $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; if ($user->admin) { diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 82cf1ba1d43..82e8a09177c 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -305,7 +305,7 @@ if (empty($reshook)) { } // Create new object if ($result > 0 && !$error) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty // Change values $object->civility_id = trim(GETPOST("civility_id", 'alphanohtml')); @@ -862,7 +862,7 @@ if (empty($reshook)) { } if ($action == 'update_extras' && $user->hasRight('adherent', 'creer')) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty $attribute_name = GETPOST('attribute', 'restricthtml'); // Fill array 'array_options' with data from update form @@ -1484,7 +1484,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Login Dolibarr print ''.$langs->trans("LinkedToDolibarrUser").''; if ($object->user_id) { - $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none'); + $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, (string) $object->user_id, 'none'); } else { print $langs->trans("NoDolibarrAccess"); } @@ -1957,10 +1957,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Login Dolibarr - Link to user print ''; $editenable = $user->hasRight('adherent', 'creer') && $user->hasRight('user', 'user', 'creer'); - print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable); + print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, (int) $editenable); print ''; if ($action == 'editlogin') { - $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', array()); + $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, (string) $object->user_id, 'userid', array()); } else { if ($object->user_id) { $linkeduser = new User($db); diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index fddb1cf8566..ce9fffee5a6 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -5,7 +5,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Charlie Benke * Copyright (C) 2017 Open-DSI - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -101,7 +101,7 @@ if ($action == 'set') { dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity); $defaultValues = new DefaultValues($db); - $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => $conf->entity)); + $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => (string) $conf->entity)); if (!is_array($result) && $result < 0) { setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); } elseif (count($result) > 0) { @@ -391,7 +391,7 @@ print ' '."\n"; print ''."\n"; $defval = 'na'; $defaultValues = new DefaultValues($db); -$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => $conf->entity)); +$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => (string) $conf->entity)); if (!is_array($result) && $result < 0) { setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); } elseif (count($result) > 0) { diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 9b6e857f8fa..35f131273ac 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2018 Alexandre Spangaro * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -127,7 +128,7 @@ if (empty($reshook)) { } } - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty $triggermodname = 'ASSET_MODIFY'; // Name of trigger action code to execute when we modify record // Action dispose object @@ -283,11 +284,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $disposal_subject_to_vat = !empty($disposal_subject_to_vat) ? 1 : 0; $object->fields['fk_disposal_type']['visible'] = 1; - $disposal_type_form = $object->showInputField(null, 'fk_disposal_type', $fk_disposal_type, '', '', '', 0); + $disposal_type_form = $object->showInputField(null, 'fk_disposal_type', (string) $fk_disposal_type, '', '', '', 0); $object->fields['fk_disposal_type']['visible'] = -2; $object->fields['disposal_invoice_id'] = array('type' => 'integer:Facture:compta/facture/class/facture.class.php::entity IN (__SHARED_ENTITIES__)', 'enabled' => '1', 'notnull' => 1, 'visible' => 1, 'index' => 1, 'validate' => '1',); - $disposal_invoice_form = $object->showInputField(null, 'disposal_invoice_id', $disposal_invoice_id, '', '', '', 0); + $disposal_invoice_form = $object->showInputField(null, 'disposal_invoice_id', (string) $disposal_invoice_id, '', '', '', 0); unset($object->fields['disposal_invoice_id']); // Create an array for form @@ -343,7 +344,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''."\n"; // Common attributes - $keyforbreak='date_acquisition'; // We change column just before this field + $keyforbreak = 'date_acquisition'; // We change column just before this field //unset($object->fields['fk_project']); // Hide field already shown in banner //unset($object->fields['fk_soc']); // Hide field already shown in banner include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index ad8882f6ebc..18925764aed 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017-2023 Laurent Destailleur * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2023 Charlene Benke - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -181,7 +181,7 @@ if (empty($reshook)) { $disable_stock_change = GETPOSTINT('disable_stock_change'); $fk_workstation = GETPOSTINT('idworkstations'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); - $fk_unit = GETPOST('fk_unit', 'alphanohtml'); + $fk_unit = GETPOSTINT('fk_unit'); $fk_default_workstation = 0; if (!empty($idprod) && isModEnabled('workstation')) { @@ -235,7 +235,7 @@ if (empty($reshook)) { } } - $result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null, $fk_unit, $array_options, $fk_default_workstation); + $result = $object->addLine((int) $idprod, (float) $qty, (float) $qty_frozen, $disable_stock_change, (float) $efficiency, -1, $bom_child_id, null, $fk_unit, $array_options, $fk_default_workstation); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -264,7 +264,7 @@ if (empty($reshook)) { $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); $disable_stock_change = GETPOSTINT('disable_stock_change'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); - $fk_unit = GETPOST('fk_unit', 'alphanohtml'); + $fk_unit = GETPOSTINT('fk_unit'); if ($qty == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); @@ -291,7 +291,7 @@ if (empty($reshook)) { $fk_default_workstation = GETPOSTINT('idworkstations'); } - $result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key, $fk_unit, $array_options, $fk_default_workstation); + $result = $object->updateLine($lineid, (float) $qty, (int) $qty_frozen, (int) $disable_stock_change, (float) $efficiency, $bomline->position, $bomline->import_key, $fk_unit, $array_options, $fk_default_workstation); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index d0e58c22668..9a54a64ce3f 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -8,7 +8,7 @@ * Copyright (C) 2016 Marcos García * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Charlene Benke - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -470,7 +470,7 @@ if ($action == 'create') { print ''; print ''; } @@ -1130,7 +1130,7 @@ if ($action == 'create') { /** @var FormAccounting $formaccounting */ print ''; print ''; } diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 353628a473b..9a57473f144 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -221,7 +221,7 @@ if ($action == 'create') { print ""; print ''; print ""; @@ -419,7 +419,7 @@ if ($action == 'create') { // Km/Price print '"; @@ -449,9 +449,9 @@ if ($action == 'create') { print '
'.$langs->trans('State').''; if ($selectedcode) { print img_picto('', 'state', 'class="pictofixedwidth"'); - print $formcompany->select_state(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : '', $selectedcode, 'account_state_id'); + print $formcompany->select_state(GETPOSTISSET("account_state_id") ? GETPOSTINT("account_state_id") : 0, $selectedcode, 'account_state_id'); } else { print $countrynotdefined; } @@ -672,7 +672,7 @@ if ($action == 'create') { /** @var FormAccounting $formaccounting */ print '
'.$langs->trans("AccountancyJournal").''; - print $formaccounting->select_journal($object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0); + print $formaccounting->select_journal((string) $object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0); print '
'.$langs->trans("AccountancyJournal").''; - print $formaccounting->select_journal($object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0); + print $formaccounting->select_journal((string) $object->fk_accountancy_journal, 'fk_accountancy_journal', 4, 1, 0, 0); print '
'.$langs->trans("Type").''; - $form->select_type_fees(GETPOSTINT('type'), 'type', 1); + $form->select_type_fees((string) GETPOSTINT('type'), 'type', 1); print '
'; - print $form->editfieldkey("FeesKilometersOrAmout", 'km', $object->km, $object, $user->hasRight('deplacement', 'creer'), 'numeric:6'); + print $form->editfieldkey("FeesKilometersOrAmout", 'km', (string) $object->km, $object, $user->hasRight('deplacement', 'creer'), 'numeric:6'); print ''; print $form->editfieldval("FeesKilometersOrAmout", 'km', $object->km, $object, $user->hasRight('deplacement', 'creer'), 'numeric:6'); print "
'; print ''; if ($action == 'classify') { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1); + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, 'projectid', 0, 0, 1); } else { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0); + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, 'none', 0, 0); } print ''; print ''; diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 2e671025ebf..f24008595c4 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Marcos García * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -539,7 +539,7 @@ if ($resql) { $paiement = $invoice->getSommePaiement(); $creditnotes = $invoice->getSumCreditNotesUsed(); $deposits = $invoice->getSumDepositsUsed(); - $alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT'); + $alreadypaid = price2num($paiement + $creditnotes + $deposits, 'MT'); $remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT'); print ''; @@ -577,7 +577,7 @@ if ($resql) { print ''.price($remaintopay).''; // Status - print ''.$invoice->getLibStatut(5, $alreadypayed).''; + print ''.$invoice->getLibStatut(5, (float) $alreadypaid).''; $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 diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 60d398f35b7..2bc0c95932c 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -112,7 +112,7 @@ if ($reshook < 0) { if (empty($reshook)) { if ($action == 'setbankaccount' && $permissiontoadd) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty $object->fk_bank_account = GETPOSTINT('fk_bank_account'); $object->update($user); @@ -150,7 +150,7 @@ if (empty($reshook)) { $mesg='BadFile'; }*/ - $error = $object->set_infotrans($user, $dt, GETPOST('methode', 'alpha')); + $error = $object->set_infotrans($user, $dt, GETPOSTINT('methode')); if ($error) { header("Location: card.php?id=".$id."&error=$error"); @@ -315,9 +315,9 @@ if ($id > 0 || $ref) { print ''; print ''; if ($action == 'editfkbankaccount') { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $fk_bank_account, 'fk_bank_account', 0); + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $fk_bank_account, 'fk_bank_account', 0); } else { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $fk_bank_account, 'none'); + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $fk_bank_account, 'none'); } print ""; print ''; diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 9c37b76e37b..19c2c3e6148 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -137,7 +137,7 @@ if (empty($reshook)) { // Link to a project if ($action == 'classin' && $permissiontoadd) { - $object->setProject(GETPOST('fk_project')); + $object->setProject(GETPOSTINT('fk_project')); } if ($action == 'setfk_user' && $permissiontoadd) { @@ -243,7 +243,7 @@ if (empty($reshook)) { } else { $result = $object->fetch($id); - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty $object->type = $actioncode; $object->date_ech = $dateech; @@ -384,7 +384,7 @@ if ($action == 'create') { print $langs->trans("Type"); print ''; print ''; - $formsocialcontrib->select_type_socialcontrib(GETPOST('actioncode', 'alpha') ? GETPOST('actioncode', 'alpha') : '', 'actioncode', 1); + $formsocialcontrib->select_type_socialcontrib(GETPOST('actioncode', 'alpha') ? GETPOSTINT('actioncode') : 0, 'actioncode', 1); print ''; print ''; @@ -438,7 +438,7 @@ if ($action == 'create') { // Payment Mode print ''.$langs->trans('DefaultPaymentMode').''; - $form->select_types_paiements(GETPOSTINT('mode_reglement_id'), 'mode_reglement_id'); + $form->select_types_paiements((string) GETPOSTINT('mode_reglement_id'), 'mode_reglement_id'); print ''; // Bank Account @@ -567,7 +567,7 @@ if ($id > 0) { if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), $object->fk_project, ($action == 'classify' ? 'fk_project' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'fk_project' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { if (!empty($object->fk_project)) { $proj = new Project($db); @@ -648,9 +648,9 @@ if ($id > 0) { print ''; print ''; if ($action == 'editmode') { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', '', 1, 1); + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', '', 1, 1); } else { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none'); + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'none'); } print ''; @@ -666,9 +666,9 @@ if ($id > 0) { print ''; print ''; if ($action == 'editbankaccount') { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1); } else { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none'); } print ''; print ''; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index dcf5d5b3248..bdb0f3deff9 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2015-2023 Alexandre Spangaro * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -493,7 +493,7 @@ if ($action == 'create') { // Type payment print ''.$langs->trans("PaymentMode").''; - print $form->select_types_paiements(GETPOSTINT("type_payment"), "type_payment", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1); + print $form->select_types_paiements((string) GETPOSTINT("type_payment"), "type_payment", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1); print "\n"; print ""; @@ -617,7 +617,7 @@ if ($id > 0) { print '';*/ print ''; - print $form->editfieldkey($form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")), 'datev', $object->datev, $object, $user->hasRight('tax', 'charges', 'creer'), 'day'); + print $form->editfieldkey($form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")), 'datev', (string) $object->datev, $object, $user->hasRight('tax', 'charges', 'creer'), 'day'); print ''; print $form->editfieldval("PeriodEndDate", 'datev', $object->datev, $object, $user->hasRight('tax', 'charges', 'creer'), 'day'); //print dol_print_date($object->datev,'day'); @@ -640,9 +640,9 @@ if ($id > 0) { print ''; print ''; if ($action == 'editmode') { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->type_payment, 'mode_reglement_id'); + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->type_payment, 'mode_reglement_id'); } else { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->type_payment, 'none'); + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->type_payment, 'none'); } print ''; @@ -658,9 +658,9 @@ if ($id > 0) { print ''; print ''; if ($action == 'editbankaccount') { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1); } else { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none'); } print ''; print ''; diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 28a9186b4e6..21baabbf257 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -179,7 +179,7 @@ abstract class ActionsContactCardCommon } // Country - $this->tpl['select_country'] = $form->select_country($this->object->country_id, 'country_id'); + $this->tpl['select_country'] = $form->select_country((string) $this->object->country_id, 'country_id'); $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; if ($user->admin) { diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 606ca72fecf..f4ef1c53a1b 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -11,7 +11,7 @@ * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2019 Josep Lluís Amador * Copyright (C) 2020 Open-Dsi - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -329,7 +329,7 @@ if (empty($reshook)) { if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'contact', 'supprimer')) { $result = $object->fetch($id); - $object->oldcopy = clone $object; + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty $result = $object->delete($user); if ($result > 0) { @@ -413,7 +413,7 @@ if (empty($reshook)) { } } - $object->oldcopy = clone $object; + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty $object->socid = $socid; $object->lastname = (string) GETPOST("lastname", 'alpha'); @@ -537,7 +537,7 @@ if (empty($reshook)) { // Update extrafields if ($action == 'update_extras' && $user->hasRight('societe', 'contact', 'creer')) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty // Fill array 'array_options' with data from update form $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); @@ -865,7 +865,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; // Default value is in MAILING_CONTACT_DEFAULT_BULK_STATUS that you can modify in setup of module emailing - print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOSTINT("no_email") : getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS')), 1, false, (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2)); + print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOSTINT("no_email") : getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS')), 1, false, (int) (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2)); print ''; print ''; } @@ -1105,7 +1105,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // EMail - print ''.$form->editfieldkey('EMail', 'email', GETPOST('email', 'alpha'), $object, 0, 'string', '', (getDolGlobalString('SOCIETE_EMAIL_MANDATORY'))).''; + print ''.$form->editfieldkey('EMail', 'email', GETPOST('email', 'alpha'), $object, 0, 'string', '', (int) (getDolGlobalInt('SOCIETE_EMAIL_MANDATORY'))).''; print ''; print img_picto('', 'object_email', 'class="pictofixedwidth"'); print ''; @@ -1152,7 +1152,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; $useempty = (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2); - print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOSTINT("no_email") : $object->no_email), 1, false, $useempty); + print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOSTINT("no_email") : $object->no_email), 1, false, (int) $useempty); print ''; print ''; } @@ -1440,7 +1440,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; if ($action == 'editlevel') { - $formcompany->formProspectContactLevel($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_prospectlevel, 'prospect_contact_level_id', 1); + $formcompany->formProspectContactLevel($_SERVER['PHP_SELF'].'?id='.$object->id, (int) $object->fk_prospectlevel, 'prospect_contact_level_id', 1); } else { print $object->getLibProspLevel(); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a9904b26a9c..48a0defae7d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9432,7 +9432,7 @@ class Form * Show a multiselect form from an array. WARNING: Use this only for short lists. * * @param string $htmlname Name of select - * @param array $array Array(key=>value) or Array(key=>array('id'=>key, 'label'=>value, 'color'=> , 'picto'=> , 'labelhtml'=> )) + * @param array $array Array(key=>value) or Array(key=>array('id'=>key, 'label'=>value, 'color'=> , 'picto'=> , 'labelhtml'=> )) * @param string[] $selected Array of keys preselected * @param int<0,1> $key_in_label 1 to show key like in "[key] value" * @param int<0,1> $value_as_key 1 to use value as key diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index fae07b24a6b..f765f3f2f4c 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2015 Ari Elbaz (elarifr) * Copyright (C) 2016 Marcos García * Copyright (C) 2016-2024 Alexandre Spangaro - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -155,13 +155,13 @@ class FormAccounting extends Form * * @param string[] $selectedIds Preselected journal code array * @param string $htmlname Name of field in html form - * @param int $nature Limit the list to a particular type of journals (1:various operations / 2:sale / 3:purchase / 4:bank / 9: has-new) + * @param int<0,9> $nature Limit the list to a particular type of journals (1:various operations / 2:sale / 3:purchase / 4:bank / 9: has-new) * @param int $showempty Add an empty field * @param int $select_in 0=selectid value is the journal rowid (default) or 1=selectid is journal code * @param int $select_out Set value returned by select. 0=rowid (default), 1=code * @param string $morecss More css non HTML object * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache. - * @param int $disabledajaxcombo Disable ajax combo box. + * @param int<0,1> $disabledajaxcombo Disable ajax combo box. * @return string|int<-1,-1> String with HTML select, or -1 if error */ public function multi_select_journal($selectedIds = array(), $htmlname = 'journal', $nature = 0, $showempty = 0, $select_in = 0, $select_out = 0, $morecss = '', $usecache = '', $disabledajaxcombo = 0) @@ -233,12 +233,12 @@ class FormAccounting extends Form * Return list of accounting category. * Use mysoc->country_id or mysoc->country_code so they must be defined. * - * @param int $selected Preselected type - * @param string $htmlname Name of field in form - * @param int $useempty Set to 1 if we want an empty value - * @param int $maxlen Max length of text in combo box - * @param int $help Add or not the admin help picto - * @param int $allcountries All countries + * @param int $selected Preselected type + * @param string $htmlname Name of field in form + * @param int<0,1> $useempty Set to 1 if we want an empty value + * @param int $maxlen Max length of text in combo box + * @param int<0,1> $help Add or not the admin help picto + * @param int<0,1> $allcountries All countries * @return void|string HTML component with the select */ public function select_accounting_category($selected = 0, $htmlname = 'account_category', $useempty = 0, $maxlen = 0, $help = 1, $allcountries = 0) @@ -365,7 +365,7 @@ class FormAccounting extends Form * @param int $select_out Set value returned by select. 0=rowid (default), 1=account_number * @param string $morecss More css non HTML object * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache. - * @param string $active Filter on status active or not: '0', '1' or '' for no filter + * @param '1'|'0'|'' $active Filter on status active or not: '0', '1' or '' for no filter * @return string|int<-1,-1> String with HTML select, or -1 if error */ public function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss = 'minwidth100 maxwidth300 maxwidthonsmartphone', $usecache = '', $active = '1') diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index d0a1be598b0..6e981a1ff3f 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -211,7 +211,7 @@ if ($action == 'setdate_delivery' && $permissiontoadd) { // Update extrafields if ($action == 'update_extras' && $permissiontoadd) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty // Fill array 'array_options' with data from update form $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 8db831b035c..24aca9686b0 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -343,7 +343,7 @@ if (empty($reshook)) { } if ($action == 'update_extras' && $permissiontoadd) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty // Fill array 'array_options' with data from update form $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index c4aac6a9505..13087a12914 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -3,6 +3,7 @@ * Copyright (C) 2008-2012 Regis Houssin * Copyright (C) 2015-2024 Alexandre Spangaro * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -95,7 +96,7 @@ if (!$sortfield) { $ecmdir = new EcmDirectory($db); if (!empty($section)) { - $result = $ecmdir->fetch($section); + $result = $ecmdir->fetch((int) $section); if (!($result > 0)) { dol_print_error($db, $ecmdir->error); exit; diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index 8472163e0e2..6090bc32118 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -87,7 +88,7 @@ if (!$urlfile) { // Load ecm object $ecmdir = new EcmDirectory($db); -$result = $ecmdir->fetch(GETPOST("section", 'alpha')); +$result = $ecmdir->fetch(GETPOSTINT("section")); if (!($result > 0)) { dol_print_error($db, $ecmdir->error); exit; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 468f79f9a9d..6518c74e35d 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -411,7 +411,7 @@ if (empty($reshook)) { $nbstockline = count($stockLine[$i]); for ($j = 0; $j < $nbstockline; $j++) { if ($stockLine[$i][$j]['qty'] > 0 || ($stockLine[$i][$j]['qty'] == 0 && getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS'))) { - $ret = $object->addline($stockLine[$i][$j]['warehouse_id'], $stockLine[$i][$j]['ix_l'], $stockLine[$i][$j]['qty'], $array_options[$i]); + $ret = $object->addline($stockLine[$i][$j]['warehouse_id'], $stockLine[$i][$j]['ix_l'], (float) $stockLine[$i][$j]['qty'], $array_options[$i]); if ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -430,7 +430,7 @@ if (empty($reshook)) { $entrepot_id = 0; } - $ret = $object->addline($entrepot_id, GETPOSTINT($idl), price2num(GETPOSTFLOAT($qty), 'MS'), $array_options[$i]); + $ret = $object->addline($entrepot_id, GETPOSTINT($idl), (float) price2num(GETPOSTFLOAT($qty), 'MS'), $array_options[$i]); if ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 850375d0ed6..14c1453f654 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -365,7 +365,7 @@ if (empty($reshook)) { } if ($action == 'update_extras' && $permissiontoadd) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty // Fill array 'array_options' with data from update form $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); @@ -1364,7 +1364,7 @@ if (empty($reshook)) { if (!$error) { // TODO Use update method of ExpenseReportLine - $result = $object->updateline($rowid, $type_fees_id, $projet_id, $vatrate, $comments, (float) $qty, (float) $value_unit, $date, $id, $fk_c_exp_tax_cat, $fk_ecm_files); + $result = $object->updateline($rowid, $type_fees_id, $projet_id, (float) $vatrate, $comments, (float) $qty, (float) $value_unit, $date, $id, $fk_c_exp_tax_cat, $fk_ecm_files); if ($result >= 0) { if ($result > 0) { // Define output language @@ -2420,7 +2420,7 @@ if ($action == 'create') { if (getDolGlobalString('MAIN_USE_EXPENSE_IK')) { print ''; $params = array('fk_expense' => $object->id, 'fk_expense_det' => $line->id, 'date' => $line->date); - print $form->selectExpenseCategories($line->fk_c_exp_tax_cat, 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', (string) $userauthor->default_c_exp_tax_cat, $params); + print $form->selectExpenseCategories((string) $line->fk_c_exp_tax_cat, 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', (int) $userauthor->default_c_exp_tax_cat, $params); print ''; } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 451f7197600..10b13b53b64 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -819,7 +819,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; if ($action == 'update_extras' && $permissiontoadd) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty $attribute_name = GETPOST('attribute', 'restricthtml'); // Fill array 'array_options' with data from update form diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 6b46a16b109..4214ac71517 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -309,7 +309,7 @@ if (empty($reshook)) { if ($action == 'update' && GETPOSTISSET('savevalidator') && $user->hasRight('holiday', 'approve')) { $object->fetch($id); - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty $object->fk_validator = GETPOSTINT('valideur'); @@ -468,7 +468,7 @@ if (empty($reshook)) { // If draft and owner of leave if ($object->status == Holiday::STATUS_DRAFT && $permissiontoadd) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty $object->status = Holiday::STATUS_VALIDATED; @@ -584,7 +584,7 @@ if (empty($reshook)) { } if ($action == 'update_extras') { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty // Fill array 'array_options' with data from update form $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); @@ -612,7 +612,7 @@ if (empty($reshook)) { // If status is waiting approval and approver is also user if ($object->status == Holiday::STATUS_VALIDATED && ($user->id == $object->fk_validator || $permissiontoaddall) && $user->hasRight('holiday', 'approve')) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty $object->date_approval = dol_now(); $object->fk_user_approve = $user->id; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index db27c51a795..dc2f2c93a7c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -490,7 +490,7 @@ if (empty($reshook)) { // Quick edit for extrafields if ($action == 'update_extras' && $usercancreate) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty // Fill array 'array_options' with data from update form $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); @@ -783,7 +783,7 @@ if (empty($reshook)) { } else { if ($object->id > 0) { //Need dol_clone methode 1 (same object class) because update product use hasbatch() method on oldcopy - $object->oldcopy = dol_clone($object, 1); + $object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) { $object->ref = (string) $ref; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 41bcc14c066..a028fc3bd6d 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -249,7 +249,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'update_extras' && $user->hasRight('stock', 'creer')) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty // Fill array 'array_options' with data from update form $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 08625a71259..d6e865545a0 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -315,7 +315,7 @@ if (empty($reshook)) { $db->begin(); $old_start_date = 0; if (!$error) { - $object->oldcopy = clone $object; + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty $old_start_date = $object->date_start; @@ -384,7 +384,7 @@ if (empty($reshook)) { if (!$error) { if (GETPOST("reportdate") && ($object->date_start != $old_start_date)) { - $result = $object->shiftTaskDate($old_start_date); + $result = $object->shiftTaskDate((int) $old_start_date); if ($result < 0) { $error++; setEventMessages($langs->trans("ErrorShiftTaskDate").':'.$object->error, $object->errors, 'errors'); @@ -561,7 +561,7 @@ if (empty($reshook)) { // Quick edit for extrafields if ($action == 'update_extras' && $permissiontoadd) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty // Fill array 'array_options' with data from update form $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 2e8d1800282..1aaeebd88b5 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -273,7 +273,7 @@ if (empty($reshook)) { } if ($action == 'update_extras' && $permissiontoadd) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty // Fill array 'array_options' with data from update form $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index a87d0e4078d..d217fd20885 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -265,7 +265,7 @@ if (empty($reshook)) { if ($action == 'update_extras' && $permissiontoadd) { $object->fetch($socid); - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty // Fill array 'array_options' with data from update form $extrafields->fetch_name_optionals_label($object->table_element); @@ -322,7 +322,7 @@ if (empty($reshook)) { if (!$error) { if ($action == 'update') { // Test on permission not required here $ret = $object->fetch($socid); - $object->oldcopy = clone $object; + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty } else { $object->canvas = $canvas; } @@ -838,7 +838,7 @@ if (empty($reshook)) { // Delete third party if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'supprimer')) { $object->fetch($socid); - $object->oldcopy = clone $object; + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty $result = $object->delete($socid, $user); if ($result > 0) { @@ -2071,7 +2071,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio $prefixSupplierIsUsed = false; } - $object->oldcopy = clone $object; + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty if (GETPOSTISSET('name')) { // We overwrite with values if posted diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 523ed59af88..11995233bf1 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1157,7 +1157,7 @@ if (empty($reshook)) { // Multicurrency rate $result = $object->setMulticurrencyRate(GETPOSTFLOAT('multicurrency_tx'), GETPOSTINT('calculation_mode')); } elseif ($action == 'update_extras' && $usercancreate) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty $attribute_name = GETPOST('attribute', 'restricthtml'); // Fill array 'array_options' with data from update form