Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2026-02-02 15:59:37 +01:00
8 changed files with 40 additions and 43 deletions

View File

@@ -8,7 +8,7 @@
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
* Copyright (C) 2011-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2011-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
@@ -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

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2013-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@@ -481,33 +481,28 @@ print '<br>';
// Case of the parameter ACCOUNTING_MODE
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="updatemode">';
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) {
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="updatemode">';
print '<table class="noborder centpercent">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans('OptionMode').'</td>';
print "</tr>\n";
print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_1" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode != 'RECETTES-DEPENSES' ? ' checked' : '').'><label for="accounting_mode_1"> '.$langs->trans('OptionModeVirtual').'</label> ('.$langs->trans('Default').')</td>';
print '<td><span class="opacitymedium">'.nl2br($langs->trans('ACCOUNTING_USE_NON_TREASURY_Desc')).'</span>';
print "</td></tr>\n";
print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_2" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode == 'RECETTES-DEPENSES' ? ' checked' : '').'><label for="accounting_mode_2"> '.$langs->trans('OptionModeTrue').'</label></td>';
print '<td><span class="opacitymedium">'.nl2br($langs->trans('ACCOUNTING_USE_TREASURY_Desc'))."</span>";
print "</td></tr>\n";
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans('OptionMode').'</td>';
print "</tr>\n";
print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_1" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode != 'RECETTES-DEPENSES' ? ' checked' : '').'><label for="accounting_mode_1"> '.$langs->trans('OptionModeVirtual').'</label> ('.$langs->trans('Default').')</td>';
print '<td><span class="opacitymedium">'.nl2br($langs->trans('ACCOUNTING_USE_NON_TREASURY_Desc')).'</span>';
print "</td></tr>\n";
print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_2" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode == 'RECETTES-DEPENSES' ? ' checked' : '').'><label for="accounting_mode_2"> '.$langs->trans('OptionModeTrue').'</label></td>';
print '<td><span class="opacitymedium">'.nl2br($langs->trans('ACCOUNTING_USE_TREASURY_Desc'))."</span>";
print "</td></tr>\n";
print "</table>\n";
print "</table>\n";
print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Save').'"></div>';
print '</form>';
print '<br><br>';
}
print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Save').'"></div>';
print '</form>';
print '<br><br>';
// Show form main options
print $formSetup->generateOutput(true);

View File

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

View File

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

View File

@@ -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 .= '<a href="#" id="linkforlayouttemplates" class="notasortlink inline-block alink marginrightonly">';
$out .= img_picto($showlinktolayoutlabel, 'layout', 'class="paddingrightonly"');
$out .= '<span class="hideobject hideonsmartphone">'.$showlinktolayoutlabel.'...</span>';
@@ -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 .= '<a href="#" id="linkforaiprompt'.$showlinktoai.'" class="notasortlink inline-block alink '.$morecss.'">';
$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 .= '<!-- No link to the AI feature, $formmail->withaiprompt must be set to the ai feature and module ai must be enabled -->';
}

View File

@@ -5,6 +5,7 @@
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2026 Alexandre Spangaro <alexandre@inovea-conseil.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
@@ -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] : '');

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2020 Ahmad Jamaly Rabib <rabib@metroworks.co.jp>
* Copyright (C) 2021-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2026 Alexandre Spangaro <alexandre@inovea-conseil.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
@@ -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

View File

@@ -572,7 +572,6 @@ if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
$variants = 0;
$iskit = 0;