From 3782ef7282bcbf3b397d2c7522d3cff7f19ca46a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20G=C3=BCnther?=
Date: Fri, 31 May 2024 20:13:27 +0200
Subject: [PATCH] Store organisator email
---
lib/database/kompass_veranstaltungen_index.sql | 1 +
.../event-participants/Controllers/class-createevent.php | 2 +-
.../event-participants/Controllers/class-updateevent.php | 2 +-
modules/event-participants/Models/class-event.php | 2 --
modules/event-participants/Views/event-edit-form.php | 8 ++++++++
5 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/lib/database/kompass_veranstaltungen_index.sql b/lib/database/kompass_veranstaltungen_index.sql
index e685e0f..4472be5 100644
--- a/lib/database/kompass_veranstaltungen_index.sql
+++ b/lib/database/kompass_veranstaltungen_index.sql
@@ -4,6 +4,7 @@ START TRANSACTION;
CREATE TABLE `%tablename%` (
`id` int NOT NULL AUTO_INCREMENT,
`event_name` varchar(1024) NOT NULL,
+ `event_email` varchar(1024) NOT NULL,
`archived` tinyint NOT NULL DEFAULT '0',
`signup_allowed` tinyint NOT NULL DEFAULT '0',
`startdatum` date DEFAULT NULL,
diff --git a/modules/event-participants/Controllers/class-createevent.php b/modules/event-participants/Controllers/class-createevent.php
index 9dbaa00..2c66eee 100644
--- a/modules/event-participants/Controllers/class-createevent.php
+++ b/modules/event-participants/Controllers/class-createevent.php
@@ -8,7 +8,7 @@ class CreateEvent {
public function __construct() {
global $_POST, $_REQUEST, $dbHandler;
- $use_data = ['event_name', 'startdatum', 'enddatum','max_participants', 'max_volunteers', 'amount_reduced', 'amount_default', 'amount_social', 'contributing_tribes'];
+ $use_data = ['event_name', 'event_email', 'startdatum', 'enddatum','max_participants', 'max_volunteers', 'amount_reduced', 'amount_default', 'amount_social', 'contributing_tribes'];
$post_data = [];
foreach ($_POST as $key => $value) {
if (in_array($key, $use_data)) {
diff --git a/modules/event-participants/Controllers/class-updateevent.php b/modules/event-participants/Controllers/class-updateevent.php
index a3c8b9e..5e660e8 100644
--- a/modules/event-participants/Controllers/class-updateevent.php
+++ b/modules/event-participants/Controllers/class-updateevent.php
@@ -8,7 +8,7 @@ class UpdateEvent {
public function __construct() {
global $_POST, $_REQUEST, $dbHandler;
- $use_data = ['event_name', 'startdatum', 'enddatum','max_participants', 'max_volunteers', 'amount_reduced', 'amount_default', 'amount_social', 'contributing_tribes'];
+ $use_data = ['event_name', 'event_email', 'startdatum', 'enddatum','max_participants', 'max_volunteers', 'amount_reduced', 'amount_default', 'amount_social', 'contributing_tribes'];
$post_data = [];
foreach ($_POST as $key => $value) {
if (in_array($key, $use_data)) {
diff --git a/modules/event-participants/Models/class-event.php b/modules/event-participants/Models/class-event.php
index 080804f..09b80d4 100644
--- a/modules/event-participants/Models/class-event.php
+++ b/modules/event-participants/Models/class-event.php
@@ -32,9 +32,7 @@ class Event extends CommonModel {
}
}
- #echo '';print_r($class);die();
return $class;
-
}
public function __construct() {
diff --git a/modules/event-participants/Views/event-edit-form.php b/modules/event-participants/Views/event-edit-form.php
index 8a09c33..4919398 100644
--- a/modules/event-participants/Views/event-edit-form.php
+++ b/modules/event-participants/Views/event-edit-form.php
@@ -31,6 +31,14 @@ function kompass_print_event_edit_form(?int $event_id = null)
'events_settings',
['setting' => 'event_name', 'style' => 'width: 1024px', 'value' => null !== $event ? $event->event_name : '']);
+ add_settings_field(
+ 'event_settings_1b',
+ __('Organisator E-Mail', BDP_LV_PLUGIN_SLUG),
+ 'kompass_print_textbox',
+ $events_settings,
+ 'events_settings',
+ ['setting' => 'event_email', 'style' => 'width: 1024px', 'value' => null !== $event ? $event->event_email : '']);
+
add_settings_field(
'event_settings_2',
__('Start date', BDP_LV_PLUGIN_SLUG),