2
0
forked from Wavyzz/dolibarr

Qual: Fix phan notices (admin) (#33483)

* Qual: Fix phan notices (accountancy, adherents)

* Qual: Fix phan notices (admin)

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
MDW
2025-03-16 20:21:22 +01:00
committed by GitHub
parent 6eb65f383d
commit 2c95fba2ee
25 changed files with 83 additions and 106 deletions

View File

@@ -10,10 +10,10 @@
return [ return [
// # Issue statistics: // # Issue statistics:
// PhanUndeclaredProperty : 460+ occurrences // PhanUndeclaredProperty : 460+ occurrences
// PhanTypeMismatchArgument : 280+ occurrences // PhanTypeMismatchArgument : 230+ occurrences
// PhanTypeMismatchProperty : 100+ occurrences // PhanTypeMismatchProperty : 100+ occurrences
// PhanUndeclaredGlobalVariable : 100+ occurrences // PhanUndeclaredGlobalVariable : 100+ occurrences
// PhanTypeMismatchArgumentNullable : 90+ occurrences // PhanTypeMismatchArgumentNullable : 70+ occurrences
// PhanTypeExpectedObjectPropAccess : 20+ occurrences // PhanTypeExpectedObjectPropAccess : 20+ occurrences
// PhanTypeInvalidDimOffset : 20+ occurrences // PhanTypeInvalidDimOffset : 20+ occurrences
// PhanTypeMismatchDimFetch : 15+ occurrences // PhanTypeMismatchDimFetch : 15+ occurrences
@@ -40,33 +40,10 @@ return [
'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
'htdocs/adherents/list.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/adherents/list.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/admin/agenda_other.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/admin/agenda_other.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/agenda_reminder.php' => ['PhanTypeMismatchArgumentNullable'],
'htdocs/admin/barcode.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/bom.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/bom.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/company.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/defaultvalues.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/admin/defaultvalues.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/eventorganization.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/expensereport_rules.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/external_rss.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/hrm.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/knowledgemanagement.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/mails.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/mails_emailing.php' => ['PhanTypeMismatchArgumentNullable'],
'htdocs/admin/mails_passwordreset.php' => ['PhanTypeMismatchArgumentNullable'],
'htdocs/admin/mails_senderprofile_list.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/mails_templates.php' => ['PhanTypeMismatchArgumentNullable'],
'htdocs/admin/mails_ticket.php' => ['PhanTypeMismatchArgumentNullable'],
'htdocs/admin/menus/index.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/multicurrency.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/receiptprinter.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/system/filecheck.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/system/modules.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/taxes.php' => ['PhanTypeMismatchArgumentNullable'],
'htdocs/admin/ticket.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/tools/export.php' => ['PhanTypeMismatchArgument'],
'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
'htdocs/api/class/api_setup.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchReturn'], 'htdocs/api/class/api_setup.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchReturn'],
'htdocs/asset/admin/setup.php' => ['PhanTypeMismatchArgument'],
'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeInvalidDimOffset'], 'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeInvalidDimOffset'],
'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/asset/class/assetmodel.class.php' => ['PhanUndeclaredProperty'], 'htdocs/asset/class/assetmodel.class.php' => ['PhanUndeclaredProperty'],
@@ -285,11 +262,9 @@ return [
'htdocs/ecm/search.php' => ['PhanTypeMismatchArgument'], 'htdocs/ecm/search.php' => ['PhanTypeMismatchArgument'],
'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'], 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'],
'htdocs/eventorganization/class/conferenceorboothattendee.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/eventorganization/class/conferenceorboothattendee.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/eventorganization/conferenceorbooth_card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/eventorganization/conferenceorbooth_contact.php' => ['PhanTypeMismatchArgument'], 'htdocs/eventorganization/conferenceorbooth_contact.php' => ['PhanTypeMismatchArgument'],
'htdocs/eventorganization/conferenceorbooth_document.php' => ['PhanTypeMismatchArgument'], 'htdocs/eventorganization/conferenceorbooth_document.php' => ['PhanTypeMismatchArgument'],
'htdocs/eventorganization/conferenceorbooth_list.php' => ['PhanTypeMismatchArgument'], 'htdocs/eventorganization/conferenceorbooth_list.php' => ['PhanTypeMismatchArgument'],
'htdocs/eventorganization/conferenceorboothattendee_card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/eventorganization/conferenceorboothattendee_list.php' => ['PhanTypeMismatchArgument'], 'htdocs/eventorganization/conferenceorboothattendee_list.php' => ['PhanTypeMismatchArgument'],
'htdocs/eventorganization/core/actions_massactions_mail.inc.php' => ['PhanUndeclaredProperty'], 'htdocs/eventorganization/core/actions_massactions_mail.inc.php' => ['PhanUndeclaredProperty'],
'htdocs/expedition/ajax/searchfrombarcode.php' => ['PhanTypeMismatchArgument'], 'htdocs/expedition/ajax/searchfrombarcode.php' => ['PhanTypeMismatchArgument'],
@@ -342,7 +317,7 @@ return [
'htdocs/hrm/core/tpl/objectline_view.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/hrm/core/tpl/objectline_view.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/hrm/evaluation_card.php' => ['PhanTypeMismatchArgument'], 'htdocs/hrm/evaluation_card.php' => ['PhanTypeMismatchArgument'],
'htdocs/hrm/job_card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/hrm/job_card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/hrm/skill_card.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/hrm/skill_card.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredProperty'],
'htdocs/imports/import.php' => ['PhanTypeMismatchArgument'], 'htdocs/imports/import.php' => ['PhanTypeMismatchArgument'],
'htdocs/intracommreport/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/intracommreport/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanUndeclaredProperty'], 'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanUndeclaredProperty'],
@@ -352,7 +327,6 @@ return [
'htdocs/loan/note.php' => ['PhanUndeclaredProperty'], 'htdocs/loan/note.php' => ['PhanUndeclaredProperty'],
'htdocs/loan/payment/payment.php' => ['PhanUndeclaredProperty'], 'htdocs/loan/payment/payment.php' => ['PhanUndeclaredProperty'],
'htdocs/mrp/class/mo.class.php' => ['PhanTypeMismatchProperty'], 'htdocs/mrp/class/mo.class.php' => ['PhanTypeMismatchProperty'],
'htdocs/mrp/mo_movements.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/mrp/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/mrp/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/multicurrency/class/api_multicurrencies.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/multicurrency/class/api_multicurrencies.class.php' => ['PhanTypeMismatchArgument'],
'htdocs/multicurrency/class/multicurrency.class.php' => ['PhanTypeExpectedObjectPropAccess'], 'htdocs/multicurrency/class/multicurrency.class.php' => ['PhanTypeExpectedObjectPropAccess'],
@@ -379,7 +353,6 @@ return [
'htdocs/product/stock/stats/mo.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/stats/mo.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/stats/reception.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/stats/reception.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/stocktransfer/class/stocktransferline.class.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/stocktransfer/class/stocktransferline.class.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/stocktransfer/stocktransfer_card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/product/stock/tpl/stockcorrection.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/tpl/stockcorrection.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/tpl/stocktransfer.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/tpl/stocktransfer.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/projet/admin/project.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/admin/project.php' => ['PhanTypeMismatchArgumentProbablyReal'],

View File

@@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@@ -284,6 +284,7 @@ if (getDolGlobalString('AGENDA_REMINDER_EMAIL')) {
} else { } else {
$selected = json_decode(getDolGlobalString('AGENDA_DEFAULT_REMINDER_EVENT_TYPES', '')); $selected = json_decode(getDolGlobalString('AGENDA_DEFAULT_REMINDER_EVENT_TYPES', ''));
} }
// Assuming $selected is correct type: @phan-suppress-next-line PhanTypeMismatchArgumentNullable
print $formactions->select_type_actions($selected, "AGENDA_DEFAULT_REMINDER_EVENT_TYPES", "systemauto", 0, -1, 1, 1); print $formactions->select_type_actions($selected, "AGENDA_DEFAULT_REMINDER_EVENT_TYPES", "systemauto", 0, -1, 1, 1);
print '</td></tr>'; print '</td></tr>';
} }

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@@ -474,7 +474,7 @@ if (isModEnabled('product')) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>'; print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
print '<td width="60" class="right">'; print '<td width="60" class="right">';
print $formbarcode->selectBarcodeType(getDolGlobalString('PRODUIT_DEFAULT_BARCODE_TYPE'), "PRODUIT_DEFAULT_BARCODE_TYPE", 1); print $formbarcode->selectBarcodeType(getDolGlobalInt('PRODUIT_DEFAULT_BARCODE_TYPE'), "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
print '</td>'; print '</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
@@ -485,7 +485,7 @@ if (isModEnabled('societe')) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>'; print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
print '<td width="60" class="right">'; print '<td width="60" class="right">';
print $formbarcode->selectBarcodeType(getDolGlobalString('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1); print $formbarcode->selectBarcodeType(getDolGlobalInt('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
print '</td>'; print '</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';

View File

@@ -466,7 +466,7 @@ print '</td></tr>'."\n";
// Country // Country
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td>'; print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td>';
print img_picto('', 'globe-americas', 'class="pictofixedwidth"'); print img_picto('', 'globe-americas', 'class="pictofixedwidth"');
print $form->select_country($mysoc->country_id, 'country_id', '', 0); print $form->select_country((string) $mysoc->country_id, 'country_id', '', 0);
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
print '</td></tr>'."\n"; print '</td></tr>'."\n";

View File

@@ -234,7 +234,7 @@ if ($action == 'edit') {
$tmp = explode(':', $val['type']); $tmp = explode(':', $val['type']);
print img_picto('', 'category', 'class="pictofixedwidth"'); print img_picto('', 'category', 'class="pictofixedwidth"');
print $formother->select_categories($tmp[1], getDolGlobalString($constname), $constname, 0, $langs->trans('CustomersProspectsCategoriesShort')); print $formother->select_categories($tmp[1], getDolGlobalInt($constname), $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
} elseif (preg_match('/thirdparty_type/', $val['type'])) { } elseif (preg_match('/thirdparty_type/', $val['type'])) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
@@ -250,7 +250,7 @@ if ($action == 'edit') {
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
} elseif ($val['type'] == 'product') { } elseif ($val['type'] == 'product') {
if (isModEnabled("product") || isModEnabled("service")) { if (isModEnabled("product") || isModEnabled("service")) {
$selected = getDolGlobalString($constname); $selected = getDolGlobalInt($constname);
print img_picto('', 'product', 'class="pictofixedwidth"'); print img_picto('', 'product', 'class="pictofixedwidth"');
print $form->select_produits($selected, $constname, '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', null, 1); print $form->select_produits($selected, $constname, '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', null, 1);
} }
@@ -295,7 +295,7 @@ if ($action == 'edit') {
$tmp = explode(':', $val['type']); $tmp = explode(':', $val['type']);
$labelemailtemplate = getDolGlobalString($constname); $labelemailtemplate = getDolGlobalString($constname);
if ($labelemailtemplate && $labelemailtemplate != '-1') { if ($labelemailtemplate && $labelemailtemplate != '-1') {
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalInt($constname));
if (is_numeric($template) && $template < 0) { if (is_numeric($template) && $template < 0) {
setEventMessages($formmail->error, $formmail->errors, 'errors'); setEventMessages($formmail->error, $formmail->errors, 'errors');
} else { } else {
@@ -306,9 +306,9 @@ if ($action == 'edit') {
} }
} }
} elseif (preg_match('/category:/', $val['type'])) { } elseif (preg_match('/category:/', $val['type'])) {
if (getDolGlobalString($constname)) { if (getDolGlobalInt($constname)) {
$c = new Categorie($db); $c = new Categorie($db);
$result = $c->fetch(getDolGlobalString($constname)); $result = $c->fetch(getDolGlobalInt($constname));
if ($result < 0) { if ($result < 0) {
setEventMessages(null, $c->errors, 'errors'); setEventMessages(null, $c->errors, 'errors');
} }
@@ -331,7 +331,7 @@ if ($action == 'edit') {
} }
} elseif ($val['type'] == 'product') { } elseif ($val['type'] == 'product') {
$product = new Product($db); $product = new Product($db);
$idproduct = getDolGlobalString($constname); $idproduct = getDolGlobalInt($constname);
if ($idproduct > 0) { if ($idproduct > 0) {
$resprod = $product->fetch($idproduct); $resprod = $product->fetch($idproduct);
if ($resprod > 0) { if ($resprod > 0) {

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr> * Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
* Copyright (C) 2017 Pierre-Henry Favre <phf@atm-consulting.fr> * Copyright (C) 2017 Pierre-Henry Favre <phf@atm-consulting.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -292,7 +292,7 @@ foreach ($rules as $rule) {
echo '<td class="linecoltype">'; echo '<td class="linecoltype">';
if ($action == 'edit' && $object->id == $rule->id) { if ($action == 'edit' && $object->id == $rule->id) {
echo $form->selectExpense($object->fk_c_type_fees, 'fk_c_type_fees', 0, 1, 1); echo $form->selectExpense((string) $object->fk_c_type_fees, 'fk_c_type_fees', 0, 1, 1);
} else { } else {
if ($rule->fk_c_type_fees == -1) { if ($rule->fk_c_type_fees == -1) {
echo $langs->trans('AllExpenseReport'); echo $langs->trans('AllExpenseReport');

View File

@@ -7,7 +7,7 @@
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com> * Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@@ -138,7 +138,7 @@ if (GETPOST("delete")) {
// Supprime boite box_external_rss de definition des boites // Supprime boite box_external_rss de definition des boites
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."boxes_def"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."boxes_def";
$sql .= " WHERE file = 'box_external_rss.php' AND note LIKE '".$db->escape(GETPOSTINT("norss"))." %'"; $sql .= " WHERE file = 'box_external_rss.php' AND note LIKE '".$db->escape((string) GETPOSTINT("norss"))." %'";
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {

View File

@@ -559,7 +559,7 @@ if ($action == 'edit') {
$tmp = explode(':', $val['type']); $tmp = explode(':', $val['type']);
print img_picto('', 'category', 'class="pictofixedwidth"'); print img_picto('', 'category', 'class="pictofixedwidth"');
print $formother->select_categories($tmp[1], getDolGlobalString($constname), $constname, 0, $langs->trans('CustomersProspectsCategoriesShort')); print $formother->select_categories($tmp[1], getDolGlobalInt($constname), $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
} elseif (preg_match('/thirdparty_type/', $val['type'])) { } elseif (preg_match('/thirdparty_type/', $val['type'])) {
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
@@ -575,7 +575,7 @@ if ($action == 'edit') {
print dolJSToSetRandomPassword($constname, 'generate_token' . $constname); print dolJSToSetRandomPassword($constname, 'generate_token' . $constname);
} elseif ($val['type'] == 'product') { } elseif ($val['type'] == 'product') {
if (isModEnabled('product') || isModEnabled('service')) { if (isModEnabled('product') || isModEnabled('service')) {
$selected = getDolGlobalString($constname); $selected = getDolGlobalInt($constname);
$form->select_produits($selected, $constname, '', 0); $form->select_produits($selected, $constname, '', 0);
} }
} else { } else {
@@ -617,14 +617,14 @@ if ($action == 'edit') {
$tmp = explode(':', $val['type']); $tmp = explode(':', $val['type']);
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalInt($constname));
if ($template < 0) { if ($template < 0) {
setEventMessages(null, $formmail->errors, 'errors'); setEventMessages(null, $formmail->errors, 'errors');
} }
print $langs->trans($template->label); print $langs->trans($template->label);
} elseif (preg_match('/category:/', $val['type'])) { } elseif (preg_match('/category:/', $val['type'])) {
$c = new Categorie($db); $c = new Categorie($db);
$result = $c->fetch(getDolGlobalString($constname)); $result = $c->fetch(getDolGlobalInt($constname));
if ($result < 0) { if ($result < 0) {
setEventMessages(null, $c->errors, 'errors'); setEventMessages(null, $c->errors, 'errors');
} }
@@ -646,7 +646,7 @@ if ($action == 'edit') {
} }
} elseif ($val['type'] == 'product') { } elseif ($val['type'] == 'product') {
$product = new Product($db); $product = new Product($db);
$resprod = $product->fetch(getDolGlobalString($constname)); $resprod = $product->fetch(getDolGlobalInt($constname));
if ($resprod > 0) { if ($resprod > 0) {
print $product->ref; print $product->ref;
} elseif ($resprod < 0) { } elseif ($resprod < 0) {

View File

@@ -265,7 +265,7 @@ if ($action == 'edit') {
$tmp = explode(':', $val['type']); $tmp = explode(':', $val['type']);
print img_picto('', 'category', 'class="pictofixedwidth"'); print img_picto('', 'category', 'class="pictofixedwidth"');
print $formother->select_categories($tmp[1], getDolGlobalString($constname), $constname, 0, $langs->trans('CustomersProspectsCategoriesShort')); print $formother->select_categories($tmp[1], getDolGlobalInt($constname), $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
} elseif (preg_match('/thirdparty_type/', $val['type'])) { } elseif (preg_match('/thirdparty_type/', $val['type'])) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
@@ -308,7 +308,7 @@ if ($action == 'edit') {
$tmp = explode(':', $val['type']); $tmp = explode(':', $val['type']);
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalInt($constname));
if ($template < 0) { if ($template < 0) {
setEventMessages(null, $formmail->errors, 'errors'); setEventMessages(null, $formmail->errors, 'errors');
} }

View File

@@ -5,7 +5,7 @@
* Copyright (C) 2016 Jonathan TISSEAU <jonathan.tisseau@86dev.fr> * Copyright (C) 2016 Jonathan TISSEAU <jonathan.tisseau@86dev.fr>
* Copyright (C) 2023 Anthony Berton <anthony.berton@bb2a.fr> * Copyright (C) 2023 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -951,7 +951,7 @@ if ($action == 'edit') {
} elseif (getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE') === 'company') { } elseif (getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE') === 'company') {
print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>');
} else { } else {
$id = preg_replace('/senderprofile_/', '', getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE')); $id = (int) preg_replace('/senderprofile_/', '', getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE'));
if ($id > 0) { if ($id > 0) {
include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php';
$emailsenderprofile = new EmailSenderProfile($db); $emailsenderprofile = new EmailSenderProfile($db);

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Jonathan TISSEAU <jonathan.tisseau@86dev.fr> * Copyright (C) 2016 Jonathan TISSEAU <jonathan.tisseau@86dev.fr>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -747,11 +748,11 @@ if ($action == 'edit') {
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mail = new CMailFile('', '', '', '', array(), array(), array(), '', '', 0, 0, '', '', '', $trackid, $sendcontext); $mail = new CMailFile('', '', '', '', array(), array(), array(), '', '', 0, 0, '', '', '', $trackid, $sendcontext);
$result = $mail->check_server_port($server, $port); $result = $mail->check_server_port((string) $server, (int) $port);
if ($result) { if ($result) {
print '<div class="ok">'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'</div>'; print '<div class="ok">'.$langs->trans("ServerAvailableOnIPOrPort", (string) $server, (string) $port).'</div>';
} else { } else {
$errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port); $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", (string) $server, (string) $port);
if ($mail->error) { if ($mail->error) {
$errormsg .= ' - '.$mail->error; $errormsg .= ' - '.$mail->error;

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Jonathan TISSEAU <jonathan.tisseau@86dev.fr> * Copyright (C) 2016 Jonathan TISSEAU <jonathan.tisseau@86dev.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -798,11 +799,11 @@ if ($action == 'edit') {
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mail = new CMailFile('', '', '', '', array(), array(), array(), '', '', 0, 0, '', '', '', $trackid, $sendcontext); $mail = new CMailFile('', '', '', '', array(), array(), array(), '', '', 0, 0, '', '', '', $trackid, $sendcontext);
$result = $mail->check_server_port($server, $port); $result = $mail->check_server_port((string) $server, (int) $port);
if ($result) { if ($result) {
print '<div class="ok">'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'</div>'; print '<div class="ok">'.$langs->trans("ServerAvailableOnIPOrPort", (string) $server, (string) $port).'</div>';
} else { } else {
$errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port); $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", (string) $server, (string) $port);
if ($mail->error) { if ($mail->error) {
$errormsg .= ' - '.$mail->error; $errormsg .= ' - '.$mail->error;

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -759,13 +759,13 @@ while ($i < $imaxinloop) {
if (!empty($arrayfields['t.'.$key]['checked'])) { if (!empty($arrayfields['t.'.$key]['checked'])) {
print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : ''); print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) { if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) {
print ' title="'.dol_escape_htmltag($object->$key).'"'; print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
} }
print '>'; print '>';
if ($key == 'status') { if ($key == 'status') {
print $object->getLibStatut(5); print $object->getLibStatut(5);
} elseif ($key == 'rowid') { } elseif ($key == 'rowid') {
print $object->showOutputField($val, $key, $object->id, ''); print $object->showOutputField($val, $key, (string) $object->id, '');
} else { } else {
print $object->showOutputField($val, $key, $object->$key, ''); print $object->showOutputField($val, $key, $object->$key, '');
} }

View File

@@ -696,7 +696,7 @@ $titlepicto = 'title_setup';
$url = DOL_URL_ROOT.'/admin/mails_templates.php?action=create'; $url = DOL_URL_ROOT.'/admin/mails_templates.php?action=create';
$newcardbutton = ''; $newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('NewEMailTemplate'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd); $newcardbutton .= dolGetButtonTitle($langs->trans('NewEMailTemplate'), '', 'fa fa-plus-circle', $url, '', (int) $permissiontoadd);
if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates')) { if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates')) {

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Jonathan TISSEAU <jonathan.tisseau@86dev.fr> * Copyright (C) 2016 Jonathan TISSEAU <jonathan.tisseau@86dev.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -740,11 +741,11 @@ if ($action == 'edit') {
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mail = new CMailFile('', '', '', '', array(), array(), array(), '', '', 0, 0, '', '', '', $trackid, $sendcontext); $mail = new CMailFile('', '', '', '', array(), array(), array(), '', '', 0, 0, '', '', '', $trackid, $sendcontext);
$result = $mail->check_server_port($server, $port); $result = $mail->check_server_port((string) $server, (int) $port);
if ($result) { if ($result) {
print '<div class="ok">'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'</div>'; print '<div class="ok">'.$langs->trans("ServerAvailableOnIPOrPort", (string) $server, (string) $port).'</div>';
} else { } else {
$errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port); $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", (string) $server, (string) $port);
if ($mail->error) { if ($mail->error) {
$errormsg .= ' - '.$mail->error; $errormsg .= ' - '.$mail->error;

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -105,7 +105,7 @@ if ($action == 'up') {
$sql .= " AND m.menu_handler='".$db->escape($menu_handler_to_search)."'"; $sql .= " AND m.menu_handler='".$db->escape($menu_handler_to_search)."'";
$sql .= " AND m.entity = ".$conf->entity; $sql .= " AND m.entity = ".$conf->entity;
$sql .= " AND m.type = '".$db->escape($current['type'])."'"; $sql .= " AND m.type = '".$db->escape($current['type'])."'";
$sql .= " AND m.fk_menu = '".$db->escape($current['fk_menu'])."'"; $sql .= " AND m.fk_menu = '".$db->escape((string) $current['fk_menu'])."'";
$sql .= " ORDER BY m.position, m.rowid"; $sql .= " ORDER BY m.position, m.rowid";
dol_syslog("admin/menus/index.php ".$sql); dol_syslog("admin/menus/index.php ".$sql);
$result = $db->query($sql); $result = $db->query($sql);
@@ -156,7 +156,7 @@ if ($action == 'up') {
$sql .= " AND m.menu_handler='".$db->escape($menu_handler_to_search)."'"; $sql .= " AND m.menu_handler='".$db->escape($menu_handler_to_search)."'";
$sql .= " AND m.entity = ".$conf->entity; $sql .= " AND m.entity = ".$conf->entity;
$sql .= " AND m.type = '".$db->escape($current['type'])."'"; $sql .= " AND m.type = '".$db->escape($current['type'])."'";
$sql .= " AND m.fk_menu = '".$db->escape($current['fk_menu'])."'"; $sql .= " AND m.fk_menu = '".$db->escape((string) $current['fk_menu'])."'";
$sql .= " ORDER BY m.position, m.rowid"; $sql .= " ORDER BY m.position, m.rowid";
dol_syslog("admin/menus/index.php ".$sql); dol_syslog("admin/menus/index.php ".$sql);
$result = $db->query($sql); $result = $db->query($sql);

View File

@@ -1,7 +1,7 @@
<?php <?php
/* <one line to give the program's name and a brief idea of what it does.> /* <one line to give the program's name and a brief idea of what it does.>
* Copyright (C) 2015 ATM Consulting <support@atm-consulting.fr> * Copyright (C) 2015 ATM Consulting <support@atm-consulting.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -96,7 +96,7 @@ if ($action == 'add_currency') {
if (!$error) { if (!$error) {
if ($currency->create($user) > 0) { if ($currency->create($user) > 0) {
if ($currency->addRate($rate)) { if ($currency->addRate((float) $rate)) {
setEventMessages($langs->trans('RecordSaved'), array()); setEventMessages($langs->trans('RecordSaved'), array());
} else { } else {
setEventMessages($langs->trans('ErrorAddRateFail'), array(), 'errors'); setEventMessages($langs->trans('ErrorAddRateFail'), array(), 'errors');
@@ -119,7 +119,7 @@ if ($action == 'add_currency') {
} }
if (!$error) { if (!$error) {
if ($currency->fetch($fk_multicurrency) > 0) { if ($currency->fetch($fk_multicurrency) > 0) {
$result = $currency->updateRate($rate); $result = $currency->updateRate((float) $rate);
if ($result < 0) { if ($result < 0) {
setEventMessages(null, $currency->errors, 'errors'); setEventMessages(null, $currency->errors, 'errors');
} }

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2020 Andreu Bisquerra Gaya <jove@bisquerra.com> * Copyright (C) 2020 Andreu Bisquerra Gaya <jove@bisquerra.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Abbes Bahfir <contact@ab1consult.com><bafbes@gmail.com> * Copyright (C) 2024 Abbes Bahfir <contact@ab1consult.com><bafbes@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@@ -379,9 +379,9 @@ if ($mode == 'config' && $user->admin) {
if ($action == 'editprinter' && $printer->listprinters[$line]['rowid'] == $printerid) { if ($action == 'editprinter' && $printer->listprinters[$line]['rowid'] == $printerid) {
print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">'; print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">';
print '<td><input type="text" class="minwidth200" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>'; print '<td><input type="text" class="minwidth200" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
$ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']); $ret = $printer->selectTypePrinter((string) $printer->listprinters[$line]['fk_type']);
print '<td>'.$printer->resprint.'</td>'; print '<td>'.$printer->resprint.'</td>';
$ret = $printer->selectProfilePrinter($printer->listprinters[$line]['fk_profile']); $ret = $printer->selectProfilePrinter((string) $printer->listprinters[$line]['fk_profile']);
print '<td>'.$printer->profileresprint.'</td>'; print '<td>'.$printer->profileresprint.'</td>';
print '<td><input size="60" type="text" name="parameter" value="'.$printer->listprinters[$line]['parameter'].'"></td>'; print '<td><input size="60" type="text" name="parameter" value="'.$printer->listprinters[$line]['parameter'].'"></td>';
print '<td>'; print '<td>';

View File

@@ -4,7 +4,7 @@
* Copyright (C) 2007-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2007-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -302,7 +302,7 @@ if (empty($error) && !empty($xml)) {
$out .= '<td>'.dol_escape_htmltag($file['filename']).'</td>'."\n"; $out .= '<td>'.dol_escape_htmltag($file['filename']).'</td>'."\n";
$out .= '<td class="right">'; $out .= '<td class="right">';
if (!empty($file['expectedsize'])) { if (!empty($file['expectedsize'])) {
$out .= dol_print_size($file['expectedsize']); $out .= dol_print_size((int) $file['expectedsize']);
} }
$out .= '</td>'."\n"; $out .= '</td>'."\n";
$out .= '<td class="center">'.dol_escape_htmltag($file['expectedmd5']).'</td>'."\n"; $out .= '<td class="center">'.dol_escape_htmltag($file['expectedmd5']).'</td>'."\n";
@@ -343,7 +343,7 @@ if (empty($error) && !empty($xml)) {
$out .= '<td class="center">'.dol_escape_htmltag($file['md5']).'</td>'."\n"; $out .= '<td class="center">'.dol_escape_htmltag($file['md5']).'</td>'."\n";
$out .= '<td class="right">'; $out .= '<td class="right">';
if ($file['expectedsize']) { if ($file['expectedsize']) {
$out .= dol_print_size($file['expectedsize']); $out .= dol_print_size((int) $file['expectedsize']);
} }
$out .= '</td>'."\n"; $out .= '</td>'."\n";
$size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']); $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']);
@@ -396,7 +396,7 @@ if (empty($error) && !empty($xml)) {
$out .= ' '.$form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helprm'.$i); $out .= ' '.$form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helprm'.$i);
} }
$out .= '</td>'."\n"; $out .= '</td>'."\n";
$out .= '<td class="center">'.dol_escape_htmltag($file['expectedmd5']).'</td>'."\n"; // @phan-suppress-current-line PhanTypeInvalidDimOffset $out .= '<td class="center">'.dol_escape_htmltag((string) $file['expectedmd5']).'</td>'."\n"; // @phan-suppress-current-line PhanTypeInvalidDimOffset
$out .= '<td class="center">'.dol_escape_htmltag($file['md5']).'</td>'."\n"; $out .= '<td class="center">'.dol_escape_htmltag($file['md5']).'</td>'."\n";
$size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']); $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']);
$totalsize += $size; $totalsize += $size;

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@@ -68,15 +68,14 @@ $object = new stdClass();
// Definition of fields for lists // Definition of fields for lists
$arrayfields = array( $arrayfields = array(
'name' => array('label' => $langs->trans("Modules"), 'checked' => 1, 'position' => 10), 'name' => array('label' => $langs->trans("Modules"), 'checked' => '1', 'position' => 10),
'version' => array('label' => $langs->trans("Version"), 'checked' => 1, 'position' => 20), 'version' => array('label' => $langs->trans("Version"), 'checked' => '1', 'position' => 20),
'id' => array('label' => $langs->trans("IdModule"), 'checked' => 1, 'position' => 30), 'id' => array('label' => $langs->trans("IdModule"), 'checked' => '1', 'position' => 30),
'module_position' => array('label' => $langs->trans("Position"), 'checked' => 1, 'position' => 35), 'module_position' => array('label' => $langs->trans("Position"), 'checked' => '1', 'position' => 35),
'permission' => array('label' => $langs->trans("IdPermissions"), 'checked' => 1, 'position' => 40) 'permission' => array('label' => $langs->trans("IdPermissions"), 'checked' => '1', 'position' => 40)
); );
$arrayfields = dol_sort_array($arrayfields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position');
'@phan-var-force array<string,array{label:string,checked:int<0,1>,position:int}> $arrayfields';
$param = ''; $param = '';
$info_admin = ''; $info_admin = '';

View File

@@ -6,7 +6,7 @@
* Copyright (C) 2015-2022 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2015-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2023 Joachim Kueter <git-jk@bloxera.com> * Copyright (C) 2023 Joachim Kueter <git-jk@bloxera.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -110,10 +110,10 @@ if ($action == 'update') {
$valuebuyservice = 'payment'; $valuebuyservice = 'payment';
break; break;
default: default:
$valuesellproduct = null; $valuesellproduct = '';
$valuebuyproduct = null; $valuebuyproduct = '';
$valuesellservice = null; $valuesellservice = '';
$valuebuyservice = null; $valuebuyservice = '';
break; break;
} }

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr> * Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2022-2023 Udo Tamm <dev@dolibit.de> * Copyright (C) 2022-2023 Udo Tamm <dev@dolibit.de>
* Copyright (C) 2023 Alexandre Spangaro <aspangaro@easya.solutions> * Copyright (C) 2023 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com> * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 Benjamin Falière <benjamin.faliere@altairis.fr> * Copyright (C) 2024-2025 Benjamin Falière <benjamin.faliere@altairis.fr>
* *
@@ -359,7 +359,7 @@ foreach ($dirmodels as $reldir) {
} }
print '<td class="center">'; print '<td class="center">';
print $formcategory->textwithpicto('', $htmltooltip, 1, 0); print $formcategory->textwithpicto('', $htmltooltip, 1, '0');
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@@ -510,7 +510,7 @@ foreach ($dirmodels as $reldir) {
print '<td class="center">'; print '<td class="center">';
print $formcategory->textwithpicto('', $htmltooltip, 1, 0); print $formcategory->textwithpicto('', $htmltooltip, 1, '0');
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2021 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2021 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -147,7 +148,7 @@ if ($what == 'mysql') {
} }
if (!$errormsg) { if (!$errormsg) {
$utils->dumpDatabase(GETPOST('compression', 'alpha'), $what, 0, $file, 0, 0, $lowmemorydump); $utils->dumpDatabase(GETPOST('compression', 'alpha'), $what, 0, $file, 0, 0, (int) $lowmemorydump);
$errormsg = $utils->error; $errormsg = $utils->error;
$_SESSION["commandbackuplastdone"] = $utils->result['commandbackuplastdone']; $_SESSION["commandbackuplastdone"] = $utils->result['commandbackuplastdone'];
$_SESSION["commandbackuptorun"] = $utils->result['commandbackuptorun']; $_SESSION["commandbackuptorun"] = $utils->result['commandbackuptorun'];
@@ -156,7 +157,7 @@ if ($what == 'mysql') {
// MYSQL NO BIN // MYSQL NO BIN
if ($what == 'mysqlnobin') { if ($what == 'mysqlnobin') {
$utils->dumpDatabase(GETPOST('compression', 'alpha'), $what, 0, $file, 0, 0, $lowmemorydump); $utils->dumpDatabase(GETPOST('compression', 'alpha'), $what, 0, $file, 0, 0, (int) $lowmemorydump);
$errormsg = $utils->error; $errormsg = $utils->error;
$_SESSION["commandbackuplastdone"] = $utils->result['commandbackuplastdone']; $_SESSION["commandbackuplastdone"] = $utils->result['commandbackuplastdone'];
@@ -186,7 +187,7 @@ if ($what == 'postgresql') {
} }
if (!$errormsg) { if (!$errormsg) {
$utils->dumpDatabase(GETPOST('compression', 'alpha'), $what, 0, $file, 0, 0, $lowmemorydump); $utils->dumpDatabase(GETPOST('compression', 'alpha'), $what, 0, $file, 0, 0, (int) $lowmemorydump);
$errormsg = $utils->error; $errormsg = $utils->error;
$_SESSION["commandbackuplastdone"] = $utils->result['commandbackuplastdone']; $_SESSION["commandbackuplastdone"] = $utils->result['commandbackuplastdone'];
$_SESSION["commandbackuptorun"] = $utils->result['commandbackuptorun']; $_SESSION["commandbackuptorun"] = $utils->result['commandbackuptorun'];

View File

@@ -518,7 +518,7 @@ if ($action == 'edit') {
$tmp = explode(':', $val['type']); $tmp = explode(':', $val['type']);
print img_picto('', 'category', 'class="pictofixedwidth"'); print img_picto('', 'category', 'class="pictofixedwidth"');
print $formother->select_categories($tmp[1], getDolGlobalString($constname), $constname, 0, $langs->trans('CustomersProspectsCategoriesShort')); print $formother->select_categories($tmp[1], getDolGlobalInt($constname), $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
} elseif (preg_match('/thirdparty_type/', $val['type'])) { } elseif (preg_match('/thirdparty_type/', $val['type'])) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
@@ -534,7 +534,7 @@ if ($action == 'edit') {
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
} elseif ($val['type'] == 'product') { } elseif ($val['type'] == 'product') {
if (isModEnabled("product") || isModEnabled("service")) { if (isModEnabled("product") || isModEnabled("service")) {
$selected = getDolGlobalString($constname); $selected = getDolGlobalInt($constname);
$form->select_produits($selected, $constname, '', 0); $form->select_produits($selected, $constname, '', 0);
} }
} elseif ($val['type'] == 'accountancy_code') { } elseif ($val['type'] == 'accountancy_code') {
@@ -542,7 +542,7 @@ if ($action == 'edit') {
if (isModEnabled('accounting')) { if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
$formaccounting = new FormAccounting($db); $formaccounting = new FormAccounting($db);
print $formaccounting->select_account($selected, $constname, 1, array(), 1, 1, 'minwidth150 maxwidth300', 1); print $formaccounting->select_account($selected, $constname, 1, array(), 1, 1, 'minwidth150 maxwidth300', '1');
} else { } else {
print '<input name="' . $constname . '" class="maxwidth200" value="' . dol_escape_htmltag($selected) . '">'; print '<input name="' . $constname . '" class="maxwidth200" value="' . dol_escape_htmltag($selected) . '">';
} }
@@ -608,7 +608,7 @@ if ($action == 'edit') {
$tmp = explode(':', $val['type']); $tmp = explode(':', $val['type']);
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalInt($constname));
if ($template < 0) { if ($template < 0) {
setEventMessages(null, $formmail->errors, 'errors'); setEventMessages(null, $formmail->errors, 'errors');
} }

View File

@@ -514,7 +514,7 @@ class dolReceiptPrinter extends Printer
* Function to add a printer template in db * Function to add a printer template in db
* *
* @param string $name Template name * @param string $name Template name
* @param int $template Template * @param string $template Template
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
public function addTemplate($name, $template) public function addTemplate($name, $template)
@@ -523,7 +523,7 @@ class dolReceiptPrinter extends Printer
$error = 0; $error = 0;
$sql = "INSERT INTO ".$this->db->prefix()."printer_receipt_template"; $sql = "INSERT INTO ".$this->db->prefix()."printer_receipt_template";
$sql .= " (name, template, entity) VALUES ('".$this->db->escape($name)."'"; $sql .= " (name, template, entity) VALUES ('".$this->db->escape($name)."'";
$sql .= ", '".$this->db->escape((string) $template)."', ".$conf->entity.")"; $sql .= ", '".$this->db->escape($template)."', ".$conf->entity.")";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (!$resql) { if (!$resql) {
$error++; $error++;
@@ -557,7 +557,7 @@ class dolReceiptPrinter extends Printer
* Function to Update a printer template in db * Function to Update a printer template in db
* *
* @param string $name Template name * @param string $name Template name
* @param int $template Template * @param string $template Template
* @param int $templateid Template id * @param int $templateid Template id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
@@ -568,7 +568,7 @@ class dolReceiptPrinter extends Printer
$sql = "UPDATE ".$this->db->prefix()."printer_receipt_template"; $sql = "UPDATE ".$this->db->prefix()."printer_receipt_template";
$sql .= " SET name='".$this->db->escape($name)."'"; $sql .= " SET name='".$this->db->escape($name)."'";
$sql .= ", template='".$this->db->escape((string) $template)."'"; $sql .= ", template='".$this->db->escape($template)."'";
$sql .= " WHERE rowid=".((int) $templateid); $sql .= " WHERE rowid=".((int) $templateid);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (!$resql) { if (!$resql) {