Tabellen Spielorte, Teams um die Felder telefon, EMail, Ruhetage und Trainingstage erweitert.

This commit is contained in:
Jürgen Meyer
2026-01-22 11:31:27 +01:00
parent 8fed3c217f
commit ab6f776b96
6 changed files with 604 additions and 529 deletions
@@ -3915,6 +3915,9 @@ function adminEditSpielort(): void
$ortsname = $db->escape(trim($jInput->get('ortsname', '', 'RAW'))); $ortsname = $db->escape(trim($jInput->get('ortsname', '', 'RAW')));
$ortsteil = $db->escape(trim($jInput->get('ortsteil', '', 'RAW'))); $ortsteil = $db->escape(trim($jInput->get('ortsteil', '', 'RAW')));
$url = $db->escape(trim($jInput->get('url', '', 'RAW'))); $url = $db->escape(trim($jInput->get('url', '', 'RAW')));
$telefon = $db->escape(trim($jInput->get('telefon', '', 'RAW')));
$email = $db->escape(trim($jInput->get('email', '', 'RAW')));
$ruhetage = $db->escape(trim($jInput->get('ruhetage', '', 'RAW')));
$beschreibung = $db->escape(trim($jInput->get('beschreibung', '', 'RAW'))); $beschreibung = $db->escape(trim($jInput->get('beschreibung', '', 'RAW')));
$status = $jInput->get('status', 0, 'INT'); $status = $jInput->get('status', 0, 'INT');
@@ -3923,8 +3926,8 @@ function adminEditSpielort(): void
} }
if ($id == 0) { if ($id == 0) {
$query = "INSERT INTO #__sportsmanager_spielort (name, strasse, plz, ortsname, ortsteil, url, beschreibung, status)" $query = "INSERT INTO #__sportsmanager_spielort (name, strasse, plz, ortsname, ortsteil, url, telefon, email, ruhetage, beschreibung, status)"
. "\n VALUES ('$name', '$strasse', '$plz', '$ortsname', '$ortsteil', '$url', '$beschreibung', '$status');"; . "\n VALUES ('$name', '$strasse', '$plz', '$ortsname', '$ortsteil', '$url', '$telefon', '$email', '$ruhetage', '$beschreibung', '$status');";
$db->setQuery($query); $db->setQuery($query);
if (!$db->execute()) { if (!$db->execute()) {
die($db->stderr(true)); die($db->stderr(true));
@@ -3938,6 +3941,9 @@ function adminEditSpielort(): void
. "\n ortsname = '$ortsname'," . "\n ortsname = '$ortsname',"
. "\n ortsteil = '$ortsteil'," . "\n ortsteil = '$ortsteil',"
. "\n url = '$url'," . "\n url = '$url',"
. "\n telefon = '$telefon',"
. "\n email = '$email',"
. "\n ruhetage = '$ruhetage',"
. "\n beschreibung = '$beschreibung'," . "\n beschreibung = '$beschreibung',"
. "\n status = '$status'" . "\n status = '$status'"
. "\n WHERE spielort_id = $id"; . "\n WHERE spielort_id = $id";
@@ -7944,6 +7950,7 @@ function adminEditMannschaft(): void
$heimspiel_wochentag = $jInput->get('heimspiel_wochentag', 0, 'INT'); $heimspiel_wochentag = $jInput->get('heimspiel_wochentag', 0, 'INT');
$heimspiel_uhrzeit = sprintf("%02d%02d", $jInput->get('heimspiel_uhrzeit_stunden', 0, 'INT'), $jInput->get('heimspiel_uhrzeit_minuten', 0, 'INT')); $heimspiel_uhrzeit = sprintf("%02d%02d", $jInput->get('heimspiel_uhrzeit_stunden', 0, 'INT'), $jInput->get('heimspiel_uhrzeit_minuten', 0, 'INT'));
$heimspielort_id = $jInput->get('heimspielort_id', 0, 'INT'); $heimspielort_id = $jInput->get('heimspielort_id', 0, 'INT');
$trainingstage = $db->escape(trim($jInput->get('trainingstage', '', 'RAW')));
$nichtraucherschutz = $jInput->get('nichtraucherschutz', 0, 'INT'); $nichtraucherschutz = $jInput->get('nichtraucherschutz', 0, 'INT');
$zusatzpunkte = $jInput->get('zusatzpunkte', 0, 'FLOAT'); $zusatzpunkte = $jInput->get('zusatzpunkte', 0, 'FLOAT');
$bildbeibehalten = $jInput->get('bildbeibehalten', 0, 'INT'); $bildbeibehalten = $jInput->get('bildbeibehalten', 0, 'INT');
@@ -7970,8 +7977,8 @@ function adminEditMannschaft(): void
$veranstaltung = $rows[0]; $veranstaltung = $rows[0];
if ($id == 0) { if ($id == 0) {
$query = "INSERT INTO #__sportsmanager_team (verein_id, veranstaltung_id, teamname, teamname_kurz, tischtyp, tischeigenschaften, heimspiel_wochentag, heimspiel_uhrzeit, heimspielort_id, nichtraucherschutz, zusatzpunkte" . ($veranstaltung->tabellenwertung == -2 ? ", platz" : "") . ", pin)" $query = "INSERT INTO #__sportsmanager_team (verein_id, veranstaltung_id, teamname, teamname_kurz, tischtyp, tischeigenschaften, heimspiel_wochentag, heimspiel_uhrzeit, heimspielort_id, trainingstage, nichtraucherschutz, zusatzpunkte" . ($veranstaltung->tabellenwertung == -2 ? ", platz" : "") . ", pin)"
. "\n VALUES (" . ($verein_id != 0 ? "'$verein_id'" : "NULL") . ", '$veranstaltungId', '$teamname', '$teamname_kurz', '$tischtyp', '$tischeigenschaften', '$heimspiel_wochentag', '$heimspiel_uhrzeit', " . ($heimspielort_id != 0 ? "'$heimspielort_id'" : "NULL") . ", '$nichtraucherschutz', '$zusatzpunkte'" . ($veranstaltung->tabellenwertung == -2 ? ($platz != 0 ? ", '$platz'" : ", NULL") : "") . ", '$pin');"; . "\n VALUES (" . ($verein_id != 0 ? "'$verein_id'" : "NULL") . ", '$veranstaltungId', '$teamname', '$teamname_kurz', '$tischtyp', '$tischeigenschaften', '$heimspiel_wochentag', '$heimspiel_uhrzeit', " . ($heimspielort_id != 0 ? "'$heimspielort_id'" : "NULL") . ", '$trainingstage', '$nichtraucherschutz', '$zusatzpunkte'" . ($veranstaltung->tabellenwertung == -2 ? ($platz != 0 ? ", '$platz'" : ", NULL") : "") . ", '$pin');";
$db->setQuery($query); $db->setQuery($query);
if (!$db->execute()) { if (!$db->execute()) {
die($db->stderr(true)); die($db->stderr(true));
@@ -7999,6 +8006,7 @@ function adminEditMannschaft(): void
. "\n heimspiel_wochentag = '$heimspiel_wochentag'," . "\n heimspiel_wochentag = '$heimspiel_wochentag',"
. "\n heimspiel_uhrzeit = '$heimspiel_uhrzeit'," . "\n heimspiel_uhrzeit = '$heimspiel_uhrzeit',"
. "\n heimspielort_id = " . ($heimspielort_id != 0 ? "'$heimspielort_id'" : "NULL") . "," . "\n heimspielort_id = " . ($heimspielort_id != 0 ? "'$heimspielort_id'" : "NULL") . ","
. "\n trainingstage = '$trainingstage',"
. "\n nichtraucherschutz = '$nichtraucherschutz'," . "\n nichtraucherschutz = '$nichtraucherschutz',"
. ($veranstaltung->tabellenwertung == -2 ? ($platz != 0 ? "\n platz = '$platz'," : "\n platz = NULL,") : "") . ($veranstaltung->tabellenwertung == -2 ? ($platz != 0 ? "\n platz = '$platz'," : "\n platz = NULL,") : "")
. "\n zusatzpunkte = '$zusatzpunkte'," . "\n zusatzpunkte = '$zusatzpunkte',"
@@ -5541,6 +5541,33 @@ function updateDatabase(): void
} }
} }
if ($datenbank_version < 116) {
$query = "ALTER TABLE `#__sportsmanager_spielort`"
. "\n ADD IF NOT EXISTS `telefon` VARCHAR(64) NULL DEFAULT NULL AFTER `url`,"
. "\n ADD IF NOT EXISTS `email` VARCHAR(64) NULL DEFAULT NULL AFTER `telefon`,"
. "\n ADD IF NOT EXISTS `ruhetage` VARCHAR(64) NULL DEFAULT NULL AFTER `email`;";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
$query = "ALTER TABLE `#__sportsmanager_team`"
. "\n ADD IF NOT EXISTS `trainingstage` VARCHAR(64) NULL DEFAULT NULL AFTER `heimspielort_id`;";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
$query = "UPDATE #__sportsmanager_einstellungen"
. "\n SET wert = '116'"
. "\n WHERE name = 'datenbank_version'";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
}
if ($termin_aktionen_email_setzen) { if ($termin_aktionen_email_setzen) {
$query = "SELECT aktion_user_id, termin_aktion_id" $query = "SELECT aktion_user_id, termin_aktion_id"
. "\n FROM #__sportsmanager_termin_aktion"; . "\n FROM #__sportsmanager_termin_aktion";
@@ -4022,12 +4022,14 @@ class HTML_sportsmanager_admin
if (count($vereinsmitglieder) > 0) { if (count($vereinsmitglieder) > 0) {
?> ?>
<div class="uk-overflow-auto">
<table class="contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>"> <table class="contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
<tr class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>"> <tr class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>">
<th nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_LAST_NAME'); ?></strong></th> <th style="width: 200px; text-align: left;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_LAST_NAME'); ?></strong></th>
<th nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_FIRST_NAME'); ?> </strong></th> <th style="width: 200px; text-align: left;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_FIRST_NAME'); ?> </strong></th>
<th nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_FIRST_NAME'); ?></strong></th> <th style="width: 150px; text-align: left;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_PLAYER_NUMBER_SHORT'); ?></strong></th>
<th nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_MEMBER_STATUS'); ?></strong></th> <th style="width: 150px; text-align: left;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_STATUS'); ?></strong></th>
<th style="width: 100px;"></th>
</tr> </tr>
<?php <?php
@@ -4058,6 +4060,7 @@ class HTML_sportsmanager_admin
} }
?> ?>
</table> </table>
</div>
<?php <?php
} }
} }
@@ -4277,17 +4280,13 @@ class HTML_sportsmanager_admin
<form action="<?php echo SportsManagerURL(($row != null ? ('#id' . $row->spielort_id) : "")); ?>" method="post" <form action="<?php echo SportsManagerURL(($row != null ? ('#id' . $row->spielort_id) : "")); ?>" method="post"
name="adminForm" id="adminForm" enctype="multipart/form-data"> name="adminForm" id="adminForm" enctype="multipart/form-data">
<div class="uk-overflow-auto"> <div class="uk-overflow-auto">
<table class="uk-table" style="width: 100%"> <table style="width: 100%">
<tr>
<td nowrap style="width: 60%; vertical-align: top">
<div class="uk-overflow-auto">
<table class="uk-table" style="width: 100%">
<tr> <tr>
<td nowrap style="width: 20%; text-align: right"> <td nowrap style="width: 20%; text-align: right">
<label for="name"><?php echo Text::_('COM_SPORTSMANAGER_NAME'); ?>:</label> <label for="name"><?php echo Text::_('COM_SPORTSMANAGER_NAME'); ?>:</label>
</td> </td>
<td nowrap> <td nowrap>
<input class="inputbox" type="text" name="name" id="name" size="50" <input class="inputbox" type="text" name="name" id="name" size="64"
maxlength="50" maxlength="50"
value="<?php if ($row != null) echo htmlentities_utf8($row->name); ?>"/> value="<?php if ($row != null) echo htmlentities_utf8($row->name); ?>"/>
</td> </td>
@@ -4298,7 +4297,7 @@ class HTML_sportsmanager_admin
:</label> :</label>
</td> </td>
<td nowrap> <td nowrap>
<input class="inputbox" type="text" name="strasse" id="street" size="50" <input class="inputbox" type="text" name="strasse" id="street" size="64"
maxlength="30" maxlength="30"
value="<?php if ($row != null) if ($row->strasse != null) echo htmlentities_utf8($row->strasse); ?>"/> value="<?php if ($row != null) if ($row->strasse != null) echo htmlentities_utf8($row->strasse); ?>"/>
</td> </td>
@@ -4316,10 +4315,10 @@ class HTML_sportsmanager_admin
<input class="inputbox" type="text" name="plz" id="zip" size="5" <input class="inputbox" type="text" name="plz" id="zip" size="5"
maxlength="6" maxlength="6"
value="<?php if ($row != null) echo htmlentities_utf8($row->plz); ?>"/> value="<?php if ($row != null) echo htmlentities_utf8($row->plz); ?>"/>
<input class="inputbox" type="text" name="ortsname" id="location" size="28" <input class="inputbox" type="text" name="ortsname" id="location" size="27"
maxlength="30" maxlength="30"
value="<?php if ($row != null) echo htmlentities_utf8($row->ortsname); ?>"/> value="<?php if ($row != null) echo htmlentities_utf8($row->ortsname); ?>"/>
<input class="inputbox" type="text" name="ortsteil" id="district" size="21" <input class="inputbox" type="text" name="ortsteil" id="district" size="20"
maxlength="30" maxlength="30"
value="<?php if ($row != null) echo htmlentities_utf8($row->ortsteil); ?>"/> value="<?php if ($row != null) echo htmlentities_utf8($row->ortsteil); ?>"/>
</td> </td>
@@ -4330,11 +4329,44 @@ class HTML_sportsmanager_admin
:</label> :</label>
</td> </td>
<td nowrap> <td nowrap>
<input class="inputbox" type="text" name="url" id="url" size="50" <input class="inputbox" type="text" name="url" id="url" size="64"
maxlength="150" maxlength="150"
value="<?php if ($row != null) echo htmlentities_utf8($row->url); ?>"/> value="<?php if ($row != null) echo htmlentities_utf8($row->url); ?>"/>
</td> </td>
</tr> </tr>
<tr>
<td nowrap style="width: 20%; text-align: right">
<label for="phone"><?php echo Text::_('COM_SPORTSMANAGER_PHONE'); ?>
:</label>
</td>
<td nowrap>
<input class="inputbox" type="text" name="telefon" id="phone" size="64"
maxlength="64"
value="<?php if ($row != null) echo htmlentities_utf8($row->telefon); ?>"/>
</td>
</tr>
<tr>
<td nowrap style="width: 20%; text-align: right">
<label for="email"><?php echo Text::_('COM_SPORTSMANAGER_EMAIL'); ?>
:</label>
</td>
<td nowrap>
<input class="inputbox" type="text" name="email" id="email" size="64"
maxlength="64"
value="<?php if ($row != null) echo htmlentities_utf8($row->email); ?>"/>
</td>
</tr>
<tr>
<td nowrap style="width: 20%; text-align: right">
<label for="restdays"><?php echo Text::_('COM_SPORTSMANAGER_REST_DAYS'); ?>
:</label>
</td>
<td nowrap>
<input class="inputbox" type="text" name="ruhetage" id="restdays" size="64"
maxlength="64"
value="<?php if ($row != null) echo htmlentities_utf8($row->ruhetage); ?>"/>
</td>
</tr>
<tr> <tr>
<td nowrap style="width: 20%; text-align: right; vertical-align: top"> <td nowrap style="width: 20%; text-align: right; vertical-align: top">
<label <label
@@ -4342,7 +4374,7 @@ class HTML_sportsmanager_admin
:</label> :</label>
</td> </td>
<td nowrap> <td nowrap>
<textarea name="beschreibung" id="description" cols="50" <textarea name="beschreibung" id="description" cols="60"
rows="8"><?php if ($row != null) echo htmlentities_utf8($row->beschreibung); ?></textarea> rows="8"><?php if ($row != null) echo htmlentities_utf8($row->beschreibung); ?></textarea>
</td> </td>
</tr> </tr>
@@ -4369,10 +4401,6 @@ class HTML_sportsmanager_admin
</tr> </tr>
</table> </table>
</div> </div>
</td>
</tr>
</table>
</div>
<input type="submit" name="save" value="<?php echo Text::_('COM_SPORTSMANAGER_SAVE'); ?>" class="button"/> <input type="submit" name="save" value="<?php echo Text::_('COM_SPORTSMANAGER_SAVE'); ?>" class="button"/>
<input type="submit" name="cancel" value="<?php echo Text::_('COM_SPORTSMANAGER_CANCEL'); ?>" <input type="submit" name="cancel" value="<?php echo Text::_('COM_SPORTSMANAGER_CANCEL'); ?>"
@@ -8855,10 +8883,6 @@ class HTML_sportsmanager_admin
enctype="multipart/form-data"> enctype="multipart/form-data">
<div class="uk-overflow-auto"> <div class="uk-overflow-auto">
<table style="width: 100%;padding-top: 20px;"> <table style="width: 100%;padding-top: 20px;">
<tr>
<td nowrap style="width: 60%; vertical-align: top;">
<div class="uk-overflow-auto">
<table style="width: 100%;">
<tr> <tr>
<td nowrap style="width: 20%; text-align: right;"> <td nowrap style="width: 20%; text-align: right;">
<label for="team_name"><?php echo Text::_('COM_SPORTSMANAGER_TEAM_NAME'); ?> <label for="team_name"><?php echo Text::_('COM_SPORTSMANAGER_TEAM_NAME'); ?>
@@ -9019,6 +9043,18 @@ class HTML_sportsmanager_admin
</select> </select>
</td> </td>
</tr> </tr>
<tr>
<td nowrap style="width: 20%; text-align: right">
<label
for="trainingdays"><?php echo Text::_('COM_SPORTSMANAGER_TRAINING_DAYS'); ?>
:</label>
</td>
<td nowrap>
<input class="uk-select uk-form-width-medium" type="text" name="trainingstage" id="trainingdays"
size="50" maxlength="64" style="height: 34px; width: 370px;"
value="<?php if ($row != null) echo htmlentities_utf8($row->trainingstage); ?>"/>
</td>
</tr>
<tr> <tr>
<td nowrap style="width: 20%; text-align: right"> <td nowrap style="width: 20%; text-align: right">
<label <label
@@ -9281,10 +9317,6 @@ class HTML_sportsmanager_admin
</tr> </tr>
</table> </table>
</div> </div>
</td>
</tr>
</table>
</div>
<input type="submit" name="save" value="<?php echo Text::_('COM_SPORTSMANAGER_SAVE'); ?>" class="button"/> <input type="submit" name="save" value="<?php echo Text::_('COM_SPORTSMANAGER_SAVE'); ?>" class="button"/>
<input type="submit" name="cancel" value="<?php echo Text::_('COM_SPORTSMANAGER_CANCEL'); ?>" <input type="submit" name="cancel" value="<?php echo Text::_('COM_SPORTSMANAGER_CANCEL'); ?>"
@@ -1068,3 +1068,5 @@ COM_SPORTSMANAGER_MATCH_RESCHEDULING="Spielverlegung"
COM_SPORTSMANAGER_MATCH_SWAPPING_HELP="Bei Heimrechttausch gleichen Termin eintragen" COM_SPORTSMANAGER_MATCH_SWAPPING_HELP="Bei Heimrechttausch gleichen Termin eintragen"
COM_SPORTSMANAGER_NOT_VALID_TIME="Ung&uuml;ltige Uhrzeit" COM_SPORTSMANAGER_NOT_VALID_TIME="Ung&uuml;ltige Uhrzeit"
COM_SPORTSMANAGER_REALLY_MATCH_RESCHEDULING="Willst Du diesen Spielverlegung wirklich entfernen?" COM_SPORTSMANAGER_REALLY_MATCH_RESCHEDULING="Willst Du diesen Spielverlegung wirklich entfernen?"
COM_SPORTSMANAGER_REST_DAYS="Ruhetage"
COM_SPORTSMANAGER_TRAINING_DAYS="Trainingstage"
@@ -1068,3 +1068,5 @@ COM_SPORTSMANAGER_MATCH_RESCHEDULING="Match rescheduling"
COM_SPORTSMANAGER_MATCH_SWAPPING_HELP="If home advantage is swapped, enter the same date" COM_SPORTSMANAGER_MATCH_SWAPPING_HELP="If home advantage is swapped, enter the same date"
COM_SPORTSMANAGER_NOT_VALID_TIME="Not valid time" COM_SPORTSMANAGER_NOT_VALID_TIME="Not valid time"
COM_SPORTSMANAGER_REALLY_MATCH_RESCHEDULING="Do you really want to remove this match rescheduling?" COM_SPORTSMANAGER_REALLY_MATCH_RESCHEDULING="Do you really want to remove this match rescheduling?"
COM_SPORTSMANAGER_REST_DAYS="Rest days"
COM_SPORTSMANAGER_TRAINING_DAYS="Training days"
+5 -1
View File
@@ -670,6 +670,9 @@ return new class () implements InstallerScriptInterface
. "\n `ortsname` varchar(30) DEFAULT NULL," . "\n `ortsname` varchar(30) DEFAULT NULL,"
. "\n `ortsteil` varchar(30) DEFAULT NULL," . "\n `ortsteil` varchar(30) DEFAULT NULL,"
. "\n `url` varchar(150) DEFAULT NULL," . "\n `url` varchar(150) DEFAULT NULL,"
. "\n `telefon` varchar(64) DEFAULT NULL,"
. "\n `email` varchar(64) DEFAULT NULL,"
. "\n `ruhetage` varchar(64) DEFAULT NULL,"
. "\n `beschreibung` varchar(500) DEFAULT NULL," . "\n `beschreibung` varchar(500) DEFAULT NULL,"
. "\n `status` tinyint(1) NOT NULL DEFAULT '0'," . "\n `status` tinyint(1) NOT NULL DEFAULT '0',"
. "\n PRIMARY KEY (`spielort_id`)" . "\n PRIMARY KEY (`spielort_id`)"
@@ -692,6 +695,7 @@ return new class () implements InstallerScriptInterface
. "\n `heimspiel_wochentag` tinyint(4) DEFAULT NULL," . "\n `heimspiel_wochentag` tinyint(4) DEFAULT NULL,"
. "\n `heimspiel_uhrzeit` smallint(6) DEFAULT NULL," . "\n `heimspiel_uhrzeit` smallint(6) DEFAULT NULL,"
. "\n `heimspielort_id` int(11) DEFAULT NULL," . "\n `heimspielort_id` int(11) DEFAULT NULL,"
. "\n `trainingstage` varchar(64) DEFAULT NULL,"
. "\n `nichtraucherschutz` tinyint(4) DEFAULT '0'," . "\n `nichtraucherschutz` tinyint(4) DEFAULT '0',"
. "\n `platz` smallint(6) DEFAULT NULL," . "\n `platz` smallint(6) DEFAULT NULL,"
. "\n `gesamtpunkte` float(6,2) DEFAULT NULL," . "\n `gesamtpunkte` float(6,2) DEFAULT NULL,"
@@ -1184,7 +1188,7 @@ return new class () implements InstallerScriptInterface
$db->setQuery( $query ); $db->setQuery( $query );
if (!$db->execute()) { die($db->stderr(true)); } if (!$db->execute()) { die($db->stderr(true)); }
$query = "INSERT IGNORE #__sportsmanager_einstellungen SET name = 'datenbank_version', wert = '115';"; $query = "INSERT IGNORE #__sportsmanager_einstellungen SET name = 'datenbank_version', wert = '116';";
$db->setQuery( $query ); $db->setQuery( $query );
if (!$db->execute()) { die($db->stderr(true)); } if (!$db->execute()) { die($db->stderr(true)); }