Display-Seiten: Betriebszeiten, PIN, Gerätesperre, Sprache und Vorschau
All checks were successful
CI / PHP Lint (push) Successful in 34s
CI / PHP Lint-1 (push) Successful in 39s
CI / Unit Tests & Static Analysis (push) Successful in 38s
CI / PHP Lint (pull_request) Successful in 41s
CI / PHP Lint-1 (pull_request) Successful in 49s
CI / Unit Tests & Static Analysis (pull_request) Successful in 41s
All checks were successful
CI / PHP Lint (push) Successful in 34s
CI / PHP Lint-1 (push) Successful in 39s
CI / Unit Tests & Static Analysis (push) Successful in 38s
CI / PHP Lint (pull_request) Successful in 41s
CI / PHP Lint-1 (pull_request) Successful in 49s
CI / Unit Tests & Static Analysis (pull_request) Successful in 41s
Die Display-Seiten hängen an öffentlichen Links, deshalb bekommen sie Regler, mit denen sich der Missbrauch begrenzen lässt, und ein paar Komfortfunktionen für den Betrieb: - Betriebszeiten je Seite (auch über Mitternacht hinweg); außerhalb zeigt die Seite einen Hinweis statt des Buttons - Optionale PIN von der Rezeption, geprüft mit hash_equals - Wartezeit je Gerät über ein Cookie, zusätzlich zum globalen Cooldown - Feste Sprache je Seite, sonst Browsersprache; Gäste können unten umschalten - Reporting zeigt die Ausgabe pro Display-Seite - Vorschau der Seite direkt in der Administration - Backup exportiert und importiert die neuen Felder mit Migration 0007, 16 neue Sprachschlüssel, 7 zusätzliche Tests (69 Tests, 152 Assertions). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
88f40a3d21
commit
dd8e805e27
28 changed files with 478 additions and 26 deletions
|
|
@ -37,7 +37,8 @@ if (isset($_GET['export']) && isset($_GET['token']) && $auth->validateCsrfToken(
|
|||
'kiosks' => $db->fetchAll(
|
||||
"SELECT k.name, k.token, k.headline, k.subline, k.logo_url, k.background_url,
|
||||
k.bg_overlay, k.accent_color, k.card_style, k.daily_limit,
|
||||
k.cooldown_seconds, k.display_seconds, k.is_active,
|
||||
k.cooldown_seconds, k.display_seconds, k.active_from, k.active_to,
|
||||
k.device_cooldown_seconds, k.pin, k.language, k.is_active,
|
||||
s.name AS site_name, t.name AS template_name
|
||||
FROM kiosks k
|
||||
INNER JOIN sites s ON s.id = k.site_id
|
||||
|
|
@ -126,22 +127,28 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['import'])) {
|
|||
$k['logo_url'] ?? null, $k['background_url'] ?? null, (int)($k['bg_overlay'] ?? 45),
|
||||
$k['accent_color'] ?? null, ($k['card_style'] ?? 'light') === 'dark' ? 'dark' : 'light',
|
||||
(int)($k['daily_limit'] ?? 100), (int)($k['cooldown_seconds'] ?? 20),
|
||||
(int)($k['display_seconds'] ?? 90), (int)($k['is_active'] ?? 1),
|
||||
(int)($k['display_seconds'] ?? 90),
|
||||
$k['active_from'] ?? null, $k['active_to'] ?? null,
|
||||
(int)($k['device_cooldown_seconds'] ?? 0),
|
||||
$k['pin'] ?? null, $k['language'] ?? null,
|
||||
(int)($k['is_active'] ?? 1),
|
||||
];
|
||||
|
||||
if ($exists) {
|
||||
$db->query(
|
||||
"UPDATE kiosks SET site_id=?, template_id=?, name=?, headline=?, subline=?, logo_url=?,
|
||||
background_url=?, bg_overlay=?, accent_color=?, card_style=?, daily_limit=?,
|
||||
cooldown_seconds=?, display_seconds=?, is_active=? WHERE id=?",
|
||||
cooldown_seconds=?, display_seconds=?, active_from=?, active_to=?,
|
||||
device_cooldown_seconds=?, pin=?, language=?, is_active=? WHERE id=?",
|
||||
array_merge($values, [(int)$exists['id']])
|
||||
);
|
||||
} else {
|
||||
$db->query(
|
||||
"INSERT INTO kiosks (site_id, template_id, name, headline, subline, logo_url, background_url,
|
||||
bg_overlay, accent_color, card_style, daily_limit, cooldown_seconds, display_seconds,
|
||||
active_from, active_to, device_cooldown_seconds, pin, language,
|
||||
is_active, token, created_by)
|
||||
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
|
||||
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
|
||||
array_merge($values, [$k['token'] ?? Kiosk::newToken(), $_SESSION['user_id'] ?? null])
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue