This commit is contained in:
2026-04-27 17:46:12 +02:00
parent ed2f89567c
commit 11afc80a7b
27 changed files with 1245 additions and 24 deletions

View File

@@ -27,7 +27,8 @@ Planned:
### Phase 3: Registration Form Settings
Status: Applying
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.
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.

View File

@@ -2,28 +2,31 @@
Milestone: v0.1 XXXV Konferencja Registration Update
Phase: 3 of 3 (Registration Form Settings) - Planning
Plan: 03-01 applied, awaiting unify
Status: APPLY complete, ready for UNIFY
Last activity: 2026-04-24 23:09:13 +02:00 - Added in-plan KSeF helper note under NIP field
Plan: 03-02 unified
Status: Loop closed — ready for next action
Last activity: 2026-04-27 — UNIFY complete for 03-02
Progress:
- Milestone: [#######---] 67%
- Phase 3: [----------] 0%
- Milestone: [########--] 80%
- Phase 3: [########--] 80% (03-01 APPLY done, UNIFY pending; 03-02 loop closed)
## Loop Position
Current loop state:
```text
PLAN --> APPLY --> UNIFY
* * o [Apply complete, awaiting unify]
PLAN ──▶ APPLY ──▶ UNIFY
[Loop 03-02 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-24 23:09:13 +02:00
Stopped at: Plan 03-01 applied
Next action: Run $paul-unify `.paul/phases/03-registration-form-settings/03-01-PLAN.md`
Resume file: `.paul/phases/03-registration-form-settings/03-01-APPLY.md`
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
## Accumulated Context

View File

@@ -0,0 +1,25 @@
# 2026-04-27
## Co zrobiono
- [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
- Zaktualizowano model MfParticipant: właściwość `additionalInfo`, getter/setter
- Pole zapisywane w bazie przez IndexController
- Pole wyświetlane w potwierdzeniu rejestracji (IndexSent.tpl, IndexSent_good.tpl)
- Pole wyświetlane w panelu administratora (Reg.tpl)
- Odwrócono kolejność tabeli w Admin/Calc/Reg — najnowsze zgłoszenia wyświetlane na górze
## Zmienione pliki
- `_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`
- `_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`

3
.paul/docs/API.md Normal file
View File

@@ -0,0 +1,3 @@
# API
> Endpointy, kontrakty request/response, autentykacja.

View File

@@ -0,0 +1,3 @@
# ARCHITECTURE
> Struktura klas, modulow, przeplywow i zaleznosci w projekcie.

3
.paul/docs/DB_SCHEMA.md Normal file
View File

@@ -0,0 +1,3 @@
# DB_SCHEMA
> Schemat bazy danych — tabele, kolumny, FK, indeksy.

3
.paul/docs/DECISIONS.md Normal file
View File

@@ -0,0 +1,3 @@
# DECISIONS
> Kluczowe decyzje techniczne i ich uzasadnienia.

3
.paul/docs/STACK.md Normal file
View File

@@ -0,0 +1,3 @@
# STACK
> Stack technologiczny, wersje, zaleznosci, srodowisko.

View File

@@ -0,0 +1,3 @@
# TECH_CHANGELOG
> Chronologiczny log zmian technicznych — co i dlaczego.

3
.paul/docs/TODO.md Normal file
View File

@@ -0,0 +1,3 @@
# TODO
> Luzny parking pomyslow, rzeczy do sprawdzenia.

View File

@@ -0,0 +1,23 @@
{"ts":"2026-04-27T13:23:52Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\.paul\\\\phases\\\\03-registration-form-settings\\\\03-02-PLAN.md","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:24:08Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\.paul\\\\STATE.md","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:24:16Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\.paul\\\\ROADMAP.md","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:26:30Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\.paul\\\\phases\\\\03-registration-form-settings\\\\03-02-PLAN.md","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:27:19Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\_rejestracja\\\\sql\\\\2026-04-27-additional-info-field.sql","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:27:20Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\_rejestracja\\\\core\\\\model\\\\MfParticipant.class.php","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:27:23Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\_rejestracja\\\\core\\\\model\\\\MfParticipant.class.php","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:27:28Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\_rejestracja\\\\core\\\\model\\\\MfParticipant.class.php","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:27:44Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\_rejestracja\\\\sql\\\\apply-2026-04-27-additional-info-field.php","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:27:51Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\_rejestracja\\\\controller\\\\IndexController.php","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:28:11Z","tool":"Bash","cmd":"php -l \"C:/visual studio code/projekty/aktualia.com.pl/_rejestracja/core/model/MfParticipant.class.php\" && php -l \"C:/visual studio code/projekty/aktualia.com.pl/_rejestracja/controller/IndexContro","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:28:21Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\_rejestracja\\\\template\\\\partial\\\\Index\\\\Index.tpl","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:28:33Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\_rejestracja\\\\template\\\\partial\\\\Index\\\\Index_good.tpl","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:28:40Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\_rejestracja\\\\template\\\\partial\\\\Index\\\\IndexSent.tpl","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:28:46Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\_rejestracja\\\\template\\\\partial\\\\Index\\\\IndexSent_good.tpl","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:28:50Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\_rejestracja\\\\Admin\\\\template\\\\partial\\\\Calc\\\\Reg.tpl","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:28:59Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\_rejestracja\\\\Admin\\\\controller\\\\CalcController.php","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:29:06Z","tool":"Bash","cmd":"php -l \"C:/visual studio code/projekty/aktualia.com.pl/_rejestracja/Admin/controller/CalcController.php\"\",\"description\":\"PHP syntax check CalcController\"},\"tool_response\":{\"stdout\":\"No syn","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:29:20Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\.paul\\\\STATE.md","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T13:29:22Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\.paul\\\\STATE.md","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T15:45:21Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\.paul\\\\phases\\\\03-registration-form-settings\\\\03-02-SUMMARY.md","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T15:45:31Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\.paul\\\\changelog\\\\2026-04-27.md","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}
{"ts":"2026-04-27T15:45:48Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\aktualia.com.pl\\\\.paul\\\\STATE.md","cwd":"/c/visual studio code/projekty/aktualia.com.pl"}

View File

@@ -0,0 +1,283 @@
---
phase: 03-registration-form-settings
plan: 02
type: execute
wave: 1
depends_on: []
files_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
- _rejestracja/sql/2026-04-27-additional-info-field.sql
- _rejestracja/sql/apply-2026-04-27-additional-info-field.php
autonomous: true
delegation: off
---
<objective>
## Goal
Add a new optional "Dodatkowe informacje" textarea to the registration form (below NIP), with the existing KSeF helper note moved above it. Persist the value to the database, display it in the confirmation summary and admin panel, and reverse the admin Reg table so newest registrations appear first.
## 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_info` column (TEXT NULL).
- Updated `MfParticipant` model with `additionalInfo` property, getter, and setter.
- Updated IndexController persisting `additional_info` from 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`.
</objective>
<context>
## Project Context
@.paul/PROJECT.md
@.paul/ROADMAP.md
@.paul/STATE.md
## 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
</context>
<acceptance_criteria>
## AC-1: "Dodatkowe informacje" Field in Public Form
```gherkin
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
```gherkin
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
```gherkin
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
```gherkin
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
```gherkin
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
```gherkin
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>
<tasks>
<task type="auto">
<name>Task 1: Add additional_info Column, Model, and Controller Persistence</name>
<files>
_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
</files>
<action>
**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.
</action>
<verify>
- `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.
</verify>
<done>AC-2 and AC-6 satisfied: additional_info column migration ready, model maps it, controller persists from POST.</done>
</task>
<task type="auto">
<name>Task 2: Public Form — Move Helper Text, Add "Dodatkowe informacje" Textarea</name>
<files>
_rejestracja/template/partial/Index/Index.tpl,
_rejestracja/template/partial/Index/Index_good.tpl
</files>
<action>
**Index.tpl** — current NIP block (lines ~7479) looks like:
```html
<div class="entry">
<div class="label">{translate word='NIP Instytucji'}:</div>
<div class="value">
{formField name="nip" type="text" errorClass="warning"}
<div style="font-size: 11px; line-height: 1.3; margin-top: 4px;">{translate word='Do wypełnienia w przypadku posiadania identyfikatora wewnętrznego w KSEF i prośba o podanie KSeF ID wew.'}</div>
</div>
</div>
```
Replace with two blocks:
1. NIP entry with helper `<div>` removed — NIP value div contains only the formField.
2. New entry immediately after NIP:
```html
<div class="entry">
<div class="label">Dodatkowe informacje:</div>
<div class="value">
<div style="font-size: 11px; line-height: 1.3; margin-bottom: 4px;">{translate word='Do wypełnienia w przypadku posiadania identyfikatora wewnętrznego w KSEF i prośba o podanie KSeF ID wew.'}</div>
<textarea name="additional_info" rows="3" style="width:100%; box-sizing:border-box;">{if isset($smarty.post.additional_info)}{$smarty.post.additional_info|escape}{/if}</textarea>
</div>
</div>
```
Use a raw `<textarea>` (not `{formField}`) since `{formField}` does not support textarea type in this framework.
The `rows="3"` keeps it compact. The existing `{$smarty.post.additional_info|escape}` pattern re-populates the field on validation error, consistent with how other fields work via the formField plugin.
**Index_good.tpl** — NIP block (lines ~7476) has no helper text inside.
Add the same new entry (label + helper note + textarea) immediately after the NIP entry.
Do not change any other entries.
</action>
<verify>
- Open Index.tpl: confirm helper text `<div>` is no longer inside the NIP value div.
- Confirm the new entry with `name="additional_info"` textarea and the helper note `<div>` above it exists after NIP in both templates.
</verify>
<done>AC-1 satisfied: helper note appears above the "Dodatkowe informacje" textarea in both public form templates.</done>
</task>
<task type="auto">
<name>Task 3: Display Field in Confirmations and Admin + Reverse Table Order</name>
<files>
_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
</files>
<action>
**IndexSent.tpl** — institution data section (line ~40):
After `NIP Instytucji: {$objParticipant->getNip()|default:$registrationMissing}<br>`, add:
```
Dodatkowe informacje: {$objParticipant->getAdditionalInfo()|default:$registrationMissing}<br>
```
**IndexSent_good.tpl** — institution data section (line ~32):
After `NIP Instytucji: {$objParticipant->getNip()|default:'brak'}<br>`, add:
```
Dodatkowe informacje: {$objParticipant->getAdditionalInfo()|default:'brak'}<br>
```
**Reg.tpl** — institution data cell (line ~55):
After `NIP Instytucji: {$obj->getNip()}</br>`, add:
```
Dodatkowe informacje: {$obj->getAdditionalInfo()}</br>
```
**CalcController.php** — RegAction method (around line 248252):
After `$dalData->addCondition('location', $location);` add:
```php
$dalData->setSortBy('id_mf_participant DESC');
```
`setSortBy` value is injected directly into `ORDER BY`, so DESC is valid here.
Do not alter any other controller methods.
</action>
<verify>
- `php -l _rejestracja/Admin/controller/CalcController.php` — no errors
- Confirm `getAdditionalInfo()` calls in IndexSent.tpl, IndexSent_good.tpl, and Reg.tpl.
- Confirm `setSortBy('id_mf_participant DESC')` present in CalcController.php RegAction.
</verify>
<done>AC-3, AC-4, and AC-5 satisfied: field shows in confirmations and admin list; Reg table ordered newest-first.</done>
</task>
</tasks>
<boundaries>
## DO NOT CHANGE
- `core/_model/MfParticipant.class.php` — legacy copy, not loaded by autoloader.
- `mf_participant` existing columns other than adding `additional_info`.
- Any other admin controllers or templates beyond CalcController.php RegAction sort.
- Existing `mf_parameters` pricing logic, form field names, or dictionary keys from Phase 1 and 2.
- Smarty compiled cache files under `temp/compile`.
## SCOPE LIMITS
- Do not add validation for `additional_info` — field is optional, no format constraint.
- Do not add the field to the admin RegEdit form — display only, no edit via admin.
- Do not modify `RegPAN.tpl` (panel location=2 view).
- Do not touch `_rejestracja/template/partial/Index/_/IndexSent.tpl` (archived copy).
</boundaries>
<verification>
Before declaring plan complete:
- [ ] `php -l _rejestracja/core/model/MfParticipant.class.php` — no errors
- [ ] `php -l _rejestracja/controller/IndexController.php` — no errors
- [ ] `php -l _rejestracja/Admin/controller/CalcController.php` — no errors
- [ ] `php -l _rejestracja/sql/apply-2026-04-27-additional-info-field.php` — no errors
- [ ] `getAdditionalInfo()` and `setAdditionalInfo()` exist in MfParticipant.class.php
- [ ] `'additional_info' => 'additionalInfo'` in `$fields` array
- [ ] `<textarea name="additional_info"` present in Index.tpl and Index_good.tpl
- [ ] Helper text no longer inside the NIP value div in Index.tpl
- [ ] `getAdditionalInfo()` called in IndexSent.tpl, IndexSent_good.tpl, and Reg.tpl
- [ ] `setSortBy('id_mf_participant DESC')` in CalcController.php RegAction
</verification>
<success_criteria>
- All tasks completed with no PHP syntax errors.
- All verification checks pass.
- No existing registration behavior, pricing logic, or dictionary phrases are affected.
- Deployment SQL runner is idempotent (safe to run on production even if column already exists).
</success_criteria>
<output>
After completion, create `.paul/phases/03-registration-form-settings/03-02-SUMMARY.md`
</output>

View File

@@ -0,0 +1,132 @@
---
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 <textarea> 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
---
# Phase 3 Plan 02: Dodatkowe informacje Field + Admin Table Order
**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.**
## Performance
| Metric | Value |
|--------|-------|
| Duration | ~15 min |
| Tasks | 3/3 completed |
| Files modified | 8 |
| Files created | 2 |
## Acceptance Criteria Results
| Criterion | Status | Notes |
|-----------|--------|-------|
| AC-1: Field in Public Form | Pass | Helper note above textarea in Index.tpl and Index_good.tpl |
| AC-2: Value Persisted to DB | Pass | IndexController saves via setAdditionalInfo(Request::GetPost('additional_info')) |
| AC-3: Field in Confirmation | Pass | IndexSent.tpl and IndexSent_good.tpl show field after NIP |
| AC-4: Field in Admin Panel | Pass | Reg.tpl institution cell shows field after NIP |
| AC-5: Admin Table Reversed | Pass | CalcController RegAction: setSortBy('id_mf_participant DESC') |
| AC-6: Idempotent Migration | Pass | PHP runner checks INFORMATION_SCHEMA before ALTER TABLE |
## Accomplishments
- New `additional_info` TEXT column added to `mf_participant` with safe idempotent runner.
- KSeF helper text moved from inside NIP field div to above the new "Dodatkowe informacje" textarea.
- Field persisted on form submit and displayed in all output surfaces (confirmation, email, admin).
- Admin `/Calc/Reg` table now shows newest registrations first without any schema change.
## Files Created/Modified
| File | Change | Purpose |
|------|--------|---------|
| `_rejestracja/sql/2026-04-27-additional-info-field.sql` | Created | Raw ALTER TABLE SQL |
| `_rejestracja/sql/apply-2026-04-27-additional-info-field.php` | Created | Idempotent migration runner (?run=20260427) |
| `_rejestracja/core/model/MfParticipant.class.php` | Modified | Added additional_info field mapping, property, getter/setter |
| `_rejestracja/controller/IndexController.php` | Modified | Saves additional_info from POST |
| `_rejestracja/template/partial/Index/Index.tpl` | Modified | Moved helper text, added textarea below NIP |
| `_rejestracja/template/partial/Index/Index_good.tpl` | Modified | Same changes as Index.tpl |
| `_rejestracja/template/partial/Index/IndexSent.tpl` | Modified | Shows field in confirmation summary |
| `_rejestracja/template/partial/Index/IndexSent_good.tpl` | Modified | Shows field in alternate confirmation |
| `_rejestracja/Admin/template/partial/Calc/Reg.tpl` | Modified | Shows field in admin institution column |
| `_rejestracja/Admin/controller/CalcController.php` | Modified | RegAction sorted DESC by id_mf_participant |
## Decisions Made
| Decision | Rationale | Impact |
|----------|-----------|--------|
| Raw `<textarea>` not `{formField}` | `formField` Smarty plugin supports only `type="text"` / `type="hidden"` | Must use raw textarea for multi-line fields |
| Column name `additional_info` | Label changed from "ID KSeF" to "Dodatkowe informacje" — generic column name avoids future confusion | Neutral; column stores any free text |
## Deviations from Plan
None — plan executed exactly as written.
## Issues Encountered
None.
## Next Phase Readiness
**Ready:**
- Phase 3 feature work complete. Both plans (03-01 form settings admin page, 03-02 additional field) delivered.
- Production deployment requires two migration runners:
1. `/_rejestracja/sql/apply-2026-04-24-registration-form-settings.php?run=20260424` (from 03-01)
2. `/_rejestracja/sql/apply-2026-04-27-additional-info-field.php?run=20260427` (from 03-02)
**Concerns:**
- 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.
**Blockers:**
- None for further development. Deployment migration must precede production use of the new field.
---
*Phase: 03-registration-form-settings, Plan: 02*
*Completed: 2026-04-27*

2
.serena/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/cache
/project.local.yml

154
.serena/project.yml Normal file
View File

@@ -0,0 +1,154 @@
# the name by which the project can be referenced within Serena
project_name: "aktualia.com.pl"
# list of languages for which language servers are started; choose from:
# al bash clojure cpp csharp
# csharp_omnisharp dart elixir elm erlang
# fortran fsharp go groovy haskell
# haxe java julia kotlin lua
# markdown
# matlab nix pascal perl php
# php_phpactor powershell python python_jedi r
# rego ruby ruby_solargraph rust scala
# swift terraform toml typescript typescript_vts
# vue yaml zig
# (This list may be outdated. For the current list, see values of Language enum here:
# https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py
# For some languages, there are alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.)
# Note:
# - For C, use cpp
# - For JavaScript, use typescript
# - For Free Pascal/Lazarus, use pascal
# Special requirements:
# Some languages require additional setup/installations.
# See here for details: https://oraios.github.io/serena/01-about/020_programming-languages.html#language-servers
# When using multiple languages, the first language server that supports a given file will be used for that file.
# The first language is the default language and the respective language server will be used as a fallback.
# Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
languages:
- php
# the encoding used by text files in the project
# For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings
encoding: "utf-8"
# line ending convention to use when writing source files.
# Possible values: unset (use global setting), "lf", "crlf", or "native" (platform default)
# This does not affect Serena's own files (e.g. memories and configuration files), which always use native line endings.
line_ending:
# The language backend to use for this project.
# If not set, the global setting from serena_config.yml is used.
# Valid values: LSP, JetBrains
# Note: the backend is fixed at startup. If a project with a different backend
# is activated post-init, an error will be returned.
language_backend:
# whether to use project's .gitignore files to ignore files
ignore_all_files_in_gitignore: true
# advanced configuration option allowing to configure language server-specific options.
# Maps the language key to the options.
# Have a look at the docstring of the constructors of the LS implementations within solidlsp (e.g., for C# or PHP) to see which options are available.
# No documentation on options means no options are available.
ls_specific_settings: {}
# list of additional paths to ignore in this project.
# Same syntax as gitignore, so you can use * and **.
# Note: global ignored_paths from serena_config.yml are also applied additively.
ignored_paths: []
# whether the project is in read-only mode
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
# Added on 2025-04-18
read_only: false
# list of tool names to exclude.
# This extends the existing exclusions (e.g. from the global configuration)
#
# Below is the complete list of tools for convenience.
# To make sure you have the latest list of tools, and to view their descriptions,
# execute `uv run scripts/print_tool_overview.py`.
#
# * `activate_project`: Activates a project based on the project name or path.
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
# * `create_text_file`: Creates/overwrites a file in the project directory.
# * `delete_memory`: Delete a memory file. Should only happen if a user asks for it explicitly,
# for example by saying that the information retrieved from a memory file is no longer correct
# or no longer relevant for the project.
# * `edit_memory`: Replaces content matching a regular expression in a memory.
# * `execute_shell_command`: Executes a shell command.
# * `find_file`: Finds files in the given relative paths
# * `find_referencing_symbols`: Finds symbols that reference the given symbol using the language server backend
# * `find_symbol`: Performs a global (or local) search using the language server backend.
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
# * `initial_instructions`: Provides instructions Serena usage (i.e. the 'Serena Instructions Manual')
# for clients that do not read the initial instructions when the MCP server is connected.
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
# * `list_memories`: List available memories. Any memory can be read using the `read_memory` tool.
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
# * `read_file`: Reads a file within the project directory.
# * `read_memory`: Read the content of a memory file. This tool should only be used if the information
# is relevant to the current task. You can infer whether the information
# is relevant from the memory file name.
# You should not read the same memory file multiple times in the same conversation.
# * `rename_memory`: Renames or moves a memory. Moving between project and global scope is supported
# (e.g., renaming "global/foo" to "bar" moves it from global to project scope).
# * `rename_symbol`: Renames a symbol throughout the codebase using language server refactoring capabilities.
# For JB, we use a separate tool.
# * `replace_content`: Replaces content in a file (optionally using regular expressions).
# * `replace_symbol_body`: Replaces the full definition of a symbol using the language server backend.
# * `safe_delete_symbol`:
# * `search_for_pattern`: Performs a search for a pattern in the project.
# * `write_memory`: Write some information (utf-8-encoded) about this project that can be useful for future tasks to a memory in md format.
# The memory name should be meaningful.
excluded_tools: []
# list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default).
# This extends the existing inclusions (e.g. from the global configuration).
included_optional_tools: []
# fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools.
# This cannot be combined with non-empty excluded_tools or included_optional_tools.
fixed_tools: []
# list of mode names to that are always to be included in the set of active modes
# The full set of modes to be activated is base_modes + default_modes.
# If the setting is undefined, the base_modes from the global configuration (serena_config.yml) apply.
# Otherwise, this setting overrides the global configuration.
# Set this to [] to disable base modes for this project.
# Set this to a list of mode names to always include the respective modes for this project.
base_modes:
# list of mode names that are to be activated by default.
# The full set of modes to be activated is base_modes + default_modes.
# If the setting is undefined, the default_modes from the global configuration (serena_config.yml) apply.
# Otherwise, this overrides the setting from the global configuration (serena_config.yml).
# This setting can, in turn, be overridden by CLI parameters (--mode).
default_modes:
# initial prompt for the project. It will always be given to the LLM upon activating the project
# (contrary to the memories, which are loaded on demand).
initial_prompt: ""
# time budget (seconds) per tool call for the retrieval of additional symbol information
# such as docstrings or parameter information.
# This overrides the corresponding setting in the global configuration; see the documentation there.
# If null or missing, use the setting from the global configuration.
symbol_info_budget:
# list of regex patterns which, when matched, mark a memory entry as readonly.
# Extends the list from the global configuration, merging the two lists.
read_only_memory_patterns: []
# list of regex patterns for memories to completely ignore.
# Matching memories will not appear in list_memories or activate_project output
# and cannot be accessed via read_memory or write_memory.
# To access ignored memory files, use the read_file tool on the raw file path.
# Extends the list from the global configuration, merging the two lists.
# Example: ["_archive/.*", "_episodes/.*"]
ignored_memory_patterns: []

View File

@@ -23,11 +23,162 @@
},
"Admin": {
"controller": {
"BoxController.php": {
"type": "-",
"size": 4461,
"lmtime": 0,
"modified": false
},
"CalcController.php": {
"type": "-",
"size": 9144,
"lmtime": 1777037268858,
"modified": false
},
"CalcController.php.bak": {
"type": "-",
"size": 8801,
"lmtime": 0,
"modified": false
},
"ConfigController.php": {
"type": "-",
"size": 12033,
"lmtime": 0,
"modified": false
},
"DemoController.php": {
"type": "-",
"size": 7187,
"lmtime": 0,
"modified": false
},
"DictionaryController.php": {
"type": "-",
"size": 3663,
"lmtime": 1777064574258,
"modified": false
},
"FileController.php": {
"type": "-",
"size": 16244,
"lmtime": 0,
"modified": false
},
"HomeController.php": {
"type": "-",
"size": 6453,
"lmtime": 0,
"modified": false
},
"HomeSiteController.php": {
"type": "-",
"size": 19136,
"lmtime": 0,
"modified": false
},
"HomeSiteController.php.bak": {
"type": "-",
"size": 18589,
"lmtime": 0,
"modified": false
},
"ImageController.php": {
"type": "-",
"size": 12271,
"lmtime": 0,
"modified": false
},
"IndexController.php": {
"type": "-",
"size": 3722,
"lmtime": 0,
"modified": false
},
"LoginController.php": {
"type": "-",
"size": 1458,
"lmtime": 0,
"modified": false
},
"MailingController.php": {
"type": "-",
"size": 5937,
"lmtime": 0,
"modified": false
},
"MainSiteController.php": {
"type": "-",
"size": 43994,
"lmtime": 0,
"modified": false
},
"ProductAttributeController.php": {
"type": "-",
"size": 23149,
"lmtime": 0,
"modified": false
},
"ProductCategoryController.php": {
"type": "-",
"size": 23278,
"lmtime": 0,
"modified": false
},
"ProductController.php": {
"type": "-",
"size": 76725,
"lmtime": 0,
"modified": false
},
"ProductSeriesController.php": {
"type": "-",
"size": 10413,
"lmtime": 0,
"modified": false
},
"ProductSpecController.php": {
"type": "-",
"size": 11598,
"lmtime": 0,
"modified": false
},
"SetupController.php": {
"type": "-",
"size": 4365,
"lmtime": 1777064574259,
"modified": false
},
"SharedController.php": {
"type": "-",
"size": 5405,
"lmtime": 0,
"modified": false
},
"SimpleArticle": {},
"StructureController.php": {
"type": "-",
"size": 119939,
"lmtime": 0,
"modified": false
},
"UploaderController.php": {
"type": "-",
"size": 1378,
"lmtime": 0,
"modified": false
},
"UserController.php": {
"type": "-",
"size": 22192,
"lmtime": 0,
"modified": false
},
"FormSettingsController.php": {
"type": "-",
"size": 1846,
"lmtime": 1777064574255,
"modified": false
}
},
"template": {
@@ -75,6 +226,33 @@
"lmtime": 0,
"modified": false
}
},
"Config": {},
"Dictionary": {},
"File": {},
"Home": {},
"HomeSite": {},
"Image": {},
"Index": {},
"Login": {},
"Mailing": {},
"MainSite": {},
"Product": {},
"ProductAttribute": {},
"ProductCategory": {},
"Setup": {},
"Shared": {},
"SimpleArticle": {},
"Structure": {},
"Uploader": {},
"User": {},
"FormSettings": {
"Index.tpl": {
"type": "-",
"size": 2989,
"lmtime": 1777064574257,
"modified": false
}
}
}
}
@@ -97,8 +275,8 @@
},
"IndexController.php": {
"type": "-",
"size": 24230,
"lmtime": 1777037695974,
"size": 25237,
"lmtime": 1777064597088,
"modified": false
},
"ProductController.php": {
@@ -143,6 +321,266 @@
"lmtime": 1777036966083,
"modified": false
}
},
"class": {
"Config.class.php": {
"type": "-",
"size": 1827,
"lmtime": 0,
"modified": false
},
"Controller.class.php": {
"type": "-",
"size": 21781,
"lmtime": 0,
"modified": false
},
"ControllerDataExchange.class.php": {
"type": "-",
"size": 1008,
"lmtime": 0,
"modified": false
},
"ControllerInterface.class.php": {
"type": "-",
"size": 370,
"lmtime": 0,
"modified": false
},
"DB.class.php": {
"type": "-",
"size": 16466,
"lmtime": 0,
"modified": false
},
"Daemon.class.php": {
"type": "-",
"size": 9137,
"lmtime": 0,
"modified": false
},
"DaemonTask.class.php": {
"type": "-",
"size": 1241,
"lmtime": 0,
"modified": false
},
"DalData.class.php": {
"type": "-",
"size": 5326,
"lmtime": 0,
"modified": false
},
"DataObject.class.php": {
"type": "-",
"size": 4893,
"lmtime": 0,
"modified": false
},
"DbCache.class.php": {
"type": "-",
"size": 1007,
"lmtime": 0,
"modified": false
},
"DbSqlLite.class.php": {
"type": "-",
"size": 11806,
"lmtime": 0,
"modified": false
},
"Dictionary.class.php": {
"type": "-",
"size": 2013,
"lmtime": 0,
"modified": false
},
"Enviroment.class.php": {
"type": "-",
"size": 608,
"lmtime": 0,
"modified": false
},
"Exception.class.php": {
"type": "-",
"size": 2913,
"lmtime": 0,
"modified": false
},
"FileGenerator.class.php": {
"type": "-",
"size": 1050,
"lmtime": 0,
"modified": false
},
"FrontController.class.php": {
"type": "-",
"size": 17576,
"lmtime": 0,
"modified": false
},
"HtmlButton.class.php": {
"type": "-",
"size": 387,
"lmtime": 0,
"modified": false
},
"HtmlElement.class.php": {
"type": "-",
"size": 428,
"lmtime": 0,
"modified": false
},
"IDefaultDAL.class.php": {
"type": "-",
"size": 651,
"lmtime": 0,
"modified": false
},
"MFLog.class.php": {
"type": "-",
"size": 4611,
"lmtime": 0,
"modified": false
},
"Mailer.class.php": {
"type": "-",
"size": 2165,
"lmtime": 0,
"modified": false
},
"MainController.class.php": {
"type": "-",
"size": 14596,
"lmtime": 0,
"modified": false
},
"MfCurl.class.php": {
"type": "-",
"size": 5308,
"lmtime": 0,
"modified": false
},
"MfMemcache.class.php": {
"type": "-",
"size": 1573,
"lmtime": 0,
"modified": false
},
"MfXmlParser.class.php": {
"type": "-",
"size": 713,
"lmtime": 0,
"modified": false
},
"ModuleController.class.php": {
"type": "-",
"size": 3393,
"lmtime": 0,
"modified": false
},
"PHPMailer.class.php": {
"type": "-",
"size": 47048,
"lmtime": 0,
"modified": false
},
"Profiler.class.php": {
"type": "-",
"size": 5137,
"lmtime": 0,
"modified": false
},
"QueryCache.class.php": {
"type": "-",
"size": 1618,
"lmtime": 0,
"modified": false
},
"RegistrationFormSettings.class.php": {
"type": "-",
"size": 8389,
"lmtime": 1777064629582,
"modified": false
},
"Registry.class.php": {
"type": "-",
"size": 1761,
"lmtime": 0,
"modified": false
},
"Request.class.php": {
"type": "-",
"size": 9588,
"lmtime": 0,
"modified": false
},
"RestRequest.class.php": {
"type": "-",
"size": 2868,
"lmtime": 0,
"modified": false
},
"Router.class.php": {
"type": "-",
"size": 27521,
"lmtime": 0,
"modified": false
},
"Router.class.php.bak": {
"type": "-",
"size": 28997,
"lmtime": 0,
"modified": false
},
"SQL.class.php": {
"type": "-",
"size": 4384,
"lmtime": 0,
"modified": false
},
"SessionProxy.class.php": {
"type": "-",
"size": 2725,
"lmtime": 0,
"modified": false
},
"TemplateMaster.class.php": {
"type": "-",
"size": 5854,
"lmtime": 0,
"modified": false
},
"UserValidator.class.php": {
"type": "-",
"size": 2349,
"lmtime": 0,
"modified": false
},
"Utils.class.php": {
"type": "-",
"size": 37608,
"lmtime": 0,
"modified": false
},
"UtilsUtf.class.php": {
"type": "-",
"size": 3530,
"lmtime": 0,
"modified": false
},
"Validator.class.php": {
"type": "-",
"size": 21554,
"lmtime": 0,
"modified": false
},
"Xml2Array.class.php": {
"type": "-",
"size": 4092,
"lmtime": 0,
"modified": false
}
}
},
"error.html": {
@@ -207,8 +645,8 @@
},
"Index.tpl": {
"type": "-",
"size": 28715,
"lmtime": 1777058498780,
"size": 28721,
"lmtime": 1777064948255,
"modified": false
},
"Index.tpl.bak": {
@@ -305,6 +743,18 @@
"size": 3804,
"lmtime": 1777038005276,
"modified": false
},
"2026-04-24-registration-form-settings.sql": {
"type": "-",
"size": 1305,
"lmtime": 1777064472197,
"modified": false
},
"apply-2026-04-24-registration-form-settings.php": {
"type": "-",
"size": 3963,
"lmtime": 1777064472197,
"modified": false
}
}
},
@@ -418,9 +868,9 @@
"nowe": {},
"okonferencji.html": {
"type": "-",
"size": 11546,
"size": 11604,
"lmtime": 0,
"modified": false
"modified": true
},
"pliki": {},
"program.html": {

View File

@@ -247,7 +247,7 @@ class CalcController extends MainController implements ControllerInterface {
$dalData = MfParticipantDAL::GetDalDataObj();
$dalData->addCondition('location', $location);
//$dalData->setSortBy();
$dalData->setSortBy('id_mf_participant DESC');
$arrayObjReg = MfParticipantDAL::GetResult($dalData);
//Utils::ArrayDisplay($arrayObjReg);

View File

@@ -52,7 +52,8 @@
Ulica i numer: {$obj->getAddress()}</br>
Kod pocztowy: {$obj->getPostCode()}</br>
Miejscowość: {$obj->getCity()}</br>
NIP Instytucji: {$obj->getNip()}</br></td>
NIP Instytucji: {$obj->getNip()}</br>
Dodatkowe informacje: {$obj->getAdditionalInfo()}</br></td>
<td>Referat: {$obj->getReferat()|replace:1:$registrationYes|replace:0:$registrationNo|replace:2:$registrationNo}</br>
Poster: {$obj->getPoster()|replace:1:$registrationYes|replace:0:$registrationNo|replace:2:$registrationNo}
<p>{'registration_topic'|translate}: {$obj->getMessage()|default:$registrationMissing}</p>

Binary file not shown.

View File

@@ -161,6 +161,7 @@ class IndexController extends MainController implements ControllerInterface {
$objParticipant->setPostCode(Request::GetPost('post_code'));
$objParticipant->setCity(Request::GetPost('city'));
$objParticipant->setNip(Request::GetPost('nip'));
$objParticipant->setAdditionalInfo(Request::GetPost('additional_info'));
$objParticipant->setReferat(Request::GetPost('referat'));
$objParticipant->setPoster(Request::GetPost('poster'));
$objParticipant->setMessage(Request::GetPost('message'));

View File

@@ -45,6 +45,7 @@ class MfParticipant extends DataObject{
'autor' => 'autor',
'name' => 'name',
'nip' => 'nip',
'additional_info' => 'additionalInfo',
'phone' => 'phone',
'position' => 'position',
'post_code' => 'postCode',
@@ -89,6 +90,7 @@ class MfParticipant extends DataObject{
private $autor;
private $name;
private $nip;
private $additionalInfo;
private $phone;
private $position;
private $postCode;
@@ -314,7 +316,15 @@ class MfParticipant extends DataObject{
$this->nip = $nip;
}
public function getAdditionalInfo(){
return $this->additionalInfo;
}
public function setAdditionalInfo($additionalInfo){
$this->additionalInfo = $additionalInfo;
}
public function getPhone(){
return $this->phone;
}

View File

@@ -0,0 +1 @@
ALTER TABLE `mf_participant` ADD COLUMN `additional_info` TEXT NULL DEFAULT NULL AFTER `nip`;

View File

@@ -0,0 +1,99 @@
<?php
/**
* One-off migration: adds additional_info column to mf_participant.
*
* Usage:
* - Browser: /_rejestracja/sql/apply-2026-04-27-additional-info-field.php?run=20260427
* - CLI: php apply-2026-04-27-additional-info-field.php --run
*
* Remove this file from the server after a successful production run.
*/
ini_set('display_errors', 1);
error_reporting(E_ALL);
$isCli = PHP_SAPI === 'cli';
$approved = $isCli
? in_array('--run', $argv, true)
: (isset($_GET['run']) && $_GET['run'] === '20260427');
header_safe('Content-Type: text/plain; charset=utf-8');
if (!$approved) {
echo "DRY RUN ONLY\n";
echo "To apply migration, run with ?run=20260427 in browser or --run in CLI.\n";
echo "No database changes were made.\n";
exit;
}
$configPath = __DIR__ . '/../core/config/Strona/db.config.ini';
if (!is_file($configPath)) {
fail("Config file not found: " . $configPath);
}
$config = parse_ini_file($configPath, true);
if (!isset($config['db'])) {
fail("Missing [db] section in config.");
}
$dbConfig = $config['db'];
foreach (array('prodHost', 'prodUser', 'prodPass', 'prodDb') as $key) {
if (!array_key_exists($key, $dbConfig)) {
fail("Missing db config key: " . $key);
}
}
$mysqli = new mysqli(
$dbConfig['prodHost'],
$dbConfig['prodUser'],
$dbConfig['prodPass'],
$dbConfig['prodDb']
);
if ($mysqli->connect_errno) {
fail("MySQL connection failed: " . $mysqli->connect_error);
}
$mysqli->set_charset('utf8');
echo "Checking mf_participant.additional_info column...\n";
$result = $mysqli->query(
"SELECT COUNT(*) AS cnt
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'mf_participant'
AND COLUMN_NAME = 'additional_info'"
);
if (!$result) {
fail("INFORMATION_SCHEMA query failed: " . $mysqli->error);
}
$row = $result->fetch_assoc();
if ((int)$row['cnt'] > 0) {
echo "Column additional_info already exists. Nothing to do.\n";
$mysqli->close();
exit;
}
if (!$mysqli->query("ALTER TABLE `mf_participant` ADD COLUMN `additional_info` TEXT NULL DEFAULT NULL AFTER `nip`")) {
fail("ALTER TABLE failed: " . $mysqli->error);
}
echo "Column additional_info added successfully.\n";
$mysqli->close();
function fail($message) {
echo "ERROR: " . $message . "\n";
exit(1);
}
function header_safe($header) {
if (!headers_sent() && PHP_SAPI !== 'cli') {
header($header);
}
}
?>

View File

@@ -74,9 +74,15 @@
<div class="label">{translate word='NIP Instytucji'}:</div>
<div class="value">
{formField name="nip" type="text" errorClass="warning"}
<div style="font-size: 11px; line-height: 1.3; margin-top: 4px;">{translate word='Do wypełnienia w przypadku posiadania identyfikatora wewnętrznego w KSEF i prośba o podanie KSeF ID wew.'}</div>
</div>
</div>
</div>
<div class="entry">
<div class="label">Dodatkowe informacje:</div>
<div class="value">
<div style="font-size: 11px; line-height: 1.3; margin-bottom: 4px;">{translate word='Do wypełnienia w przypadku posiadania identyfikatora wewnętrznego w KSEF i prośba o podanie KSeF ID wew.'}</div>
<textarea name="additional_info" rows="3" style="width:100%; box-sizing:border-box;">{if isset($smarty.post.additional_info)}{$smarty.post.additional_info|escape}{/if}</textarea>
</div>
</div>
<div class="cb"></div>
<div class="entry">
<div class="label">{translate word='registration_submit_talk'}</div>

View File

@@ -38,6 +38,7 @@
Kod pocztowy: {$objParticipant->getPostCode()|default:$registrationMissing}<br>
Miejscowość: {$objParticipant->getCity()|default:$registrationMissing}<br>
NIP Instytucji: {$objParticipant->getNip()|default:$registrationMissing}<br>
Dodatkowe informacje: {$objParticipant->getAdditionalInfo()|default:$registrationMissing}<br>
</div>
</div>

View File

@@ -30,6 +30,7 @@
Kod pocztowy: {$objParticipant->getPostCode()|default:'brak'}<br>
Miejscowość: {$objParticipant->getCity()|default:'brak'}<br>
NIP Instytucji: {$objParticipant->getNip()|default:'brak'}<br>
Dodatkowe informacje: {$objParticipant->getAdditionalInfo()|default:'brak'}<br>
</div>
</div>

View File

@@ -73,7 +73,14 @@
<div class="entry">
<div class="label">{translate word='NIP Instytucji'}:</div>
<div class="value">{formField name="nip" type="text" errorClass="warning"}</div>
</div>
</div>
<div class="entry">
<div class="label">Dodatkowe informacje:</div>
<div class="value">
<div style="font-size: 11px; line-height: 1.3; margin-bottom: 4px;">{translate word='Do wypełnienia w przypadku posiadania identyfikatora wewnętrznego w KSEF i prośba o podanie KSeF ID wew.'}</div>
<textarea name="additional_info" rows="3" style="width:100%; box-sizing:border-box;">{if isset($smarty.post.additional_info)}{$smarty.post.additional_info|escape}{/if}</textarea>
</div>
</div>
<div class="cb"></div>
<div class="entry">
<div class="label">Zgłaszam referat</div>