Debug v21

This commit is contained in:
Laurent Destailleur 2025-01-23 01:29:29 +01:00
parent 46ec368462
commit 821565e031
4 changed files with 26 additions and 39 deletions

View File

@ -799,7 +799,7 @@ if ($action == 'create') { // aaa
// Print mail form
print load_fiche_titre($langs->trans("NewMailing"), $availablelink, 'object_email');
print dol_get_fiche_head(array(), '', '', -4, '', 0, '', '');
print dol_get_fiche_head(array(), '', '', 0, '', 0, '', '');
print '<table class="border centpercent">';
@ -831,17 +831,21 @@ if ($action == 'create') { // aaa
}
print '</table>';
print '<br><br>';
print '<br>';
print '<table class="border centpercent">';
print '<tr class="fieldsforemail"><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailFrom").'</td><td><input class="flat minwidth200" name="from" value="'.(GETPOSTISSET('from') ? GETPOST('from') : getDolGlobalString('MAILING_EMAIL_FROM')).'"></td></tr>';
print '<tr class="fieldsforemail"><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailFrom").'</td>';
print '<td>'.img_picto('', 'email', 'class="pictofixedwidth"').'<input class="flat minwidth200" name="from" value="'.(GETPOSTISSET('from') ? GETPOST('from') : getDolGlobalString('MAILING_EMAIL_FROM')).'"></td></tr>';
print '<tr class="fieldsforsms hidden"><td class="fieldrequired titlefieldcreate">'.$langs->trans("PhoneFrom").'</td><td><input class="flat minwidth200" name="fromphone" value="'.(GETPOSTISSET('fromphone') ? GETPOST('fromphone') : getDolGlobalString('MAILING_SMS_FROM')).'" placeholder="+123..."></td></tr>';
print '<tr class="fieldsforsms hidden"><td class="fieldrequired titlefieldcreate">'.$langs->trans("PhoneFrom").'</td>';
print '<td>'.img_picto('', 'email', 'class="pictofixedwidth"').'<input class="flat minwidth200" name="fromphone" value="'.(GETPOSTISSET('fromphone') ? GETPOST('fromphone') : getDolGlobalString('MAILING_SMS_FROM')).'" placeholder="+123..."></td></tr>';
print '<tr class="fieldsforemail"><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.getDolGlobalString('MAILING_EMAIL_ERRORSTO', getDolGlobalString('MAIN_MAIL_ERRORS_TO')).'"></td></tr>';
print '<tr class="fieldsforemail"><td>'.$langs->trans("MailErrorsTo").'</td>';
print '<td>'.img_picto('', 'email', 'class="pictofixedwidth"').'<input class="flat minwidth200" name="errorsto" value="'.getDolGlobalString('MAILING_EMAIL_ERRORSTO', getDolGlobalString('MAIN_MAIL_ERRORS_TO')).'"></td></tr>';
print '<tr class="fieldsforemail"><td>'.$langs->trans("MailReply").'</td><td><input class="flat minwidth200" name="replyto" value="'.getDolGlobalString('MAILING_EMAIL_REPLYTO', getDolGlobalString('MAIN_MAIL_REPLY_TO')).'"></td></tr>';
print '<tr class="fieldsforemail"><td>'.$langs->trans("MailReply").'</td>';
print '<td>'.img_picto('', 'email', 'class="pictofixedwidth"').'<input class="flat minwidth200" name="replyto" value="'.getDolGlobalString('MAILING_EMAIL_REPLYTO', getDolGlobalString('MAIN_MAIL_REPLY_TO')).'"></td></tr>';
// Other attributes
$parameters = array();
@ -852,7 +856,8 @@ if ($action == 'create') { // aaa
}
print '</table>';
print '<br><br>';
print '<br>';
print '<table class="border centpercent">';
print '<tr class="fieldsforemail"><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTopic").'</td><td><input id="sujet" class="flat minwidth200 quatrevingtpercent" name="sujet" value="'.dol_escape_htmltag(GETPOST('sujet', 'alphanohtml')).'"></td></tr>';
@ -889,7 +894,7 @@ if ($action == 'create') { // aaa
print '<div style="padding-top: 10px">';
// wysiwyg editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%');
$doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '100%');
$doleditor->Create();
print '</div>';
@ -1129,7 +1134,7 @@ if ($action == 'create') { // aaa
}
print $text;
if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'default') {
if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'mail') {
if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') && getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'mail') {
print ' <span class="opacitymedium">('.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING', getDolGlobalString('MAIN_MAIL_SMTP_SERVER')).')</span>';
}
} elseif (getDolGlobalString('MAIN_MAIL_SENDMODE') != 'mail' && getDolGlobalString('MAIN_MAIL_SMTP_SERVER')) {
@ -1329,7 +1334,7 @@ if ($action == 'create') { // aaa
$readonly = 1;
// wysiwyg editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', false, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%', $readonly);
$doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', false, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '100%', $readonly);
$doleditor->Create();
} else {
print dol_htmlentitiesbr($object->body);
@ -1548,19 +1553,19 @@ if ($action == 'create') { // aaa
if ($action == 'edit') {
// wysiwyg editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%');
$doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '100%');
$doleditor->Create();
}
if ($action == 'edittxt') {
// wysiwyg editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, 0, 20, '90%');
$doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, 0, 20, '100%');
$doleditor->Create();
}
if ($action == 'edithtml') {
// HTML source editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, 'ace', 20, '90%');
$doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, -1, 'ace', 20, '100%');
$doleditor->Create(0, '', false, 'HTML Source', 'php');
}

