fix: note temporanee che non funzionavano. feat: le note possono essere inviate ad otrs senza numero di ticket. style: rivisti alcuni nomi e colore per invio di una nota temporanea in otrs.

This commit is contained in:
Gabriele Cimaschi committed 2026-09-07 17:58:13 +02:00
1 parent b828d60bb2
commit f21be0abcb
9 files changed
+216 -70

No files matched your search

+28 -1
View File
@@ -245,6 +245,10 @@ const TicketDetailView = {
<label class="quick-edit-label">Tempo (minuti)</label>
<input type="number" step="any" min="0" class="form-input" id="qe-time-unit" placeholder="minuti" style="padding: 6px 12px; height: 32px; font-size: 0.85rem;" />
</div>
<div class="quick-edit-field full-width">
<label class="quick-edit-label">Oggetto Nota (opzionale)</label>
<input type="text" class="form-input quick-edit-input" id="qe-note-subject" placeholder="Oggetto della nota..." style="padding: 6px 12px; height: 32px; font-size: 0.85rem;" />
</div>
<div class="quick-edit-field full-width">
<label class="quick-edit-label">Nota / Commento</label>
<textarea class="quick-edit-textarea" id="qe-note" placeholder="Inserisci una nota..."></textarea>
@@ -599,6 +603,7 @@ const TicketDetailView = {
const saveBtn = document.getElementById('qe-save');
const resetBtn = document.getElementById('qe-reset');
const timeUnitInput = document.getElementById('qe-time-unit');
const noteSubjectInput = document.getElementById('qe-note-subject');
const noteInput = document.getElementById('qe-note');
const checkChanges = () => {
@@ -622,6 +627,14 @@ const TicketDetailView = {
hasChanges = true;
}
const noteSubText = noteSubjectInput ? noteSubjectInput.value.trim() : '';
if (noteSubjectInput) {
noteSubjectInput.classList.toggle('changed', noteSubText.length > 0);
}
if (noteSubText.length > 0) {
hasChanges = true;
}
const noteText = noteInput ? noteInput.value.trim() : '';
if (noteInput) {
noteInput.classList.toggle('changed', noteText.length > 0);
@@ -633,11 +646,17 @@ const TicketDetailView = {
saveBtn.disabled = !hasChanges;
};
fields.forEach(el => el.addEventListener('change', checkChanges));
fields.forEach(el => {
el.addEventListener('change', checkChanges);
});
if (timeUnitInput) {
timeUnitInput.addEventListener('input', checkChanges);
timeUnitInput.addEventListener('change', checkChanges);
}
if (noteSubjectInput) {
noteSubjectInput.addEventListener('input', checkChanges);
noteSubjectInput.addEventListener('change', checkChanges);
}
if (noteInput) {
noteInput.addEventListener('input', checkChanges);
noteInput.addEventListener('change', checkChanges);
@@ -796,6 +815,10 @@ const TicketDetailView = {
if (timeUnitInput) {
timeUnitInput.value = '';
}
if (noteSubjectInput) {
noteSubjectInput.value = '';
noteSubjectInput.classList.remove('changed');
}
if (noteInput) {
noteInput.value = '';
noteInput.classList.remove('changed');
@@ -840,6 +863,10 @@ const TicketDetailView = {
}
}
if (noteSubjectInput && noteSubjectInput.value.trim()) {
updates.note_subject = noteSubjectInput.value.trim();
}
if (noteInput && noteInput.value.trim()) {
updates.note = noteInput.value.trim();
}