- SMTP-palvelinkenttä näkyy nyt aina mailbox-lomakkeessa,
myös kun "Käytä samoja tunnuksia" on päällä (vain käyttäjä
ja salasana piiloutuvat)
- Korjattu CuituNet → Cuitunet kaikkialla (pieni n)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Jos käyttäjä ei ole asettanut omaa allekirjoitusta mailboxille,
generoidaan automaattisesti oletus:
Etunimi
Yrityksen nimi
Postilaatikon sähköpostiosoite
Toimii sekä esikatselu-previewssä että sähköpostin lähetyksessä.
Käyttäjä voi yliajaa oletuksen tallentamalla oman allekirjoituksen
profiilin kautta.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Portti ja salaus tarvitaan aina (IMAP=993/SSL vs SMTP=587/TLS),
joten ne näkyvät nyt checkboxin tilasta riippumatta.
"Käytä samoja tunnuksia" piilottaa vain palvelimen, käyttäjän
ja salasanan.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mailbox-lomake näyttää nyt Saapuva (IMAP) ja Lähtevä (SMTP)
vierekkäin. SMTP-puolella on "Käytä samoja tunnuksia kuin
saapuvassa" -checkbox (oletuksena päällä), joka piilottaa
SMTP-kentät ja kopioi IMAP-asetukset tallennettaessa.
Lähettäjän sähköposti ja nimi omana osionaan alhaalla.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Aiemmin sähköpostit lähetettiin PHP mail()-funktiolla, mikä
ei toimi kunnolla useimmilla palvelimilla (SPF/DKIM-ongelmat).
Nyt mailboxiin voi konfiguroida SMTP-asetukset (host, port,
user, pass, encryption), ja lähetys tapahtuu suoraan
SMTP-palvelimen kautta socket-yhteydellä. Fallback PHP
mail():iin jos SMTP-asetuksia ei ole asetettu.
- db.php: smtp_host/port/user/password/encryption sarakkeet
- api.php: sendViaSMTP() socket-pohjainen SMTP-client
- index.html: SMTP-kentät mailbox-lomakkeeseen
- script.js: SMTP-kenttien luku/kirjoitus lomakkeessa
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Lisää fallback-haku: kokeillaan ensin suoraan mailbox-id:llä,
sitten string/number-konversiolla, ja lopuksi käytetään
ensimmäistä löytyvää allekirjoitusta jos mitään ei matchaa.
Tämä korjaa tilanteen jossa mailbox_id:n tyyppi ei täsmää
tai tiketti on tullut tuntemattoman mailboxin kautta.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Käyttäjä näkee nyt "Käytä allekirjoitusta" -täpän alla
suoraan mitä allekirjoitustekstiä viestiin liitetään.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Vastaanottaja (TO) näkyy nyt Lähettäjä- ja CC-kenttien välissä
- Esitäytetään tiketin alkuperäisen lähettäjän osoitteella
- Muokattavissa ennen lähetystä
- Backend käyttää frontendistä tullutta TO:ta tai fallbackina from_email
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Checkbox nyt oletuksena rastittuna = allekirjoitus mukaan. Rastin poisto
poistaa allekirjoituksen viestistä.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Lisätty "Oma profiili" -nappi headeriin (⚙ + nimen klikkaus)
- Profiili-modaali: muokkaa nimi, sähköposti, salasana, allekirjoitukset
- Uusi profile_update API-endpoint (vaatii vain kirjautumisen)
- check_auth palauttaa nyt myös email-kentän
- Siivottu kaikki yrityskohtaiset placeholder-tekstit geneerisiksi
(cuitunet.fi → yritys.fi, Kauppakatu → Esimerkkikatu, jne.)
- Poistettu väliaikaiset fix_role.php ja fix_saatavuus.php
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Kun tiketti avataan, tarkistetaan lähettäjän sähköposti
asiakasrekisteristä (sahkoposti + laskutussahkoposti)
- Jos asiakas löytyy → linkitetään automaattisesti + vihreä badge
- Jos ei löydy → näytetään "Lisää liidi" -nappi lähettäjätietojen
vieressä, joka avaa liidilomakkeen esitäytetyillä tiedoilla
(yhteyshenkilö, sähköposti, muistiinpanot)
- Jo linkitetyllä tiketillä näytetään vihreä asiakas-badge
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Käyttäjät-nappi näkyy nyt myös admin-roolille
- Admin näkee/hallitsee vain oman yrityksensä käyttäjiä
- Admin voi luoda admin/user-rooleja (ei superadmin)
- Admin ei voi poistaa/muokata superadmineja
- Superadmin-vaihtoehto piilotettu rooli-dropdownista adminilta
- Yritysoikeudet-osio piilotettu adminilta (lisätään automaattisesti)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sama logiikka kuin headerissa — kun yrityksellä on logo,
pelkkä logo riittää eikä tekstejä näytetä.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Korvattu yleinen lisätiedot-tekstikenttä neljällä erillisellä
kentällä (vlan, laite, portti, ip) jotta tiedoista voi hakea
ja filtteröidä tarkemmin.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Moduulijärjestelmä: yrityskohtaiset tabit (customers, support, leads, archive,
changelog, settings) valittavissa checkboxeina yrityksen asetuksissa
- Käyttäjäroolit: superadmin (pääkäyttäjä), admin (yritysadmin), user (käyttäjä)
- Superadmin: kaikki oikeudet kuten ennen
- Yritysadmin: muokkaa oman yrityksen asetuksia, moduuleita, postilaatikoita
- Käyttäjä: peruskäyttö ilman hallintaoikeuksia
- Päivitetty-kenttä näyttää suhteellista aikaa (15min sitten, 2h sitten, 3pv sitten)
- DB: enabled_modules sarake companies-tauluun, role ENUM laajennettu
- Automaattinen migraatio: vanhat admin → superadmin
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Priority was missing from the tickets list endpoint,
so colors weren't showing in the ticket table.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Urgent (red) and tärkeä (orange) row colors now override
the "käsittelyssä" green highlight so priority is always visible.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Priority emails are now per-customer, not per-company.
Each customer can have a list of email addresses that
automatically elevate ticket priority to "tärkeä" when
they send email. Field added to customer form under
"Lisätiedot" section.
Removed separate priority_emails settings from API/rules tabs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reply form:
- Mailbox/sender selection dropdown (choose which email to reply from)
- CC field (auto-filled from incoming email CC, editable)
- Reply templates dropdown (quick insert pre-made responses)
Priority system:
- Three levels: normaali, tärkeä, urgent
- Priority dropdown in ticket detail view
- Priority-based sorting (urgent/tärkeä always on top)
- Visual indicators in ticket list (colored rows, emoji badges)
- Priority emails: per-company email list that auto-sets "tärkeä"
Response templates:
- CRUD management in Settings tab
- Dropdown selector in reply form
- Templates insert into textarea
Telegram alerts:
- Bot token + chat ID configuration in Settings
- Test button to verify connection
- Auto-alert on urgent tickets (both manual and from email fetch)
- Alert on priority email matches
Database changes:
- New tables: reply_templates, customer_priority_emails
- New columns: tickets.cc, tickets.priority
- ALTER TABLE migration in initDatabase()
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- When company logo is set, show only "Hallintapaneeli" without
company name (logo identifies the company)
- Ticket auto-refresh checkbox is checked by default
- Auto-refresh starts when switching to support tab
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Header is now white with neutral text colors.
Nav tab bar uses primary-color background with white text.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Added extractDominantColor() JS function that picks the dominant
color from uploaded logo and suggests it as theme color.
Updated gdcheck.php to show all needed extensions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Changed header from colored gradient background to clean white
with primary-color text, border-bottom accent line, and updated
button styles. Logos now display nicely against white background.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
finfo_open() is not available on CloudLinux alt-php84.
Now validates by file extension first, and only uses finfo
if the extension is available. Falls back gracefully.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
With MySQL migration, data/companies/{id}/ directories may not exist.
Now creates directory automatically instead of returning 404.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
check_auth was returning branding based on active company with
wrong field name (company_nimi instead of nimi), causing Noxus Intra
to show instead of company name on refresh. Now uses dbGetBranding()
with the request domain, same as the branding endpoint.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Users can only log in from domains belonging to their assigned company.
E.g. cuitunet users can only log in via intra.cuitunet.fi.
Admin users can still log in from any domain.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Drops all tables (with FK checks disabled) before recreating.
Use: migrate.php?reset=1 or php migrate.php --reset
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Column name yhteyshenkilö contains ö which \w doesn't match
without the /u flag. This caused SQL syntax errors.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Foreign key constraints fail if charset doesn't match between
referencing and referenced tables. Added utf8mb4 to user_companies,
reset_tokens, and login_attempts tables.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PDO extension was not available on CloudLinux/alt-php84 server.
MySQLi is available, so rewrote entire database layer to use it.
Added helper functions (_dbRun, _dbFetchAll, _dbFetchOne, etc.)
that handle named parameter conversion and type binding automatically.
All public db*() function signatures remain identical.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>