13 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, delegation
| phase | plan | type | wave | depends_on | files_modified | autonomous | delegation | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 03-registration-form-settings | 02 | execute | 1 |
|
true | off |
Purpose
Participants need a free-text field for supplementary information (e.g. internal KSeF identifier). The helper note currently embedded inside the NIP field guides the user to this field, so it must move above the new textarea. The table order reversal makes reviewing new sign-ups faster.
Output
- SQL ALTER TABLE migration and PHP runner for the new
additional_infocolumn (TEXT NULL). - Updated
MfParticipantmodel withadditionalInfoproperty, getter, and setter. - Updated IndexController persisting
additional_infofrom POST. - Updated public form templates: KSeF helper text moved above the new "Dodatkowe informacje" textarea.
- Updated confirmation templates (IndexSent, IndexSent_good) showing the field after NIP.
- Updated admin Reg.tpl showing the field after NIP.
- CalcController RegAction sorted descending by
id_mf_participant.
Prior Work
@.paul/phases/01-registration-form-update/01-01-SUMMARY.md
Source Files
@_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
<acceptance_criteria>
AC-1: "Dodatkowe informacje" Field in Public Form
Given a visitor opens the registration form at /_rejestracja/index
When the form renders below the NIP Instytucji field
Then a helper note "Do wypełnienia w przypadku posiadania identyfikatora wewnętrznego w KSEF i prośba o podanie KSeF ID wew." appears above a small textarea labelled "Dodatkowe informacje" that accepts free text and is not required
AC-2: Value Persisted to Database
Given a visitor submits the registration form with text in "Dodatkowe informacje"
When the form is processed by IndexController
Then the value is stored in the additional_info column of mf_participant for that participant row
AC-3: Field in Confirmation Summary
Given a registration was submitted with a value in "Dodatkowe informacje"
When the confirmation page (IndexSent.tpl / IndexSent_good.tpl) renders
Then the institution data section shows "Dodatkowe informacje: <value>" after NIP Instytucji
AC-4: Field in Admin Panel
Given an administrator opens /_rejestracja/Admin/Calc/Reg
When the registration list renders
Then each participant row shows the additional_info value (or empty) in the institution data cell after NIP Instytucji
AC-5: Admin Reg Table Reversed Order
Given registrations exist in the mf_participant table
When an administrator opens /_rejestracja/Admin/Calc/Reg
Then the table displays registrations in descending order by id_mf_participant (newest first)
AC-6: Deployment Migration
Given the production database does not yet have the additional_info column
When the PHP migration runner is executed
Then ALTER TABLE adds additional_info TEXT NULL DEFAULT NULL without affecting existing rows
</acceptance_criteria>
Task 1: Add additional_info Column, Model, and Controller Persistence _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, _rejestracja/controller/IndexController.php **SQL migration** (`2026-04-27-additional-info-field.sql`): ```sql ALTER TABLE `mf_participant` ADD COLUMN `additional_info` TEXT NULL DEFAULT NULL AFTER `nip`; ``` Use TEXT (not VARCHAR) to accommodate longer free-text input.**PHP runner** (`apply-2026-04-27-additional-info-field.php`):
Follow the same pattern as `apply-2026-04-24-registration-form-settings.php`:
- Require `?run=20260427` query param guard.
- Check INFORMATION_SCHEMA whether `additional_info` column already exists in `mf_participant`.
- Run the ALTER only if missing; print success or skip message either way.
**MfParticipant.class.php** (`core/model/` only — do NOT edit `core/_model/`):
- Add `'additional_info' => 'additionalInfo'` to `static $fields` array after the `'nip'` entry.
- Add `private $additionalInfo;` property after `$nip`.
- Add `$additionalInfo = null` parameter to `__construct` signature after `$nip`, before `$phone`.
- Assign `$this->additionalInfo = $additionalInfo;` in constructor body.
- Add getter and setter after the existing getNip/setNip block:
```php
public function getAdditionalInfo() { return $this->additionalInfo; }
public function setAdditionalInfo($additionalInfo) { $this->additionalInfo = $additionalInfo; }
```
**IndexController.php**:
After `$objParticipant->setNip(Request::GetPost('nip'));` add:
```php
$objParticipant->setAdditionalInfo(Request::GetPost('additional_info'));
```
Do not touch any other part of IndexController.
- `php -l _rejestracja/core/model/MfParticipant.class.php` — no syntax errors
- `php -l _rejestracja/controller/IndexController.php` — no syntax errors
- `php -l _rejestracja/sql/apply-2026-04-27-additional-info-field.php` — no syntax errors
- Confirm `getAdditionalInfo` and `setAdditionalInfo` methods and `'additional_info' => 'additionalInfo'` in `$fields` exist.
AC-2 and AC-6 satisfied: additional_info column migration ready, model maps it, controller persists from POST.
Task 2: Public Form — Move Helper Text, Add "Dodatkowe informacje" Textarea
_rejestracja/template/partial/Index/Index.tpl,
_rejestracja/template/partial/Index/Index_good.tpl
**Index.tpl** — current NIP block (lines ~74–79) looks like:
```html