用户 14 条需求一次交付(1-13 功能 + 14 工作方式)。 观影(1-4) - 返回文案全模块统一为「返回观影」(不再有「返回列表」「返回观影记录」三种叫法) - 观影人一律用彩色人物标签 person_chip:底色由头像主色算出来(上传时存库), 瀑布流卡片也按人显示;五处观影模板全部改用它 - 人员显示统一走 person_name()(shown → 我给他起的称呼 → 姓名) - 影院管理页与年度报告页的上下两块用 .card + .card 统一给间距(原来紧贴成一整块) 家谱(5) - 树根从「我」换成**辈分最高的祖先**:库画的是"树根的祖先链+后代+树根的兄弟姐妹", 根=我 时伯父/堂兄/嫂子/侄子一个都不画(12 人夹具只画出 8 人) - focusMap 按**代数**圈定三代(不再按步数),normalizeLinks 把子女对称挂到父母双方 —— 修掉"母亲登录看不到孩子" - 新增「看全部 / 回到我」两个按钮,放在画布外(画布整块被库接管了手势) 统一事件原语(6-9) - 旅程:TripLog 全量迁入(3 趟旅程 / 21 段行程 / 72 张照片 / 5 个人)。 复用 events(kind='trip') + trip_details + trip_nodes(计划/执行双轨保留) - 日程:每人可建日历本(自定义色)+ 共享只读/可写;观影与旅行是每人默认两本, 内容是**从各模块实时派生**的(不复制,所以改了观影日期日历立刻跟着变); 没有具体时分 = 全天;月视图参照群晖 Calendar - 资源:挂在某人名下的附属信息(标题+正文+多附件),可共享给多人并设只读/读写, 默认折叠、可搜标题与正文 - 任务:看板三列 + 两级子任务 + 评论@人 + 共享 + 循环(完成时按原截止日推下一期) - 统一附件表:四个模块的附件共用一张,下载地址不落库、一律由 media.php 现算 模块化(10-11) - App\Module 是模块的唯一来源(加一行 = 导航条/主题色/个人设置三处自动出现) - 个人设置里可勾选要显示哪些模块、拖动排序(关掉的模块**不会**被兜底补回来) - 每个模块一套主题色(家庭级),只覆盖 --brand 三兄弟,不碰纸墨底色 其他(12-13) - 新增成员表单可选所属分组(编辑表单没有:分组是"我和他的关系",只归我自己) - 首页改 dashboard:接下来的日子 / 未来七天 / 手头在做 / 往年今日。 家人卡片从首页撤走(看人去名册) 验证(全部通过) - e2e 542 条(新增 4 模块端到端 60+ 条) - 桌面几何 368 / 移动端几何 520 / 家谱 12 / 交互 97 / 老库升级 123 - SQL 列名静态校验 0 处可疑(对着真实表结构) - 反向验证 18 条新注入全部抓住 顺带修掉的既有问题 - 老库升级回填 SQL 按实际存在的列动态拼(缺列不再 1054 炸断升级) - 全新安装时 Schema::ensure 跑在"人还没建"之前 → 补建日历本三处齐备 - 窄屏导航横向溢出(模块从 4 个加到 8 个后顶栏撑破视口)
148 lines
7.1 KiB
PHP
148 lines
7.1 KiB
PHP
<?php
|
|
/**
|
|
* 个人设置 —— 「我自己的」设置。
|
|
*
|
|
* 与「系统设置」(?r=settings,仅管理员)的分工:
|
|
* · 系统设置改一次**全家都变**:slogan 兜底、附件存储、运行环境、**公共分组**;
|
|
* · 个人设置只影响**我自己看到的样子**:我怎么称呼家人、我自己的分组。
|
|
*
|
|
* ⚠️ 「我的资料」表单**不在这页**(用户明确要求合并):
|
|
* 「编辑成员」和「改自己的资料」本来就是一件事,所以只剩
|
|
* `templates/people/form.php` 那一张表单,两个入口都指过去 ——
|
|
* 这页顶部那个按钮,和名册卡片上的「编辑资料」,落到的完全是同一个页面。
|
|
*/
|
|
$groupCounts = $groupCounts ?? [];
|
|
$groupTotal = count($groups);
|
|
$rosterCount = $rosterCount ?? 0;
|
|
?>
|
|
<div class="page-head">
|
|
<h1>个人设置</h1>
|
|
<span class="sub">只影响你自己看到的样子</span>
|
|
<div class="actions">
|
|
<a class="btn btn-sm" href="<?= e(url('people/edit', ['id' => (int)$person['id']])) ?>">编辑我的资料</a>
|
|
<a class="btn btn-ghost btn-sm" href="<?= e(url('people/show', ['id' => (int)$person['id']])) ?>">看我的详情页</a>
|
|
<?php if (\App\Auth::isAdmin()): ?>
|
|
<a class="btn btn-ghost btn-sm" href="<?= e(url('settings')) ?>">系统设置</a>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card card-pad">
|
|
<h2 class="section-title">我的资料 <span class="hint">姓名、头像、生日、联系方式</span></h2>
|
|
<p class="small muted" style="margin:0 0 14px">
|
|
<?= e((string)$person['name']) ?>
|
|
<?php if (trim((string)($person['slogan'] ?? '')) !== ''): ?>
|
|
· 「<?= e((string)$person['slogan']) ?>」
|
|
<?php endif; ?>
|
|
<br>
|
|
资料的编辑表单只有一张,和「编辑成员」是同一个页面 —— 从这里进去改的就是你自己。
|
|
</p>
|
|
<div class="btn-row" style="margin-top:0">
|
|
<a class="btn" href="<?= e(url('people/edit', ['id' => (int)$person['id']])) ?>">编辑我的资料</a>
|
|
<a class="btn btn-ghost" href="<?= e(url('auth/password')) ?>">改登录密码</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="stack-gap"></div>
|
|
<?php require __DIR__ . '/_nicknames.php'; ?>
|
|
|
|
<!-- ==================== 我的分组 ==================== -->
|
|
<div class="card card-pad" style="margin-top:20px">
|
|
<h2 class="section-title">
|
|
我的分组
|
|
<span class="hint">公共的 + 我自己加的</span>
|
|
</h2>
|
|
<p class="small muted" style="margin:0 0 16px">
|
|
名册是按「关系分组」分栏显示的。这里有两层:
|
|
<b>公共分组</b>由管理员在「系统设置」里维护(全家都能用);
|
|
你要是觉得不够,就在下面<b>加只给自己看的分组</b>,别人看不到、也不受影响。
|
|
<br>
|
|
列表里 <b>{{ 公共 }}</b> 标的是大家共用的那几个。
|
|
哪一组排前面也是你自己的习惯,用 ▲ ▼ 调 —— 别人看到的顺序不变。
|
|
<br>
|
|
你的名册现在有 <b><?= (int)$rosterCount ?></b> 人。
|
|
</p>
|
|
|
|
<?php if (!$groups): ?>
|
|
<p class="small muted" style="margin:0 0 14px">还没有分组。加一个吧。</p>
|
|
<?php else: ?>
|
|
<ol class="order-list">
|
|
<?php foreach ($groups as $i => $g): $gid = (int)$g['id']; $own = (int)$g['owner_id']; ?>
|
|
<li class="order-row">
|
|
<span class="order-no"><?= $i + 1 ?></span>
|
|
<span class="order-name">
|
|
<?= e((string)$g['name']) ?>
|
|
<?php if ($own === 0): ?><span class="badge">公共</span><?php else: ?><span class="badge badge-open">我的</span><?php endif; ?>
|
|
</span>
|
|
<span class="order-count"><?= (int)($groupCounts[$gid] ?? 0) ?> 人</span>
|
|
<form method="post" action="<?= e(url('settings/groups/move')) ?>" class="order-move">
|
|
<?= csrf_field() ?>
|
|
<input type="hidden" name="id" value="<?= $gid ?>">
|
|
<input type="hidden" name="scope" value="me">
|
|
<button class="btn btn-ghost btn-sm" type="submit" name="dir" value="up"
|
|
title="上移一组" <?= $i === 0 ? 'disabled' : '' ?>>▲</button>
|
|
<button class="btn btn-ghost btn-sm" type="submit" name="dir" value="down"
|
|
title="下移一组" <?= $i === $groupTotal - 1 ? 'disabled' : '' ?>>▼</button>
|
|
</form>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ol>
|
|
<?php endif; ?>
|
|
|
|
<form method="post" action="<?= e(url('settings/groups/add')) ?>" class="inline-form" style="margin-top:16px">
|
|
<?= csrf_field() ?>
|
|
<input type="hidden" name="scope" value="me">
|
|
<label class="sr-only" for="newMyGroup">新分组名</label>
|
|
<input class="input" id="newMyGroup" name="name" maxlength="20" placeholder="例如:球友、老同学">
|
|
<button class="btn btn-sm" type="submit">加一个我自己的分组</button>
|
|
</form>
|
|
|
|
<?php
|
|
// 只有我自己建的分组才给改名 / 删除 —— 公共分组要在系统设置里改(那是管理员的事),
|
|
// 免得有人在自己设置里把"家人"改成别的、影响全家。
|
|
$mineGroups = array_values(array_filter($groups, fn($g) => (int)$g['owner_id'] > 0));
|
|
?>
|
|
<?php if ($mineGroups): ?>
|
|
<ul class="group-manage" style="margin-top:14px">
|
|
<?php foreach ($mineGroups as $g): $gid = (int)$g['id']; ?>
|
|
<li class="group-manage-row">
|
|
<form method="post" action="<?= e(url('settings/groups/rename')) ?>" class="group-rename">
|
|
<?= csrf_field() ?>
|
|
<input type="hidden" name="id" value="<?= $gid ?>">
|
|
<input type="hidden" name="scope" value="me">
|
|
<label class="sr-only" for="gname<?= $gid ?>">分组名</label>
|
|
<input class="input" id="gname<?= $gid ?>" name="name" maxlength="20"
|
|
value="<?= e((string)$g['name']) ?>">
|
|
<button class="btn btn-ghost btn-sm" type="submit">改名</button>
|
|
</form>
|
|
<span class="group-count muted small"><?= (int)($groupCounts[$gid] ?? 0) ?> 人</span>
|
|
<?php /* 删除做成两步(<details>),不用 JS 也能防手滑 —— 一点就没了太容易出事 */ ?>
|
|
<details class="del-wrap">
|
|
<summary class="btn btn-ghost btn-sm">删除</summary>
|
|
<form method="post" action="<?= e(url('settings/groups/delete')) ?>" class="del-confirm">
|
|
<?= csrf_field() ?>
|
|
<input type="hidden" name="id" value="<?= $gid ?>">
|
|
<input type="hidden" name="scope" value="me">
|
|
<span class="small muted">这组的人会变成「未分类」,确定?</span>
|
|
<button class="btn btn-ghost btn-sm danger" type="submit">确认删除</button>
|
|
</form>
|
|
</details>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
<?php endif; ?>
|
|
|
|
<?php if (\App\Auth::isAdmin()): ?>
|
|
<p class="small muted" style="margin:16px 0 0">
|
|
公共分组在「<a href="<?= e(url('settings')) ?>#public-groups">系统设置</a>」里维护。
|
|
</p>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<!-- ==================== 模块:导航条上显示哪些、各自什么主题色 ==================== -->
|
|
<?php
|
|
$navKeys = \App\Module::navFor((int)\App\Auth::personId());
|
|
$colors = \App\Module::colors((int)\App\Auth::familyId());
|
|
require __DIR__ . '/_modules.php';
|
|
?>
|