View File

@ -73,16 +73,17 @@ if (GETPOSTISSET('content')) {
foreach ($selectedPosts as $postId) {
$post = getNewsDetailsById($postId);
$newsList .= '<div style="display: flex; align-items: flex-start; justify-content: flex-start; width: 100%; max-width: 800px; margin-top: 20px;margin-bottom: 50px; padding: 20px;">
<div style="flex-grow: 1; margin-right: 30px; max-width: 600px; margin-left: 100px;">
<h2 style="margin: 0; font-size: 1.5em;">' . htmlentities($post['title']) . '</h2>
<p style="margin: 10px 0; color: #555;">' . htmlentities($post['description']) . '</p>
<span style="display: block; margin-bottom: 5px; color: #888;">Created By: <strong>' . htmlentities($post['user_fullname']) . '</strong></span>
<h2 style="margin: 0; font-size: 1.5em;">' . htmlentities(empty($post['title']) ? '' : $post['title']) . '</h2>
<p style="margin: 10px 0; color: #555;">' . htmlentities(empty($post['description']) ? '' : $post['description']) . '</p>
<span style="display: block; margin-bottom: 5px; color: #888;">Created By: <strong>' . htmlentities(empty($post['user_fullname']) ? '' : $post['user_fullname']) . '</strong></span>
<br>
<span style="display: block; color: #888;">' . dol_print_date($post['date_creation'], 'daytext', 'tzserver', $langs) . '</span>
<span style="display: block; color: #888;">' . dol_print_date((empty($post['date_creation']) ? dol_now() : $post['date_creation']), 'daytext', 'tzserver', $langs) . '</span>
</div>
<div style="flex-shrink: 0; margin-left: 100px; float: right;">
' . ($post['image'] ? '<img alt="Image" width="130px" height="130px" style="border-radius: 10px;" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=medias&file=' . htmlentities($post['image']) . '">' : '<img alt="Gray rectangle" width="130px" height="130px" style="border-radius: 10px;" src="__GRAY_RECTANGLE__">') . '
' . (!empty($post['image']) ? '<img alt="Image" width="130px" height="130px" style="border-radius: 10px;" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=medias&file=' . htmlentities($post['image']) . '">' : '<img alt="Gray rectangle" width="130px" height="130px" style="border-radius: 10px;" src="__GRAY_RECTANGLE__">') . '
</div>
</div>';
}

View File

@ -1693,7 +1693,7 @@ 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 .= '<label for="blogpost-select">Select Posts: </label>';
$out .= self::multiselectarray('blogpost-select', $blogArray);
$out .= self::multiselectarray('blogpost-select', $blogArray, array(), 0, 0, 'minwidth200');
$out .= '</div>';
$out .= '<script type="text/javascript">
@ -1706,9 +1706,7 @@ class FormMail extends Form
var sendtocc = jQuery("#sendtocc").val();
var sendtoccc = jQuery("#sendtoccc").val();
console.log("We choose a layout for email template=" + template + ", subject="+subject);
console.log("We choose a layout for email template " + template);
console.log("We choose a layout for email template=" + template + ", subject="+subject);
$(".template-option").removeClass("selected");
$(this).addClass("selected");

View File

@ -2704,23 +2704,6 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
$out .= '<div class="inline-block floatright tabsElem">'.$morehtmlright.'</div>'; // Output right area first so when space is missing, text is in front of tabs and not under.
}
// Show title
/*
if (!empty($title) && $showtitle && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$limittitle = 30;
$out .= '<a class="tabTitle">';
if ($picto) {
$noprefix = $pictoisfullpath;
if (strpos($picto, 'fontawesome_') !== false) {
$noprefix = 1;
}
$out .= img_picto($title, ($noprefix ? '' : 'object_').$picto, '', $pictoisfullpath, 0, 0, '', 'imgTabTitle').' ';
}
$out .= '<span class="tabTitleText">'.dol_escape_htmltag(dol_trunc($title, $limittitle)).'</span>';
$out .= '</a>';
}
*/
// Show tabs
// Define max of key (max may be higher than sizeof because of hole due to module disabling some tabs).