2
0
forked from Wavyzz/dolibarr

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

This commit is contained in:
ldestailleur
2025-10-08 20:28:58 +02:00
3 changed files with 29 additions and 7 deletions

View File

@@ -244,7 +244,8 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) {
print '<tr class="oddeven drag" id="trforcenature"><td>';
print $langs->trans("ForceMemberNature");
print '</td><td>';
$forcenature = getDolGlobalString('MEMBER_NEWFORM_FORCEMORPHY');
$forcenature = getDolGlobalString('MEMBER_NEWFORM_FORCEMORPHY'); // 'phy' or 'mor'
print $form->selectarray("MEMBER_NEWFORM_FORCEMORPHY", $morphys, $forcenature, $langs->trans("No"), 0, 0, '', 0, 0, 0, '', 'width200');
print "</td></tr>\n";

View File

@@ -8,6 +8,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 Joachim Kueter <git-jk@bloxera.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
@@ -626,7 +627,9 @@ class CMailFile
if (!empty($this->atleastonefile)) {
foreach ($filename_list as $i => $val) {
$content = file_get_contents($filename_list[$i]);
$smtps->setAttachment($content, $mimefilename_list[$i], $mimetype_list[$i], (empty($cid_list[$i]) ? '' : $cid_list[$i]));
if (empty($cid_list[$i])) {
$smtps->setAttachment($content, $mimefilename_list[$i], $mimetype_list[$i], (empty($cid_list[$i]) ? '' : $cid_list[$i]));
}
}
}
@@ -1869,15 +1872,17 @@ class CMailFile
$mimetype_list[$i] = "application/octet-stream";
}
// Skip files that have a CID (they will be added as inline images instead)
if (!empty($cidlist) && is_array($cidlist) && isset($cidlist[$i]) && $cidlist[$i] !== null && $cidlist[$i] !== '') {
continue; // Skip this file as it will be processed as inline image
}
$out .= "--".$this->mixed_boundary.$this->eol;
$out .= "Content-Disposition: attachment; filename=\"".$filename_list[$i]."\"".$this->eol;
$out .= "Content-Type: ".$mimetype_list[$i]."; name=\"".$filename_list[$i]."\"".$this->eol;
$out .= "Content-Transfer-Encoding: base64".$this->eol;
$out .= "Content-Description: ".$filename_list[$i].$this->eol;
if (!empty($cidlist) && is_array($cidlist) && $cidlist[$i]) {
$out .= "X-Attachment-Id: ".$cidlist[$i].$this->eol;
$out .= "Content-ID: <".$cidlist[$i].'>'.$this->eol;
}
$out .= $this->eol;
$out .= $encoded;
$out .= $this->eol;
@@ -2209,6 +2214,22 @@ class CMailFile
$i++;
}
// Also add cidfromdata images to images_encoded array so they are sent as inline images
foreach ($this->html_images as $img) {
if ($img['type'] == 'cidfromdata') {
$image_content = file_get_contents($img['fullpath']);
if ($image_content !== false) {
$idx = count($this->images_encoded);
$this->images_encoded[$idx]['name'] = $img['name'];
$this->images_encoded[$idx]['fullpath'] = $img['fullpath'];
$this->images_encoded[$idx]['content_type'] = $img['content_type'];
$this->images_encoded[$idx]['cid'] = $img['cid'];
$this->images_encoded[$idx]['type'] = 'cidfromdata';
$this->images_encoded[$idx]['image_encoded'] = chunk_split(base64_encode($image_content), 68, $this->eol);
}
}
}
return 1;
} else {
return 0;

View File

@@ -141,7 +141,7 @@ $search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'a
$search_multicurrency_montant_tva = GETPOST('search_multicurrency_montant_tva', 'alpha');
$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
$billed = GETPOSTINT('billed');
$billed = GETPOST('billed', 'int'); // Value '' must be possible
$search_project_ref = GETPOST('search_project_ref', 'alpha');
$search_btn = GETPOST('button_search', 'alpha');
$search_remove_btn = GETPOST('button_removefilter', 'alpha');