6.0 KiB
6.0 KiB
phase: 03-registration-form-settings
plan: 02
subsystem: ui
tags: [php, smarty, mysql, registration, form]
requires:
- phase: 01-registration-form-update
provides: MfParticipant model, IndexController save flow, Reg.tpl admin display
provides:
- additional_info TEXT column in mf_participant (idempotent migration)
- MfParticipant::getAdditionalInfo / setAdditionalInfo
- "Dodatkowe informacje" textarea in public registration form (Index.tpl, Index_good.tpl)
- KSeF helper note relocated above new field
- Field displayed in confirmation templates (IndexSent.tpl, IndexSent_good.tpl)
- Field displayed in admin Reg.tpl institution column
- Admin Reg table ordered newest-first (id_mf_participant DESC)
affects: []
tech-stack:
added: []
patterns:
- "Raw for multi-line optional fields (formField plugin does not support textarea type)"
- "CalcController.php RegAction sort set via setSortBy — value injected directly into ORDER BY"
key-files:
created:
- _rejestracja/sql/2026-04-27-additional-info-field.sql
- _rejestracja/sql/apply-2026-04-27-additional-info-field.php
modified:
- _rejestracja/core/model/MfParticipant.class.php
- _rejestracja/controller/IndexController.php
- _rejestracja/template/partial/Index/Index.tpl
- _rejestracja/template/partial/Index/Index_good.tpl
- _rejestracja/template/partial/Index/IndexSent.tpl
- _rejestracja/template/partial/Index/IndexSent_good.tpl
- _rejestracja/Admin/template/partial/Calc/Reg.tpl
- _rejestracja/Admin/controller/CalcController.php
key-decisions:
- "Use raw <textarea rows=3> instead of {formField} — framework plugin does not support textarea type"
- "DB column named additional_info (TEXT) despite original KSeF context — generic name matches visible label"
- "KSeF helper note kept as dictionary translation but relocated above the new textarea (not inside NIP div)"
patterns-established:
- "Idempotent migration runner pattern: INFORMATION_SCHEMA column check before ALTER TABLE"
duration: ~15min
started: 2026-04-27T00:00:00Z
completed: 2026-04-27T00:00:00Z
<!-- yaml: line 12: did not find expected '-' indicator -->
<h1 id="user-content-phase-3-plan-02-dodatkowe-informacje-field--admin-table-order" dir="auto">Phase 3 Plan 02: Dodatkowe informacje Field + Admin Table Order</h1>
<p dir="auto"><strong>Optional free-text "Dodatkowe informacje" textarea added to registration form with DB persistence, KSeF helper note relocated above it, field shown in confirmations and admin panel, admin Reg table reversed to newest-first.</strong></p>
<h2 id="user-content-performance" dir="auto">Performance</h2>
<table>
<thead>
<tr>
<th>Metric</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Duration</td>
<td>~15 min</td>
</tr>
<tr>
<td>Tasks</td>
<td>3/3 completed</td>
</tr>
<tr>
<td>Files modified</td>
<td>8</td>
</tr>
<tr>
<td>Files created</td>
<td>2</td>
</tr>
</tbody>
</table>
<h2 id="user-content-acceptance-criteria-results" dir="auto">Acceptance Criteria Results</h2>
<table>
<thead>
<tr>
<th>Criterion</th>
<th>Status</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td>AC-1: Field in Public Form</td>
<td>Pass</td>
<td>Helper note above textarea in Index.tpl and Index_good.tpl</td>
</tr>
<tr>
<td>AC-2: Value Persisted to DB</td>
<td>Pass</td>
<td>IndexController saves via setAdditionalInfo(Request::GetPost('additional_info'))</td>
</tr>
<tr>
<td>AC-3: Field in Confirmation</td>
<td>Pass</td>
<td>IndexSent.tpl and IndexSent_good.tpl show field after NIP</td>
</tr>
<tr>
<td>AC-4: Field in Admin Panel</td>
<td>Pass</td>
<td>Reg.tpl institution cell shows field after NIP</td>
</tr>
<tr>
<td>AC-5: Admin Table Reversed</td>
<td>Pass</td>
<td>CalcController RegAction: setSortBy('id_mf_participant DESC')</td>
</tr>
<tr>
<td>AC-6: Idempotent Migration</td>
<td>Pass</td>
<td>PHP runner checks INFORMATION_SCHEMA before ALTER TABLE</td>
</tr>
</tbody>
</table>
<h2 id="user-content-accomplishments" dir="auto">Accomplishments</h2>
<ul dir="auto">
<li>New <code>additional_info</code> TEXT column added to <code>mf_participant</code> with safe idempotent runner.</li>
<li>KSeF helper text moved from inside NIP field div to above the new "Dodatkowe informacje" textarea.</li>
<li>Field persisted on form submit and displayed in all output surfaces (confirmation, email, admin).</li>
<li>Admin <code>/Calc/Reg</code> table now shows newest registrations first without any schema change.</li>
</ul>
<h2 id="user-content-files-createdmodified" dir="auto">Files Created/Modified</h2>
<table>
<thead>
<tr>
<th>File</th>
<th>Change</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>_rejestracja/sql/2026-04-27-additional-info-field.sql</code></td>
<td>Created</td>
<td>Raw ALTER TABLE SQL</td>
</tr>
<tr>
<td><code>_rejestracja/sql/apply-2026-04-27-additional-info-field.php</code></td>
<td>Created</td>
<td>Idempotent migration runner (?run=20260427)</td>
</tr>
<tr>
<td><code>_rejestracja/core/model/MfParticipant.class.php</code></td>
<td>Modified</td>
<td>Added additional_info field mapping, property, getter/setter</td>
</tr>
<tr>
<td><code>_rejestracja/controller/IndexController.php</code></td>
<td>Modified</td>
<td>Saves additional_info from POST</td>
</tr>
<tr>
<td><code>_rejestracja/template/partial/Index/Index.tpl</code></td>
<td>Modified</td>
<td>Moved helper text, added textarea below NIP</td>
</tr>
<tr>
<td><code>_rejestracja/template/partial/Index/Index_good.tpl</code></td>
<td>Modified</td>
<td>Same changes as Index.tpl</td>
</tr>
<tr>
<td><code>_rejestracja/template/partial/Index/IndexSent.tpl</code></td>
<td>Modified</td>
<td>Shows field in confirmation summary</td>
</tr>
<tr>
<td><code>_rejestracja/template/partial/Index/IndexSent_good.tpl</code></td>
<td>Modified</td>
<td>Shows field in alternate confirmation</td>
</tr>
<tr>
<td><code>_rejestracja/Admin/template/partial/Calc/Reg.tpl</code></td>
<td>Modified</td>
<td>Shows field in admin institution column</td>
</tr>
<tr>
<td><code>_rejestracja/Admin/controller/CalcController.php</code></td>
<td>Modified</td>
<td>RegAction sorted DESC by id_mf_participant</td>
</tr>
</tbody>
</table>
<h2 id="user-content-decisions-made" dir="auto">Decisions Made</h2>
<table>
<thead>
<tr>
<th>Decision</th>
<th>Rationale</th>
<th>Impact</th>
</tr>
</thead>
<tbody>
<tr>
<td>Raw <code><textarea></code> not <code>{formField}</code></td>
<td><code>formField</code> Smarty plugin supports only <code>type="text"</code> / <code>type="hidden"</code></td>
<td>Must use raw textarea for multi-line fields</td>
</tr>
<tr>
<td>Column name <code>additional_info</code></td>
<td>Label changed from "ID KSeF" to "Dodatkowe informacje" — generic column name avoids future confusion</td>
<td>Neutral; column stores any free text</td>
</tr>
</tbody>
</table>
<h2 id="user-content-deviations-from-plan" dir="auto">Deviations from Plan</h2>
<p dir="auto">None — plan executed exactly as written.</p>
<h2 id="user-content-issues-encountered" dir="auto">Issues Encountered</h2>
<p dir="auto">None.</p>
<h2 id="user-content-next-phase-readiness" dir="auto">Next Phase Readiness</h2>
<p dir="auto"><strong>Ready:</strong></p>
<ul dir="auto">
<li>Phase 3 feature work complete. Both plans (03-01 form settings admin page, 03-02 additional field) delivered.</li>
<li>Production deployment requires two migration runners:
<ol dir="auto">
<li><code>/_rejestracja/sql/apply-2026-04-24-registration-form-settings.php?run=20260424</code> (from 03-01)</li>
<li><code>/_rejestracja/sql/apply-2026-04-27-additional-info-field.php?run=20260427</code> (from 03-02)</li>
</ol>
</li>
</ul>
<p dir="auto"><strong>Concerns:</strong></p>
<ul dir="auto">
<li>Plan 03-01 APPLY was completed but UNIFY was never run — no 03-01-SUMMARY.md exists. Phase not formally closed until 03-01 is also unified.</li>
</ul>
<p dir="auto"><strong>Blockers:</strong></p>
<ul dir="auto">
<li>None for further development. Deployment migration must precede production use of the new field.</li>
</ul>
<hr>
<p dir="auto"><em>Phase: 03-registration-form-settings, Plan: 02</em>
<em>Completed: 2026-04-27</em></p>
</body></html>