Kalender-Abos Baustellen und Aufgaben für Outlook classic, Caddy lässt /kalender ohne Anmeldung durch
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
@@ -347,6 +347,34 @@ function einsatzHtml(e: Zeile): string {
|
||||
return tabelle + liste;
|
||||
}
|
||||
|
||||
// T11: Kalender-Abos für Outlook classic (nur lesen, Outlook holt Änderungen selbst ab)
|
||||
function kalenderLinks(token: string | null): void {
|
||||
const ziel = document.getElementById("kalender")!;
|
||||
const neu = async () => {
|
||||
if (token && !(await bestaetigen("Neue Links erzeugen? Die bisherigen Abos in Outlook funktionieren dann nicht mehr."))) return;
|
||||
kalenderLinks((await api<{ kalenderToken: string }>("kalender/neu", "POST")).kalenderToken);
|
||||
};
|
||||
if (!token) {
|
||||
ziel.innerHTML = `<p class="hinweis">Die Vorgänge aus dem Terminplan und fällige Aufgaben lassen sich als Internetkalender in Outlook einbinden.</p>
|
||||
<p><button class="haupt">Kalender-Links erzeugen</button></p>`;
|
||||
ziel.querySelector("button")!.onclick = neu;
|
||||
return;
|
||||
}
|
||||
const link = (name: string) => `${location.origin}/kalender/${token}/${name}`;
|
||||
ziel.innerHTML = `${[["Baustellen", "baustellen.ics"], ["Aufgaben", "aufgaben.ics"]].map(([titel, datei]) =>
|
||||
`<div class="kalender-link"><b>${titel}</b><input readonly value="${esc(link(datei!))}"><button class="neben" data-kopie="${esc(link(datei!))}">Kopieren</button></div>`).join("")}
|
||||
<p class="hinweis">In Outlook: Datei → Kontoeinstellungen → Kontoeinstellungen → Internetkalender → Neu, Link einfügen, Name „Baustellen“ bzw. „Aufgaben“.
|
||||
Outlook holt Änderungen etwa stündlich ab. Wer den Link hat, kann die Termine lesen; gib ihn deshalb nicht weiter.</p>
|
||||
<p><button class="neben" data-a="neu">Neue Links erzeugen</button></p>`;
|
||||
ziel.onclick = async (ev) => {
|
||||
const b = ev.target as HTMLElement;
|
||||
if (b.dataset.kopie) {
|
||||
try { await navigator.clipboard.writeText(b.dataset.kopie); b.textContent = "Kopiert"; } catch { (b.previousElementSibling as HTMLInputElement).select(); }
|
||||
}
|
||||
if (b.dataset.a === "neu") neu();
|
||||
};
|
||||
}
|
||||
|
||||
async function daten(): Promise<void> {
|
||||
seite("Daten und Einstellungen");
|
||||
const e = await api<Zeile>("einstellungen");
|
||||
@@ -357,7 +385,10 @@ async function daten(): Promise<void> {
|
||||
<p class="hinweis">Sicherungsdatei aus V70 wählen (projektplaner-sicherung-….json). Geht nur, solange noch nichts erfasst ist.</p>
|
||||
<p><input type="file" id="v70-datei" accept=".json,application/json"></p>
|
||||
<div id="v70-ergebnis"></div>
|
||||
<h2>Kalender in Outlook</h2>
|
||||
<div id="kalender"></div>
|
||||
<h2>Einstellungen</h2>`);
|
||||
kalenderLinks(e.kalenderToken);
|
||||
const datei = document.getElementById("v70-datei") as HTMLInputElement;
|
||||
datei.onchange = async () => {
|
||||
const f = datei.files?.[0];
|
||||
|
||||
@@ -207,3 +207,6 @@ tr.ohne .einsatz { background: #fdecea; color: #7a1c14; }
|
||||
.einsatz-liste { display: block; }
|
||||
.liqui { grid-template-columns: 1fr 1fr; }
|
||||
}
|
||||
.kalender-link { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
|
||||
.kalender-link b { width: 90px; }
|
||||
.kalender-link input { flex: 1; min-width: 220px; padding: 8px 10px; border: 1px solid var(--linie); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
|
||||
|
||||
Reference in New Issue
Block a user