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

This commit is contained in:
Laurent Destailleur
2026-02-27 14:46:41 +01:00
3 changed files with 34 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2026 Vincent de Grandpré <vincent@de-grandpre.quebec>
*
* 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
@@ -1766,6 +1767,7 @@ class EmailCollector extends CommonObject
$nbactiondone = 0;
$charset = ($this->hostcharset ? $this->hostcharset : "UTF-8");
$arrayofemail = array();
$Query = 0;
if (getDolGlobalString('MAIN_IMAP_USE_PHPIMAP') && is_object($client)) {
try {
@@ -1779,10 +1781,13 @@ class EmailCollector extends CommonObject
$f = $client->getFolders(false, $tmpsourcedir); // Note the search of directory do a search on sourcedir*
if ($f) {
$folder = $f[0];
if ($folder instanceof Webklex\PHPIMAP\Folder) {
$Query = $folder->messages()->where($criteria); // @phan-suppress-current-line PhanPluginUnknownObjectMethodCall
} else {
foreach ($f as $_f) {
if ($_f->path == $this->source_directory && $_f instanceof Webklex\PHPIMAP\Folder) {
$Query = $_f->messages()->where($criteria); // @phan-suppress-current-line PhanPluginUnknownObjectMethodCall
}
}
// @phpstan-ignore-line
if (empty($Query)) {
$error++;
$this->error = "Source directory ".$sourcedir." not found";
$this->errors[] = $this->error;

View File

@@ -60,6 +60,15 @@ var Dolibarr = {
* @returns {string}
*/
trans(key, ...args) {},
/**
* Translate a key using current locale
* Supports placeholders like %s, %d, %f (simple sprintf)
* @param {string} key
* @param {...any} args
* @returns {string}
*/
transNoEntities(key, ...args) {},
},
// You can add more standard Dolibarr tools here for IDE autocompletion.

View File

@@ -220,6 +220,21 @@ document.addEventListener('Dolibarr:Init', function(e) {
return sprintf(text, ...args);
}
/**
* Translate a key using current locale
* Supports placeholders like %s, %d, %f (simple sprintf)
* @param {string} key
* @param {...any} args
* @returns {string}
*/
function transNoEntities(key, ...args) {
let str = trans(key, ...args);
let txt = document.createElement('textarea');
txt.innerHTML = str;
return txt.value;
}
function sprintf(fmt, ...args) {
let i = 0;
return fmt.replace(/%[%bcdeEfFgGosuxX]/g, (match) => {
@@ -246,6 +261,7 @@ document.addEventListener('Dolibarr:Init', function(e) {
clearCache,
setLocale,
trans,
transNoEntities,
get currentLocale() { return currentLocale; }
};
};