diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php index 159fd74e576..e26311c8305 100644 --- a/htdocs/compta/bank/info.php +++ b/htdocs/compta/bank/info.php @@ -74,11 +74,11 @@ $h++; $head[$h][0] = DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$id; $head[$h][1] = $langs->trans("Info"); -$hselected = $h; +$hselected = (string) $h; $h++; -print dol_get_fiche_head($head, (string) $hselected, $langs->trans("LineRecord"), -1, 'accountline'); +print dol_get_fiche_head($head, $hselected, $langs->trans("LineRecord"), -1, 'accountline'); $linkback = ''.$langs->trans("BackToList").''; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 7d03bc17ba1..4e527c8f229 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -321,7 +321,7 @@ if ($action == 'new') { $h = 0; $head[$h][0] = $_SERVER["PHP_SELF"].'?action=new'; $head[$h][1] = $langs->trans("MenuChequeDeposits"); - $hselected = $h; + $hselected = (string) $h; $h++; print load_fiche_titre($title, '', 'bank_account'); @@ -336,13 +336,13 @@ if ($action == 'new') { $head = array(); $head[$h][0] = $_SERVER["PHP_SELF"].'?id='.$object->id; $head[$h][1] = $langs->trans("CheckReceipt"); - $hselected = $h; + $hselected = (string) $h; $h++; // $head[$h][0] = DOL_URL_ROOT.'/compta/paiement/cheque/info.php?id='.$object->id; // $head[$h][1] = $langs->trans("Info"); // $h++; - print dol_get_fiche_head($head, (string) $hselected, $langs->trans("Cheques"), -1, 'payment'); + print dol_get_fiche_head($head, $hselected, $langs->trans("Cheques"), -1, 'payment'); /* * Confirmation of slip's delete diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index b1e56ea8b21..3551647754d 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -105,7 +105,7 @@ $h = 0; $head = array(); $head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$id; $head[$h][1] = $langs->trans("PaymentSocialContribution"); -$hselected = $h; +$hselected = (string) $h; $h++; /*$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/info.php?id='.$id; @@ -114,7 +114,7 @@ $h++; */ -print dol_get_fiche_head($head, (string) $hselected, $langs->trans("PaymentSocialContribution"), -1, 'payment'); +print dol_get_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), -1, 'payment'); /* * Deletion confirmation of payment diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index 4c722a39675..385487a9ecb 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -134,7 +134,7 @@ $h = 0; $head = array(); $head[$h][0] = DOL_URL_ROOT.'/compta/payment_vat/card.php?id='.$id; $head[$h][1] = $langs->trans("VATPayment"); -$hselected = $h; +$hselected = (string) $h; $h++; /*$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/info.php?id='.$id; @@ -143,7 +143,7 @@ $h++; */ -print dol_get_fiche_head($head, (string) $hselected, $langs->trans("VATPayment"), -1, 'payment'); +print dol_get_fiche_head($head, $hselected, $langs->trans("VATPayment"), -1, 'payment'); /* * Deletion confirmation of payment diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 662922ba36e..0a26ac6ada5 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -153,7 +153,7 @@ $head = array(); $h = 0; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/line.php?id='.((int) $id).'&type='.urlencode($type); $head[$h][1] = $title; -$hselected = $h; +$hselected = (string) $h; $h++; if ($id) { @@ -164,7 +164,7 @@ if ($id) { $bon = new BonPrelevement($db); $bon->fetch($lipre->bon_rowid); - print dol_get_fiche_head($head, (string) $hselected, $title, -1, 'payment'); + print dol_get_fiche_head($head, $hselected, $title, -1, 'payment'); print ''; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index f18e5daa63f..d9aee4712a7 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -109,7 +109,7 @@ $extralabelslines = $extrafields->fetch_name_optionals_label($object->table_elem $permissionnote = $user->hasRight('contrat', 'creer'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('contrat', 'creer'); // Used by the include of actions_dellink.inc.php -$permissiontodelete = ($user->hasRight('contrat', 'creer') && $object->statut == $object::STATUS_DRAFT) || $user->hasRight('contrat', 'supprimer'); +$permissiontodelete = ($user->hasRight('contrat', 'creer') && $object->status == $object::STATUS_DRAFT) || $user->hasRight('contrat', 'supprimer'); $permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontoedit = $permissiontoadd; $permissiontoactivate = $user->hasRight('contrat', 'activer'); @@ -1345,7 +1345,7 @@ if ($action == 'create') { $head = contract_prepare_head($object); - $hselected = 0; + $hselected = '0'; $formconfirm = ''; print dol_get_fiche_head($head, $hselected, $langs->trans("Contract"), -1, 'contract'); diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index f123a16d05f..0cfb9dc306b 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -5,6 +5,7 @@ * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2023 Christian Foellmann * Copyright (C) 2024 Alexandre Spangaro + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -143,7 +144,7 @@ if ($id > 0 || !empty($ref)) { $head = contract_prepare_head($object); - $hselected = 1; + $hselected = '1'; print dol_get_fiche_head($head, $hselected, $langs->trans("Contract"), -1, 'contract'); diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index 4103becee3c..23202ea9034 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -1,7 +1,7 @@ - * Copyright (C) 2019 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -90,7 +90,7 @@ $h = 0; $head = array(); $head[$h][0] = DOL_URL_ROOT.'/don/payment/card.php?id='.$id; $head[$h][1] = $langs->trans("DonationPayment"); -$hselected = $h; +$hselected = (string) $h; $h++; print dol_get_fiche_head($head, $hselected, $langs->trans("DonationPayment"), -1, 'payment'); diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 7049d80699c..92c05c4d437 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -452,7 +452,7 @@ if ($step == 1 || !$datatoexport) { $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=1'; $head[$h][1] = $langs->trans("Step")." 1"; - $hselected = $h; + $hselected = (string) $h; $h++; print dol_get_fiche_head($head, $hselected, '', -1); @@ -516,7 +516,7 @@ if ($step == 2 && $datatoexport) { $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=2&datatoexport='.$datatoexport; $head[$h][1] = $langs->trans("Step")." 2"; - $hselected = $h; + $hselected = (string) $h; $h++; print dol_get_fiche_head($head, $hselected, '', -2); @@ -702,7 +702,7 @@ if ($step == 3 && $datatoexport) { $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=3&datatoexport='.$datatoexport; $head[$h][1] = $langs->trans("Step")." 3"; - $hselected = $h; + $hselected = (string) $h; $h++; print dol_get_fiche_head($head, $hselected, '', -2); @@ -884,7 +884,7 @@ if ($step == 4 && $datatoexport) { $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=4&datatoexport='.$datatoexport; $head[$h][1] = $langs->trans("Step")." ".(3 + $stepoffset); - $hselected = $h; + $hselected = (string) $h; $h++; print dol_get_fiche_head($head, $hselected, '', -2); @@ -1168,7 +1168,7 @@ if ($step == 5 && $datatoexport) { $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=5&datatoexport='.$datatoexport; $head[$h][1] = $langs->trans("Step")." ".(4 + $stepoffset); - $hselected = $h; + $hselected = (string) $h; $h++; print dol_get_fiche_head($head, $hselected, '', -2); diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 8d808e9ff9f..7d31d0ac0ff 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -1,6 +1,7 @@ - * Copyright (C) 2024 MDW +/* Copyright (C) 2014-2024 Alexandre Spangaro + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -92,7 +93,7 @@ $h = 0; $head[$h][0] = DOL_URL_ROOT.'/loan/payment/card.php?id='.$id; $head[$h][1] = $langs->trans("PaymentLoan"); -$hselected = $h; +$hselected = (string) $h; $h++; print dol_get_fiche_head($head, $hselected, $langs->trans("PaymentLoan"), -1, 'payment'); diff --git a/htdocs/salaries/payment_salary/card.php b/htdocs/salaries/payment_salary/card.php index 752a5247a3c..95696e6ef7d 100644 --- a/htdocs/salaries/payment_salary/card.php +++ b/htdocs/salaries/payment_salary/card.php @@ -1,11 +1,12 @@ - * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2009 Regis Houssin +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Alexandre SPANGARO + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre SPANGARO + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -103,7 +104,7 @@ $head = array(); $head[$h][0] = DOL_URL_ROOT.'/salaries/payment_salary/card.php?id='.$id; $head[$h][1] = $langs->trans("SalaryPayment"); -$hselected = $h; +$hselected = (string) $h; $h++; /* diff --git a/phpstan.neon.dist b/phpstan.neon.dist index f2f97df1479..d06ff1390f3 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -81,7 +81,6 @@ parameters: - '#dol_copy expects string, int given#' - '#dol_getIdFromCode expects string, int given#' - '#dol_strlen expects string, int given#' - - '#dol_get_fiche_head expects string, int given#' - '#EvalMath::trigger\(\) expects string, int given#' - '#get_next_value expects string, int given#' - '#pdf_writeLinkedObjects expects string, int given#'