2
0
forked from Wavyzz/dolibarr

Debug v23

This commit is contained in:
ldestailleur
2025-10-06 02:50:07 +02:00
parent 2da06f9fb1
commit 3f91f3f1fc
12 changed files with 44 additions and 25 deletions

View File

@@ -793,7 +793,7 @@ if ($action == 'create') { // aaa
$htmltext .= '</span></i>';
$availablelink = $form->textwithpicto('<span class="opacitymedium hideonsmartphone">'.$langs->trans("AvailableVariables").'</span>', $htmltext, 1, 'helpclickable', '', 0, 2, 'availvar');
$availablelink = $form->textwithpicto('<span class="opacitymedium hideonsmartphone small">'.$langs->trans("AvailableVariables").'</span>', $htmltext, 1, 'helpclickable', '', 0, 2, 'availvar');
//print '<a href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$objMod->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto($langs->trans("ClickToShowDescription"), $imginfo).'</a>';
@@ -865,9 +865,12 @@ if ($action == 'create') { // aaa
print '<tr class="fieldsforemail"><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTopic").'</td>';
print '<td><input id="subject" class="flat minwidth200 quatrevingtpercent" name="subject" id="subject" value="'.dol_escape_htmltag(GETPOST('subject', 'alphanohtml')).'"></td></tr>';
print '<tr class="fieldsforemail"><td>'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
print $htmlother->selectColor(GETPOST('bgcolor'), 'bgcolor', '', 0);
print '</td></tr>';
// Background color
/* if (getDolGlobalString('EMAILING_CAN_EDIT_BACKGROUND_COLOR')) {
print '<tr class="fieldsforemail"><td>'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
print $htmlother->selectColor(GETPOST('bgcolor'), 'bgcolor', '', 0);
print '</td></tr>';
} */
$formmail = new FormMail($db);
$formmail->withfckeditor = 1;
@@ -1330,9 +1333,11 @@ if ($action == 'create') { // aaa
}
// Background color
/*print '<tr><td width="15%">'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
print $htmlother->selectColor($object->bgcolor,'bgcolor','',0);
print '</td></tr>';*/
/* if (getDolGlobalString('EMAILING_CAN_EDIT_BACKGROUND_COLOR')) {
print '<tr><td width="15%">'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
print $htmlother->selectColor($object->bgcolor,'bgcolor','',0);
print '</td></tr>';
}*/
print '</table>';

View File

@@ -84,7 +84,7 @@ if (GETPOSTISSET('template')) {
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
$mycompanyaddress = $mysoc->getFullAddress(0, '<br>', 1, '');
$mycompanyaddress = $mysoc->getFullAddress(0, ',', 1, '');
$specificSubstitutionArray = array(
'__TITLEOFMAILHOLDER__' => $langs->trans('TitleOfMailHolder'),
@@ -193,10 +193,10 @@ if (GETPOSTISSET('template')) {
}
$content = str_replace('__NEWS_LIST__', $newsList, $content);
$content = str_replace('__PRODUCTS_LIST__', $newsList, $content);
$content = str_replace('__PRODUCT_SELECTED__', $newsList, $content);
} else {
$content = str_replace('__NEWS_LIST__', $langs->trans("SelectSomeArticlesOrEnterYourOwnContent"), $content);
$content = str_replace('__PRODUCTS_LIST__', $langs->trans("SelectSomeArticlesOrEnterYourOwnContent"), $content);
$content = str_replace('__PRODUCT_SELECTED__', $langs->trans("SelectOneArticleOrEnterYourOwnContent"), $content);
}
print $content;

View File

@@ -2902,7 +2902,7 @@ class Form
}
}
$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
$out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' spellcheck="false" />';
if ($hidelabel == 3) {
$out .= img_picto($langs->trans("Search"), 'search');
}

View File

@@ -1513,10 +1513,9 @@ class FormMail extends Form
// Define list of email layouts to use
$layouts = array(
'empty' => 'empty',
'none' => 'None',
);
// Search available layouts on disk
// Add layouts found on disk in install/doctemplates/maillayout directory
$arrayoflayoutemplates = dol_dir_list(DOL_DOCUMENT_ROOT.'/install/doctemplates/maillayout/', 'files', 0, '\.html$');
foreach ($arrayoflayoutemplates as $layouttemplatefile) {
$layoutname = preg_replace('/\.html$/i', '', $layouttemplatefile['name']);
@@ -1525,7 +1524,7 @@ class FormMail extends Form
if ($layoutname == 'news' && (!in_array($showlinktolayout, array('emailing', 'websitepage')) || !isModEnabled('website'))) {
continue;
}
if ($layoutname == 'products' && (!in_array($showlinktolayout, array('emailing', 'websitepage')) || (!isModEnabled('product') && !isModEnabled('service')))) {
if ($layoutname == 'product' && (!in_array($showlinktolayout, array('emailing', 'websitepage')) || (!isModEnabled('product') && !isModEnabled('service')))) {
continue;
}
@@ -1577,12 +1576,24 @@ class FormMail extends Form
}
// Use the multiselect array function to create the dropdown
$out .= '<div id="post-dropdown-container" class="email-layout-container hidden" style="display:none;">';
$out .= '<div id="post-dropdown-container" class="email-layout-container hidden" style="height: 32px; display:none;">';
$out .= '<label for="blogpost-select">Select Posts: </label>';
$out .= '<!-- select component for selection of products -->'."\n";
$out .= '<!-- select component for selection of blog posts -->'."\n";
$out .= self::multiselectarray('blogpost-select', $blogArray, array(), 0, 0, 'minwidth200');
$out .= ' <input type="submit" class="smallpaddingimp button" name="submit" id="post-submit" value="'.dolPrintHTMLForAttribute($langs->trans("Select")).'">';
$out .= '</div>';
if (isModEnabled('product') || isModEnabled('service')) {
include_once DOL_DOCUMENT_ROOT.'/htdocs/core/class/html.form.class.php';
$form = new Form($this->db);
$out .= '<div id="product-dropdown-container" class="email-layout-container hidden" style="height: 32px; display:none;">';
$out .= '<label for="product-select">'.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("Product").' : </label>';
$out .= '<!-- select component for selection of product -->'."\n";
$out .= $form->select_produits(0, 'product-select', '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, '', 0, '', null, 1);
$out .= ' <input type="submit" class="smallpaddingimp button" name="submit" id="product-submit" value="'.dolPrintHTMLForAttribute($langs->trans("Select")).'">';
$out .= '</div>';
}
$out .= '<!-- Js code to manage choice of an email layout -->'."\n";
$out .= '<script type="text/javascript">
$(document).ready(function() {
@@ -1601,12 +1612,15 @@ class FormMail extends Form
if (template === "news") {
$("#post-dropdown-container").show();
$("#product-dropdown-container").hide();
console.log("Displaying dropdown for news selection");
} else if (template === "products") {
$("#post-dropdown-container").show();
console.log("Displaying dropdown for products selection");
} else if (template === "product") {
$("#product-dropdown-container").show();
$("#post-dropdown-container").hide();
console.log("Displaying dropdown for product selection");
} else {
$("#post-dropdown-container").hide();
$("#product-dropdown-container").hide();
}
var csrfToken = "' .newToken().'";

View File

@@ -51,7 +51,7 @@ if (empty($htmlname)) {
}
?>
<!-- BEGIN PHP TEMPLATE formlayoutai.tpl.php -->
<!-- BEGIN PHP TEMPLATE htdocs/core/tpl/formlayoutai.tpl.php -->
<?php
'
@@ -170,4 +170,4 @@ if ($showlinktoai) {
}
?>
<!-- END PHP TEMPLATE commonfields_edit.tpl.php -->
<!-- END PHP TEMPLATE htdocs/core/tpl/formlayoutai.tpl.php -->

View File

@@ -29,7 +29,6 @@ body {
<strong>__MYCOMPANY_NAME__</strong><br>
__MYCOMPANY_ADDRESS_WITH_PICTO__<br>
__MYCOMPANY_EMAIL_WITH_PICTO__<br>
__MYCOMPANY_PHONE_PRO_WITH_PICTO__
__MYCOMPANY_SOCIAL_NETWORKS__<br>
</div>
</div>

View File

@@ -26,7 +26,7 @@ body {
<!-- <h2>__CONTENTOFMAILHOLDER__ </h2>-->
<!-- PRODUCTS_START -->
__PRODUCTS_LIST__
__PRODUCT_SELECTED__
<!-- PRODUCTS_END -->
</div>

View File

@@ -208,3 +208,4 @@ PasswordReset=Password reset
MailingNumberOfEmailsPerBatch=Number of emails per batch
MailingNumberOfEmailsPerBatchHelp=Define the number of emails you want to send for each manual sending action. Warning: An important number of emails can lead to your server being blacklisted.
SelectSomeArticlesOrEnterYourOwnContent=Select your articles or enter your own text...
SelectOneArticleOrEnterYourOwnContent=Select one product or service or enter your own text...

View File

@@ -381,7 +381,7 @@ TLSv1.2=TLSv1.2
TLS/STARTTLS=TLS/STARTTLS
FillExtrafieldWithAi=Fill extrafield with AI content
ExtrafieldFiller=Extrafield filler
OurProductSelection=Our selection of new products
OurProductSelection=The product to discover
NoSupportedModulesHaveBeenActivated=The reporting tool can generate dynamic reports for some modules only. There is no supported module enabled yet.
# Bookmarks
AddThisPageToBookmarks = Add current page to bookmarks

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB