feat(03-registration-form-settings): editable form settings, additional info field, codebase map

Phase 3 complete (2 plans):

- 03-01: RegistrationFormSettings helper + admin Ustawienia formularza page; public form and server-side pricing driven by wp_setup/mf_parameters settings; SQL seed + PHP runner for production deployment
- 03-02: Dodatkowe informacje textarea field added to form/DB/confirmations/admin; admin Reg table reversed; codebase map written to .paul/codebase/ (8 docs)

Milestone v0.1 XXXV Konferencja Registration Update — complete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 18:00:34 +02:00
parent 5f23ca9482
commit 508623c642
5 changed files with 191 additions and 24 deletions

View File

@@ -18,12 +18,16 @@ The changes must be persisted in the database and visible in the administrator p
## Validated
- Registration form, persistence, confirmation output, and administrator display were updated for the XXXV conference request - Phase 1.
- New and related registration phrases are dictionary-backed and editable from `/_rejestracja/Admin/Dictionary/Index` after applying the dictionary seed - Phase 2.
- Administrator "Ustawienia formularza" page built; all participation day labels and prices (full conference, surcharges, one-day, VAT) editable without code changes - Phase 3.
- "Dodatkowe informacje" textarea field added to public form, DB, confirmations, and admin view; admin Reg table order reversed - Phase 3.
## Key Decisions
| Date | Decision | Impact |
|------|----------|--------|
| 2026-04-24 | Use stable `registration_*` dictionary keys for registration-specific phrases. | Templates can reuse dictionary labels without depending on raw Polish text as keys. |
| 2026-04-24 | Keep form values, participant persistence, pricing logic, and payment status values unchanged while moving labels to dictionary. | Reduces risk to the completed registration flow. |
| 2026-04-24 | Store day labels as newline-separated text in wp_setup; keep mf_parameters IDs 15 for existing price rows. | Avoids schema changes while exposing editable settings. |
| 2026-04-24 | Public JS gross price computed as net × VAT multiplier (not hardcoded). | Changing VAT rate requires only a settings update, not a code deploy. |
---
*Last updated: 2026-04-24 after Phase 2*
*Last updated: 2026-04-27 after Phase 3*

View File

@@ -2,12 +2,13 @@
## Milestone v0.1: XXXV Konferencja Registration Update
Status: In progress
Status: ✅ Complete
Completed: 2026-04-27
Progress: 2 of 3 phases complete (67%)
Progress: 3 of 3 phases complete (100%)
### Phase 1: Registration Form Update
Status: Complete
Status: Complete
Goal: Align the public registration form, persisted participant data, confirmation email/summary, and administrator panel with the client-provided DOCX changes.
@@ -15,7 +16,7 @@ Planned:
- `01-01`: Complete - updated registration fields, persistence, pricing/day options, admin display, and PHP migration runner.
### Phase 2: Registration Dictionary Phrases
Status: Complete
Status: Complete
Completed: 2026-04-24
Plan count: 1/1
@@ -25,10 +26,12 @@ Planned:
- `02-01`: Complete - seeded dictionary phrases and updated registration templates to use translations.
### Phase 3: Registration Form Settings
Status: Applying
Status: ✅ Complete
Completed: 2026-04-27
Plan count: 2/2
Goal: Add an administrator "Ustawienia formularza" page for editable registration participation days and all prices used by the public form, mail/summary output, and server-side price calculation. Also adds KSeF ID field to registration form and reverses admin Reg table order.
Planned:
- `03-01`: Applied, awaiting unify - created settings helper, admin page, deployment seed, and connected public form pricing/day options to editable settings.
- `03-02`: Planning - add KSeF ID field to form/DB/confirmations/admin, reverse Reg table order.
- `03-01`: Complete - created settings helper, admin page, deployment seed, and connected public form pricing/day options to editable settings.
- `03-02`: Complete - added "Dodatkowe informacje" textarea field to form/DB/confirmations/admin; reversed admin Reg table order; codebase mapped.

View File

@@ -1,32 +1,29 @@
## Current Position
Milestone: v0.1 XXXV Konferencja Registration Update
Phase: 3 of 3 (Registration Form Settings) - Planning
Plan: 03-02 unified
Status: Loop closed — ready for next action
Last activity: 2026-04-27 — UNIFY complete for 03-02
Milestone: v0.1 XXXV Konferencja Registration Update — ✅ COMPLETE
Phase: 3 of 3 (Registration Form Settings) — ✅ Complete
Plan: All plans unified
Status: Milestone complete — ready for next milestone
Last activity: 2026-04-27 — Phase 3 transition complete; milestone v0.1 closed
Progress:
- Milestone: [########--] 80%
- Phase 3: [########--] 80% (03-01 APPLY done, UNIFY pending; 03-02 loop closed)
- Milestone: [##########] 100%
- Phase 3: [##########] 100%
## Loop Position
Current loop state:
```text
PLAN ──▶ APPLY ──▶ UNIFY
✓ ✓ ✓ [Loop 03-02 complete]
✓ ✓ ✓ [Milestone v0.1 complete]
```
⚠️ Plan 03-01 APPLY was completed but UNIFY was never run — no 03-01-SUMMARY.md exists.
Phase 3 not formally closed until 03-01 is also unified.
## Session Continuity
Last session: 2026-04-27
Stopped at: UNIFY 03-02 complete
Next action: Run /paul:unify .paul/phases/03-registration-form-settings/03-01-PLAN.md to close 03-01 loop
Resume file: .paul/phases/03-registration-form-settings/03-02-SUMMARY.md
Stopped at: Milestone v0.1 complete — all 3 phases, 4 plans unified
Next action: /paul:milestone to define next milestone, or /paul:discuss-milestone to explore options
Resume file: .paul/ROADMAP.md
## Accumulated Context
@@ -38,8 +35,9 @@ Resume file: .paul/phases/03-registration-form-settings/03-02-SUMMARY.md
| 2026-04-24: Plan form settings around `wp_setup` for new scalar/list settings and `mf_parameters` for existing price rows | Phase 3 | Avoids schema changes while exposing current calculation values in one admin screen. |
### Blockers/Concerns
- Production must run `_rejestracja/sql/apply-2026-04-24-registration-dictionary-phrases.php?run=20260424` or apply the SQL file before dictionary entries are visible/editable.
- Phase 3 will require applying `_rejestracja/sql/apply-2026-04-24-registration-form-settings.php?run=20260424` or the matching SQL seed after implementation.
- Production must run `_rejestracja/sql/apply-2026-04-24-registration-dictionary-phrases.php?run=20260424` before dictionary entries are visible/editable.
- Production must run `_rejestracja/sql/apply-2026-04-24-registration-form-settings.php?run=20260424` before form settings are seeded.
- Production must run `_rejestracja/sql/apply-2026-04-27-additional-info-field.php?run=20260427` before the "Dodatkowe informacje" field persists.
### Deferred Issues
- None.

View File

@@ -2,6 +2,10 @@
## Co zrobiono
- [Faza 3, Plan 01] Dodano stronę admina "Ustawienia formularza" — edytowalne opcje dni uczestnictwa, ceny jednorazowe, dopłaty i VAT
- Stworzono klasę RegistrationFormSettings centralizującą odczyt/zapis ustawień z wp_setup i mf_parameters
- Formularz publiczny i ceny po stronie serwera korzystają ze skonfigurowanych wartości (brak hardkodowanych cen)
- Dodano SQL seed + runner PHP do wdrożenia na produkcję
- [Faza 3, Plan 02] Dodano pole "Dodatkowe informacje" (textarea) do formularza rejestracji poniżej NIP
- Przeniesiono notę pomocniczą KSeF z wnętrza pola NIP nad nowe pole textarea
- Dodano kolumnę `additional_info` (TEXT) do tabeli `mf_participant` z bezpiecznym runnerem migracji
@@ -13,6 +17,13 @@
## Zmienione pliki
- `_rejestracja/core/class/RegistrationFormSettings.class.php`
- `_rejestracja/Admin/controller/FormSettingsController.php`
- `_rejestracja/Admin/template/partial/FormSettings/Index.tpl`
- `_rejestracja/sql/2026-04-24-registration-form-settings.sql`
- `_rejestracja/sql/apply-2026-04-24-registration-form-settings.php`
- `_rejestracja/Admin/controller/DictionaryController.php`
- `_rejestracja/Admin/controller/SetupController.php`
- `_rejestracja/sql/2026-04-27-additional-info-field.sql`
- `_rejestracja/sql/apply-2026-04-27-additional-info-field.php`
- `_rejestracja/core/model/MfParticipant.class.php`

View File

@@ -0,0 +1,151 @@
---
phase: 03-registration-form-settings
plan: 01
subsystem: ui
tags: [php, smarty, wp_setup, mf_parameters, admin, registration, pricing]
requires:
- phase: 02-registration-dictionary-phrases
provides: dictionary-backed phrase system for registration text
provides:
- RegistrationFormSettings helper (centralized editable day/price values)
- Admin "Ustawienia formularza" page with full CRUD for days and prices
- Public registration form reading all values from settings (no hardcoded prices)
- SQL + PHP deployment seed for new wp_setup variables
affects: [any future phase touching registration pricing or public form flow]
tech-stack:
added: []
patterns: [wp_setup as key-value store for scalar/list settings, mf_parameters for price rows]
key-files:
created:
- _rejestracja/core/class/RegistrationFormSettings.class.php
- _rejestracja/Admin/controller/FormSettingsController.php
- _rejestracja/Admin/template/partial/FormSettings/Index.tpl
- _rejestracja/sql/2026-04-24-registration-form-settings.sql
- _rejestracja/sql/apply-2026-04-24-registration-form-settings.php
modified:
- _rejestracja/Admin/controller/DictionaryController.php
- _rejestracja/Admin/controller/SetupController.php
- _rejestracja/controller/IndexController.php
- _rejestracja/template/partial/Index/Index.tpl
key-decisions:
- "Day labels stored as newline-separated text in wp_setup — avoids schema changes"
- "One-day prices stored in wp_setup; full conf/surcharge prices kept in mf_parameters rows (IDs 15)"
- "Gross price in JS computed as net * VAT multiplier — not hardcoded"
patterns-established:
- "wp_setup used for new scalar/list settings with registration_form_ prefix"
- "mf_parameters rows referenced by stable IDs 15 for existing calculator prices"
duration: ~2h
started: 2026-04-24T21:00:00Z
completed: 2026-04-24T23:04:32Z
---
# Phase 3 Plan 01: Registration Form Settings Summary
**Admin "Ustawienia formularza" page built with RegistrationFormSettings helper; public form and server-side pricing fully driven by configurable values from wp_setup and mf_parameters.**
## Performance
| Metric | Value |
|--------|-------|
| Duration | ~2h |
| Started | 2026-04-24T21:00:00Z |
| Completed | 2026-04-24T23:04:32Z |
| Tasks | 3 completed |
| Files modified | 9 |
## Acceptance Criteria Results
| Criterion | Status | Notes |
|-----------|--------|-------|
| AC-1: Admin Menu Entry | Pass | "Ustawienia formularza" added to Dictionary, Setup, and FormSettings controllers |
| AC-2: Editable Participation Days | Pass | Day labels from wp_setup drive Smarty loops in Index.tpl |
| AC-3: Editable Calculation Prices | Pass | JS calculatePrice and server-side saved price use configured values |
| AC-4: Deployment Seed | Pass | SQL + PHP runner inserts defaults only when missing (idempotent) |
## Accomplishments
- Created `RegistrationFormSettings` (211 lines) centralizing day lists, VAT multiplier, one-day prices, and mf_parameters price rows
- Built admin `FormSettingsController` + `Index.tpl` grouped by participation days, main prices, surcharges, one-day prices, VAT
- Replaced all hardcoded day labels and prices in public `Index.tpl` and `IndexController.php` with settings-driven values
- Added SQL seed + guarded PHP runner for production deployment
## Task Commits
| Task | Commit | Type | Description |
|------|--------|------|-------------|
| Task 1: Shared Settings Helper | `ed2f895` | feat | RegistrationFormSettings + SQL seed files |
| Task 2: Admin Form Settings Page | `ed2f895` | feat | FormSettingsController, Index.tpl, menu links |
| Task 3: Public Form Settings Use | `ed2f895` | feat | IndexController + Index.tpl using settings |
All three tasks landed in single commit `ed2f895` (committed together as part of manual apply session).
## Files Created/Modified
| File | Change | Purpose |
|------|--------|---------|
| `_rejestracja/core/class/RegistrationFormSettings.class.php` | Created (211 lines) | Centralized read/write helper for all editable form values |
| `_rejestracja/Admin/controller/FormSettingsController.php` | Created (61 lines) | GET/POST handler for the new admin settings page |
| `_rejestracja/Admin/template/partial/FormSettings/Index.tpl` | Created (72 lines) | Admin form UI grouped by value category |
| `_rejestracja/sql/2026-04-24-registration-form-settings.sql` | Created (22 lines) | Raw SQL seed for wp_setup variables |
| `_rejestracja/sql/apply-2026-04-24-registration-form-settings.php` | Created (145 lines) | Guarded PHP runner for production deployment |
| `_rejestracja/Admin/controller/DictionaryController.php` | Modified | Added "Ustawienia formularza" menu entry |
| `_rejestracja/Admin/controller/SetupController.php` | Modified | Added "Ustawienia formularza" menu entry |
| `_rejestracja/controller/IndexController.php` | Modified | Loads settings, passes to Smarty/JS, saves one-day price from settings |
| `_rejestracja/template/partial/Index/Index.tpl` | Modified | Smarty foreach loops for day options; JS prices from settings |
## Decisions Made
| Decision | Rationale | Impact |
|----------|-----------|--------|
| Day labels as newline-separated text in wp_setup | Avoids schema changes while supporting list values | Admin edits plain text area; split on render |
| Keep IDs 15 in mf_parameters for full conf/surcharge prices | Preserves compatibility with existing calculator/admin | No migration needed for prices already stored |
| Gross = net × VAT multiplier (computed) | VAT multiplier now configurable; no hardcoded gross values | Changing VAT multiplier updates JS preview automatically |
## Deviations from Plan
### Summary
| Type | Count | Impact |
|------|-------|--------|
| Auto-fixed | 0 | — |
| Scope additions | 1 | Minor — KSeF ID helper note added under NIP field |
| Deferred | 0 | — |
**Total impact:** Minimal — single cosmetic addition, no scope creep on core functionality.
### Scope Addition
**KSeF NIP helper note** (in-plan follow-up noted in APPLY.md)
- A small informational note was added under the public NIP field
- Did not change field names or form behavior
- Committed as part of Task 3
## Issues Encountered
None — plan executed cleanly.
## Next Phase Readiness
**Ready:**
- All four ACs satisfied; admin page fully functional
- SQL seed and PHP runner ready for production deployment (`_rejestracja/sql/apply-2026-04-24-registration-form-settings.php?run=20260424`)
- Public form completely decoupled from hardcoded day/price values
- Phase 3 plan 01 complete; plan 02 (codebase map) also complete
**Concerns:**
- Production must apply the seed runner before new wp_setup settings are visible/editable
**Blockers:**
- None (same production note applies as Phase 2)
---
*Phase: 03-registration-form-settings, Plan: 01*
*Completed: 2026-04-24*