Merge branch 'develop' into patch-606226

This commit is contained in:
Laurent Destailleur
2025-12-11 01:19:53 +01:00
committed by GitHub
10 changed files with 46 additions and 78 deletions

View File

@@ -7356,24 +7356,6 @@ parameters:
count: 1
path: ../../../htdocs/core/modules/import/import_csv.modules.php
-
message: '#^Property ModeleImports\:\:\$errors \(array\<string\>\) does not accept array\<array\<string, mixed\>\|string\>\.$#'
identifier: assign.propertyType
count: 3
path: ../../../htdocs/core/modules/import/import_csv.modules.php
-
message: '#^Property ModeleImports\:\:\$errors \(array\<string\>\) does not accept array\<array\<string, string\>\|string\>\.$#'
identifier: assign.propertyType
count: 3
path: ../../../htdocs/core/modules/import/import_csv.modules.php
-
message: '#^Property ModeleImports\:\:\$warnings \(array\<string\>\) does not accept array\<array\<string, mixed\>\|string\>\.$#'
identifier: assign.propertyType
count: 1
path: ../../../htdocs/core/modules/import/import_csv.modules.php
-
message: '#^Variable \$key might not be defined\.$#'
identifier: variable.undefined
@@ -7422,24 +7404,6 @@ parameters:
count: 1
path: ../../../htdocs/core/modules/import/import_xlsx.modules.php
-
message: '#^Property ModeleImports\:\:\$errors \(array\<string\>\) does not accept array\<array\<string, mixed\>\|string\>\.$#'
identifier: assign.propertyType
count: 3
path: ../../../htdocs/core/modules/import/import_xlsx.modules.php
-
message: '#^Property ModeleImports\:\:\$errors \(array\<string\>\) does not accept array\<array\<string, string\>\|string\>\.$#'
identifier: assign.propertyType
count: 3
path: ../../../htdocs/core/modules/import/import_xlsx.modules.php
-
message: '#^Property ModeleImports\:\:\$warnings \(array\<string\>\) does not accept array\<array\<string, mixed\>\|string\>\.$#'
identifier: assign.propertyType
count: 1
path: ../../../htdocs/core/modules/import/import_xlsx.modules.php
-
message: '#^Variable \$where might not be defined\.$#'
identifier: variable.undefined

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-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
@@ -140,7 +140,7 @@ class box_members_last_subscriptions extends ModeleBoxes
'asis' => 1,
);
$daterange = get_date_range($this->db->jdate($obj->date_start), $this->db->jdate($obj->date_end), '', null, 0);
$daterange = get_date_range($this->db->jdate($obj->date_start), $this->db->jdate($obj->date_end), '', $langs, 0);
$this->info_box_contents[$line][] = array(
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone" title="'.dol_escape_htmltag($daterange).'"',
'text' => '<span class="opacitymedium small">'.$daterange.'</span>',

View File

@@ -9385,8 +9385,10 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = '
* @return string Translated string for the key
*/
function ($m) {
return '__BRACKETSTART' . $m[1] . 'BRACKETEND__'; },
$out);
return '__BRACKETSTART' . $m[1] . 'BRACKETEND__';
},
$out
);
$dom->loadHTML($out, LIBXML_HTML_NODEFDTD | LIBXML_ERR_NONE | LIBXML_HTML_NOIMPLIED | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_NOERROR | LIBXML_NOXMLDECL);
@@ -9402,8 +9404,10 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = '
* @return string Translated string for the key
*/
function ($m) {
return '__[' . $m[1] . ']__'; },
$out);
return '__[' . $m[1] . ']__';
},
$out
);
// Remove the trick added to solve pb with text in utf8 and text without parent tag
//$out = preg_replace('/^'.preg_quote('<?xml encoding="UTF-8">', '/').'/', '', $out);
@@ -10973,8 +10977,8 @@ function print_date_range($date_start, $date_end, $format = '', $outputlangs = n
* @param int $date_start Start date
* @param int $date_end End date
* @param string $format Output date format ('day', 'dayhour', ...)
* @param Translate $outputlangs Output language
* @param integer $withparenthesis 1=Add space and parenthesis, 0=no parenthesis, 2=Add parenthesis
* @param ?Translate $outputlangs Output language
* @param int<0,2> $withparenthesis 1=Add space and parenthesis, 0=no parenthesis, 2=Add parenthesis
* @return string String
*/
function get_date_range($date_start, $date_end, $format = '', $outputlangs = null, $withparenthesis = 1)

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008-2013 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
@@ -244,12 +244,12 @@ class MenuManager
// Start a new ul level 1
$level = 1;
print str_pad('', $level).'<ul class="ullevel1">'."\n";
print str_repeat(' ', $level).'<ul class="ullevel1">'."\n";
// Do we have to add an extra entry that is not into menu array ?
if (($canonrelurl != $canonnexturl && !in_array($val['mainmenu'], array('tools')))
|| (strpos($canonrelurl, '/product/index.php') !== false || strpos($canonrelurl, '/compta/bank/list.php') !== false)) {
print str_pad('', $level).'<li class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
print str_repeat(' ', $level).'<li class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
print '<a href="'.$relurl.'">';
if ($val['level'] == 0) {
@@ -291,7 +291,7 @@ class MenuManager
$newlinelevel = ($val2['level'] + 1);
if ($newlinelevel > $lastlinelevel) {
print str_pad('', $newlinelevel).'<ul class="ullevel'.$newlinelevel.'" xx>'."\n";
print str_repeat(' ', $newlinelevel).'<ul class="ullevel'.$newlinelevel.'" xx>'."\n";
}
$lastlinelevel = ($val2['level'] + 1);
@@ -331,7 +331,7 @@ class MenuManager
// Show entry li level $val2['level']+1
// @phan-suppress-next-line PhanParamSuspiciousOrder
print str_pad('', ($val2['level'] + 1));
print str_repeat(' ', ($val2['level'] + 1));
print '<li class="lilevel'.($val2['level'] + 1);
if ($val2['level'] == 0) {
print ' ui-btn-icon-right ui-btn'; // ui-btn to highlight on clic
@@ -359,7 +359,7 @@ class MenuManager
if ($val2['level'] == 0 && !empty($val2['prefix'])) {
print $val2['prefix']; // the picto must have class="pictofixedwidth paddingright"
} else {
print '<i class="fa fa-does-not-exists fa-fw paddingright pictofixedwidth level'.($val2['level']+1).'"></i>';
print '<i class="fa fa-does-not-exists fa-fw paddingright pictofixedwidth level'.($val2['level'] + 1).'"></i>';
}
print $val2['titre'];
@@ -379,8 +379,8 @@ class MenuManager
print '</li>'."\n";
$fromcursor = 0;
while ($fromcursor < ($currentlevel - $nextlevel)) {
print str_pad('', $currentlevel - $fromcursor).'</ul>'."\n";
print str_pad('', $currentlevel - $fromcursor - 1).'</li>'."\n"; // end level $val2['level']+1
print str_repeat(' ', $currentlevel - $fromcursor).'</ul>'."\n";
print str_repeat(' ', $currentlevel - $fromcursor - 1).'</li>'."\n"; // end level $val2['level']+1
$fromcursor++;
}
} else {
@@ -389,8 +389,8 @@ class MenuManager
}
}
print str_pad('', $level).'</ul>'."\n"; // end ul level 1
print str_pad('', $level - 1).'</li>'."\n"; // end ul level 1
print str_repeat(' ', $level).'</ul>'."\n"; // end ul level 1
print str_repeat(' ', $level - 1).'</li>'."\n"; // end ul level 1
} elseif ($val['enabled'] == 2) {
print '<li class="lilevel0">';

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-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
@@ -246,12 +246,12 @@ class MenuManager
// Start a new ul level 1
$level = 1;
print str_pad('', $level).'<ul class="ullevel1">'."\n";
print str_repeat(' ', $level).'<ul class="ullevel1">'."\n";
// Do we have to add an extra entry that is not into menu array ?
if (($canonrelurl != $canonnexturl && !in_array($val['mainmenu'], array('tools')))
|| (strpos($canonrelurl, '/product/index.php') !== false || strpos($canonrelurl, '/compta/bank/list.php') !== false)) {
print str_pad('', $level).'<li class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
print str_repeat(' ', $level).'<li class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
print '<a href="'.$relurl.'">';
if ($val['level'] == 0) {
@@ -283,7 +283,7 @@ class MenuManager
$newlinelevel = ($val2['level'] + 1);
if ($newlinelevel > $lastlinelevel) {
print str_pad('', $newlinelevel).'<ul class="ullevel'.$newlinelevel.'" xx>'."\n";
print str_repeat(' ', $newlinelevel).'<ul class="ullevel'.$newlinelevel.'" xx>'."\n";
}
$lastlinelevel = ($val2['level'] + 1);
@@ -322,7 +322,7 @@ class MenuManager
// Show entry li level $val2['level']+1
// @phan-suppress-next-line PhanParamSuspiciousOrder
print str_pad('', ($val2['level'] + 1));
print str_repeat(' ', ($val2['level'] + 1));
print '<li class="lilevel'.($val2['level'] + 1);
if ($val2['level'] == 0) {
print ' ui-btn-icon-right ui-btn'; // ui-btn to highlight on clic
@@ -351,7 +351,7 @@ class MenuManager
if ($val2['level'] == 0 && !empty($val2['prefix'])) {
print $val2['prefix']; // the picto must have class="pictofixedwidth paddingright"
} else {
print '<i class="fa fa-does-not-exists fa-fw paddingright pictofixedwidth level'.($val2['level']+1).'"></i>';
print '<i class="fa fa-does-not-exists fa-fw paddingright pictofixedwidth level'.($val2['level'] + 1).'"></i>';
}
print $val2['titre'];
@@ -370,8 +370,8 @@ class MenuManager
print '</li>'."\n";
$fromcursor = 0;
while ($fromcursor < ($currentlevel - $nextlevel)) {
print str_pad('', $currentlevel - $fromcursor).'</ul>'."\n";
print str_pad('', $currentlevel - $fromcursor - 1).'</li>'."\n"; // end level $val2['level']+1
print str_repeat(' ', $currentlevel - $fromcursor).'</ul>'."\n";
print str_repeat(' ', $currentlevel - $fromcursor - 1).'</li>'."\n"; // end level $val2['level']+1
$fromcursor++;
}
} else {
@@ -381,8 +381,8 @@ class MenuManager
//var_dump($submenu);
}
print str_pad('', $level).'</ul>'."\n"; // end ul level 1
print str_pad('', $level - 1).'</li>'."\n"; // end ul level 1
print str_repeat(' ', $level).'</ul>'."\n"; // end ul level 1
print str_repeat(' ', $level - 1).'</li>'."\n"; // end ul level 1
} elseif ($val['enabled'] == 2) {
print '<li class="lilevel0">';

View File

@@ -258,7 +258,7 @@ class mailing_partnership extends MailingTargets
if ($resql) {
$num = $this->db->num_rows($resql);
if (!isModenabled("partnership")) {
if (!isModEnabled("partnership")) {
$num = 0; // Force empty list if module is not enabled
}

View File

@@ -54,11 +54,6 @@ class mailing_thirdparties_services_expired extends MailingTargets
*/
public $picto = 'company';
/**
* @var array<int,string>
*/
//public $arrayofproducts = array();
/**
* Constructor
@@ -214,12 +209,14 @@ class mailing_thirdparties_services_expired extends MailingTargets
// Example: return parent::getNbOfRecipients("SELECT count(*) as nb from dolibarr_table");
// Example: return 500;
$sql = "SELECT count(*) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
$sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."product as p";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c,";
$sql .= " ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."product as p";
$sql .= " WHERE s.entity IN (".getEntity('societe').")";
$sql .= " AND s.rowid = c.fk_soc AND cd.fk_contrat = c.rowid AND s.email != ''";
$sql .= " AND cd.statut= 4 AND cd.fk_product=p.rowid";
$sql .= " AND p.ref IN (".$this->db->sanitize("'".implode("','", $this->arrayofproducts)."'", 1).")";
$sql .= " AND cd.statut= 4 AND cd.fk_product = p.rowid";
if (!getDolGlobalString('CONTRACT_SUPPORT_PRODUCTS')) {
$sql .= " AND p.fk_product_type = 1"; // By default, only services
}
$sql .= " AND cd.date_fin_validite < '".$this->db->idate($now)."'";
if (empty($this->evenunsubscribe)) {
$sql .= " AND NOT EXISTS (SELECT rowid FROM ".MAIN_DB_PREFIX."mailing_unsubscribe as mu WHERE mu.email = s.email and mu.entity = ".((int) $conf->entity).")";

View File

@@ -104,7 +104,10 @@ if (in_array($object->element, array('propal', 'commande', 'facture', 'supplier_
//print '<script>$(document).ready(function() { $(".clickvatforalllines").click(function() { jQuery(".classvatforalllines").toggle(); }); });</script>';
if (GETPOST('mode', 'aZ09') == 'vatforalllines') {
print '<div class="classvatforalllines inline-block nowraponall">';
print $form->load_tva('vatforalllines', '', $mysoc, $object->thirdparty, 0, 0, '', false, 1);
$societe_vendeuse = strpos($object->element, 'supplier') === false ? $mysoc : $object->thirdparty;
$societe_acheteuse = strpos($object->element, 'supplier') === false ? $object->thirdparty : $mysoc;
$vat_mode = strpos($object->element, 'supplier') === false ? 1 : 2;
print $form->load_tva('vatforalllines', '', $societe_vendeuse, $societe_acheteuse, 0, 0, '', false, 1, $vat_mode);
print '<input class="inline-block button smallpaddingimp" type="submit" name="submitforalllines" value="'.$langs->trans("Update").'">';
print '</div>';
}

View File

@@ -2356,11 +2356,11 @@ class ExpenseReport extends CommonObject
* deleteline
*
* @param int $rowid Row id
* @param User|string $fuser User
* @param ?User $fuser User
* @param int<0,1> $notrigger 1=No trigger
* @return int<-1,1> Return integer <0 if KO, >0 if OK
*/
public function deleteLine($rowid, $fuser = '', $notrigger = 0)
public function deleteLine($rowid, $fuser = null, $notrigger = 0)
{
$error = 0;

View File

@@ -186,7 +186,7 @@ ACCOUNTING_RESULT_LOSS=Ergebnisabrechnungskonto (Verlust)
ACCOUNTING_CLOSURE_DEFAULT_JOURNAL=Journal für Abschlussbuchungen
ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT=Kontengruppen, die zur Berechnung der Bilanz verwendet werden
ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNTHelp=Legen Sie hier die Liste der Kontengruppen (definiert im Kontenplan) fest, die verwendet werden müssen, um alle Konten zur Berechnung der Bilanz zu finden. Trennen Sie die einzelnen Werte durch Kommas.<br>Beispiel: CAPIT,IMMOSTOCK,FINAN,THIRDPARTY
ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT=Kontenruppen, die zur Berechnung der Gewinn- und Verlustrechnung verwendet werden
ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT=Kontengruppen, die zur Berechnung der Gewinn- und Verlustrechnung verwendet werden
ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENTHelp=Legen Sie hier die Liste der Kontengruppen (definiert im Kontenplan) fest, die verwendet werden müssen, um alle Konten zu finden um die Gewinn- und Verlustrechnung zu berechnen. Trennen Sie die einzelnen Werte durch Kommas.<br>Beispiel: ERLÖSE,AUFWENDUNGEN
ACCOUNTING_ACCOUNT_TRANSFER_CASH=Konto (aus dem Kontenplan), das als Verrechnungskonto/Transferkonto für Banküberweisungen verwendet werden soll
TransitionalAccount=Überweisungskonto