Debug v22

This commit is contained in:
ldestailleur 2025-06-02 16:59:46 +02:00
parent 22e7200ecd
commit d543bdcffe
2 changed files with 4 additions and 4 deletions

View file

@ -1498,7 +1498,7 @@ class FormMail extends Form
* @param string $showlinktolayout Show link to layout
* @return string HTML for model email boxes
*/
public function getModelEmailTemplate($htmlContent = 'message', $showlinktolayout = 'email')
public function getEmailLayoutSelector($htmlContent = 'message', $showlinktolayout = 'email')
{
global $websitepage, $langs;
@ -1519,10 +1519,10 @@ class FormMail extends Form
$layoutname = preg_replace('/\.html$/i', '', $layouttemplatefile['name']);
// Exclude some layouts for some use cases
if ($layoutname == 'news' && !in_array($showlinktolayout, array('emailing', 'websitepage'))) {
if ($layoutname == 'news' && !in_array($showlinktolayout, array('emailing', 'websitepage')) && !isModEnabled('website')) {
continue;
}
if ($layoutname == 'products' && !in_array($showlinktolayout, array('emailing', 'websitepage'))) {
if ($layoutname == 'products' && !in_array($showlinktolayout, array('emailing', 'websitepage')) && !isModEnabled('product') && !isModEnabled('service')) {
continue;
}

View file

@ -142,7 +142,7 @@ if ($showlinktolayout) {
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
}
$out .= $formmail->getModelEmailTemplate($htmlname, $showlinktolayout);
$out .= $formmail->getEmailLayoutSelector($htmlname, $showlinktolayout);
}
} else {
$out .= '<!-- No link to the layout feature, $formmail->withlayout must be set to a string use case, module WYSIWYG must be enabled and MAIN_EMAIL_USE_LAYOUT must be set -->';