Korjaa tikettiviestiluokittelu: outgoing-tyyppi tunnistetaan nyt lähteviksi
Zammad-synkasta tulevat viestit käyttävät tyyppiä 'outgoing' (ei 'reply_out'), joten ne näkyivät virheellisesti saapuvina (sininen). Nyt molemmat tyypit tunnistetaan lähteviksi ja näytetään vihreällä taustalla. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1480,7 +1480,7 @@ function renderTickets() {
|
||||
document.getElementById('tickets-table').style.display = 'table';
|
||||
const multiCompany = availableCompanies.length > 1;
|
||||
ttbody.innerHTML = pageTickets.map(t => {
|
||||
const lastType = t.last_message_type === 'reply_out' ? '→' : (t.last_message_type === 'note' ? '📝' : '←');
|
||||
const lastType = (t.last_message_type === 'reply_out' || t.last_message_type === 'outgoing') ? '→' : (t.last_message_type === 'note' ? '📝' : '←');
|
||||
const typeLabel = ticketTypeLabels[t.type] || 'Muu';
|
||||
const rowClass = t.priority === 'urgent' ? 'ticket-row-urgent' : (t.priority === 'tärkeä' ? 'ticket-row-important' : (t.status === 'kasittelyssa' ? 'ticket-row-active' : ''));
|
||||
const checked = bulkSelectedIds.has(t.id) ? 'checked' : '';
|
||||
@@ -1811,11 +1811,11 @@ async function showTicketDetail(id, companyId = '') {
|
||||
// Thread messages
|
||||
const thread = document.getElementById('ticket-thread');
|
||||
thread.innerHTML = (ticket.messages || []).map(m => {
|
||||
const isOut = m.type === 'reply_out';
|
||||
const isOut = m.type === 'reply_out' || m.type === 'outgoing';
|
||||
const isAutoReply = m.type === 'auto_reply';
|
||||
const isNote = m.type === 'note';
|
||||
const typeClass = (isOut || isAutoReply) ? 'ticket-msg-out' : (isNote ? 'ticket-msg-note' : 'ticket-msg-in');
|
||||
const typeIcon = isAutoReply ? '⚡ Automaattinen vastaus' : (isOut ? '→ Vastaus' : (isNote ? '📝 Muistiinpano' : '← Saapunut'));
|
||||
const typeIcon = isAutoReply ? '⚡ Automaattinen vastaus' : (isOut ? '→ Lähetetty' : (isNote ? '📝 Muistiinpano' : '← Saapunut'));
|
||||
return `<div class="ticket-message ${typeClass}">
|
||||
<div class="ticket-msg-header">
|
||||
<span class="ticket-msg-type">${typeIcon}</span>
|
||||
|
||||
Reference in New Issue
Block a user