mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-03-18 16:13:59 +01:00
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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; }
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user