feat: inversion relation User→Projects, les projets pointent vers les utilisateurs
All checks were successful
Deploy Preprod / Build and Deploy to Preprod (push) Successful in 31s

Le champ `users` est désormais sur le blueprint projet. Les blueprints
pochet/client perdent leur champ `projects`. La logique PHP (user-projects,
managers, controller, template, mark-all-read) lit project.users au lieu
de user.projects. Script de migration inclus.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-03-03 14:01:27 +01:00
parent 075e511a6a
commit ea90f512cf
10 changed files with 101 additions and 25 deletions

View file

@ -46,7 +46,7 @@ $currentUser = $kirby->user();
try {
$children = $currentUser->role() == 'admin'
? $page->childrenAndDrafts()->map(fn($project) => getProjectData($project, $currentUser))->values()
: $currentUser->projects()->toPages()->map(fn($project) => getProjectData($project, $currentUser))->values();
: $currentUser->currentProjects()->map(fn($project) => getProjectData($project, $currentUser))->values();
} catch (\Throwable $th) {
throw new Exception($th->getMessage() . ' line ' . $th->getLine() . ' in file ' . $th->getFile(), 1);
$children = [];