From 86b3b3be15a61c3bcde1c80c85c09644d62df5ed Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 5 May 2026 00:57:28 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20add=20direct=20Ny=20kontakt=20/=20S?= =?UTF-8?q?=C3=B8g=20/=20Firma=20buttons=20on=20telefoni=20rows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- app/modules/telefoni/templates/log.html | 55 +++++++++++++++++++++++-- 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 0f434c9..6f898f5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.89 +2.2.90 diff --git a/app/modules/telefoni/templates/log.html b/app/modules/telefoni/templates/log.html index 020ac8d..6736482 100644 --- a/app/modules/telefoni/templates/log.html +++ b/app/modules/telefoni/templates/log.html @@ -630,6 +630,47 @@ function openLinkContactModal(callId, mode = 'contact') { }, 200); } +function quickNewContact(callId, number) { + // Open the link-contact modal but scroll to / pre-fill the 'opret ny kontakt' form. + linkContactState.callId = Number(callId); + linkContactState.number = String(number || '').trim(); + linkContactState.mode = 'contact'; + + const ctx = document.getElementById('linkContactContext'); + const phoneInput = document.getElementById('newContactPhone'); + const firstNameInput = document.getElementById('newContactFirstName'); + const lastNameInput = document.getElementById('newContactLastName'); + const emailInput = document.getElementById('newContactEmail'); + const titleInput = document.getElementById('newContactTitle'); + const searchInput = document.getElementById('linkContactSearch'); + const companySearchInput = document.getElementById('linkCompanySearch'); + + if (ctx) ctx.textContent = `Opkald: ${linkContactState.number || ('#' + callId)}`; + if (phoneInput) phoneInput.value = linkContactState.number; + if (firstNameInput) firstNameInput.value = ''; + if (lastNameInput) lastNameInput.value = ''; + if (emailInput) emailInput.value = ''; + if (titleInput) titleInput.value = ''; + if (searchInput) searchInput.value = ''; + if (companySearchInput) companySearchInput.value = ''; + setLinkContactSelected(null, ''); + setLinkCompanySelected(null, ''); + renderLinkContactResults([]); + renderCompanyResults([]); + + const modal = getLinkContactModalInstance(); + if (modal) modal.show(); + + // Scroll to the "Opret ny kontakt" section after modal opens + setTimeout(() => { + const newSection = document.getElementById('newContactFirstName'); + if (newSection) { + newSection.scrollIntoView({ behavior: 'smooth', block: 'center' }); + newSection.focus(); + } + }, 300); +} + async function unlinkContact(callId) { if (!confirm('Fjern link til kontakt for dette opkald?')) return; try { @@ -951,9 +992,17 @@ async function loadCalls() { ${r.contact_company ? `
${escapeHtml(r.contact_company)}
` : ''}` - : ``; + : `
+ + + +
`; const numberForTitle = (r.display_number || r.ekstern_nummer || '').trim(); const createQs = new URLSearchParams();