Merge origin/main: Remote-Stand übernehmen
Konflikte in app/bootstrap.php, app/pages.php, app/privacy.php, app/util.php, tools/send_reminders.php, views/booking_form.php und views/legal_datenschutz.php zugunsten von origin/main aufgelöst (Enthalten u. a. Einladungen, Buchungsformular-Neustrukturierung und die überarbeiteten Rechtsseiten). Eigene Ergänzungen bleiben erhalten, soweit sie nicht ersetzt wurden: README-Abschnitt "Rechtliches / DSGVO", docs/dsgvo.md, docs/architecture.md, app/config.example.php, install.php und web/offline.html.
This commit is contained in:
commit
dd1fba062e
34 changed files with 1784 additions and 256 deletions
|
|
@ -324,7 +324,7 @@ a .ico, button .ico { pointer-events: none; }
|
|||
.list-summary { font-size: .84rem; color: var(--muted); margin: -4px 0 16px; }
|
||||
|
||||
/* --------------------------------------------------------------- KPI + Dashboard */
|
||||
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
|
||||
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
|
||||
.kpi {
|
||||
display: flex; align-items: center; gap: 12px;
|
||||
background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
|
||||
|
|
@ -342,8 +342,26 @@ a .ico, button .ico { pointer-events: none; }
|
|||
.kpi strong { display: block; font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); line-height: 1.1; }
|
||||
.kpi span { font-size: .78rem; color: var(--muted); }
|
||||
|
||||
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, .85fr); gap: 18px; align-items: start; }
|
||||
.dash-main, .dash-side { display: grid; gap: 18px; min-width: 0; }
|
||||
/* ---------------------------------------------------------- Verfügbarkeit */
|
||||
.availability-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
|
||||
.availability-group h3 {
|
||||
display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
|
||||
margin: 0 0 8px; font-size: .95rem;
|
||||
}
|
||||
.availability-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
|
||||
.availability-row {
|
||||
display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
|
||||
padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
|
||||
}
|
||||
.availability-row.is-free { border-color: #bfe3bf; background: #f8fdf8; }
|
||||
.availability-row.is-busy { background: #fbfcfd; }
|
||||
.availability-row__name { flex: 1 1 auto; min-width: 0; }
|
||||
.availability-row__hint { flex: 1 1 100%; }
|
||||
@media (max-width: 760px) {
|
||||
.availability-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, .85fr); gap: 18px; align-items: start; }.dash-main, .dash-side { display: grid; gap: 18px; min-width: 0; }
|
||||
.trailer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
|
||||
.trailer-card {
|
||||
border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 13px;
|
||||
|
|
@ -540,7 +558,11 @@ a .ico, button .ico { pointer-events: none; }
|
|||
.form-main { display: grid; gap: 16px; min-width: 0; }
|
||||
.form-side { display: grid; gap: 16px; position: sticky; top: calc(var(--topbar-h) + 16px); }
|
||||
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
|
||||
.form-grid--single { grid-template-columns: minmax(0, 1fr); gap: 12px; }
|
||||
.field-with-aside { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
|
||||
.segmented-radio--compact span { min-width: 52px; padding: 6px 9px; font-size: .76rem; }
|
||||
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
|
||||
.field-pair { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; }
|
||||
.field--wide { grid-column: 1 / -1; }
|
||||
.field > span, .field > label > span { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
|
||||
.field input, .field select, .field textarea {
|
||||
|
|
@ -597,6 +619,13 @@ a .ico, button .ico { pointer-events: none; }
|
|||
.detail-meta { margin: 0; }
|
||||
.card--copy { overflow: hidden; }
|
||||
.copy-source { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
|
||||
.copy-source--visible {
|
||||
position: static; width: 100%; height: auto; min-height: 54px; opacity: 1;
|
||||
padding: 10px 12px; resize: vertical;
|
||||
border: 1px solid var(--line-soft); border-radius: 9px; background: var(--ice-50);
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; color: var(--ink-2);
|
||||
word-break: break-all;
|
||||
}
|
||||
.copy-list { margin: 0; display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line-soft); }
|
||||
.copy-list__row { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 14px; padding: 9px 2px; border-bottom: 1px solid var(--line-soft); }
|
||||
.copy-list__row:last-child { border-bottom: 0; }
|
||||
|
|
@ -732,6 +761,7 @@ a .ico, button .ico { pointer-events: none; }
|
|||
.table-person > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
|
||||
.table-person strong { color: var(--ink); font-size: .85rem; }
|
||||
.table-person small { color: var(--muted); font-size: .72rem; }
|
||||
.table-person .invite-open { color: var(--brand-700); font-weight: 600; }
|
||||
.admin-split { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; align-items: start; }
|
||||
.trailer-admin { display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
|
||||
.trailer-admin__head, .trailer-admin__row {
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@
|
|||
if (!source) return;
|
||||
try {
|
||||
await copyToClipboard(source.value);
|
||||
toast('Buchungstext kopiert.');
|
||||
toast(source.dataset.copyToast || 'Buchungstext kopiert.');
|
||||
const original = button.innerHTML;
|
||||
button.innerHTML = '<svg class="ico" aria-hidden="true"><use href="#i-check"/></svg> Kopiert';
|
||||
window.setTimeout(() => { button.innerHTML = original; }, 1800);
|
||||
|
|
@ -194,7 +194,11 @@
|
|||
const startInput = bookingForm.querySelector('[data-date-start]');
|
||||
const endInput = bookingForm.querySelector('[data-date-end]');
|
||||
const depositInput = bookingForm.querySelector('[data-money="deposit"]');
|
||||
const totalInput = bookingForm.querySelector('[data-money="total"]');
|
||||
const rentInput = bookingForm.querySelector('[data-money="rent"]');
|
||||
const deliveryInput = bookingForm.querySelector('[data-money="delivery"]');
|
||||
const totalOutput = bookingForm.querySelector('[data-total-output]');
|
||||
const startTimeInput = bookingForm.querySelector('[data-time-start]');
|
||||
const endTimeInput = bookingForm.querySelector('[data-time-end]');
|
||||
const dueOutput = bookingForm.querySelector('[data-due]');
|
||||
const conflictBox = bookingForm.querySelector('[data-conflict]');
|
||||
const availabilityUrl = bookingForm.dataset.availabilityUrl;
|
||||
|
|
@ -218,9 +222,13 @@
|
|||
const [y, m, d] = iso.split('-');
|
||||
return `${d}.${m}.${y}`;
|
||||
};
|
||||
const formatRange = (a, b) => {
|
||||
const formatDateTime = (iso, time) => {
|
||||
const date = formatDate(iso);
|
||||
return time ? `${date} ${time}` : date;
|
||||
};
|
||||
const formatRange = (a, b, aTime, bTime) => {
|
||||
if (!a || !b) return '–';
|
||||
return a === b ? formatDate(a) : `${formatDate(a)} – ${formatDate(b)}`;
|
||||
return a === b ? formatDateTime(a, aTime) : `${formatDateTime(a, aTime)} – ${formatDateTime(b, bTime)}`;
|
||||
};
|
||||
const contrast = (hex) => {
|
||||
const clean = String(hex || '').replace('#', '');
|
||||
|
|
@ -238,8 +246,7 @@
|
|||
const option = trailerSelect.selectedOptions[0];
|
||||
if (!option) return;
|
||||
const color = option.dataset.color || '#196abc';
|
||||
const name = option.dataset.colorName || '';
|
||||
const label = option.textContent.split('·')[0].trim();
|
||||
const label = option.textContent.trim();
|
||||
const preview = bookingForm.querySelector('[data-trailer-preview]');
|
||||
if (preview) {
|
||||
preview.style.setProperty('--trailer', color);
|
||||
|
|
@ -247,20 +254,27 @@
|
|||
const dot = preview.querySelector('.trailer-dot');
|
||||
if (dot) dot.style.setProperty('--trailer', color);
|
||||
const text = preview.querySelector('[data-trailer-preview-label]');
|
||||
if (text) text.textContent = `${label} · ${name}`;
|
||||
if (text) text.textContent = label;
|
||||
}
|
||||
const summary = bookingForm.querySelector('[data-summary-trailer]');
|
||||
if (summary) summary.textContent = label;
|
||||
};
|
||||
|
||||
const updateTotals = () => {
|
||||
const rent = parseMoney(rentInput?.value);
|
||||
const delivery = parseMoney(deliveryInput?.value);
|
||||
const total = rent + delivery;
|
||||
const deposit = parseMoney(depositInput?.value);
|
||||
const total = parseMoney(totalInput?.value);
|
||||
const due = total - deposit;
|
||||
if (totalOutput) totalOutput.textContent = formatMoney(total);
|
||||
if (dueOutput) dueOutput.textContent = formatMoney(due);
|
||||
const totalSummary = bookingForm.querySelector('[data-summary-total]');
|
||||
const rentSummary = bookingForm.querySelector('[data-summary-rent]');
|
||||
const deliverySummary = bookingForm.querySelector('[data-summary-delivery]');
|
||||
const depositSummary = bookingForm.querySelector('[data-summary-deposit]');
|
||||
const dueSummary = bookingForm.querySelector('[data-summary-due]');
|
||||
if (rentSummary) rentSummary.textContent = formatMoney(rent);
|
||||
if (deliverySummary) deliverySummary.textContent = formatMoney(delivery);
|
||||
if (totalSummary) totalSummary.textContent = formatMoney(total);
|
||||
if (depositSummary) depositSummary.textContent = formatMoney(deposit);
|
||||
if (dueSummary) dueSummary.textContent = formatMoney(due);
|
||||
|
|
@ -268,7 +282,7 @@
|
|||
|
||||
const updateSummary = () => {
|
||||
const dates = bookingForm.querySelector('[data-summary-dates]');
|
||||
if (dates) dates.textContent = formatRange(startInput?.value, endInput?.value);
|
||||
if (dates) dates.textContent = formatRange(startInput?.value, endInput?.value, startTimeInput?.value, endTimeInput?.value);
|
||||
const employee = bookingForm.querySelector('[data-summary-employee]');
|
||||
if (employee && employeeSelect) {
|
||||
employee.textContent = employeeSelect.selectedOptions[0]?.textContent.trim() || '–';
|
||||
|
|
@ -342,7 +356,125 @@
|
|||
});
|
||||
endInput?.addEventListener('change', () => { updateSummary(); checkAvailability(); });
|
||||
depositInput?.addEventListener('input', updateTotals);
|
||||
totalInput?.addEventListener('input', updateTotals);
|
||||
rentInput?.addEventListener('input', updateTotals);
|
||||
deliveryInput?.addEventListener('input', updateTotals);
|
||||
startTimeInput?.addEventListener('input', updateSummary);
|
||||
endTimeInput?.addEventListener('input', updateSummary);
|
||||
|
||||
// Rechnungsnummer gesetzt -> "Rechnung: JA" mitziehen.
|
||||
const invoiceNoInput = bookingForm.querySelector('[data-invoice-no]');
|
||||
const invoiceYes = bookingForm.querySelector('input[name="invoice"][value="1"]');
|
||||
invoiceNoInput?.addEventListener('input', () => {
|
||||
if (invoiceNoInput.value.trim() !== '' && invoiceYes) invoiceYes.checked = true;
|
||||
});
|
||||
|
||||
/* Einfügen aus Excel: Spalte untereinander -> Felder der Reihe nach füllen. */
|
||||
const pasteHost = bookingForm.querySelector('[data-paste-targets]');
|
||||
if (pasteHost) {
|
||||
const pasteRows = Array.from(pasteHost.querySelectorAll('[data-paste-field]')).map((row) => ({
|
||||
row,
|
||||
name: row.dataset.pasteField,
|
||||
control: row.querySelector('select, output, input:not([type="hidden"]):not([type="radio"])'),
|
||||
}));
|
||||
|
||||
const normalizeDate = (value) => {
|
||||
const text = String(value || '').trim();
|
||||
if (/^\d{4}-\d{2}-\d{2}$/.test(text)) return text;
|
||||
const dotted = /^(\d{1,2})[.\/](\d{1,2})[.\/](\d{2,4})$/.exec(text);
|
||||
if (!dotted) return '';
|
||||
const year = dotted[3].length === 2 ? `20${dotted[3]}` : dotted[3];
|
||||
return `${year}-${dotted[2].padStart(2, '0')}-${dotted[1].padStart(2, '0')}`;
|
||||
};
|
||||
const normalizeTime = (value) => {
|
||||
const match = /^(\d{1,2}):(\d{2})(?::\d{2})?$/.exec(String(value || '').trim());
|
||||
return match ? `${match[1].padStart(2, '0')}:${match[2]}` : '';
|
||||
};
|
||||
const normalizeMoney = (value) => String(value || '').replace(/€/g, '').trim();
|
||||
const alias = { niklas: 'n. jorns', 'krücken': 'm. krücken', kruecken: 'm. krücken', schmitz: 'm. schmitz' };
|
||||
const chooseOption = (select, value) => {
|
||||
const text = String(value || '').trim().toLowerCase();
|
||||
if (!text) return false;
|
||||
const options = Array.from(select.options);
|
||||
const hit = options.find((o) => o.value.toLowerCase() === text)
|
||||
|| options.find((o) => o.textContent.trim().toLowerCase() === text)
|
||||
|| options.find((o) => o.textContent.toLowerCase().includes(text))
|
||||
|| options.find((o) => alias[text] && o.textContent.toLowerCase().includes(alias[text]));
|
||||
if (!hit) return false;
|
||||
select.value = hit.value;
|
||||
return true;
|
||||
};
|
||||
|
||||
const applyPaste = (text, startIndex) => {
|
||||
const clean = text.replace(/\r/g, '');
|
||||
const values = /\n/.test(clean.trim()) ? clean.split('\n') : clean.split('\t');
|
||||
while (values.length && values[values.length - 1].trim() === '') values.pop();
|
||||
if (values.length < 2) return 0;
|
||||
|
||||
let index = startIndex;
|
||||
let filled = 0;
|
||||
for (const raw of values) {
|
||||
if (index >= pasteRows.length) break;
|
||||
const field = pasteRows[index];
|
||||
index += 1;
|
||||
const value = raw.trim();
|
||||
if (field.name === '__computed__') continue; // Gesamt wird berechnet
|
||||
|
||||
if (field.name === 'kind') {
|
||||
const lower = value.toLowerCase();
|
||||
const target = lower.includes('liefer') ? 'delivery' : lower.includes('abhol') ? 'pickup' : '';
|
||||
if (target) {
|
||||
const radio = bookingForm.querySelector(`input[name="kind"][value="${target}"]`);
|
||||
if (radio) radio.checked = true;
|
||||
filled += 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
const control = field.control;
|
||||
if (!control || control.tagName === 'OUTPUT') continue;
|
||||
|
||||
let next = value;
|
||||
if (control.type === 'date') next = normalizeDate(value);
|
||||
else if (control.type === 'time') next = normalizeTime(value);
|
||||
else if (['rent', 'delivery', 'deposit'].includes(field.name)) next = normalizeMoney(value);
|
||||
else if (field.name === 'invoice_no') {
|
||||
if (value.toLowerCase() === 'nein') {
|
||||
next = '';
|
||||
const no = bookingForm.querySelector('input[name="invoice"][value="0"]');
|
||||
if (no) no.checked = true;
|
||||
} else if (value) {
|
||||
const yes = bookingForm.querySelector('input[name="invoice"][value="1"]');
|
||||
if (yes) yes.checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (control.tagName === 'SELECT') {
|
||||
if (next && chooseOption(control, next)) filled += 1;
|
||||
continue;
|
||||
}
|
||||
control.value = next;
|
||||
filled += 1;
|
||||
control.dispatchEvent(new Event('input', { bubbles: true }));
|
||||
control.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
}
|
||||
return filled;
|
||||
};
|
||||
|
||||
pasteHost.addEventListener('paste', (event) => {
|
||||
const clipboard = event.clipboardData || window.clipboardData;
|
||||
const text = clipboard ? clipboard.getData('text') : '';
|
||||
if (!/[\t\n]/.test(text.trim())) return; // einzelner Wert: Standardverhalten
|
||||
const targetRow = event.target.closest?.('[data-paste-field]');
|
||||
let startIndex = pasteRows.findIndex((field) => field.row === targetRow);
|
||||
if (startIndex < 0) startIndex = 0;
|
||||
if (applyPaste(text, startIndex) > 0) {
|
||||
event.preventDefault();
|
||||
updateTotals();
|
||||
updateSummary();
|
||||
checkAvailability();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
updateTrailer();
|
||||
updateTotals();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue