From d274d5988ca257a79e06be0e1fe7fdc9336e45cb Mon Sep 17 00:00:00 2001 From: Linus Maximilian Nilson Date: Fri, 30 Jan 2026 14:51:36 +0000 Subject: [PATCH 1/3] Update konficastle-workshopwahl.php --- konficastle-workshopwahl.php | 134 +++++++++++++++++------------------ 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/konficastle-workshopwahl.php b/konficastle-workshopwahl.php index 8e71ad4..4a3b691 100644 --- a/konficastle-workshopwahl.php +++ b/konficastle-workshopwahl.php @@ -1,68 +1,68 @@ - Date: Fri, 30 Jan 2026 16:36:41 +0100 Subject: [PATCH 2/3] update README --- .github/copilot-instructions.production.md | 37 +++++++++++++++++ README.md | 48 ++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 .github/copilot-instructions.production.md diff --git a/.github/copilot-instructions.production.md b/.github/copilot-instructions.production.md new file mode 100644 index 0000000..fff5999 --- /dev/null +++ b/.github/copilot-instructions.production.md @@ -0,0 +1,37 @@ +# Copilot Instructions for Workshop-Wahlen (Production) + +## Project Overview + +This WordPress plugin manages workshop elections for Konfi-Castle events. It provides an admin backend (elections, workshops, participants, teamers, assignments) and a participant frontend. + +## Architecture & Components +- **Main file:** `konficastle-workshopwahl.php` – Initializes hooks, loads assets, admin menus. +- **Backend:** + - `includes/` with modules for elections, workshops, participants, teamers, assignments, data management, force assignment + - Core assignment logic: `includes/zuteilungslogik.php` +- **Frontend:** + - Shortcodes: `[konficastle_workshopwahl wahl=ID]`, `[konficastle_workshop_ergebnis wahl=ID]` +- **Database:** Tables are created via `install.php`, prefix: `kc_` + +## Key Patterns & Workflows +- **Admin tabs:** Navigation via `kc_admin_tabs()` +- **Naming:** Functions and tables use `kc_` prefix +- **Force assignments:** Manual assignments take precedence +- **Test data:** Only user ID 1 can generate via admin (`admin-data.php`) +- **CSV export:** Possible via admin assignments +- **Teamer password:** Managed via admin, hash in WP options + +## Examples & Entry Points +- **Admin menu:** `konficastle-workshopwahl.php`, `includes/admin-wahlen.php` +- **Assignment logic:** `includes/zuteilungslogik.php` +- **Frontend form:** `includes/frontend-form.php` + +## Notes for AI Agents +- Always use `$wpdb->prefix` for DB tables +- Backend logic is modular, each entity has its own file +- No complex JS logic in frontend, validation is server-side +- For changes to assignment logic: use test scenarios via test data admin page + +--- + +See README.md for further details. \ No newline at end of file diff --git a/README.md b/README.md index 78379fd..157bba0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,50 @@ # Workshop-Wahlen +## Überblick + +Dieses WordPress-Plugin ermöglicht die Verwaltung und Durchführung von Workshop-Wahlen für Konfi-Castle-Events. Es bietet ein vollständiges Backend für Admins (Wahlen, Workshops, Teilnehmer, Teamer, Zuteilungen) und ein Frontend-Formular für Teilnehmer. + +## Architektur & Hauptkomponenten + +- **Haupt-Plugin-Datei:** `konficastle-workshopwahl.php` – Registriert Hooks, lädt Assets, initialisiert Admin-Menüs. +- **Backend-Module (im `includes/`-Verzeichnis):** + - `admin-wahlen.php`, `admin-workshops.php`, `admin-teilnehmer.php`, `admin-teamer.php`, `admin-zuteilungen.php`, `admin-data.php`, `force-zuteilung.php`: Jeweils eigene Admin-Seiten für die Verwaltung der zugehörigen Entitäten. + - `zuteilungslogik.php`: Kernlogik für die automatische Zuteilung von Teilnehmern zu Workshops (inkl. Force-Zuteilungen und Kapazitätsprüfung). +- **Frontend:** + - `frontend-form.php`: Shortcode `[konficastle_workshopwahl wahl=ID]` für das Teilnehmer-Formular. + - `frontend-ergebnis.php`: Shortcode `[konficastle_workshop_ergebnis wahl=ID]` für Ergebnisanzeige. +- **Styles & Assets:** + - `assets/`: Enthält CSS für Admin und Frontend. + +## Datenbank & Installation + +- Tabellen werden über `install.php` beim Aktivieren angelegt (z.B. `kc_wahlen`, `kc_workshops`, `kc_teilnehmer`, `kc_zuteilung`, ...). +- Tabellenpräfix wird dynamisch über `$wpdb->prefix` verwendet. + +## Entwickler-Workflows + +- **Testdaten:** Über die Admin-Seite "Datenverwaltung" (`admin-data.php`) können Testdaten generiert werden (nur User ID 1). +- **CSV-Export:** Zuteilungen können über die Admin-Seite exportiert werden (`admin-zuteilungen.php`). +- **Zuteilungslogik:** Anpassungen an der Kernlogik erfolgen in `zuteilungslogik.php`. +- **Shortcodes:** + - `[konficastle_workshopwahl wahl=ID]` – Teilnehmer-Frontend + - `[konficastle_workshop_ergebnis wahl=ID]` – Ergebnisanzeige + +## Besondere Konventionen & Hinweise + +- **Namensschema:** Alle Plugin-Funktionen und Tabellen sind mit `kc_` (Konfi-Castle) prefixiert. +- **Admin-Tabs:** Navigation zwischen Admin-Seiten über `kc_admin_tabs()`. +- **Force-Zuteilungen:** Manuelle Zuweisungen haben Vorrang vor automatischer Logik. +- **Teamer-Passwort:** Verwaltung über eigene Admin-Seite, Passwort-Hash in WP-Optionen. +- **Frontend-Validierung:** Erfolgt serverseitig, keine komplexe JS-Logik im Frontend. + +## Einstiegspunkte & Beispiele + +- **Admin-Menüstruktur:** Siehe `konficastle-workshopwahl.php` und `includes/admin-wahlen.php`. +- **Zuteilungslogik:** Siehe `includes/zuteilungslogik.php` (Funktionen wie `kc_run_zuteilung`). +- **Frontend-Formular:** Siehe `includes/frontend-form.php` (Shortcode-Handler). + +--- + +Für Detailfragen zu Datenbankstruktur, Shortcodes oder Zuteilungslogik siehe die jeweiligen Dateien im `includes/`-Verzeichnis. + From 0375602e69018bff87bcd898841036bafbb17a5c Mon Sep 17 00:00:00 2001 From: Linus Maximilian Nilson Date: Fri, 30 Jan 2026 16:28:39 +0000 Subject: [PATCH 3/3] Delete .github/copilot-instructions.production.md --- .github/copilot-instructions.production.md | 37 ---------------------- 1 file changed, 37 deletions(-) delete mode 100644 .github/copilot-instructions.production.md diff --git a/.github/copilot-instructions.production.md b/.github/copilot-instructions.production.md deleted file mode 100644 index fff5999..0000000 --- a/.github/copilot-instructions.production.md +++ /dev/null @@ -1,37 +0,0 @@ -# Copilot Instructions for Workshop-Wahlen (Production) - -## Project Overview - -This WordPress plugin manages workshop elections for Konfi-Castle events. It provides an admin backend (elections, workshops, participants, teamers, assignments) and a participant frontend. - -## Architecture & Components -- **Main file:** `konficastle-workshopwahl.php` – Initializes hooks, loads assets, admin menus. -- **Backend:** - - `includes/` with modules for elections, workshops, participants, teamers, assignments, data management, force assignment - - Core assignment logic: `includes/zuteilungslogik.php` -- **Frontend:** - - Shortcodes: `[konficastle_workshopwahl wahl=ID]`, `[konficastle_workshop_ergebnis wahl=ID]` -- **Database:** Tables are created via `install.php`, prefix: `kc_` - -## Key Patterns & Workflows -- **Admin tabs:** Navigation via `kc_admin_tabs()` -- **Naming:** Functions and tables use `kc_` prefix -- **Force assignments:** Manual assignments take precedence -- **Test data:** Only user ID 1 can generate via admin (`admin-data.php`) -- **CSV export:** Possible via admin assignments -- **Teamer password:** Managed via admin, hash in WP options - -## Examples & Entry Points -- **Admin menu:** `konficastle-workshopwahl.php`, `includes/admin-wahlen.php` -- **Assignment logic:** `includes/zuteilungslogik.php` -- **Frontend form:** `includes/frontend-form.php` - -## Notes for AI Agents -- Always use `$wpdb->prefix` for DB tables -- Backend logic is modular, each entity has its own file -- No complex JS logic in frontend, validation is server-side -- For changes to assignment logic: use test scenarios via test data admin page - ---- - -See README.md for further details. \ No newline at end of file