From 988fc75ca2d2a6853b59c3e37e7e9ac3754d6464 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 10 Mar 2025 15:47:55 +0100 Subject: [PATCH] Qual: Fix phan notices (emailcollector, bookkeeping) (#33375) * Qual: Fix phan notices (mostly propal) * Fix some const arguments to Form::select_dolusers() * Update phan baseline * Qual: Fix phan notices (propal) * Qual: Fix phan notices (emailcollector, bookkeeping) --- dev/tools/phan/baseline.txt | 41 ++----- htdocs/accountancy/bookkeeping/card.php | 20 ++-- htdocs/accountancy/bookkeeping/export.php | 36 +++---- htdocs/accountancy/bookkeeping/list.php | 40 +++---- .../accountancy/bookkeeping/listbyaccount.php | 38 +++---- .../accountancy/class/bookkeeping.class.php | 74 ++++++------- htdocs/accountancy/closure/index.php | 9 +- htdocs/admin/emailcollector_list.php | 6 +- htdocs/admin/mails_templates.php | 6 +- htdocs/admin/paymentbybanktransfer.php | 3 +- htdocs/admin/prelevement.php | 3 +- htdocs/bookmarks/card.php | 9 +- htdocs/comm/propal/agenda.php | 3 +- htdocs/comm/propal/card.php | 58 +++++----- htdocs/comm/propal/class/propal.class.php | 10 +- .../comm/propal/class/propaleligne.class.php | 16 +-- htdocs/comm/propal/contact.php | 5 +- htdocs/comm/propal/document.php | 3 +- htdocs/comm/propal/list.php | 102 +++++++++--------- htdocs/comm/propal/note.php | 3 +- htdocs/comm/propal/stats/index.php | 6 +- htdocs/compta/deplacement/card.php | 6 +- htdocs/compta/deplacement/stats/index.php | 4 +- htdocs/compta/facture/list.php | 4 +- htdocs/compta/facture/stats/index.php | 4 +- htdocs/contrat/card.php | 6 +- htdocs/contrat/list.php | 2 +- htdocs/core/class/html.form.class.php | 6 +- htdocs/core/lib/agenda.lib.php | 2 +- .../modules/propale/doc/pdf_azur.modules.php | 10 +- .../modules/propale/doc/pdf_cyan.modules.php | 22 ++-- .../modules/propale/mod_propale_marbre.php | 4 +- .../modules/propale/mod_propale_saphir.php | 4 +- .../core/modules/propale/modules_propale.php | 4 +- htdocs/core/tpl/massactions_pre.tpl.php | 13 +-- .../core/tpl/objectlinked_lineimport.tpl.php | 3 +- .../class/emailcollector.class.php | 79 +++++++------- htdocs/expedition/stats/index.php | 4 +- htdocs/expensereport/list.php | 4 +- htdocs/fichinter/stats/index.php | 4 +- 40 files changed, 335 insertions(+), 341 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 5eef4ce5338..e588cd408fa 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,17 +9,17 @@ */ return [ // # Issue statistics: - // PhanTypeMismatchArgument : 1000+ occurrences + // PhanTypeMismatchArgument : 810+ occurrences // PhanUndeclaredProperty : 470+ occurrences - // PhanTypeMismatchArgumentNullable : 260+ occurrences + // PhanTypeMismatchArgumentNullable : 230+ occurrences // PhanTypeMismatchProperty : 140+ occurrences // PhanUndeclaredGlobalVariable : 100+ occurrences // PhanTypeExpectedObjectPropAccess : 20+ occurrences // PhanTypeInvalidDimOffset : 20+ occurrences // PhanTypeMismatchDimFetch : 20+ occurrences - // PhanPluginUndeclaredVariableIsset : 15+ occurrences // PhanTypeMismatchArgumentProbablyReal : 15+ occurrences // PhanUndeclaredConstant : 15+ occurrences + // PhanPluginUndeclaredVariableIsset : 10+ occurrences // PhanTypeMismatchArgumentNullableInternal : 10+ occurrences // PhanPossiblyUndeclaredGlobalVariable : 9 occurrences // PhanUndeclaredMethod : 9 occurrences @@ -49,14 +49,9 @@ return [ 'htdocs/accountancy/admin/fiscalyear_card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/accountancy/admin/productaccount.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/accountancy/admin/subaccount.php' => ['PhanTypeMismatchArgument'], - 'htdocs/accountancy/bookkeeping/card.php' => ['PhanTypeMismatchArgument'], - 'htdocs/accountancy/bookkeeping/export.php' => ['PhanTypeMismatchArgument'], - 'htdocs/accountancy/bookkeeping/list.php' => ['PhanTypeMismatchArgument'], - 'htdocs/accountancy/bookkeeping/listbyaccount.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/accountancy/class/accountancycategory.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/accountancy/class/accountingjournal.class.php' => ['PhanTypeMismatchArgument'], - 'htdocs/accountancy/class/bookkeeping.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/accountancy/class/lettering.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/accountancy/closure/index.php' => ['PhanTypeMismatchArgument'], 'htdocs/accountancy/customer/index.php' => ['PhanTypeMismatchArgument'], @@ -87,8 +82,6 @@ return [ 'htdocs/admin/bom.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/company.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/defaultvalues.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/admin/emailcollector_card.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/emailcollector_list.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/eventorganization.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/expensereport_rules.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/external_rss.php' => ['PhanTypeMismatchArgument'], @@ -98,20 +91,17 @@ return [ 'htdocs/admin/mails_emailing.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/admin/mails_passwordreset.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/admin/mails_senderprofile_list.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/mails_templates.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + '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/paymentbybanktransfer.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/pdf_other.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/prelevement.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/admin/webhook.php' => ['PhanTypeMismatchArgument'], 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/api/class/api_setup.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchReturn'], 'htdocs/asset/admin/setup.php' => ['PhanTypeMismatchArgument'], @@ -140,7 +130,6 @@ return [ 'htdocs/bookcal/calendar_list.php' => ['PhanTypeMismatchArgument'], 'htdocs/bookcal/class/availabilities.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/bookcal/class/calendar.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], - 'htdocs/bookmarks/card.php' => ['PhanTypeMismatchArgument'], 'htdocs/categories/class/categorie.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/categories/photos.php' => ['PhanTypeMismatchArgument'], 'htdocs/categories/viewcat.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], @@ -161,15 +150,8 @@ return [ 'htdocs/comm/mailing/class/advtargetemailing.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/comm/mailing/index.php' => ['PhanUndeclaredProperty'], 'htdocs/comm/multiprix.php' => ['PhanTypeMismatchArgument'], - 'htdocs/comm/propal/agenda.php' => ['PhanTypeMismatchArgument'], - 'htdocs/comm/propal/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'], - 'htdocs/comm/propal/class/propal.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], - 'htdocs/comm/propal/class/propaleligne.class.php' => ['PhanTypeMismatchArgument'], - 'htdocs/comm/propal/contact.php' => ['PhanTypeMismatchArgument'], - 'htdocs/comm/propal/document.php' => ['PhanTypeMismatchArgument'], - 'htdocs/comm/propal/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], - 'htdocs/comm/propal/note.php' => ['PhanTypeMismatchArgument'], - 'htdocs/comm/propal/stats/index.php' => ['PhanTypeMismatchArgument'], + 'htdocs/comm/propal/card.php' => ['PhanTypeMismatchProperty'], + 'htdocs/comm/propal/list.php' => ['PhanUndeclaredProperty'], 'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/comm/remise.php' => ['PhanTypeMismatchArgument'], 'htdocs/comm/remx.php' => ['PhanTypeMismatchArgument'], @@ -272,7 +254,7 @@ return [ 'htdocs/core/actions_extrafields.inc.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/actions_lineupdown.inc.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/actions_massactions.inc.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], - 'htdocs/core/actions_sendmails.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/core/actions_sendmails.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/core/ajax/ajaxdirpreview.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/core/ajax/ajaxdirtree.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/ajax/ajaxstatusprospect.php' => ['PhanTypeMismatchArgument'], @@ -304,7 +286,6 @@ return [ 'htdocs/core/class/extrafields.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/fileupload.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/fiscalyear.class.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/class/html.form.class.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/core/class/html.formcompany.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/core/class/html.formfile.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/html.formmail.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], @@ -380,8 +361,8 @@ return [ 'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/project/doc/pdf_beluga.modules.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/core/modules/societe/doc/doc_generic_odt.modules.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanUndeclaredProperty'], @@ -406,7 +387,6 @@ return [ 'htdocs/core/tpl/objectline_create.tpl.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/core/tpl/objectline_edit.tpl.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], - 'htdocs/core/tpl/objectlinked_lineimport.tpl.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/tpl/passwordreset.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/resource_view.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], @@ -431,7 +411,7 @@ return [ 'htdocs/ecm/file_card.php' => ['PhanTypeMismatchArgument'], 'htdocs/ecm/file_note.php' => ['PhanTypeMismatchArgument'], 'htdocs/ecm/search.php' => ['PhanTypeMismatchArgument'], - 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'], 'htdocs/eventorganization/class/conferenceorboothattendee.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/eventorganization/conferenceorbooth_card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/eventorganization/conferenceorbooth_contact.php' => ['PhanTypeMismatchArgument'], @@ -446,7 +426,6 @@ return [ 'htdocs/expedition/class/expeditionlinebatch.class.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/expedition/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/expedition/shipment.php' => ['PhanTypeMismatchProperty'], - 'htdocs/expedition/stats/index.php' => ['PhanTypeMismatchArgument'], 'htdocs/expensereport/ajax/ajaxik.php' => ['PhanTypeMismatchArgument'], 'htdocs/expensereport/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/expensereport/class/expensereport.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 8f5a4cff32d..b98f6db02a2 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2013-2024 Alexandre Spangaro * Copyright (C) 2017 Laurent Destailleur * 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 @@ -127,7 +127,7 @@ if (empty($reshook)) { $error = 0; if ($cancel) { - header("Location: ". $backtopage . (!empty($type)?'?type=sub':'')); + header("Location: ". $backtopage . (!empty($type) ? '?type=sub' : '')); exit; } @@ -170,7 +170,7 @@ if (empty($reshook)) { $object->sens = 'C'; } - $result = $object->update($user, false, $mode); + $result = $object->update($user, 0, $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -234,7 +234,7 @@ if (empty($reshook)) { $object->sens = 'C'; } - $result = $object->createStd($user, false, $mode); + $result = $object->createStd($user, 0, $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -366,7 +366,11 @@ if (empty($reshook)) { } // Delete all lines into the transaction - $toselect = explode(',', GETPOST('toselect', 'alphanohtml')); + $toselect_str = explode(',', GETPOST('toselect', 'alphanohtml')); + $toselect = array(); + foreach ($toselect_str as $i) { + $toselect[] = (int) $i; + } if ($action == 'deletebookkeepingwriting' && $confirm == "yes" && $permissiontodelete) { $db->begin(); @@ -647,7 +651,7 @@ if ($action == 'create') { print ''; print ''; print ''; - print $formaccounting->select_journal($object->code_journal, 'code_journal', 0, 0, 0, 1, 1); + print $formaccounting->select_journal($object->code_journal, 'code_journal', 0, 0, 0, 1, ''); print ''; print ''; } else { @@ -980,13 +984,13 @@ if ($action == 'create') { if (empty($total_debit) && empty($total_credit)) { print ''; } elseif ($total_debit == $total_credit) { - print ''.$langs->trans("ValidTransaction").''; + print ''.$langs->trans("ValidTransaction").''; } else { print ''; } print '   '; - print ''.$langs->trans("Cancel").''; + print ''.$langs->trans("Cancel").''; print ""; } diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index e866ea95980..9aa1d238dbd 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -6,7 +6,7 @@ * Copyright (C) 2016-2017 Laurent Destailleur * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Progiseize - * 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 @@ -171,7 +171,7 @@ $form = new Form($db); if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOSTINT('page') == '' && !GETPOSTINT('noreset') && $user->hasRight('accounting', 'mouvements', 'export')) { if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values') && !GETPOST('search_accountancy_code_start')) { $sql = "SELECT date_start, date_end"; - $sql .=" FROM ".MAIN_DB_PREFIX."accounting_fiscalyear "; + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear "; if (getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT')) { $sql .= " WHERE rowid = " . getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT'); } else { @@ -204,21 +204,21 @@ if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GE $arrayfields = array( - 't.piece_num' => array('label' => $langs->trans("TransactionNumShort"), 'checked' => 1), - 't.code_journal' => array('label' => $langs->trans("Codejournal"), 'checked' => 1), - 't.doc_date' => array('label' => $langs->trans("Docdate"), 'checked' => 1), - 't.doc_ref' => array('label' => $langs->trans("Piece"), 'checked' => 1), - 't.numero_compte' => array('label' => $langs->trans("AccountAccountingShort"), 'checked' => 1), - 't.subledger_account' => array('label' => $langs->trans("SubledgerAccount"), 'checked' => 1), - 't.label_operation' => array('label' => $langs->trans("Label"), 'checked' => 1), - 't.debit' => array('label' => $langs->trans("AccountingDebit"), 'checked' => 1), - 't.credit' => array('label' => $langs->trans("AccountingCredit"), 'checked' => 1), - 't.lettering_code' => array('label' => $langs->trans("LetteringCode"), 'checked' => 1), - 't.date_creation' => array('label' => $langs->trans("DateCreation"), 'checked' => 0), - 't.tms' => array('label' => $langs->trans("DateModification"), 'checked' => 0), - 't.date_export' => array('label' => $langs->trans("DateExport"), 'checked' => 1), - 't.date_validated' => array('label' => $langs->trans("DateValidationAndLock"), 'checked' => -1, 'enabled' => !getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")), - 't.import_key' => array('label' => $langs->trans("ImportId"), 'checked' => 0, 'position' => 1100), + 't.piece_num' => array('label' => $langs->trans("TransactionNumShort"), 'checked' => '1'), + 't.code_journal' => array('label' => $langs->trans("Codejournal"), 'checked' => '1'), + 't.doc_date' => array('label' => $langs->trans("Docdate"), 'checked' => '1'), + 't.doc_ref' => array('label' => $langs->trans("Piece"), 'checked' => '1'), + 't.numero_compte' => array('label' => $langs->trans("AccountAccountingShort"), 'checked' => '1'), + 't.subledger_account' => array('label' => $langs->trans("SubledgerAccount"), 'checked' => '1'), + 't.label_operation' => array('label' => $langs->trans("Label"), 'checked' => '1'), + 't.debit' => array('label' => $langs->trans("AccountingDebit"), 'checked' => '1'), + 't.credit' => array('label' => $langs->trans("AccountingCredit"), 'checked' => '1'), + 't.lettering_code' => array('label' => $langs->trans("LetteringCode"), 'checked' => '1'), + 't.date_creation' => array('label' => $langs->trans("DateCreation"), 'checked' => '0'), + 't.tms' => array('label' => $langs->trans("DateModification"), 'checked' => '0'), + 't.date_export' => array('label' => $langs->trans("DateExport"), 'checked' => '1'), + 't.date_validated' => array('label' => $langs->trans("DateValidationAndLock"), 'checked' => '-1', 'enabled' => (string) (int) !getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")), + 't.import_key' => array('label' => $langs->trans("ImportId"), 'checked' => '0', 'position' => 1100), ); if (!getDolGlobalString('ACCOUNTING_ENABLE_LETTERING')) { @@ -364,7 +364,7 @@ if (empty($reshook)) { $listofaccountsforgroup2 = array(); if (is_array($listofaccountsforgroup)) { foreach ($listofaccountsforgroup as $tmpval) { - $listofaccountsforgroup2[] = "'".$db->escape($tmpval['id'])."'"; + $listofaccountsforgroup2[] = "'".$db->escape((string) $tmpval['id'])."'"; } } $filter['t.search_accounting_code_in'] = implode(',', $listofaccountsforgroup2); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index fe2952917f4..b4052f09b95 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -6,7 +6,7 @@ * Copyright (C) 2016-2017 Laurent Destailleur * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2022 Progiseize - * 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 @@ -157,7 +157,7 @@ $form = new Form($db); if (!in_array($action, array('delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'alpha') == '' && !GETPOSTINT('noreset') && $user->hasRight('accounting', 'mouvements', 'export')) { if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values') && !GETPOST('search_accountancy_code_start')) { $sql = "SELECT date_start, date_end"; - $sql .=" FROM ".MAIN_DB_PREFIX."accounting_fiscalyear "; + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear "; if (getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT')) { $sql .= " WHERE rowid = " . getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT'); } else { @@ -190,22 +190,22 @@ if (!in_array($action, array('delmouv', 'delmouvconfirm')) && !GETPOSTISSET('beg $arrayfields = array( - 't.piece_num' => array('label' => $langs->trans("TransactionNumShort"), 'checked' => 1), - 't.code_journal' => array('label' => $langs->trans("Codejournal"), 'checked' => 1), - 't.doc_date' => array('label' => $langs->trans("Docdate"), 'checked' => 1), - 't.doc_ref' => array('label' => $langs->trans("Piece"), 'checked' => 1), - 't.numero_compte' => array('label' => $langs->trans("AccountAccountingShort"), 'checked' => 1), - 't.subledger_account' => array('label' => $langs->trans("SubledgerAccount"), 'checked' => 1), - 't.label_operation' => array('label' => $langs->trans("Label"), 'checked' => 1), - 't.debit' => array('label' => $langs->trans("AccountingDebit"), 'checked' => 1), - 't.credit' => array('label' => $langs->trans("AccountingCredit"), 'checked' => 1), - 't.lettering_code' => array('label' => $langs->trans("LetteringCode"), 'checked' => 1), - 't.date_creation' => array('label' => $langs->trans("DateCreation"), 'checked' => 0), - 't.tms' => array('label' => $langs->trans("DateModification"), 'checked' => 0), - 't.date_export' => array('label' => $langs->trans("DateExport"), 'checked' => 0), - 't.date_validated' => array('label' => $langs->trans("DateValidationAndLock"), 'checked' => 0, 'enabled' => !getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")), - 't.date_lim_reglement' => array('label' => $langs->trans("DateDue"), 'checked' => 0), - 't.import_key' => array('label' => $langs->trans("ImportId"), 'checked' => 0, 'position' => 1100), + 't.piece_num' => array('label' => $langs->trans("TransactionNumShort"), 'checked' => '1'), + 't.code_journal' => array('label' => $langs->trans("Codejournal"), 'checked' => '1'), + 't.doc_date' => array('label' => $langs->trans("Docdate"), 'checked' => '1'), + 't.doc_ref' => array('label' => $langs->trans("Piece"), 'checked' => '1'), + 't.numero_compte' => array('label' => $langs->trans("AccountAccountingShort"), 'checked' => '1'), + 't.subledger_account' => array('label' => $langs->trans("SubledgerAccount"), 'checked' => '1'), + 't.label_operation' => array('label' => $langs->trans("Label"), 'checked' => '1'), + 't.debit' => array('label' => $langs->trans("AccountingDebit"), 'checked' => '1'), + 't.credit' => array('label' => $langs->trans("AccountingCredit"), 'checked' => '1'), + 't.lettering_code' => array('label' => $langs->trans("LetteringCode"), 'checked' => '1'), + 't.date_creation' => array('label' => $langs->trans("DateCreation"), 'checked' => '0'), + 't.tms' => array('label' => $langs->trans("DateModification"), 'checked' => '0'), + 't.date_export' => array('label' => $langs->trans("DateExport"), 'checked' => '0'), + 't.date_validated' => array('label' => $langs->trans("DateValidationAndLock"), 'checked' => '0', 'enabled' => (string) (int) !getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")), + 't.date_lim_reglement' => array('label' => $langs->trans("DateDue"), 'checked' => '0'), + 't.import_key' => array('label' => $langs->trans("ImportId"), 'checked' => '0', 'position' => 1100), ); if (!getDolGlobalString('ACCOUNTING_ENABLE_LETTERING')) { @@ -332,7 +332,7 @@ if (empty($reshook)) { $listofaccountsforgroup2 = array(); if (is_array($listofaccountsforgroup)) { foreach ($listofaccountsforgroup as $tmpval) { - $listofaccountsforgroup2[] = "'".$db->escape($tmpval['id'])."'"; + $listofaccountsforgroup2[] = "'".$db->escape((string) $tmpval['id'])."'"; } } $filter['t.search_accounting_code_in'] = implode(',', $listofaccountsforgroup2); @@ -806,7 +806,7 @@ if (empty($reshook)) { $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly')); $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub'.$param, '', 1, array('morecss' => 'marginleftonly')); - $url = './card.php?action=create'.(!empty($type)?'&type=sub':'').'&backtopage='.urlencode($_SERVER['PHP_SELF']); + $url = './card.php?action=create'.(!empty($type) ? '&type=sub' : '').'&backtopage='.urlencode($_SERVER['PHP_SELF']); if (!empty($socid)) { $url .= '&socid='.$socid; } diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 79b99395695..7bf8819b487 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -4,7 +4,7 @@ * Copyright (C) 2013-2020 Florian Henry * Copyright (C) 2013-2025 Alexandre Spangaro * 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 @@ -163,7 +163,7 @@ $form = new Form($db); if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('search_date_startday') && !GETPOSTISSET('search_date_startmonth') && !GETPOSTISSET('search_date_starthour')) { $sql = "SELECT date_start, date_end"; - $sql .=" FROM ".MAIN_DB_PREFIX."accounting_fiscalyear "; + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear "; if (getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT')) { $sql .= " WHERE rowid = " . getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT'); } else { @@ -195,19 +195,19 @@ if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('searc $arrayfields = array( // 't.subledger_account'=>array('label'=>$langs->trans("SubledgerAccount"), 'checked'=>1), - 't.piece_num' => array('label' => $langs->trans("TransactionNumShort"), 'checked' => 1), - 't.code_journal' => array('label' => $langs->trans("Codejournal"), 'checked' => 1), - 't.doc_date' => array('label' => $langs->trans("Docdate"), 'checked' => 1), - 't.doc_ref' => array('label' => $langs->trans("Piece"), 'checked' => 1), - 't.label_operation' => array('label' => $langs->trans("Label"), 'checked' => 1), - 't.lettering_code' => array('label' => $langs->trans("Lettering"), 'checked' => 1), - 't.debit' => array('label' => $langs->trans("AccountingDebit"), 'checked' => 1), - 't.credit' => array('label' => $langs->trans("AccountingCredit"), 'checked' => 1), - 't.balance' => array('label' => $langs->trans("Balance"), 'checked' => 1), - 't.date_export' => array('label' => $langs->trans("DateExport"), 'checked' => -1), - 't.date_validated' => array('label' => $langs->trans("DateValidation"), 'checked' => -1, 'enabled' => !getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")), - 't.date_lim_reglement' => array('label' => $langs->trans("DateDue"), 'checked' => 0), - 't.import_key' => array('label' => $langs->trans("ImportId"), 'checked' => -1, 'position' => 1100), + 't.piece_num' => array('label' => $langs->trans("TransactionNumShort"), 'checked' => '1'), + 't.code_journal' => array('label' => $langs->trans("Codejournal"), 'checked' => '1'), + 't.doc_date' => array('label' => $langs->trans("Docdate"), 'checked' => '1'), + 't.doc_ref' => array('label' => $langs->trans("Piece"), 'checked' => '1'), + 't.label_operation' => array('label' => $langs->trans("Label"), 'checked' => '1'), + 't.lettering_code' => array('label' => $langs->trans("Lettering"), 'checked' => '1'), + 't.debit' => array('label' => $langs->trans("AccountingDebit"), 'checked' => '1'), + 't.credit' => array('label' => $langs->trans("AccountingCredit"), 'checked' => '1'), + 't.balance' => array('label' => $langs->trans("Balance"), 'checked' => '1'), + 't.date_export' => array('label' => $langs->trans("DateExport"), 'checked' => '-1'), + 't.date_validated' => array('label' => $langs->trans("DateValidation"), 'checked' => '-1', 'enabled' => (string) (int) !getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")), + 't.date_lim_reglement' => array('label' => $langs->trans("DateDue"), 'checked' => '0'), + 't.import_key' => array('label' => $langs->trans("ImportId"), 'checked' => '-1', 'position' => 1100), ); if (!getDolGlobalString('ACCOUNTING_ENABLE_LETTERING')) { @@ -351,7 +351,7 @@ if (empty($reshook)) { $listofaccountsforgroup2 = array(); if (is_array($listofaccountsforgroup)) { foreach ($listofaccountsforgroup as $tmpval) { - $listofaccountsforgroup2[] = "'".$db->escape($tmpval['id'])."'"; + $listofaccountsforgroup2[] = "'".$db->escape((string) $tmpval['id'])."'"; } } $filter['t.search_accounting_code_in'] = implode(',', $listofaccountsforgroup2); @@ -553,7 +553,7 @@ if (empty($reshook)) { } } elseif ($type == 'sub' && $massaction == 'letteringpartial') { $lettering = new Lettering($db); - $result = $lettering->updateLettering($toselect, false, true); + $result = $lettering->updateLettering($toselect, 0, true); if ($result < 0) { setEventMessages('', $lettering->errors, 'errors'); } else { @@ -817,7 +817,7 @@ if (empty($reshook)) { } $newcardbutton .= dolGetButtonTitleSeparator(); } - $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create'.(!empty($type)?'&type=sub':'').'&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); + $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create'.(!empty($type) ? '&type=sub' : '').'&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); } if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { @@ -1389,7 +1389,7 @@ while ($i < min($num, $limit)) { // Lettering code if (!empty($arrayfields['t.lettering_code']['checked'])) { - print ''.dol_escape_htmltag($line->lettering_code).''; + print ''.dol_escape_htmltag((string) $line->lettering_code).''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 0e27287ffd4..cf69e29d610 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2015-2022 Alexandre Spangaro * Copyright (C) 2015-2020 Florian Henry * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Jose MARTINEZ * * This program is free software; you can redistribute it and/or modify @@ -432,7 +432,7 @@ class BookKeeping extends CommonObject $sql .= ", ".((float) $this->credit); $sql .= ", ".((float) $this->montant); $sql .= ", ".(!empty($this->sens) ? ("'".$this->db->escape($this->sens)."'") : "NULL"); - $sql .= ", '".$this->db->escape($this->fk_user_author)."'"; + $sql .= ", '".$this->db->escape((string) $this->fk_user_author)."'"; $sql .= ", '".$this->db->idate($now)."'"; $sql .= ", '".$this->db->escape($this->code_journal)."'"; $sql .= ", ".(!empty($this->journal_label) ? ("'".$this->db->escape($this->journal_label)."'") : "NULL"); @@ -708,7 +708,7 @@ class BookKeeping extends CommonObject $sql .= ' '."'".$this->db->idate($now)."',"; $sql .= ' '.(empty($this->code_journal) ? 'NULL' : "'".$this->db->escape($this->code_journal)."'").','; $sql .= ' '.(empty($this->journal_label) ? 'NULL' : "'".$this->db->escape($this->journal_label)."'").','; - $sql .= ' '.(empty($this->piece_num) ? 'NULL' : $this->db->escape($this->piece_num)).','; + $sql .= ' '.(empty($this->piece_num) ? 'NULL' : $this->db->escape((string) $this->piece_num)).','; $sql .= ' '.(!isset($this->entity) ? $conf->entity : $this->entity); $sql .= ')'; @@ -908,13 +908,13 @@ class BookKeeping extends CommonObject if (count($filter) > 0) { foreach ($filter as $key => $value) { if ($key == 't.doc_date>=') { - $sqlwhere[] = "t.doc_date >= '".$this->db->idate($value)."'"; + $sqlwhere[] = "t.doc_date >= '".$this->db->idate((int) $value)."'"; } elseif ($key == 't.doc_date<=') { - $sqlwhere[] = "t.doc_date <= '".$this->db->idate($value)."'"; + $sqlwhere[] = "t.doc_date <= '".$this->db->idate((int) $value)."'"; } elseif ($key == 't.doc_date>') { - $sqlwhere[] = "t.doc_date > '".$this->db->idate($value)."'"; + $sqlwhere[] = "t.doc_date > '".$this->db->idate((int) $value)."'"; } elseif ($key == 't.doc_date<') { - $sqlwhere[] = "t.doc_date < '".$this->db->idate($value)."'"; + $sqlwhere[] = "t.doc_date < '".$this->db->idate((int) $value)."'"; } elseif ($key == 't.numero_compte>=') { $sqlwhere[] = "t.numero_compte >= '".$this->db->escape($value)."'"; } elseif ($key == 't.numero_compte<=') { @@ -928,21 +928,21 @@ class BookKeeping extends CommonObject } elseif ($key == 't.subledger_account' || $key == 't.numero_compte') { $sqlwhere[] = $this->db->sanitize($key).' LIKE \''.$this->db->escape($this->db->escapeforlike($value)).'%\''; } elseif ($key == 't.date_creation>=') { - $sqlwhere[] = 't.date_creation >= \''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.date_creation >= \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.date_creation<=') { - $sqlwhere[] = 't.date_creation <= \''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.date_creation <= \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.date_export>=') { - $sqlwhere[] = 't.date_export >= \''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.date_export >= \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.date_export<=') { - $sqlwhere[] = 't.date_export <= \''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.date_export <= \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.date_validated>=') { - $sqlwhere[] = 't.date_validated >= \''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.date_validated >= \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.date_validated<=') { - $sqlwhere[] = 't.date_validated <= \''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.date_validated <= \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.date_lim_reglement>=') { - $sqlwhere[] = 't.date_lim_reglement>=\''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.date_lim_reglement>=\''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.date_lim_reglement<=') { - $sqlwhere[] = 't.date_lim_reglement<=\''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.date_lim_reglement<=\''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.credit' || $key == 't.debit') { $sqlwhere[] = natural_search($key, $value, 1, 1); } elseif ($key == 't.reconciled_option') { @@ -1108,15 +1108,15 @@ class BookKeeping extends CommonObject if (count($filter) > 0) { foreach ($filter as $key => $value) { if ($key == 't.doc_date') { - $sqlwhere[] = $this->db->sanitize($key).' = \''.$this->db->idate($value).'\''; + $sqlwhere[] = $this->db->sanitize($key).' = \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.doc_date>=') { - $sqlwhere[] = "t.doc_date >= '".$this->db->idate($value)."'"; + $sqlwhere[] = "t.doc_date >= '".$this->db->idate((int) $value)."'"; } elseif ($key == 't.doc_date<=') { - $sqlwhere[] = "t.doc_date <= '".$this->db->idate($value)."'"; + $sqlwhere[] = "t.doc_date <= '".$this->db->idate((int) $value)."'"; } elseif ($key == 't.doc_date>') { - $sqlwhere[] = "t.doc_date > '".$this->db->idate($value)."'"; + $sqlwhere[] = "t.doc_date > '".$this->db->idate((int) $value)."'"; } elseif ($key == 't.doc_date<') { - $sqlwhere[] = "t.doc_date < '".$this->db->idate($value)."'"; + $sqlwhere[] = "t.doc_date < '".$this->db->idate((int) $value)."'"; } elseif ($key == 't.numero_compte>=') { $sqlwhere[] = "t.numero_compte >= '".$this->db->escape($value)."'"; } elseif ($key == 't.numero_compte<=') { @@ -1130,21 +1130,21 @@ class BookKeeping extends CommonObject } elseif ($key == 't.subledger_account' || $key == 't.numero_compte') { $sqlwhere[] = $this->db->sanitize($key).' LIKE \''.$this->db->escape($value).'%\''; } elseif ($key == 't.date_creation>=') { - $sqlwhere[] = 't.date_creation >= \''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.date_creation >= \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.date_creation<=') { - $sqlwhere[] = 't.date_creation <= \''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.date_creation <= \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.tms>=') { - $sqlwhere[] = 't.tms >= \''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.tms >= \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.tms<=') { - $sqlwhere[] = 't.tms <= \''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.tms <= \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.date_export>=') { - $sqlwhere[] = 't.date_export >= \''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.date_export >= \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.date_export<=') { - $sqlwhere[] = 't.date_export <= \''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.date_export <= \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.date_validated>=') { - $sqlwhere[] = 't.date_validated >= \''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.date_validated >= \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.date_validated<=') { - $sqlwhere[] = 't.date_validated <= \''.$this->db->idate($value).'\''; + $sqlwhere[] = 't.date_validated <= \''.$this->db->idate((int) $value).'\''; } elseif ($key == 't.credit' || $key == 't.debit') { $sqlwhere[] = natural_search($key, $value, 1, 1); } elseif ($key == 't.code_journal' && !empty($value)) { @@ -1244,7 +1244,7 @@ class BookKeeping extends CommonObject * @param int $offset Offset limit * @param string|array $filter Filter * @param string $filtermode Filter mode (AND or OR) - * @param int $option option (0: aggregate by general account or 1: aggreegate by subaccount) + * @param int<0,1> $option option (0: aggregate by general account or 1: aggregate by subaccount) * @return int Return integer <0 if KO, >0 if OK */ public function fetchAllBalance($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND', $option = 0) @@ -1272,15 +1272,15 @@ class BookKeeping extends CommonObject if (count($filter) > 0) { foreach ($filter as $key => $value) { if ($key == 't.doc_date') { - $sqlwhere[] = $this->db->sanitize($key)." = '".$this->db->idate($value)."'"; + $sqlwhere[] = $this->db->sanitize($key)." = '".$this->db->idate((int) $value)."'"; } elseif ($key == 't.doc_date>=') { - $sqlwhere[] = "t.doc_date >= '".$this->db->idate($value)."'"; + $sqlwhere[] = "t.doc_date >= '".$this->db->idate((int) $value)."'"; } elseif ($key == 't.doc_date<=') { - $sqlwhere[] = "t.doc_date <= '".$this->db->idate($value)."'"; + $sqlwhere[] = "t.doc_date <= '".$this->db->idate((int) $value)."'"; } elseif ($key == 't.doc_date>') { - $sqlwhere[] = "t.doc_date > '".$this->db->idate($value)."'"; + $sqlwhere[] = "t.doc_date > '".$this->db->idate((int) $value)."'"; } elseif ($key == 't.doc_date<') { - $sqlwhere[] = "t.doc_date < '".$this->db->idate($value)."'"; + $sqlwhere[] = "t.doc_date < '".$this->db->idate((int) $value)."'"; } elseif ($key == 't.numero_compte>=') { $sqlwhere[] = "t.numero_compte >= '".$this->db->escape($value)."'"; } elseif ($key == 't.numero_compte<=') { @@ -2249,7 +2249,7 @@ class BookKeeping extends CommonObject $out = ajax_combobox($htmlname, $event); $options = array(); - $selected = null; + $selected = 0; while ($obj = $this->db->fetch_object($resql)) { $label = length_accountg($obj->account_number).' - '.$obj->label; @@ -3331,12 +3331,12 @@ class BookKeepingLine extends CommonObjectLine public $piece_num; /** - * @var int|string $date_export; + * @var int|string */ public $date_export; /** - * @var int|string $date_lim_reglement; + * @var int|string */ public $date_lim_reglement; } diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index 245e8e05d9f..684b1b05507 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -2,6 +2,7 @@ /* Copyright (C) 2019-2023 Open-DSI * Copyright (C) 2024 Frédéric France * Copyright (C) 2025 Alexandre Spangaro + * 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 @@ -154,8 +155,8 @@ if (empty($reshook)) { } } elseif ($action == 'confirm_step_2' && $confirm == "yes" && $user->hasRight('accounting', 'fiscalyear', 'write')) { $new_fiscal_period_id = GETPOSTINT('new_fiscal_period_id'); - $separate_auxiliary_account = GETPOST('separate_auxiliary_account', 'aZ09'); - $generate_bookkeeping_records = GETPOST('generate_bookkeeping_records', 'aZ09'); + $separate_auxiliary_account = GETPOSTINT('separate_auxiliary_account'); + $generate_bookkeeping_records = GETPOSTINT('generate_bookkeeping_records'); $error = 0; if ($generate_bookkeeping_records) { @@ -169,7 +170,7 @@ if (empty($reshook)) { } if (!$error) { - $result = $object->closeFiscalPeriod($current_fiscal_period['id'], $new_fiscal_period_id, $separate_auxiliary_account, $generate_bookkeeping_records); + $result = $object->closeFiscalPeriod($current_fiscal_period['id'], $new_fiscal_period_id, (bool) $separate_auxiliary_account, (bool) $generate_bookkeeping_records); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -362,7 +363,7 @@ if (empty($current_fiscal_period)) { print '' . $langs->trans("AccountancyClosureStep1Desc") . '
'; - $count_by_month = $object->getCountByMonthForFiscalPeriod($current_fiscal_period['date_start'], $current_fiscal_period['date_end']); + $count_by_month = $object->getCountByMonthForFiscalPeriod((int) $current_fiscal_period['date_start'], (int) $current_fiscal_period['date_end']); if (!is_array($count_by_month)) { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 13a484461fe..f60aa76e109 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2007-2017 Laurent Destailleur * Copyright (C) 2024 Alexandre Spangaro * Copyright (C) 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 @@ -614,7 +614,7 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['t.'.$key]['checked'])) { print '$key)) { - print ' title="'.dol_escape_htmltag($object->$key).'"'; + print ' title="'.dol_escape_htmltag((string) $object->$key).'"'; } print '>'; if ($key == 'status') { @@ -624,7 +624,7 @@ while ($i < $imaxinloop) { print $object->showOutputField($val, $key, $object->$key, ''); print ''; } elseif ($key == 'rowid') { - print $object->showOutputField($val, $key, $object->id, ''); + print $object->showOutputField($val, $key, (string) $object->id, ''); } else { print $object->showOutputField($val, $key, $object->$key, ''); } diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index d710306172c..e6fefde8be8 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -12,7 +12,7 @@ * Copyright (C) 2015-2024 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud * 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 @@ -979,7 +979,7 @@ foreach ($fieldlist as $field => $value) { print ''; } elseif ($value == 'fk_user') { print ''; - print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), array(), 0, 0, 0, '', 0, '', 'maxwidth100', 1); + print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), array(), '0', 0, 0, '', 0, '', 'maxwidth100', 1); print ''; } elseif ($value == 'topic') { print ''; @@ -1415,7 +1415,7 @@ function fieldList($fieldlist, $obj = null, $tabname = '', $context = '') } elseif ($value == 'fk_user') { print ''; if ($user->admin && $context != 'preview') { - print $form->select_dolusers(GETPOSTISSET('fk_user') ? GETPOSTINT('fk_user') : (empty($obj->$value) ? '' : $obj->$value), 'fk_user', 1, array(), 0, ($user->admin ? '' : 'hierarchyme'), array(), 0, 0, 0, '', 0, '', 'minwidth75 maxwidth100'); + print $form->select_dolusers(GETPOSTISSET('fk_user') ? GETPOSTINT('fk_user') : (empty($obj->$value) ? '' : $obj->$value), 'fk_user', 1, array(), 0, ($user->admin ? '' : 'hierarchyme'), array(), '0', 0, 0, '', 0, '', 'minwidth75 maxwidth100'); } else { if ($context == 'add') { // I am not admin and we show the add form print $user->getNomUrl(-1); // Me diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 3d5fb00b6ac..8de0ccb9bc8 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -5,6 +5,7 @@ * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2019 Markus Welters * 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 @@ -184,7 +185,7 @@ print ''; print ''.$langs->trans("ResponsibleUser").''; print ''; print img_picto('', 'user', 'class="pictofixedwidth"'); -print $form->select_dolusers($conf->global->PAYMENTBYBANKTRANSFER_USER, 'PAYMENTBYBANKTRANSFER_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'minwidth200 maxwidth500'); +print $form->select_dolusers($conf->global->PAYMENTBYBANKTRANSFER_USER, 'PAYMENTBYBANKTRANSFER_USER', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'minwidth200 maxwidth500'); print ''; print ''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 50a5430df3e..e5429985826 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -5,6 +5,7 @@ * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2019 Markus Welters * 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 @@ -194,7 +195,7 @@ print ''; print ''.$langs->trans("ResponsibleUser").''; print ''; print img_picto('', 'user', 'class="pictofixedwidth"'); -print $form->select_dolusers(getDolGlobalInt('PRELEVEMENT_USER'), 'PRELEVEMENT_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'minwidth200 maxwidth500'); +print $form->select_dolusers(getDolGlobalInt('PRELEVEMENT_USER'), 'PRELEVEMENT_USER', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'minwidth200 maxwidth500'); print ''; print ''; diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 540ca618691..bf29e53cf60 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2022 Laurent Destailleur * Copyright (C) 2014 Marcos García * 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 @@ -186,7 +187,7 @@ if ($action == 'create') { // Target print ''.$langs->trans("BehaviourOnClick").''; - $liste = array(0=>$langs->trans("ReplaceWindow"), 1=>$langs->trans("OpenANewWindow")); + $liste = array(0 => $langs->trans("ReplaceWindow"), 1 => $langs->trans("OpenANewWindow")); $defaulttarget = 1; if ($url && !preg_match('/^http/i', $url)) { $defaulttarget = 0; @@ -197,7 +198,7 @@ if ($action == 'create') { // Visibility / Owner print ''.$langs->trans("Visibility").''; print img_picto('', 'user', 'class="pictofixedwidth"'); - print $form->select_dolusers(GETPOSTISSET('userid') ? GETPOSTINT('userid') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx'); + print $form->select_dolusers(GETPOSTISSET('userid') ? GETPOSTINT('userid') : $user->id, 'userid', 0, null, 0, ($user->admin ? '' : array($user->id)), '', '0', 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx'); print ''; // Position @@ -278,7 +279,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { print ''.$langs->trans("BehaviourOnClick").''; if ($action == 'edit') { - $liste = array(1=>$langs->trans("OpenANewWindow"), 0=>$langs->trans("ReplaceWindow")); + $liste = array(1 => $langs->trans("OpenANewWindow"), 0 => $langs->trans("ReplaceWindow")); print $form->selectarray('target', $liste, GETPOSTISSET("target") ? GETPOST("target") : $object->target); } else { if ($object->target == '0') { @@ -294,7 +295,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { print ''.$langs->trans("Visibility").''; if ($action == 'edit' && $user->admin) { print img_picto('', 'user', 'class="pictofixedwidth"'); - print $form->select_dolusers(GETPOSTISSET('userid') ? GETPOSTINT('userid') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx'); + print $form->select_dolusers(GETPOSTISSET('userid') ? GETPOSTINT('userid') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx'); } else { if ($object->fk_user > 0) { $fuser = new User($db); diff --git a/htdocs/comm/propal/agenda.php b/htdocs/comm/propal/agenda.php index 26179a7b025..e930384bc09 100644 --- a/htdocs/comm/propal/agenda.php +++ b/htdocs/comm/propal/agenda.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 @@ -166,7 +167,7 @@ if ($object->id > 0) { if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { if (!empty($object->fk_project)) { $proj = new Project($db); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3ffddeb50cb..6d5c6378ceb 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -677,7 +677,7 @@ if (empty($reshook)) { if ($id > 0) { // Insert default contacts if defined if (GETPOST('contactid') > 0) { - $result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external'); + $result = $object->add_contact(GETPOSTINT('contactid'), 'CUSTOMER', 'external'); if ($result < 0) { $error++; setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors'); @@ -996,7 +996,7 @@ if (empty($reshook)) { if (!empty($line->vat_src_code)) { $tvatx .= ' ('.$line->vat_src_code.')'; } - $result = $object->updateline($line->id, $line->subprice, $line->qty, $remise_percent, $tvatx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); + $result = $object->updateline($line->id, $line->subprice, $line->qty, (float) $remise_percent, $tvatx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); $object->lines[$key] = $object->line; } } elseif ($action == 'addline' && GETPOST('submitforallmargins', 'alpha') && GETPOST('marginforalllines') !== '' && $usercancreate) { @@ -1018,7 +1018,7 @@ if (empty($reshook)) { $multicurrency_subprice = 0; } // Update DB - $result = $object->updateline($line->id, $subprice, $line->qty, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $multicurrency_subprice); + $result = $object->updateline($line->id, (float) $subprice, $line->qty, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $multicurrency_subprice); $object->lines[$key] = $object->line; // Update $object with new margin info // $line->price = $subprice; @@ -1161,7 +1161,7 @@ if (empty($reshook)) { // If price per customer require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php'; $prodcustprice = new ProductCustomerPrice($db); - $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id); + $filter = array('t.fk_product' => (string) $prod->id, 't.fk_soc' => (string) $object->thirdparty->id); // If a price per customer exist $pricebycustomerexist = false; @@ -1227,7 +1227,7 @@ if (empty($reshook)) { $prodcustprice = new ProductCustomerPrice($db); - $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id); + $filter = array('t.fk_product' => (string) $prod->id, 't.fk_soc' => (string) $object->thirdparty->id); $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { @@ -1477,7 +1477,7 @@ if (empty($reshook)) { if (!$error) { // Insert line - $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $pu_ttc, $info_bits, $type, min($rank, count($object->lines) + 1), 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $date_start, $date_end, $array_options, $fk_unit, '', 0, $pu_ht_devise); + $result = $object->addline($desc, $pu_ht, (float) $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $pu_ttc, $info_bits, $type, min($rank, count($object->lines) + 1), 0, GETPOSTINT('fk_parent_line'), (int) $fournprice, (int) $buyingprice, $label, $date_start, $date_end, $array_options, $fk_unit, '', 0, $pu_ht_devise); if ($result > 0) { $db->commit(); @@ -1683,7 +1683,7 @@ if (empty($reshook)) { $price_base_type = 'TTC'; } - $result = $object->updateline(GETPOSTINT('lineid'), $pu, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $description, $price_base_type, $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise); + $result = $object->updateline(GETPOSTINT('lineid'), (float) $pu, (float) $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $description, $price_base_type, $info_bits, $special_code, GETPOSTINT('fk_parent_line'), 0, (int) $fournprice, (int) $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOSTINT("units"), (float) $pu_ht_devise); if ($result >= 0) { $db->commit(); @@ -1786,7 +1786,7 @@ if (empty($reshook)) { // warehouse $result = $object->setWarehouse(GETPOSTINT('warehouse_id')); } 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 @@ -1809,7 +1809,7 @@ if (empty($reshook)) { if (getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) { if ($action == 'addcontact' && $usercancreate) { if ($object->id > 0) { - $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); + $contactid = (GETPOST('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); } @@ -2118,7 +2118,7 @@ if ($action == 'create') { // Mode of payment print ''.$langs->trans('PaymentMode').''; print img_picto('', 'bank', 'class="pictofixedwidth"'); - print $form->select_types_paiements($mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1); + print $form->select_types_paiements((string) $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1); print ''; // Bank Account @@ -2141,7 +2141,7 @@ if ($action == 'create') { } print ''.$langs->trans('SendingMethod').''; print img_picto('', 'dolly', 'class="pictofixedwidth"'); - $form->selectShippingMethod((GETPOSTISSET('shipping_method_id') ? GETPOSTINT('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); + $form->selectShippingMethod((string) (GETPOSTISSET('shipping_method_id') ? GETPOSTINT('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); print ''; } @@ -2650,7 +2650,7 @@ if ($action == 'create') { if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { if (!empty($object->fk_project)) { $proj = new Project($db); @@ -2715,7 +2715,7 @@ if ($action == 'create') { // print ''; $editenable = $usercancreate && $caneditfield && $object->status == Propal::STATUS_DRAFT; - print $form->editfieldkey("DatePropal", 'date', '', $object, $editenable); + print $form->editfieldkey("DatePropal", 'date', '', $object, (int) $editenable); print ''; if ($action == 'editdate' && $usercancreate && $caneditfield) { print '
'; @@ -2777,9 +2777,9 @@ if ($action == 'create') { print ''; print ''; if ($action == 'editconditions' && $usercancreate && $caneditfield) { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent); + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent); } else { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent); + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent); } print ''; print ''; @@ -2796,16 +2796,16 @@ if ($action == 'create') { print ''; print ''; if ($action == 'editmode' && $usercancreate && $caneditfield) { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 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 ''; // Delivery date $langs->load('deliveries'); print ''; - print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate && $caneditfield, 'datepicker'); + print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, (int) ($usercancreate && $caneditfield), 'datepicker'); print ''; print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate && $caneditfield, 'datepicker'); print ''; @@ -2826,9 +2826,9 @@ if ($action == 'create') { print ''; print ''; if ($action == 'editavailability' && $usercancreate && $caneditfield) { - $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'availability_id', 1); + $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'availability_id', 1); } else { - $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'none', 1); + $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'none', 1); } print ''; @@ -2846,9 +2846,9 @@ if ($action == 'create') { print ''; print ''; if ($action == 'editshippingmethod' && $usercancreate && $caneditfield) { - $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, $object->shipping_method_id, 'shipping_method_id', 1); + $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1); } else { - $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, $object->shipping_method_id, 'none'); + $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'none'); } print ''; print ''; @@ -2883,9 +2883,9 @@ if ($action == 'create') { print ''; print ''; if ($action == 'editdemandreason' && $usercancreate) { - $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'demand_reason_id', 1); + $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1); } else { - $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'none'); + $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'none'); } print ''; print ''; @@ -2915,9 +2915,9 @@ if ($action == 'create') { 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 ''; @@ -3238,9 +3238,9 @@ if ($action == 'create') { ]; if ($numlines > 0) { - print dolGetButtonAction('', $langs->trans("Create"), 'default', $arrayforbutaction, $object->id, 1, $actionButtonsParameters); + print dolGetButtonAction('', $langs->trans("Create"), 'default', $arrayforbutaction, (string) $object->id, 1, $actionButtonsParameters); } else { - print dolGetButtonAction($langs->trans("ErrorObjectMustHaveLinesToBeValidated", $object->ref), $langs->trans("Create"), 'default', $arrayforbutaction, $object->id, 0, $actionButtonsParameters); + print dolGetButtonAction($langs->trans("ErrorObjectMustHaveLinesToBeValidated", $object->ref), $langs->trans("Create"), 'default', $arrayforbutaction, (string) $object->id, 0, $actionButtonsParameters); } if ($object->status == Propal::STATUS_SIGNED && !getDolGlobalString('PROPOSAL_ARE_NOT_BILLABLE')) { @@ -3308,7 +3308,7 @@ if ($action == 'create') { $genallowed = $usercanread; $delallowed = $usercancreate; - print $formfile->showdocuments('propal', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang, '', $object); + print $formfile->showdocuments('propal', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '0', '', $soc->default_lang, '', $object); // Show links to link elements $tmparray = $form->showLinkToObjectBlock($object, array(), array('propal'), 1); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 2015e1208c6..7f3e30d1b31 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -732,7 +732,7 @@ class Propal extends CommonObject $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. } - $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $mysoc, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise); + $tabprice = calcul_price_total($qty, (float) $pu, (float) $remise_percent, $txtva, (float) $txlocaltax1, (float) $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $mysoc, $localtaxes_type, 100, $this->multicurrency_tx, (float) $pu_ht_devise); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; @@ -953,7 +953,7 @@ class Propal extends CommonObject // TODO Implement if (getDolGlobalInt('MAIN_UNIT_PRICE_WITH_TAX_IS_FOR_ALL_TAXES')) ? - $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise); + $tabprice = calcul_price_total($qty, (float) $pu, (float) $remise_percent, $txtva, (float) $txlocaltax1, (float) $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type, 100, $this->multicurrency_tx, (float) $pu_ht_devise); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; @@ -1363,7 +1363,7 @@ class Propal extends CommonObject $line->date_end, $line->array_options, $line->fk_unit, - $origintype, + (string) $origintype, $originid, 0, 0, @@ -1537,7 +1537,7 @@ class Propal extends CommonObject } } elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { $prodcustprice = new ProductCustomerPrice($this->db); - $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $objsoc->id); + $filter = array('t.fk_product' => (string) $prod->id, 't.fk_soc' => (string) $objsoc->id); $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { // If there is some prices specific to the customer @@ -3702,7 +3702,7 @@ class Propal extends CommonObject * Returns the reference to the following non used Proposal used depending on the active numbering module * defined into PROPALE_ADDON * - * @param Societe $soc Object thirdparty + * @param ?Societe $soc Object thirdparty * @return string Reference libre pour la propale */ public function getNextNumRef($soc) diff --git a/htdocs/comm/propal/class/propaleligne.class.php b/htdocs/comm/propal/class/propaleligne.class.php index 31616d5cb85..6b353bb51a9 100644 --- a/htdocs/comm/propal/class/propaleligne.class.php +++ b/htdocs/comm/propal/class/propaleligne.class.php @@ -19,7 +19,7 @@ * Copyright (C) 2022 OpenDSI * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023 William Mead - * 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 @@ -551,12 +551,12 @@ class PropaleLigne extends CommonObjectLine $sql .= ' date_start, date_end'; $sql .= ', fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc)'; $sql .= " VALUES (".$this->fk_propal.","; - $sql .= " ".($this->fk_parent_line > 0 ? "'".$this->db->escape($this->fk_parent_line)."'" : "null").","; + $sql .= " ".($this->fk_parent_line > 0 ? "'".$this->db->escape((string) $this->fk_parent_line)."'" : "null").","; $sql .= " ".(!empty($this->label) ? "'".$this->db->escape($this->label)."'" : "null").","; $sql .= " '".$this->db->escape($this->desc)."',"; - $sql .= " ".($this->fk_product ? "'".$this->db->escape($this->fk_product)."'" : "null").","; - $sql .= " '".$this->db->escape($this->product_type)."',"; - $sql .= " ".($this->fk_remise_except ? "'".$this->db->escape($this->fk_remise_except)."'" : "null").","; + $sql .= " ".($this->fk_product ? "'".$this->db->escape((string) $this->fk_product)."'" : "null").","; + $sql .= " '".$this->db->escape((string) $this->product_type)."',"; + $sql .= " ".($this->fk_remise_except ? "'".$this->db->escape((string) $this->fk_remise_except)."'" : "null").","; $sql .= " ".price2num($this->qty, 'MS').","; $sql .= " ".(empty($this->vat_src_code) ? "''" : "'".$this->db->escape($this->vat_src_code)."'").","; $sql .= " ".price2num($this->tva_tx).","; @@ -572,7 +572,7 @@ class PropaleLigne extends CommonObjectLine $sql .= " ".price2num($this->total_localtax1, 'MT').","; $sql .= " ".price2num($this->total_localtax2, 'MT').","; $sql .= " ".price2num($this->total_ttc, 'MT').","; - $sql .= " ".(!empty($this->fk_fournprice) ? "'".$this->db->escape($this->fk_fournprice)."'" : "null").","; + $sql .= " ".(!empty($this->fk_fournprice) ? "'".$this->db->escape((string) $this->fk_fournprice)."'" : "null").","; $sql .= " ".(isset($this->pa_ht) ? "'".price2num($this->pa_ht)."'" : "null").","; $sql .= ' '.((int) $this->special_code).','; $sql .= ' '.((int) $this->rang).','; @@ -768,7 +768,7 @@ class PropaleLigne extends CommonObjectLine $sql .= ", remise_percent=".price2num($this->remise_percent); $sql .= ", price=".(float) price2num($this->price); // TODO A virer $sql .= ", remise=".(float) price2num($this->remise); // TODO A virer - $sql .= ", info_bits='".$this->db->escape($this->info_bits)."'"; + $sql .= ", info_bits='".$this->db->escape((string) $this->info_bits)."'"; if (empty($this->skip_update_total)) { $sql .= ", total_ht=".price2num($this->total_ht); $sql .= ", total_tva=".price2num($this->total_tva); @@ -776,7 +776,7 @@ class PropaleLigne extends CommonObjectLine $sql .= ", total_localtax1=".price2num($this->total_localtax1); $sql .= ", total_localtax2=".price2num($this->total_localtax2); } - $sql .= ", fk_product_fournisseur_price=".(!empty($this->fk_fournprice) ? "'".$this->db->escape($this->fk_fournprice)."'" : "null"); + $sql .= ", fk_product_fournisseur_price=".(!empty($this->fk_fournprice) ? "'".$this->db->escape((string) $this->fk_fournprice)."'" : "null"); $sql .= ", buy_price_ht=".price2num($this->pa_ht); $sql .= ", special_code=".((int) $this->special_code); $sql .= ", fk_parent_line=".($this->fk_parent_line > 0 ? (int) $this->fk_parent_line : "null"); diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 15c918aca8b..5ee512c0435 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -5,6 +5,7 @@ * Copyright (C) 2011-2022 Philippe Grand * Copyright (C) 2023 Christian Foellmann * 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 @@ -89,7 +90,7 @@ $usercancreate = $user->hasRight("propal", "creer"); * Actions */ -$parameters = array('id'=>$id); +$parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -170,7 +171,7 @@ if ($object->id > 0) { if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { if (!empty($object->fk_project)) { $proj = new Project($db); diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index f0793c367d4..2936eca72dd 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -6,6 +6,7 @@ * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2017 Ferran Marcet * 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 @@ -151,7 +152,7 @@ if ($object->id > 0) { if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { if (!empty($object->fk_project)) { $proj = new Project($db); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 2241d832830..0415e494457 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -17,7 +17,7 @@ * Copyright (C) 2021 Anthony Berton * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2022 Josep Lluís Amador - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 William Mead * * This program is free software; you can redistribute it and/or modify @@ -225,51 +225,51 @@ if (empty($user->socid)) { $checkedtypetiers = 0; $arrayfields = array( - 'p.ref' => array('label' => "Ref", 'checked' => 1), - 'p.ref_client' => array('label' => "RefCustomer", 'checked' => -1), - 'pr.ref' => array('label' => "ProjectRef", 'checked' => 1, 'enabled' => (isModEnabled('project') ? 1 : 0)), - 'pr.title' => array('label' => "ProjectLabel", 'checked' => 0, 'enabled' => (isModEnabled('project') ? 1 : 0)), - 's.nom' => array('label' => "ThirdParty", 'checked' => 1), - 's.name_alias' => array('label' => "AliasNameShort", 'checked' => -1), - 's.town' => array('label' => "Town", 'checked' => -1), - 's.zip' => array('label' => "Zip", 'checked' => -1), - 'state.nom' => array('label' => "StateShort", 'checked' => 0), - 'country.code_iso' => array('label' => "Country", 'checked' => 0), - 'typent.code' => array('label' => "ThirdPartyType", 'checked' => $checkedtypetiers), - 'p.date' => array('label' => "DatePropal", 'checked' => 1), - 'p.fin_validite' => array('label' => "DateEnd", 'checked' => 1), - 'p.date_livraison' => array('label' => "DeliveryDate", 'checked' => 0), - 'p.date_signature' => array('label' => "DateSigning", 'checked' => 0), - 'ava.rowid' => array('label' => "AvailabilityPeriod", 'checked' => 0), - 'p.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => 0, 'enabled' => isModEnabled("shipping")), - 'p.fk_input_reason' => array('label' => "Origin", 'checked' => 0, 'enabled' => 1), - 'p.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => 0), - 'p.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => 0), - 'p.total_ht' => array('label' => "AmountHT", 'checked' => 1), - 'p.total_tva' => array('label' => "AmountVAT", 'checked' => 0), - 'p.total_ttc' => array('label' => "AmountTTC", 'checked' => 0), - 'p.total_ht_invoiced' => array('label' => "AmountInvoicedHT", 'checked' => 0, 'enabled' => getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT')), - 'p.total_invoiced' => array('label' => "AmountInvoicedTTC", 'checked' => 0, 'enabled' => getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT')), - 'p.multicurrency_code' => array('label' => 'Currency', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), - 'p.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), - 'p.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), - 'p.multicurrency_total_tva' => array('label' => 'MulticurrencyAmountVAT', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), - 'p.multicurrency_total_ttc' => array('label' => 'MulticurrencyAmountTTC', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), - 'p.multicurrency_total_ht_invoiced' => array('label' => 'MulticurrencyAmountInvoicedHT', 'checked' => 0, 'enabled' => isModEnabled("multicurrency") && getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT')), - 'p.multicurrency_total_invoiced' => array('label' => 'MulticurrencyAmountInvoicedTTC', 'checked' => 0, 'enabled' => isModEnabled("multicurrency") && getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT')), - 'u.login' => array('label' => "Author", 'checked' => 1, 'position' => 10), - 'sale_representative' => array('label' => "SaleRepresentativesOfThirdParty", 'checked' => -1), - 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') ? 0 : 1)), - 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') ? 0 : 1)), - 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') || !getDolGlobalString('DISPLAY_MARGIN_RATES') ? 0 : 1)), - 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') || !getDolGlobalString('DISPLAY_MARK_RATES') ? 0 : 1)), - 'p.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500), - 'p.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 500), - 'p.date_cloture' => array('label' => "DateClosing", 'checked' => 0, 'position' => 500), - 'p.note_public' => array('label' => 'NotePublic', 'checked' => 0, 'position' => 510, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), - 'p.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'position' => 511, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), - 'p.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 999), - 'p.fk_statut' => array('label' => "Status", 'checked' => 1, 'position' => 1000), + 'p.ref' => array('label' => "Ref", 'checked' => '1'), + 'p.ref_client' => array('label' => "RefCustomer", 'checked' => '-1'), + 'pr.ref' => array('label' => "ProjectRef", 'checked' => '1', 'enabled' => (isModEnabled('project') ? '1' : '0')), + 'pr.title' => array('label' => "ProjectLabel", 'checked' => '0', 'enabled' => (isModEnabled('project') ? '1' : '0')), + 's.nom' => array('label' => "ThirdParty", 'checked' => '1'), + 's.name_alias' => array('label' => "AliasNameShort", 'checked' => '-1'), + 's.town' => array('label' => "Town", 'checked' => '-1'), + 's.zip' => array('label' => "Zip", 'checked' => '-1'), + 'state.nom' => array('label' => "StateShort", 'checked' => '0'), + 'country.code_iso' => array('label' => "Country", 'checked' => '0'), + 'typent.code' => array('label' => "ThirdPartyType", 'checked' => (string) $checkedtypetiers), + 'p.date' => array('label' => "DatePropal", 'checked' => '1'), + 'p.fin_validite' => array('label' => "DateEnd", 'checked' => '1'), + 'p.date_livraison' => array('label' => "DeliveryDate", 'checked' => '0'), + 'p.date_signature' => array('label' => "DateSigning", 'checked' => '0'), + 'ava.rowid' => array('label' => "AvailabilityPeriod", 'checked' => '0'), + 'p.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => '0', 'enabled' => (string) (int) isModEnabled("shipping")), + 'p.fk_input_reason' => array('label' => "Origin", 'checked' => '0', 'enabled' => '1'), + 'p.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => '0'), + 'p.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => '0'), + 'p.total_ht' => array('label' => "AmountHT", 'checked' => '1'), + 'p.total_tva' => array('label' => "AmountVAT", 'checked' => '0'), + 'p.total_ttc' => array('label' => "AmountTTC", 'checked' => '0'), + 'p.total_ht_invoiced' => array('label' => "AmountInvoicedHT", 'checked' => '0', 'enabled' => getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT')), + 'p.total_invoiced' => array('label' => "AmountInvoicedTTC", 'checked' => '0', 'enabled' => getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT')), + 'p.multicurrency_code' => array('label' => 'Currency', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1')), + 'p.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1')), + 'p.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1')), + 'p.multicurrency_total_tva' => array('label' => 'MulticurrencyAmountVAT', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1')), + 'p.multicurrency_total_ttc' => array('label' => 'MulticurrencyAmountTTC', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1')), + 'p.multicurrency_total_ht_invoiced' => array('label' => 'MulticurrencyAmountInvoicedHT', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("multicurrency") && getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT'))), + 'p.multicurrency_total_invoiced' => array('label' => 'MulticurrencyAmountInvoicedTTC', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("multicurrency") && getDolGlobalString('PROPOSAL_SHOW_INVOICED_AMOUNT'))), + 'u.login' => array('label' => "Author", 'checked' => '1', 'position' => 10), + 'sale_representative' => array('label' => "SaleRepresentativesOfThirdParty", 'checked' => '-1'), + 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => '0', 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') ? '0' : '1')), + 'total_margin' => array('label' => 'Margin', 'checked' => '0', 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') ? '0' : '1')), + 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => '0', 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') || !getDolGlobalString('DISPLAY_MARGIN_RATES') ? '0' : '1')), + 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => '0', 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') || !getDolGlobalString('DISPLAY_MARK_RATES') ? '0' : '1')), + 'p.datec' => array('label' => "DateCreation", 'checked' => '0', 'position' => 500), + 'p.tms' => array('label' => "DateModificationShort", 'checked' => '0', 'position' => 500), + 'p.date_cloture' => array('label' => "DateClosing", 'checked' => '0', 'position' => 500), + 'p.note_public' => array('label' => 'NotePublic', 'checked' => '0', 'position' => 510, 'enabled' => (string) (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), + 'p.note_private' => array('label' => 'NotePrivate', 'checked' => '0', 'position' => 511, 'enabled' => (string) (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), + 'p.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => '1', 'visible' => -2, 'position' => 999), + 'p.fk_statut' => array('label' => "Status", 'checked' => '1', 'position' => 1000), ); // List of fields to search into when doing a "search in all" @@ -1199,7 +1199,7 @@ if ($user->hasRight('user', 'user', 'lire')) { if ($user->hasRight('user', 'user', 'lire')) { $moreforfilter .= '
'; $tmptitle = $langs->trans('LinkedToSpecificUsers'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers((empty($search_user) ? -2 : 0), 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers((empty($search_user) ? -2 : 0), 'search_user', $tmptitle, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx'); $moreforfilter .= '
'; } // If the user can view products @@ -1222,7 +1222,7 @@ if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_ $formproduct = new FormProduct($db); $moreforfilter .= '
'; $tmptitle = $langs->trans('Warehouse'); - $moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', $tmptitle, 0, 0, $tmptitle); + $moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse'); $moreforfilter .= '
'; } $parameters = array(); @@ -1278,7 +1278,7 @@ if (!empty($arrayfields['pr.title']['checked'])) { } if (!empty($arrayfields['s.nom']['checked'])) { print ''; - print ' 0 ? " disabled" : "").'>'; + print ' 0 ? " disabled" : "").'>'; print ''; } if (!empty($arrayfields['s.name_alias']['checked'])) { @@ -1377,7 +1377,7 @@ if (!empty($arrayfields['p.fk_input_reason']['checked'])) { // Payment term if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) { print ''; - print $form->getSelectConditionsPaiements($search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1); + print $form->getSelectConditionsPaiements((int) $search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1); print ''; } // Payment mode @@ -2057,7 +2057,7 @@ while ($i < $imaxinloop) { // Availability if (!empty($arrayfields['ava.rowid']['checked'])) { print ''; - $form->form_availability(0, $obj->availability, 'none', 1); + $form->form_availability('0', $obj->availability, 'none', 1); print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 9893310b924..310b365cdaf 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -6,6 +6,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2017 Ferran Marcet * 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 @@ -129,7 +130,7 @@ if ($object->id > 0) { if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { if (!empty($object->fk_project)) { $proj = new Project($db); diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index ff88cc5e51f..183c0841069 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -5,7 +5,7 @@ * Copyright (C) 2012 Marcos García * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2020 Maxime DEMAREST - * 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 @@ -231,7 +231,7 @@ if (!$mesg) { $px3->SetLegend($legend); $px3->SetYLabel($langs->trans("AmountAverage")); $px3->SetMaxValue($px3->GetCeilMaxValue()); - $px3->SetMinValue($px3->GetFloorMinValue()); + $px3->SetMinValue((int) $px3->GetFloorMinValue()); $px3->SetWidth($WIDTH); $px3->SetHeight($HEIGHT); $px3->SetShading(3); @@ -300,7 +300,7 @@ print ''; // User print ''.$langs->trans("CreatedBy").''; print img_picto('', 'user', 'class="pictofixedwidth"'); -print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); +print $form->select_dolusers($userid, 'userid', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); print ''; // Status print ''.$langs->trans("Status").''; diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 2cb946acf25..353628a473b 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2013 Florian Henry * 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 @@ -226,7 +226,7 @@ if ($action == 'create') { print ""; print ''.$langs->trans("Person").''; - print $form->select_dolusers(GETPOSTINT('fk_user'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + print $form->select_dolusers(GETPOSTINT('fk_user'), 'fk_user', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth300'); print ''; print ""; @@ -317,7 +317,7 @@ if ($action == 'create') { // Who print ""; print ''.$langs->trans("Person").''; - print $form->select_dolusers(GETPOSTINT('fk_user') ? GETPOSTINT('fk_user') : $object->fk_user, 'fk_user', 0, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + print $form->select_dolusers(GETPOSTINT('fk_user') ? GETPOSTINT('fk_user') : $object->fk_user, 'fk_user', 0, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth300'); print ''; // Date diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 79f3f16c9d8..46516dfa2d9 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2006 Rodolphe Quiedeville * Copyright (c) 2004-2012 Laurent Destailleur * Copyright (C) 2012 Marcos García - * 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 @@ -265,7 +265,7 @@ if (!$user->hasRight('deplacement', 'readall') && !$user->hasRight('deplacement' $include = 'hierarchy'; } print img_picto('', 'user', 'class="pictofixedwidth"'); -print $form->select_dolusers($userid, 'userid', 1, '', 0, $include, '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); +print $form->select_dolusers($userid, 'userid', 1, null, 0, $include, '', '0', 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); print ''; // Year print ''.$langs->trans("Year").''; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 2e4920cd379..44555f13bf4 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -17,7 +17,7 @@ * Copyright (C) 2021-2024 Anthony Berton * Copyright (C) 2023 Nick Fragoulis * Copyright (C) 2023 Joachim Kueter - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 Solution Libre SAS * Copyright (C) 2024 William Mead @@ -1382,7 +1382,7 @@ if ($user->hasRight("user", "user", "lire")) { if ($user->hasRight("user", "user", "lire")) { $moreforfilter .= '
'; $tmptitle = $langs->trans('LinkedToSpecificUsers'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= '
'; } // Filter on product tags diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index c2e5db0de9c..7b48727455e 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -5,7 +5,7 @@ * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2020 Maxime DEMAREST - * 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 @@ -342,7 +342,7 @@ if (isModEnabled('category')) { // User print ''.$langs->trans("CreatedBy").''; print img_picto('', 'user', 'class="pictofixedwidth"'); -print $form->select_dolusers($userid ? $userid : -1, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); +print $form->select_dolusers($userid ? $userid : -1, 'userid', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); print ''; // Status print ''.$langs->trans("Status").''; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index e2f11457698..7ca0b7e21a8 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023 Charlene Benke * Copyright (C) 2023 Nick Fragoulis - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -1287,13 +1287,13 @@ if ($action == 'create') { // Commercial suivi print ''.$langs->trans("TypeContact_contrat_internal_SALESREPFOLL").''; print img_picto('', 'user', 'class="pictofixedwidth"'); - print $form->select_dolusers(GETPOST("commercial_suivi_id") ? GETPOST("commercial_suivi_id") : $user->id, 'commercial_suivi_id', 1, ''); + print $form->select_dolusers(GETPOST("commercial_suivi_id") ? GETPOST("commercial_suivi_id") : $user->id, 'commercial_suivi_id', 1, null); print ''; // Commercial signature print ''.$langs->trans("TypeContact_contrat_internal_SALESREPSIGN").''; print img_picto('', 'user', 'class="pictofixedwidth"'); - print $form->select_dolusers(GETPOST("commercial_signature_id") ? GETPOST("commercial_signature_id") : $user->id, 'commercial_signature_id', 1, ''); + print $form->select_dolusers(GETPOST("commercial_signature_id") ? GETPOST("commercial_signature_id") : $user->id, 'commercial_signature_id', 1, null); print ''; print ''.$langs->trans("Date").''; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 52557b35668..580c7c78758 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -828,7 +828,7 @@ if ($user->hasRight('user', 'user', 'lire')) { if ($user->hasRight('user', 'user', 'lire')) { $moreforfilter .= '
'; $tmptitle = $langs->trans('LinkedToSpecificUsers'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, null, 0, '', '', '0', 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); $moreforfilter .= '
'; } // If the user can view categories of products diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f820a8467d5..5360bac4c93 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7010,7 +7010,7 @@ class Form // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); - if (is_object($societe_vendeuse) && isInEEC($societe_vendeuse) && isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()) { + if (is_object($societe_vendeuse) && is_object($societe_acheteuse) && isInEEC($societe_vendeuse) && isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()) { // We also add the buyer country code if (is_numeric($type)) { if ($type == 1) { // We know product is a service @@ -8941,7 +8941,7 @@ class Form * Note: Do not apply langs->trans function on returned content, content may be entity encoded twice. * * @param string $htmlname Name of html select area. Try to start name with "multi" or "search_multi" if this is a multiselect - * @param array,css?:string}>|string[] $array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...)) + * @param array,data-placeholder?:string,disable?:int<0,1>,css?:string}>|string[] $array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...)) * @param string|string[]|int $id Preselected key or array of preselected keys for multiselect. Use 'ifone' to autoselect record if there is only one record. * @param int<0,1>|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (If 1: key is -1 and value is '' or ' ', If 'Placeholder string': key is -1 and value is the string), <0 to add an empty value with key that is this value. * @param int<0,1> $key_in_label 1 to show key into label with format "[key] value" @@ -8954,7 +8954,7 @@ class Form * @param string $morecss Add more class to css styles * @param int<0,1> $addjscombo Add js combo * @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set - * @param int $disablebademail 1=Check if a not valid email, 2=Check string '---', and if found into value, disable and colorize entry + * @param int<0,2> $disablebademail 1=Check if a not valid email, 2=Check string '---', and if found into value, disable and colorize entry * @param int<0,1> $nohtmlescape No html escaping (not recommended, use 'data-html' if you need to use label with HTML content). * @return string HTML select string. * @see multiselectarray(), selectArrayAjax(), selectArrayFilter() diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 6945ef93e8c..da3848f0a56 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -104,7 +104,7 @@ function print_actions_filter( // Assigned to user print '
'; print img_picto($langs->trans("ActionsToDoBy"), 'user', 'class="pictofixedwidth inline-block"'); - print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'minwidth100 maxwidth250 widthcentpercentminusx'); + print $form->select_dolusers($filtert, 'search_filtert', 1, null, !$canedit, '', '', '0', 0, 0, '', 0, '', 'minwidth100 maxwidth250 widthcentpercentminusx'); print '
'; // Assigned to user group diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 15a45f4a2c6..6fd9c738929 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -428,7 +428,7 @@ class pdf_azur extends ModelePDFPropales // Extrafields in note $extranote = $this->getExtrafieldsInHtml($object, $outputlangs); if (!empty($extranote)) { - $notetoshow = dol_concatdesc($notetoshow, $extranote); + $notetoshow = dol_concatdesc((string) $notetoshow, $extranote); } if (getDolGlobalString('MAIN_ADD_CREATOR_IN_NOTE') && $object->user_author_id > 0) { $tmpuser = new User($this->db); @@ -443,7 +443,7 @@ class pdf_azur extends ModelePDFPropales $creator_info .= ', '.$langs->trans("Phone").': '.$tmpuser->office_phone; } - $notetoshow = dol_concatdesc($notetoshow, $creator_info); + $notetoshow = dol_concatdesc((string) $notetoshow, $creator_info); } if ($notetoshow) { @@ -1265,13 +1265,13 @@ class pdf_azur extends ModelePDFPropales $totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalVAT", $mysoc->country_code) : ''); $totalvat .= ' '; if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') { - $totalvat .= vatrate($tvaval['vatrate'], true).$tvacompl; + $totalvat .= vatrate((string) $tvaval['vatrate'], true).$tvacompl; } elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') { $totalvat .= $tvaval['vatcode'].$tvacompl; } elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate($tvaval['vatrate'], true).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl; + $totalvat .= vatrate((string) $tvaval['vatrate'], true).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); @@ -1537,7 +1537,7 @@ class pdf_azur extends ModelePDFPropales * @param Propal $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output - * @param Translate $outputlangsbis Object lang for output bis + * @param ?Translate $outputlangsbis Object lang for output bis * @return float|int Return topshift value */ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 15d61fd9aea..5549609467e 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -402,7 +402,7 @@ class pdf_cyan extends ModelePDFPropales // Extrafields in note $extranote = $this->getExtrafieldsInHtml($object, $outputlangs); if (!empty($extranote)) { - $notetoshow = dol_concatdesc($notetoshow, $extranote); + $notetoshow = dol_concatdesc((string) $notetoshow, $extranote); } if (getDolGlobalString('MAIN_ADD_CREATOR_IN_NOTE') && $object->user_author_id > 0) { @@ -417,7 +417,7 @@ class pdf_cyan extends ModelePDFPropales $creator_info .= ', '.$langs->trans("Phone").': '.$tmpuser->office_phone; } - $notetoshow = dol_concatdesc($notetoshow, $creator_info); + $notetoshow = dol_concatdesc((string) $notetoshow, $creator_info); } $tab_height = $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter; @@ -1524,14 +1524,14 @@ class pdf_cyan extends ModelePDFPropales * Show table for lines * * @param TCPDF $pdf Object PDF - * @param float|int $tab_top Top position of table - * @param float|int $tab_height Height of table (rectangle) - * @param int $nexY Y (not used) + * @param float $tab_top Top position of table + * @param float $tab_height Height of table (rectangle) + * @param float $nexY Y (not used) * @param Translate $outputlangs Langs object - * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title - * @param int $hidebottom Hide bottom bar of array + * @param int<0,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title + * @param int<0,1> $hidebottom Hide bottom bar of array * @param string $currency Currency code - * @param Translate $outputlangsbis Langs object bis + * @param ?Translate $outputlangsbis Langs object bis * @return void */ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '', $outputlangsbis = null) @@ -1574,7 +1574,7 @@ class pdf_cyan extends ModelePDFPropales if (getDolGlobalString('MAIN_PDF_TITLE_TEXT_COLOR')) { $arrayColorTextTitle = explode(',', getDolGlobalString('MAIN_PDF_TITLE_TEXT_COLOR')); - $pdf->SetTextColor($arrayColorTextTitle[0], $arrayColorTextTitle[1], $arrayColorTextTitle[2]); + $pdf->SetTextColor((float) $arrayColorTextTitle[0], (float) $arrayColorTextTitle[1], (float) $arrayColorTextTitle[2]); } $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); @@ -1594,9 +1594,9 @@ class pdf_cyan extends ModelePDFPropales * * @param TCPDF $pdf Object PDF * @param Propal $object Object to show - * @param int $showaddress 0=no, 1=yes + * @param int<0,1> $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output - * @param Translate $outputlangsbis Object lang for output bis + * @param ?Translate $outputlangsbis Object lang for output bis * @return float|int Return topshift value */ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null) diff --git a/htdocs/core/modules/propale/mod_propale_marbre.php b/htdocs/core/modules/propale/mod_propale_marbre.php index 4d2042dfa40..905578b5a10 100644 --- a/htdocs/core/modules/propale/mod_propale_marbre.php +++ b/htdocs/core/modules/propale/mod_propale_marbre.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2024-2025 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 @@ -127,7 +127,7 @@ class mod_propale_marbre extends ModeleNumRefPropales /** * Return next value * - * @param Societe $objsoc Object third party + * @param ?Societe $objsoc Object third party * @param Propal $propal Object commercial proposal * @return string|int<-1,0> Next value, <=0 if KO */ diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index 93ebf4f8298..271b2533ba5 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 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 @@ -130,7 +130,7 @@ class mod_propale_saphir extends ModeleNumRefPropales /** * Return next value * - * @param Societe $objsoc Object third party + * @param ?Societe $objsoc Object third party * @param Propal $propal Object commercial proposal * @return string|int<-1,0> Next value, <=0 if KO */ diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index b4643a0ab69..49ce72f1227 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2014 Marcos García - * Copyright (C) 2024-2025 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 @@ -148,7 +148,7 @@ abstract class ModeleNumRefPropales extends CommonNumRefGenerator /** * Return next value * - * @param Societe $objsoc Object third party + * @param ?Societe $objsoc Object third party * @param Propal $propal Object commercial proposal * @return string|int<-1,0> Next value, <=0 if KO */ diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index eee6cda2b3d..c29b7a9cf31 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -134,10 +134,11 @@ if ($massaction == 'preaffecttag' && isModEnabled('category')) { } if ($massaction == 'preupdateprice' - && (getDolGlobalString('PRODUCT_PRICE_UNIQ') + && ( + getDolGlobalString('PRODUCT_PRICE_UNIQ') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_MULTIPRICES') - )) { + )) { $formquestion = array(); $valuefield = '
'; @@ -151,9 +152,9 @@ if ($massaction == 'preupdateprice' 'value' => $valuefield ); - $descConfirmPreUpdatePrice=$langs->trans("ConfirmUpdatePriceQuestion", count($toselect)); + $descConfirmPreUpdatePrice = $langs->trans("ConfirmUpdatePriceQuestion", count($toselect)); if (getDolGlobalString('PRODUIT_MULTIPRICES')) { - $descConfirmPreUpdatePrice=$langs->trans("ConfirmUpdatePriceQuestion", count($toselect)*getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT') .' ('.$langs->transnoentities('PricingRule').', '.$langs->transnoentities('MultiPricesNumPrices').')'); + $descConfirmPreUpdatePrice = $langs->trans("ConfirmUpdatePriceQuestion", count($toselect) * getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT') .' ('.$langs->transnoentities('PricingRule').', '.$langs->transnoentities('MultiPricesNumPrices').')'); } print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUpdatePrice"), $descConfirmPreUpdatePrice, "updateprice", $formquestion, 1, 0, 200, 500, 1); @@ -428,7 +429,7 @@ if ($massaction == 'predisable') { } if ($massaction == 'presetcommercial') { $formquestion = array(); - $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, 'AND u.statut = 1', 0, '', '', 0, 1); + $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', '0', 0, 0, 'AND u.statut = 1', 0, '', '', 0, 1); $formquestion[] = array('type' => 'other', 'name' => 'affectedcommercial', 'label' => $form->editfieldkey('AllocateCommercial', 'commercial_id', '', $object, 0), @@ -437,7 +438,7 @@ if ($massaction == 'presetcommercial') { } if ($massaction == 'unsetcommercial') { $formquestion = array(); - $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, 'AND u.statut = 1', 0, '', '', 0, 1); + $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', '0', 0, 0, 'AND u.statut = 1', 0, '', '', 0, 1); $formquestion[] = array('type' => 'other', 'name' => 'unassigncommercial', 'label' => $form->editfieldkey('UnallocateCommercial', 'commercial_id', '', $object, 0), diff --git a/htdocs/core/tpl/objectlinked_lineimport.tpl.php b/htdocs/core/tpl/objectlinked_lineimport.tpl.php index eb6f7b470b6..c6ac5664b3c 100644 --- a/htdocs/core/tpl/objectlinked_lineimport.tpl.php +++ b/htdocs/core/tpl/objectlinked_lineimport.tpl.php @@ -1,5 +1,6 @@ + * 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 @@ -21,7 +22,7 @@ if (empty($conf) || !is_object($conf)) { exit(1); } -$objectUrl = $object->getNomUrl(0, '', 0, 1); +$objectUrl = $object->getNomUrl(0, '', '0', 1); if ($object->element == 'propal') { $objectUrl = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id; } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index a3dd9f7d495..0d605cd39a0 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1,7 +1,7 @@ * Copyright (C) 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 @@ -242,7 +242,7 @@ class EmailCollector extends CommonObject public $maxemailpercollect; /** - * @var int|string $datelastresult + * @var int|string */ public $datelastresult; @@ -340,9 +340,9 @@ class EmailCollector extends CommonObject /** * Create object into database * - * @param User $user User that creates - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, Id of created object if OK + * @param User $user User that creates + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK */ public function create(User $user, $notrigger = 0) { @@ -395,9 +395,9 @@ class EmailCollector extends CommonObject /** * Clone and object into another one * - * @param User $user User that creates - * @param int $fromid Id of object to clone - * @return mixed New object created, <0 if KO + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @return EmailCollector|int<-1,-1> New object created, <0 if KO */ public function createFromClone(User $user, $fromid) { @@ -469,9 +469,9 @@ class EmailCollector extends CommonObject /** * Load object in memory from the database * - * @param int $id Id object - * @param string $ref Ref - * @return int Return integer <0 if KO, 0 if not found, >0 if OK + * @param int $id Id object + * @param ?string $ref Ref + * @return int Return integer <0 if KO, 0 if not found, >0 if OK */ public function fetch($id, $ref = null) { @@ -920,7 +920,7 @@ class EmailCollector extends CommonObject /** * overwitePropertiesOfObject * - * @param object $object Current object we will set ->properties + * @param Object $object Current object (stdClass) we will set ->properties * @param string $actionparam Action parameters * @param string $messagetext Body * @param string $subject Subject @@ -1124,7 +1124,7 @@ class EmailCollector extends CommonObject /** * Execute collect for current collector loaded previously with fetch. * - * @param int $mode 0=Mode production, 1=Mode test (read IMAP and try SQL update then rollback), 2=Mode test with no SQL updates + * @param int<0,2> $mode 0=Mode production, 1=Mode test (read IMAP and try SQL update then rollback), 2=Mode test with no SQL updates * @return int Return integer <0 if KO, >0 if OK */ public function doCollectOneCollector($mode = 0) @@ -1345,6 +1345,7 @@ class EmailCollector extends CommonObject $this->error = 'Failed to open IMAP connection '.$connectstringsource.' '.imap_last_error(); return -3; } + '@phan-var-force resource|IMAP\Connection $connection'; imap_errors(); // Clear stack of errors. $host = dol_getprefix('email'); @@ -1982,7 +1983,7 @@ class EmailCollector extends CommonObject //var_dump($plainmsg); exit; //$htmlmsg,$plainmsg,$charset,$attachments - $messagetext = $plainmsg ? $plainmsg : dol_string_nohtmltag($htmlmsg, 0); + $messagetext = $plainmsg ? $plainmsg : dol_string_nohtmltag((string) $htmlmsg, 0); // Removed emojis if (utf8_valid($messagetext)) { @@ -2665,7 +2666,7 @@ class EmailCollector extends CommonObject $operationslog .= '
We try to search existing thirdparty with idtouseforthirdparty='.$idtouseforthirdparty.' emailtouseforthirdparty='.$emailtouseforthirdparty.' nametouseforthirdparty='.$nametouseforthirdparty.' namealiastouseforthirdparty='.$namealiastouseforthirdparty; // Try to find the thirdparty that match the most the information we have - $result = $thirdpartystatic->findNearest($idtouseforthirdparty, $nametouseforthirdparty, '', '', '', '', '', '', '', '', $emailtouseforthirdparty, $namealiastouseforthirdparty); + $result = $thirdpartystatic->findNearest((int) $idtouseforthirdparty, (string) $nametouseforthirdparty, '', '', '', '', '', '', '', '', (string) $emailtouseforthirdparty, (string) $namealiastouseforthirdparty); if ($result < 0) { $errorforactions++; @@ -2677,7 +2678,7 @@ class EmailCollector extends CommonObject dol_syslog("Third party with id=".$idtouseforthirdparty." email=".$emailtouseforthirdparty." name=".$nametouseforthirdparty." name_alias=".$namealiastouseforthirdparty." was not found"); // Search into contacts of thirdparties to try to guess the thirdparty to use - $resultContact = $contactstatic->findNearest(0, '', '', '', $emailtouseforthirdparty, '', 0); + $resultContact = $contactstatic->findNearest(0, '', '', '', (string) $emailtouseforthirdparty, '', 0); if ($resultContact > 0) { $idtouseforthirdparty = $contactstatic->socid; $result = $thirdpartystatic->fetch($idtouseforthirdparty); @@ -2686,13 +2687,13 @@ class EmailCollector extends CommonObject } else { $errorforactions++; $langs->load("errors"); - $this->error = $langs->trans('ErrorFailedToLoadThirdParty', $idtouseforthirdparty, $emailtouseforthirdparty, $nametouseforthirdparty, $namealiastouseforthirdparty); + $this->error = $langs->trans('ErrorFailedToLoadThirdParty', $idtouseforthirdparty, (string) $emailtouseforthirdparty, (string) $nametouseforthirdparty, (string) $namealiastouseforthirdparty); $this->errors[] = $this->error; } } else { $errorforactions++; $langs->load("errors"); - $this->error = $langs->trans('ErrorFailedToLoadThirdParty', $idtouseforthirdparty, $emailtouseforthirdparty, $nametouseforthirdparty, $namealiastouseforthirdparty); + $this->error = $langs->trans('ErrorFailedToLoadThirdParty', $idtouseforthirdparty, (string) $emailtouseforthirdparty, (string) $nametouseforthirdparty, (string) $namealiastouseforthirdparty); $this->errors[] = $this->error; } } elseif ($operation['type'] == 'loadandcreatethirdparty') { @@ -2729,7 +2730,7 @@ class EmailCollector extends CommonObject $this->error = $thirdpartystatic->error; $this->errors = $thirdpartystatic->errors; } else { - $operationslog .= '
Thirdparty created -> id = '.dol_escape_htmltag($thirdpartystatic->id); + $operationslog .= '
Thirdparty created -> id = '.dol_escape_htmltag((string) $thirdpartystatic->id); } } } @@ -2738,7 +2739,7 @@ class EmailCollector extends CommonObject $thirdpartystatic->fetch($result); - $operationslog .= '
Thirdparty already exists with id = '.dol_escape_htmltag($thirdpartystatic->id)." and name ".dol_escape_htmltag($thirdpartystatic->name); + $operationslog .= '
Thirdparty already exists with id = '.dol_escape_htmltag((string) $thirdpartystatic->id)." and name ".dol_escape_htmltag($thirdpartystatic->name); } } } @@ -2849,7 +2850,7 @@ class EmailCollector extends CommonObject $this->error = $contactstatic->error; $this->errors = $contactstatic->errors; } else { - $operationslog .= '
Contact created -> id = '.dol_escape_htmltag($contactstatic->id); + $operationslog .= '
Contact created -> id = '.dol_escape_htmltag((string) $contactstatic->id); } } } @@ -2972,7 +2973,7 @@ class EmailCollector extends CommonObject } } - $operationslog .= '
Event created -> id='.dol_escape_htmltag($actioncomm->id); + $operationslog .= '
Event created -> id='.dol_escape_htmltag((string) $actioncomm->id); } } } @@ -3288,9 +3289,9 @@ class EmailCollector extends CommonObject $this->getmsg($connection, $imapemail, $destdir); } - $operationslog .= '
Project created with attachments -> id='.dol_escape_htmltag($projecttocreate->id); + $operationslog .= '
Project created with attachments -> id='.dol_escape_htmltag((string) $projecttocreate->id); } else { - $operationslog .= '
Project created without attachments -> id='.dol_escape_htmltag($projecttocreate->id); + $operationslog .= '
Project created without attachments -> id='.dol_escape_htmltag((string) $projecttocreate->id); } } } @@ -3445,9 +3446,9 @@ class EmailCollector extends CommonObject $this->getmsg($connection, $imapemail, $destdir); } - $operationslog .= '
Ticket created with attachments -> id='.dol_escape_htmltag($tickettocreate->id); + $operationslog .= '
Ticket created with attachments -> id='.dol_escape_htmltag((string) $tickettocreate->id); } else { - $operationslog .= '
Ticket created without attachments -> id='.dol_escape_htmltag($tickettocreate->id); + $operationslog .= '
Ticket created without attachments -> id='.dol_escape_htmltag((string) $tickettocreate->id); } } } @@ -3543,7 +3544,7 @@ class EmailCollector extends CommonObject $this->errors = $candidaturetocreate->errors; } - $operationslog .= '
Candidature created without attachments -> id='.dol_escape_htmltag($candidaturetocreate->id); + $operationslog .= '
Candidature created without attachments -> id='.dol_escape_htmltag((string) $candidaturetocreate->id); } } } elseif (substr($operation['type'], 0, 4) == 'hook') { @@ -3769,9 +3770,9 @@ class EmailCollector extends CommonObject /** * getmsg * - * @param Object $mbox Structure - * @param string $mid UID email - * @param string $destdir Target dir for attachments. Leave blank to parse without writing to disk. + * @param IMAP\Connection|resource $mbox Structure + * @param int $mid Message Id / Message Number Email + * @param string $destdir Target dir for attachments. Leave blank to parse without writing to disk. * @return void */ private function getmsg($mbox, $mid, $destdir = '') @@ -3786,7 +3787,7 @@ class EmailCollector extends CommonObject //$h = imap_header($mbox,$mid); // add code here to get date, from, to, cc, subject... - // BODY @phan-suppress-next-line PhanTypeMismatchArgumentInternal + // BODY $s = imap_fetchstructure($mbox, $mid, FT_UID); @@ -3796,7 +3797,7 @@ class EmailCollector extends CommonObject } else { // multipart: cycle through each part foreach ($s->parts as $partno0 => $p) { - $this->getpart($mbox, $mid, $p, $partno0 + 1, $destdir); + $this->getpart($mbox, $mid, $p, (string) ($partno0 + 1), $destdir); } } } @@ -3820,11 +3821,11 @@ class EmailCollector extends CommonObject /** * Sub function for getpart(). Only called by createPartArray() and itself. * - * @param Object $mbox Structure - * @param string $mid Part no - * @param Object $p Object p - * @param string $partno Partno - * @param string $destdir Target dir for attachments. Leave blank to parse without writing to disk. + * @param IMAP\Connection|resource $mbox Structure + * @param int $mid Message Id / Message Number + * @param Object $p Object p + * @param string $partno Partno / Section + * @param string $destdir Target dir for attachments. Leave blank to parse without writing to disk. * @return void */ private function getpart($mbox, $mid, $p, $partno, $destdir = '') @@ -3834,8 +3835,8 @@ class EmailCollector extends CommonObject // DECODE DATA $data = ($partno) ? - imap_fetchbody($mbox, $mid, $partno, FT_UID) : // multipart @phan-suppress-current-line PhanTypeMismatchArgumentInternal - imap_body($mbox, $mid, FT_UID); // simple @phan-suppress-current-line PhanTypeMismatchArgumentInternal + imap_fetchbody($mbox, $mid, $partno, FT_UID) : // multipart + imap_body($mbox, $mid, FT_UID); // simple // Any part may be encoded, even plain text messages, so check everything. if ($p->encoding == 4) { $data = quoted_printable_decode($data); diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index f309b7e19ab..58ca26f99ad 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2003 Rodolphe Quiedeville * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * 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 @@ -240,7 +240,7 @@ print ''; // User print ''.$langs->trans("CreatedBy").''; print img_picto('', 'user', 'class="pictofixedwidth"'); -print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); +print $form->select_dolusers($userid, 'userid', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); print ''; // Year print ''.$langs->trans("Year").''; diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index bea0c167356..f389ba87e5e 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -8,7 +8,7 @@ * Copyright (C) 2018 Charlene Benke * Copyright (C) 2019 Juanjo Menent * Copyright (C) 2019-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 @@ -615,7 +615,7 @@ if (!empty($arrayfields['d.ref']['checked'])) { if (!empty($arrayfields['user']['checked'])) { if ($user->hasRight('expensereport', 'readall') || $user->hasRight('expensereport', 'lire_tous')) { print ''; - print $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200'); + print $form->select_dolusers($search_user, 'search_user', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth200'); print ''; } else { print ' '; diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 60696fcd371..ec1a1485cb9 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -1,6 +1,6 @@ - * 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 @@ -240,7 +240,7 @@ print ''; // User print ''.$langs->trans("CreatedBy").''; print img_picto('', 'user', 'class="pictofixedwidth"'); -print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); +print $form->select_dolusers($userid, 'userid', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); // Status print ''.$langs->trans("Status").''; $tmp = $objectstatic->LibStatut(0); // To force load of $this->labelStatus