From c33a7a4666f8df4a9973f7ab1b59cdc3155c358f Mon Sep 17 00:00:00 2001 From: Gabriele Cimaschi Date: Mon, 14 Sep 2026 10:53:49 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20dopo=20l'unificazione=20messaggio=20rapi?= =?UTF-8?q?do=20e=20nota,=20non=20funzionava=20pi=C3=B9=20la=20consuntivaz?= =?UTF-8?q?ione=20senza=20inserire=20oggetto=20o=20corpo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/views/ticketDetail.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/js/views/ticketDetail.js b/public/js/views/ticketDetail.js index cd1af32..23ff7a8 100644 --- a/public/js/views/ticketDetail.js +++ b/public/js/views/ticketDetail.js @@ -3755,14 +3755,16 @@ const TicketDetailView = { // 2. Perform article note creation if note fields are populated if (hasNoteContent) { - if (!noteBody && noteSubject) { + if (!noteSubject && !noteBody) { + noteSubject = 'consuntivazione'; + noteBody = '

consuntivazione

'; + } else if (!noteBody && noteSubject) { noteBody = `

${App.escapeHtml(noteSubject)}

`; - } - if (noteBody && !noteSubject) { + } else if (noteBody && !noteSubject) { const tempDiv = document.createElement('div'); tempDiv.innerHTML = noteBody; const plainText = tempDiv.textContent || tempDiv.innerText || ''; - noteSubject = plainText.trim().substring(0, 50) || 'Nota interna'; + noteSubject = plainText.trim().substring(0, 50) || 'consuntivazione'; } const resNote = await App.api(`/api/tickets/${this.ticketId}/articles`, {