${a.sender_type || 'System'}
@@ -1972,6 +1972,74 @@ const TicketDetailView = {
+
+
+
+
+
+
+
+
+
+ Dettagli Email #${a.article_id}
+
+
+
+
+
+ Da:
+ ${App.escapeHtml(a.a_from || a.creator_first + ' ' + a.creator_last || 'â')}
+
+ ${(a.a_from) ? `
+
+ ` : ''}
+
+
+ ${a.a_to ? `
+
+
+ A:
+ ${App.escapeHtml(a.a_to)}
+
+
+
+ ` : ''}
+
+ ${a.a_cc ? `
+
+
+ Cc:
+ ${App.escapeHtml(a.a_cc)}
+
+
+
+ ` : ''}
+
+
+
+
+ Link contenuti
+
+
${extractedLinks.length}
+
+
+ ${extractedLinks.length > 0 ? `
+
+ ${extractedLinks.map(link => `
+
+ đ
+ ${App.escapeHtml(link.text || link.url)}
+
+ `).join('')}
+
+ ` : `
+
Nessun link presente
+ `}
+
+
+
@@ -2007,65 +2075,20 @@ const TicketDetailView = {
-
- ${displayBody}
-
- ${visibleAttachments.length > 0 ? `
-
- ` : ''}
-
-
-
-
-
-
- Dettagli Mail
+
+ ${displayBody}
+
+ ${visibleAttachments.length > 0 ? `
+
-
- Da:
- ${App.escapeHtml(a.a_from || 'â')}
-
-
- A:
- ${App.escapeHtml(a.a_to || 'â')}
-
- ${a.a_cc ? `
-
- Cc:
- ${App.escapeHtml(a.a_cc)}
-
- ` : ''}
-
-
-
-
- Link contenuti
-
-
${extractedLinks.length}
-
-
- ${extractedLinks.length > 0 ? `
-
- ${extractedLinks.map(link => `
-
- đ
- ${App.escapeHtml(link.text || link.url)}
-
- `).join('')}
-
- ` : `
-
Nessun link presente
- `}
-
+ ` : ''}
`;
@@ -2695,9 +2718,10 @@ const TicketDetailView = {
if (!article) return;
if (window.EmailCompose) {
- const hasHtml = (article.a_content_type || '').toLowerCase().includes('html') || article.a_body.includes('') || article.a_body.includes('/>');
+ const rawQuotedBody = article.html_body || article.a_body || '';
+ const hasHtml = article.has_html || (article.a_content_type || '').toLowerCase().includes('html') || rawQuotedBody.includes('') || rawQuotedBody.includes('/>');
- let processedQuoted = article.a_body || '';
+ let processedQuoted = rawQuotedBody;
if (hasHtml) {
const articleAttachments = (attachments || []).filter(att => att.article_id === article.article_id);
articleAttachments.forEach(att => {
@@ -2721,8 +2745,8 @@ const TicketDetailView = {
const initialBodyHtml = `
-
Il ${App.formatDateTime(article.create_time)}, ${App.escapeHtml(article.a_from || 'Sistema')} ha scritto:
-
+ Il ${App.formatDateTime(article.create_time)}, ${App.escapeHtml(article.a_from || 'Sistema')} ha scritto:
+
${quotedBody}
@@ -2786,6 +2810,27 @@ const TicketDetailView = {
});
});
+ // Event listener for email address copy buttons inside popover
+ container.querySelectorAll('.btn-copy-email-addr').forEach(btn => {
+ btn.addEventListener('click', (e) => {
+ e.stopPropagation();
+ const textToCopy = btn.dataset.copyText || '';
+ if (textToCopy) {
+ navigator.clipboard.writeText(textToCopy).then(() => {
+ const origText = btn.textContent;
+ btn.textContent = 'â Copiato!';
+ btn.style.color = 'var(--success)';
+ setTimeout(() => {
+ btn.textContent = origText;
+ btn.style.color = 'var(--text-secondary)';
+ }, 1500);
+ }).catch(err => {
+ Toast.error('Impossibile copiare: ' + err.message);
+ });
+ }
+ });
+ });
+
// Retrodate Ticket Event Listeners
const btnEditTicketDate = document.getElementById('btn-edit-ticket-date');
const ticketDateEditor = document.getElementById('ticket-date-editor');