LuminaWebsite/checklist.php
Maaxxs 3ab618fa32 Checkliste: taegliche und woechentliche Aion-2-Aufgaben je Charakter abhaken (eigene Seite und Karte im Dashboard)
Charaktere aus dem Profil (Hauptcharakter = Main, sonst Twink, je Charakter einstellbar oder ausblendbar),
Haken in der Datenbank (checklist_ticks) mit Reset taeglich 9 Uhr und mittwochs 9 Uhr, Countdown und
"Nur offene". Neues Recht checklist.view fuer alle Gruppen mit dashboard.view. Patchnotes, Tour,
Datenauskunft und Datenschutz ergaenzt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 06:54:06 +02:00

80 lines
4.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/** Aion-2-Checkliste: taegliche und woechentliche Aufgaben der eigenen Charaktere (includes/checklist.php). */
require_once __DIR__ . '/includes/bootstrap.php';
require_once __DIR__ . '/includes/checklist.php';
require_login();
require_permission('checklist.view');
$userId = (int) current_user()['id'];
$allCharacters = checklist_characters($userId);
$characters = array_values(array_filter($allCharacters, static fn (array $c): bool => $c['role'] !== 'hidden'));
$periods = checklist_periods();
$ticks = checklist_ticks($userId, $periods);
$weekdays = [1 => 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag'];
$resetTime = sprintf('%02d:00 Uhr', CHECKLIST_RESET_HOUR);
$pageTitle = 'Checkliste';
include __DIR__ . '/includes/header.php';
?>
<div class="panel checklist" data-checklist data-checklist-now="<?= time() ?>">
<div class="checklist-head">
<div>
<h1>Checkliste</h1>
<p class="text-muted">Reset täglich um <?= e($resetTime) ?> · wöchentlich <?= e($weekdays[CHECKLIST_WEEKLY_DAY]) ?>, <?= e($resetTime) ?> (deutsche Zeit). Main-Charaktere sehen alle Aufgaben, Twinks nur ihre.</p>
</div>
<?php if ($characters): ?>
<button type="button" class="button-secondary button-small checklist-open-toggle" data-checklist-open-only aria-pressed="false">Nur offene</button>
<?php endif; ?>
</div>
<?php if (!$allCharacters): ?>
<?= checklist_no_characters_html() ?>
<?php elseif (!$characters): ?>
<p class="text-muted">Alle deine Charaktere sind ausgeblendet – unten unter „Charaktere in der Checkliste“ holst du sie zurück.</p>
<?php else: ?>
<?= checklist_summary_html($characters, $ticks) ?>
<div class="checklist-columns">
<?= checklist_table_html('daily', $characters, $ticks, $periods) ?>
<?= checklist_table_html('weekly', $characters, $ticks, $periods) ?>
<div class="checklist-card checklist-card-info">
<div class="checklist-card-head"><h3>Aufladung</h3></div>
<div class="checklist-reset">Lädt sich von selbst auf</div>
<div class="checklist-info-list">
<?php foreach (CHECKLIST_INFO as $info): ?>
<div class="checklist-info">
<?= e($info['name']) ?> <strong><?= e($info['val']) ?></strong>
<span class="checklist-info-who"><?= e($info['who']) ?></span>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
<?php endif; ?>
</div>
<?php if ($allCharacters): ?>
<div class="panel" id="einstellungen">
<h2>Charaktere in der Checkliste</h2>
<p class="text-muted">Automatisch ist dein Hauptcharakter Main und alle anderen sind Twinks. Hier kannst du das je Charakter ändern oder einen ganz ausblenden.
<?php if (user_has_permission('members.view')): ?>Charaktere anlegen und umbenennen geht auf deiner <a href="/member_edit.php#charaktere">Profilseite</a>.<?php endif; ?></p>
<div class="checklist-settings">
<?php foreach ($allCharacters as $c): ?>
<form method="post" action="/checklist_action.php" class="checklist-setting">
<?= csrf_field() ?>
<input type="hidden" name="action" value="role">
<input type="hidden" name="character_id" value="<?= (int) $c['id'] ?>">
<label for="checklist-role-<?= (int) $c['id'] ?>"><?= checklist_class_icon($c) ?><?= e((string) $c['name']) ?>
<?php if ((int) $c['is_main'] === 1): ?><span class="text-muted">(Hauptcharakter)</span><?php endif; ?></label>
<select id="checklist-role-<?= (int) $c['id'] ?>" name="role" data-checklist-autosubmit>
<?php foreach (CHECKLIST_ROLES as $value => $label): ?>
<option value="<?= e($value) ?>"<?= $c['setting'] === $value ? ' selected' : '' ?>><?= e($label) ?><?= $value === '' ? ' (' . e(CHECKLIST_ROLES[$c['auto_role']]) . ')' : '' ?></option>
<?php endforeach; ?>
</select>
<noscript><button type="submit" class="button-small">Speichern</button></noscript>
</form>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<script src="<?= e(asset_url('/assets/js/checklist.js')) ?>" defer></script>
<?php include __DIR__ . '/includes/footer.php'; ?>