diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 26b37bd734f..aa64408830d 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2011-2024 Alexandre Spangaro + * Copyright (C) 2011-2026 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2024-2026 Frédéric France @@ -585,8 +585,7 @@ if ($resql) { 'page' => $page, 'sortfield' => $sortfield, 'sortorder' => $sortorder, - 'rowid' => (!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')), - 'code' => $obj->code, + 'rowid' => (!empty($obj->rowid) ? $obj->rowid : '') ]); // Active diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 402308189dd..68b92a922ea 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2025 Alexandre Spangaro + * Copyright (C) 2013-2026 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent @@ -481,33 +481,28 @@ print '
'; // Case of the parameter ACCOUNTING_MODE +print '
'; +print ''; +print ''; -if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) { - print ''; - print ''; - print ''; +print ''; - print '
'; +print ''; +print ''; +print "\n"; +print ''; +print '\n"; +print ''; +print '\n"; - print ''; - print ''; - print "\n"; - print ''; - print '\n"; - print ''; - print '\n"; +print "
'.$langs->trans('OptionMode').'
('.$langs->trans('Default').')'.nl2br($langs->trans('ACCOUNTING_USE_NON_TREASURY_Desc')).''; +print "
'.nl2br($langs->trans('ACCOUNTING_USE_TREASURY_Desc')).""; +print "
'.$langs->trans('OptionMode').'
('.$langs->trans('Default').')'.nl2br($langs->trans('ACCOUNTING_USE_NON_TREASURY_Desc')).''; - print "
'.nl2br($langs->trans('ACCOUNTING_USE_TREASURY_Desc')).""; - print "
\n"; - print "\n"; - - print '
'; - print '
'; - - - print '

'; -} +print '
'; +print ''; +print '

'; // Show form main options print $formSetup->generateOutput(true); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a1db2a77221..9a815e9c133 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8455,13 +8455,9 @@ abstract class CommonObject // $param_list_array[0] can be the name of object (Example 'User' the field is linked to). Not as taking the information from the record in ->fields found from $objectfield. - // $valparent is a string 'dataobject@module:keyoffieldinfieldsarray' to find the record field to link to. - // $valparent = $this->element.($this->module ? '@'.$this->module : '').':'.$key.$keysuffix; - // $val is already the record field found at same place than found by $valparent but already loaded and may have been modified by parent caller. - //$objectfield = $valparent; - $objectfield = $val; // Is better than using old method $valparent + $objectfield = $val; // @phan-suppress-next-line PhanTypeMismatchArgumentNullable $out = $form->selectForForms($param_list_array[0], $keyprefix.$key.$keysuffix, (int) $value, $showempty, '', '', $morecss, $moreparam, 0, (empty($val['disabled']) ? 0 : 1), '', $objectfield); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index a558b61e8e0..550feca472b 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2569,7 +2569,9 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0) } elseif (empty($hidedetails) || $hidedetails > 1) { $total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht); if (!empty($object->lines[$i]->situation_percent) && $object->lines[$i]->situation_percent > 0) { - $total_ht *= $object->lines[$i]->getSituationRatio(); + if (method_exists($object->lines[$i], 'getSituationRatio')) { + $total_ht *= $object->lines[$i]->getSituationRatio(); + } } $result .= price($sign * $total_ht, 0, $outputlangs); } diff --git a/htdocs/core/tpl/formlayoutai.tpl.php b/htdocs/core/tpl/formlayoutai.tpl.php index 692449b8896..5df3db0d5c5 100644 --- a/htdocs/core/tpl/formlayoutai.tpl.php +++ b/htdocs/core/tpl/formlayoutai.tpl.php @@ -78,7 +78,7 @@ if (!isset($aiprompt)) { // Init to empty string if not defined $aiprompt = ''; } // Add link to add layout -if ($showlinktolayout) { // May be set only if MAIN_EMAIL_USE_LAYOUT is set +if (!empty($showlinktolayout)) { // May be set only if MAIN_EMAIL_USE_LAYOUT is set $out .= ''; $out .= img_picto($showlinktolayoutlabel, 'layout', 'class="paddingrightonly"'); $out .= ''.$showlinktolayoutlabel.'...'; @@ -98,7 +98,7 @@ if ($showlinktolayout) { // May be set only if MAIN_EMAIL_USE_LAYOUT is set '; } // Add link to add AI content -if ($showlinktoai) { +if (!empty($showlinktoai)) { // TODO Diff between showlinktoai and htmlname ? Why not using one key only ? $out .= ''; $out .= img_picto($showlinktoailabel, 'ai', 'class="paddingrightonly"'); @@ -134,7 +134,7 @@ if ($showlinktoai) { '; } -if ($showlinktolayout) { +if (!empty($showlinktolayout)) { if (!empty($formwebsite) && is_object($formwebsite)) { $out .= $formwebsite->getContentPageTemplate($htmlname); } else { @@ -151,7 +151,7 @@ if ($showlinktolayout) { /** @var ?FormAI $formai */ -if ($showlinktoai) { +if (!empty($showlinktoai)) { if (empty($formai) || $formai instanceof FormAI) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formai.class.php'; $formai = new FormAI($db); @@ -165,7 +165,11 @@ if ($showlinktoai) { $formai->setSubstitFromObject($object, $langs); $aiprompt = make_substitutions($aiprompt, $formai->substit); } - $out .= $formai->getSectionForAIEnhancement($showlinktoai, $formmail->withaiprompt, $htmlname, $onlyenhancements, $aiprompt); + $format = ''; + if (is_object($formmail) && !empty($formmail->withaiprompt)) { + $format = $formmail->withaiprompt; + } + $out .= $formai->getSectionForAIEnhancement($showlinktoai, $format, $htmlname, $onlyenhancements, $aiprompt); } else { $out .= ''; } diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 3ae0aaf4cc5..6defe474da1 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2024-2026 MDW * Copyright (C) 2025 Frédéric France + * Copyright (C) 2026 Alexandre Spangaro * * 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 @@ -282,12 +283,12 @@ class Export // Export Dataset Label $this->array_export_label[$i] = $module->getExportDatasetLabel($r); // Table of fields to export - $this->array_export_fields[$i] = $module->export_fields_array[$r]; + $this->array_export_fields[$i] = (isset($module->export_fields_array[$r]) ? $module->export_fields_array[$r] : []); // Table of fields to be filtered (key=field, value1=data type) Verifies that the module has filters $this->array_export_TypeFields[$i] = (isset($module->export_TypeFields_array[$r]) ? $module->export_TypeFields_array[$r] : ''); // Table of entities to export (key=field, value=entity) - $this->array_export_entities[$i] = $module->export_entities_array[$r]; - // Table of entities requiring to abandon DISTINCT (key=entity, value=field id child records) + $this->array_export_entities[$i] = (isset($module->export_entities_array[$r]) ? $module->export_entities_array[$r] : ''); + // Table of entities requiring to abandon DISTINCT (key=entity, valeur=field id child records) $this->array_export_dependencies[$i] = (!empty($module->export_dependencies_array[$r]) ? $module->export_dependencies_array[$r] : ''); // Table of special field operations $this->array_export_special[$i] = (!empty($module->export_special_array[$r]) ? $module->export_special_array[$r] : ''); diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index a766d59c73e..c5f1d17c85f 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2020 Ahmad Jamaly Rabib * Copyright (C) 2021-2025 Frédéric France * Copyright (C) 2024-2025 MDW + * Copyright (C) 2026 Alexandre Spangaro * * 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 @@ -270,11 +271,11 @@ class Import // Array of tables creator field to import (key=alias, value=creator field name) $this->array_import_tables_creator[$i] = (isset($module->import_tables_creator_array[$r]) ? $module->import_tables_creator_array[$r] : ''); // Array of fields to import (key=field, value=label) - $this->array_import_fields[$i] = $module->import_fields_array[$r]; + $this->array_import_fields[$i] = (isset($module->import_fields_array[$r]) ? $module->import_fields_array[$r] : []); // Array of hidden fields to import (key=field, value=label) $this->array_import_fieldshidden[$i] = (isset($module->import_fieldshidden_array[$r]) ? $module->import_fieldshidden_array[$r] : ''); // Array of entities to export (key=field, value=entity) - $this->array_import_entities[$i] = $module->import_entities_array[$r]; + $this->array_import_entities[$i] = (isset($module->import_entities_array[$r]) ? $module->import_entities_array[$r] : ''); // Array of aliases to export (key=field, value=alias) $this->array_import_regex[$i] = (isset($module->import_regex_array[$r]) ? $module->import_regex_array[$r] : ''); // Array of columns allowed as UPDATE options diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 9a580e926f9..013f5ae877a 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -572,7 +572,6 @@ if (isModEnabled('project')) { $formproject = new FormProjets($db); } - $variants = 0; $iskit = 0;