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)
This commit is contained in:
MDW 2025-03-10 15:47:55 +01:00 committed by GitHub
parent d2026b2981
commit 988fc75ca2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 335 additions and 341 deletions

View file

@ -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'],

View file

@ -4,7 +4,7 @@
* Copyright (C) 2013-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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 '<input type="hidden" name="mode" value="'.$mode.'">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print '<input type="hidden" name="type" value="'.$type.'">';
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 '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {
@ -980,13 +984,13 @@ if ($action == 'create') {
if (empty($total_debit) && empty($total_credit)) {
print '<input type="submit" class="button" disabled="disabled" href="#" title="'.dol_escape_htmltag($langs->trans("EnterNonEmptyLinesFirst")).'" value="'.dol_escape_htmltag($langs->trans("ValidTransaction")).'">';
} elseif ($total_debit == $total_credit) {
print '<a class="button" href="'.$_SERVER["PHP_SELF"].'?piece_num='.((int) $object->piece_num).(!empty($type)?'&type=sub':'').'&backtopage='.urlencode($backtopage).'&action=valid&token='.newToken().'">'.$langs->trans("ValidTransaction").'</a>';
print '<a class="button" href="'.$_SERVER["PHP_SELF"].'?piece_num='.((int) $object->piece_num).(!empty($type) ? '&type=sub' : '').'&backtopage='.urlencode($backtopage).'&action=valid&token='.newToken().'">'.$langs->trans("ValidTransaction").'</a>';
} else {
print '<input type="submit" class="button" disabled="disabled" href="#" title="'.dol_escape_htmltag($langs->trans("MvtNotCorrectlyBalanced", $total_debit, $total_credit)).'" value="'.dol_escape_htmltag($langs->trans("ValidTransaction")).'">';
}
print ' &nbsp; ';
print '<a class="button button-cancel" href="'.$backtopage.(!empty($type)?'?type=sub':'').'">'.$langs->trans("Cancel").'</a>';
print '<a class="button button-cancel" href="'.$backtopage.(!empty($type) ? '?type=sub' : '').'">'.$langs->trans("Cancel").'</a>';
print "</div>";
}

View file

@ -6,7 +6,7 @@
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Progiseize <a.bisotti@progiseize.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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);

View file

@ -6,7 +6,7 @@
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Progiseize <a.bisotti@progiseiea-conseil.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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;
}

View file

@ -4,7 +4,7 @@
* Copyright (C) 2013-2020 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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 '<td class="center">'.dol_escape_htmltag($line->lettering_code).'</td>';
print '<td class="center">'.dol_escape_htmltag((string) $line->lettering_code).'</td>';
if (!$i) {
$totalarray['nbfield']++;
}

View file

@ -3,7 +3,7 @@
* Copyright (C) 2015-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015-2020 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Jose MARTINEZ <jose.martinez@pichinov.com>
*
* 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<string,string> $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;
}

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2019-2023 Open-DSI <support@open-dsi.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* 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 '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep1Desc") . '</span><br>';
$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');

View file

@ -2,7 +2,7 @@
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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 '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
if (preg_match('/tdoverflow/', $cssforfield) && !is_numeric($object->$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 '</div>';
} 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, '');
}

View file

@ -12,7 +12,7 @@
* Copyright (C) 2015-2024 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -979,7 +979,7 @@ foreach ($fieldlist as $field => $value) {
print '</td>';
} elseif ($value == 'fk_user') {
print '<td class="liste_titre">';
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 '</td>';
} elseif ($value == 'topic') {
print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
@ -1415,7 +1415,7 @@ function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
} elseif ($value == 'fk_user') {
print '<td>';
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

View file

@ -5,6 +5,7 @@
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Markus Welters <markus@welters.de>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -184,7 +185,7 @@ print '</td></tr>';
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("ResponsibleUser").'</td>';
print '<td>';
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 '</td>';
print '</tr>';

View file

@ -5,6 +5,7 @@
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Markus Welters <markus@welters.de>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -194,7 +195,7 @@ print '</td></tr>';
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("ResponsibleUser").'</td>';
print '<td>';
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 '</td>';
print '</tr>';

View file

@ -3,6 +3,7 @@
* Copyright (C) 2005-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -186,7 +187,7 @@ if ($action == 'create') {
// Target
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
$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 '<tr><td>'.$langs->trans("Visibility").'</td><td>';
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 '</td><td class="hideonsmartphone"></td></tr>';
// Position
@ -278,7 +279,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) {
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
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 '<tr><td>'.$langs->trans("Visibility").'</td><td>';
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);

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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 .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$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);

View file

@ -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 '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">'.$langs->trans('PaymentMode').'</td><td class="valuefieldcreate">';
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 '</td></tr>';
// Bank Account
@ -2141,7 +2141,7 @@ if ($action == 'create') {
}
print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">'.$langs->trans('SendingMethod').'</td><td class="valuefieldcreate">';
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 '</td></tr>';
}
@ -2650,7 +2650,7 @@ if ($action == 'create') {
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$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 '</tr></table>';
$editenable = $usercancreate && $caneditfield && $object->status == Propal::STATUS_DRAFT;
print $form->editfieldkey("DatePropal", 'date', '', $object, $editenable);
print $form->editfieldkey("DatePropal", 'date', '', $object, (int) $editenable);
print '</td><td class="valuefield">';
if ($action == 'editdate' && $usercancreate && $caneditfield) {
print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
@ -2777,9 +2777,9 @@ if ($action == 'create') {
print '</tr></table>';
print '</td><td class="valuefield">';
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 '</td>';
print '</tr>';
@ -2796,16 +2796,16 @@ if ($action == 'create') {
print '</tr></table>';
print '</td><td class="valuefieldcreate">';
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 '</td></tr>';
// Delivery date
$langs->load('deliveries');
print '<tr><td>';
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 '</td><td class="valuefieldedit">';
print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate && $caneditfield, 'datepicker');
print '</td>';
@ -2826,9 +2826,9 @@ if ($action == 'create') {
print '</tr></table>';
print '</td><td class="valuefield">';
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 '</td>';
@ -2846,9 +2846,9 @@ if ($action == 'create') {
print '</tr></table>';
print '</td><td class="valuefield">';
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 '</td>';
print '</tr>';
@ -2883,9 +2883,9 @@ if ($action == 'create') {
print '</tr></table>';
print '</td><td class="valuefield">';
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 '</td>';
print '</tr>';
@ -2915,9 +2915,9 @@ if ($action == 'create') {
print '</tr></table>';
print '</td><td class="valuefield">';
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 '</td>';
print '</tr>';
@ -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);

View file

@ -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)

View file

@ -19,7 +19,7 @@
* Copyright (C) 2022 OpenDSI <support@open-dsi.fr>
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2023 William Mead <william.mead@manchenumerique.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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");

View file

@ -5,6 +5,7 @@
* Copyright (C) 2011-2022 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2023 Christian Foellmann <christian@foellmann.de>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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 .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$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);

View file

@ -6,6 +6,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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 .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$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);

View file

@ -17,7 +17,7 @@
* Copyright (C) 2021 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
*
* 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 .= '<div class="divsearchfield">';
$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 .= '</div>';
}
// If the user can view products
@ -1222,7 +1222,7 @@ if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_
$formproduct = new FormProduct($db);
$moreforfilter .= '<div class="divsearchfield">';
$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 .= '</div>';
}
$parameters = array();
@ -1278,7 +1278,7 @@ if (!empty($arrayfields['pr.title']['checked'])) {
}
if (!empty($arrayfields['s.nom']['checked'])) {
print '<td class="liste_titre" align="left">';
print '<input class="flat maxwidth100" type="text" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"'.($socid > 0 ? " disabled" : "").'>';
print '<input class="flat maxwidth100" type="text" name="search_societe" value="'.dol_escape_htmltag((string) $search_societe).'"'.($socid > 0 ? " disabled" : "").'>';
print '</td>';
}
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 '<td class="liste_titre">';
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 '</td>';
}
// Payment mode
@ -2057,7 +2057,7 @@ while ($i < $imaxinloop) {
// Availability
if (!empty($arrayfields['ava.rowid']['checked'])) {
print '<td class="center">';
$form->form_availability(0, $obj->availability, 'none', 1);
$form->form_availability('0', $obj->availability, 'none', 1);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;

View file

@ -6,6 +6,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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 .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$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);

View file

@ -5,7 +5,7 @@
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* 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 '</td></tr>';
// User
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';
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 '</td></tr>';
// Status
print '<tr><td>'.$langs->trans("Status").'</td><td>';

View file

@ -5,7 +5,7 @@
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -226,7 +226,7 @@ if ($action == 'create') {
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("Person").'</td><td>';
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 '</td></tr>';
print "<tr>";
@ -317,7 +317,7 @@ if ($action == 'create') {
// Who
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("Person").'</td><td>';
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 '</td></tr>';
// Date

View file

@ -2,7 +2,7 @@
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* 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 '</td></tr>';
// Year
print '<tr><td>'.$langs->trans("Year").'</td><td>';

View file

@ -17,7 +17,7 @@
* Copyright (C) 2021-2024 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2023 Nick Fragoulis
* Copyright (C) 2023 Joachim Kueter <git-jk@bloxera.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Solution Libre SAS <contact@solution-libre.fr>
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
@ -1382,7 +1382,7 @@ if ($user->hasRight("user", "user", "lire")) {
if ($user->hasRight("user", "user", "lire")) {
$moreforfilter .= '<div class="divsearchfield">';
$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 .= '</div>';
}
// Filter on product tags

View file

@ -5,7 +5,7 @@
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -342,7 +342,7 @@ if (isModEnabled('category')) {
// User
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';
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 '</td></tr>';
// Status
print '<tr><td>'.$langs->trans("Status").'</td><td>';

View file

@ -12,7 +12,7 @@
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2023 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2023 Nick Fragoulis
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
*
* This program is free software; you can redistribute it and/or modify
@ -1287,13 +1287,13 @@ if ($action == 'create') {
// Commercial suivi
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPFOLL").'</span></td><td>';
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 '</td></tr>';
// Commercial signature
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPSIGN").'</span></td><td>';
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 '</td></tr>';
print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td><td>';

View file

@ -828,7 +828,7 @@ if ($user->hasRight('user', 'user', 'lire')) {
if ($user->hasRight('user', 'user', 'lire')) {
$moreforfilter .= '<div class="divsearchfield">';
$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 .= '</div>';
}
// If the user can view categories of products

View file

@ -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<int|string,array{label:string,data-html:string,disable?:int<0,1>,css?:string}>|string[] $array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...))
* @param array<int|string,array{label:string,data-html?:string,data-noparam?:int<0,1>,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 '&nbsp;', 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()

View file

@ -104,7 +104,7 @@ function print_actions_filter(
// Assigned to user
print '<div class="divsearchfield">';
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 '</div>';
// Assigned to user group

View file

@ -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)

View file

@ -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)

View file

@ -2,7 +2,7 @@
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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
*/

View file

@ -4,7 +4,7 @@
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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
*/

View file

@ -4,7 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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
*/

View file

@ -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 = '<div style="display: flex; align-items: center; justify-content: flex-end; padding-right: 150px">';
@ -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),

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2011-2013 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* 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;
}

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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 .= '<br>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 .= '<br>Thirdparty created -> id = '.dol_escape_htmltag($thirdpartystatic->id);
$operationslog .= '<br>Thirdparty created -> id = '.dol_escape_htmltag((string) $thirdpartystatic->id);
}
}
}
@ -2738,7 +2739,7 @@ class EmailCollector extends CommonObject
$thirdpartystatic->fetch($result);
$operationslog .= '<br>Thirdparty already exists with id = '.dol_escape_htmltag($thirdpartystatic->id)." and name ".dol_escape_htmltag($thirdpartystatic->name);
$operationslog .= '<br>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 .= '<br>Contact created -> id = '.dol_escape_htmltag($contactstatic->id);
$operationslog .= '<br>Contact created -> id = '.dol_escape_htmltag((string) $contactstatic->id);
}
}
}
@ -2972,7 +2973,7 @@ class EmailCollector extends CommonObject
}
}
$operationslog .= '<br>Event created -> id='.dol_escape_htmltag($actioncomm->id);
$operationslog .= '<br>Event created -> id='.dol_escape_htmltag((string) $actioncomm->id);
}
}
}
@ -3288,9 +3289,9 @@ class EmailCollector extends CommonObject
$this->getmsg($connection, $imapemail, $destdir);
}
$operationslog .= '<br>Project created with attachments -> id='.dol_escape_htmltag($projecttocreate->id);
$operationslog .= '<br>Project created with attachments -> id='.dol_escape_htmltag((string) $projecttocreate->id);
} else {
$operationslog .= '<br>Project created without attachments -> id='.dol_escape_htmltag($projecttocreate->id);
$operationslog .= '<br>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 .= '<br>Ticket created with attachments -> id='.dol_escape_htmltag($tickettocreate->id);
$operationslog .= '<br>Ticket created with attachments -> id='.dol_escape_htmltag((string) $tickettocreate->id);
} else {
$operationslog .= '<br>Ticket created without attachments -> id='.dol_escape_htmltag($tickettocreate->id);
$operationslog .= '<br>Ticket created without attachments -> id='.dol_escape_htmltag((string) $tickettocreate->id);
}
}
}
@ -3543,7 +3544,7 @@ class EmailCollector extends CommonObject
$this->errors = $candidaturetocreate->errors;
}
$operationslog .= '<br>Candidature created without attachments -> id='.dol_escape_htmltag($candidaturetocreate->id);
$operationslog .= '<br>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);

View file

@ -2,7 +2,7 @@
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -240,7 +240,7 @@ print '</td></tr>';
// User
print '<tr><td class="left">'.$langs->trans("CreatedBy").'</td><td class="left">';
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 '</td></tr>';
// Year
print '<tr><td class="left">'.$langs->trans("Year").'</td><td class="left">';

View file

@ -8,7 +8,7 @@
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2019 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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 '<td class="liste_titre maxwidthonsmartphone" align="left">';
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 '</td>';
} else {
print '<td class="liste_titre">&nbsp;</td>';

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -240,7 +240,7 @@ print '</td></tr>';
// User
print '<tr><td class="left">'.$langs->trans("CreatedBy").'</td><td class="left">';
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 '<tr><td class="left">'.$langs->trans("Status").'</td><td class="left">';
$tmp = $objectstatic->LibStatut(0); // To force load of $this->labelStatus