Upload via GUI (278 Dateien)
This commit is contained in:
@@ -113,6 +113,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
redirect('/staff/profile.php?tab=settings');
|
||||
}
|
||||
|
||||
// ── Android-Push: welche Popups, stille Zeiten ─────────────────
|
||||
if ($action === 'save_push_prefs') {
|
||||
$ev = array_map('strval', (array) ($_POST['push_events'] ?? []));
|
||||
$qf = trim((string) ($_POST['quiet_from'] ?? ''));
|
||||
$qt = trim((string) ($_POST['quiet_to'] ?? ''));
|
||||
if (($qf !== '' || $qt !== '') && (!fcm_time_valid($qf) || !fcm_time_valid($qt))) {
|
||||
flash('error', 'Stille Zeiten bitte als Uhrzeit von/bis angeben (z. B. 22:00 und 06:00).');
|
||||
redirect('/staff/profile.php?tab=account');
|
||||
}
|
||||
fcm_save_prefs($pdo, (int) $staff['id'], $ev, $qf, $qt, array_keys(fcm_event_types_for($staff)));
|
||||
flash('success', 'Push-Einstellungen gespeichert.');
|
||||
redirect('/staff/profile.php?tab=account');
|
||||
}
|
||||
|
||||
// ── 2FA aktivieren ─────────────────────────────────────────────
|
||||
if ($action === 'enable_2fa') {
|
||||
$code = trim($_POST['totp_code'] ?? '');
|
||||
@@ -302,6 +316,25 @@ require __DIR__ . '/_header.php';
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php $__pp = fcm_prefs($pdo, (int) $staff['id']); ?>
|
||||
<div class="card">
|
||||
<h3>📱 Android-App: Welche Popups?</h3>
|
||||
<form method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="action" value="save_push_prefs">
|
||||
<p class="muted" style="font-size:.84rem;margin-bottom:10px">Wähle, wofür die App ein Popup zeigen soll.</p>
|
||||
<?php foreach (fcm_event_types_for($staff) as $__k => $__label): ?>
|
||||
<label style="display:flex;align-items:center;gap:8px;margin:6px 0;font-weight:400"><input type="checkbox" name="push_events[]" value="<?= e($__k) ?>" style="width:auto" <?= in_array($__k, $__pp['events'], true) ? 'checked' : '' ?>> <?= e($__label) ?></label>
|
||||
<?php endforeach; ?>
|
||||
<div style="margin-top:12px;font-size:.84rem;font-weight:600">Stille Zeiten (keine Popups)</div>
|
||||
<div style="display:flex;align-items:center;gap:8px;margin-top:6px">
|
||||
von <input type="time" name="quiet_from" value="<?= e($__pp['quiet_from']) ?>" style="width:auto"> bis <input type="time" name="quiet_to" value="<?= e($__pp['quiet_to']) ?>" style="width:auto">
|
||||
</div>
|
||||
<p class="muted" style="font-size:.78rem;margin-top:4px">Beide Felder leer = immer Popups. Die Zeit gilt nach der Serverzeit (<?= e(date_default_timezone_get()) ?>), auch über Mitternacht (z. B. 22:00 bis 06:00).</p>
|
||||
<div class="btn-row"><button type="submit" class="btn">Speichern</button></div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- ══ EINSTELLUNGEN ══════════════════════════════════════════ -->
|
||||
<?php elseif ($tab === 'settings'): ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user