Alle offenen Mängel beseitigt.

This commit is contained in:
Jürgen Meyer
2025-08-29 10:34:31 +02:00
parent cf52c718e8
commit fc1ce3bdd6
3 changed files with 56 additions and 51 deletions
@@ -9812,6 +9812,8 @@ function adminBegegnungenPokalrundeAuslosenForm(): void
$rundenTitel = $jInput->get('rundentitel', 0, 'STRING'); $rundenTitel = $jInput->get('rundentitel', 0, 'STRING');
$spielumplatz3 = $jInput->get('spielumplatz3', 0, 'INT'); $spielumplatz3 = $jInput->get('spielumplatz3', 0, 'INT');
$teams = [];
if ($veranstaltungId == 0) die("Missing id!"); if ($veranstaltungId == 0) die("Missing id!");
if (!benutzerZugriff("mannschaftswettbewerb_aendern") && !benutzerVeranstaltungModerator($veranstaltungId)) if (!benutzerZugriff("mannschaftswettbewerb_aendern") && !benutzerVeranstaltungModerator($veranstaltungId))
@@ -9880,6 +9882,12 @@ function adminBegegnungenPokalrundeAuslosenForm(): void
$sperren = true; $sperren = true;
} }
if ($anzahlteams > 128)
{
$Fehlertext = "Zu viele Teams vorhanden!!!";
$sperren = true;
}
$datum_jahr = null; $datum_jahr = null;
$zeitpunkt = ""; $zeitpunkt = "";
@@ -9943,7 +9951,6 @@ function adminBegegnungenPokalrundeAuslosenForm(): void
} }
if (!$sperren){ if (!$sperren){
$anzahlMatches = count($match);
$Zeile = 0; $Zeile = 0;
$query = "INSERT INTO #__sportsmanager_begegnung (zeitpunkt, spieltag, spieltag_titel, spiel_nr, heim_team_id, gast_team_id, spielort_id) values "; $query = "INSERT INTO #__sportsmanager_begegnung (zeitpunkt, spieltag, spieltag_titel, spiel_nr, heim_team_id, gast_team_id, spielort_id) values ";
foreach ($matches AS $key => $match) { foreach ($matches AS $key => $match) {
@@ -9973,6 +9980,11 @@ function adminBegegnungenPokalrundeAuslosenForm(): void
$db = getDatabase(); $db = getDatabase();
$jInput = Factory::getContainer()->get(SiteApplication::class)->input; $jInput = Factory::getContainer()->get(SiteApplication::class)->input;
$teams = [];
$setzliste = [];
$setzung = [];
$matches = [];
$sperren = false; $sperren = false;
$veranstaltungId = $jInput->get('veranstaltungid', 0, 'INT'); $veranstaltungId = $jInput->get('veranstaltungid', 0, 'INT');
$rundenNr = $jInput->get('runde', 0, 'INT'); $rundenNr = $jInput->get('runde', 0, 'INT');
@@ -10146,7 +10158,6 @@ function adminBegegnungenPokalrundeAuslosenForm(): void
} }
if (!$sperren){ if (!$sperren){
$anzahlMatches = count($match);
$Zeile = 0; $Zeile = 0;
$query = "INSERT INTO #__sportsmanager_begegnung (zeitpunkt, spieltag, spieltag_titel, spiel_nr, heim_team_id, gast_team_id, spielort_id) values "; $query = "INSERT INTO #__sportsmanager_begegnung (zeitpunkt, spieltag, spieltag_titel, spiel_nr, heim_team_id, gast_team_id, spielort_id) values ";
foreach ($matches AS $key => $match) { foreach ($matches AS $key => $match) {
@@ -2166,18 +2166,23 @@ function erstelleSetzliste($teams): array
} else if ($anzahlTeams >= 65 && $anzahlTeams <= 128){ } else if ($anzahlTeams >= 65 && $anzahlTeams <= 128){
$setzliste = $seedingPairs[128]; $setzliste = $seedingPairs[128];
$runden = 7; $runden = 7;
} else {
$setzliste = [];
$runden = 0;
} }
$turnier = [];
if ($runden > 1)
{
$nr = 0; $nr = 0;
foreach($setzliste as $paarung){ foreach($setzliste as $paarung){
$matches[1][++$nr]['heim'] = $mannschaften[$paarung[0]] ?? 'freilos'; $matches[1][++$nr]['heim'] = $mannschaften[$paarung[0]] ?? 'freilos';
$matches[1][$nr]['gast'] = $mannschaften[$paarung[1]] ?? 'freilos'; $matches[1][$nr]['gast'] = $mannschaften[$paarung[1]] ?? 'freilos';
} }
$turnier['runden'] = $runden; $turnier['runden'] = $runden;
$turnier['matches'] = $matches; $turnier['matches'] = $matches;
}
return $turnier; return $turnier;
} }
function getSetzliste($anzahlRunden) function getSetzliste($anzahlRunden)
@@ -4975,11 +4975,11 @@ class HTML_sportsmanager_admin
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm"> <form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
<div class="uk-overflow-auto"> <div class="uk-overflow-auto">
<table class="" style="width: 100%"> <table style="width: 100%">
<tr> <tr>
<td nowrap style="width: 60%; vertical-align: top"> <td nowrap style="width: 60%; vertical-align: top">
<div class="uk-overflow-auto"> <div class="uk-overflow-auto">
<table class="" style="width: 100%"> <table style="width: 100%">
<?php <?php
for ($typ = 1; $typ <= 7; $typ++) { for ($typ = 1; $typ <= 7; $typ++) {
?> ?>
@@ -7001,11 +7001,11 @@ class HTML_sportsmanager_admin
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm" <form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm"
enctype="multipart/form-data"> enctype="multipart/form-data">
<div class="uk-overflow-auto"> <div class="uk-overflow-auto">
<table class="" style="width: 100%"> <table style="width: 100%">
<tr> <tr>
<td nowrap style="width: 60%; vertical-align: top"> <td nowrap style="width: 60%; vertical-align: top">
<div class="uk-overflow-auto"> <div class="uk-overflow-auto">
<table class="" style="width: 100%"> <table style="width: 100%">
<tr> <tr>
<td nowrap style="width: 20%; text-align: right"> <td nowrap style="width: 20%; text-align: right">
<label <label
@@ -7963,7 +7963,6 @@ class HTML_sportsmanager_admin
</td> </td>
<td nowrap> <td nowrap>
<table style="border-spacing: 0; padding: 0"> <table style="border-spacing: 0; padding: 0">
<tr>
<?php <?php
$berechtigte = $berechtigt_fuer_team != null ? count($berechtigt_fuer_team) : 0; $berechtigte = $berechtigt_fuer_team != null ? count($berechtigt_fuer_team) : 0;
for ($nummer = 1; $nummer <= 6; $nummer++) { for ($nummer = 1; $nummer <= 6; $nummer++) {
@@ -7983,7 +7982,6 @@ class HTML_sportsmanager_admin
<?php <?php
} }
?> ?>
</tr>
</table> </table>
</td> </td>
</tr> </tr>
@@ -8793,7 +8791,7 @@ class HTML_sportsmanager_admin
if ($veranstaltung->spieltag_titel_zeigen == 1){ if ($veranstaltung->spieltag_titel_zeigen == 1){
if ($spieltag != $row->spieltag_titel) { if ($spieltag != $row->spieltag_titel) {
$spieltag = $row->spieltag_titel; $spieltag = $row->spieltag_titel;
echo htmlentities_utf8($spieltag, $veranstaltung->unterteilung == 0, true); echo htmlentities_utf8($spieltag);
} }
} }
?> ?>
@@ -9191,11 +9189,11 @@ class HTML_sportsmanager_admin
<form action="<?php echo SportsManagerURL('#id' . $begegnung->begegnung_id); ?>" method="post" name="adminForm" <form action="<?php echo SportsManagerURL('#id' . $begegnung->begegnung_id); ?>" method="post" name="adminForm"
id="adminForm"> id="adminForm">
<div class="uk-overflow-auto"> <div class="uk-overflow-auto">
<table class="" style="width: 100%"> <table style="width: 100%">
<tr> <tr>
<td nowrap style="width: 60%; vertical-align: top"> <td nowrap style="width: 60%; vertical-align: top">
<div class="uk-overflow-auto"> <div class="uk-overflow-auto">
<table class="" style="width: 100%"> <table style="width: 100%">
<tr> <tr>
<td nowrap style="width: 20%; text-align: right"> <td nowrap style="width: 20%; text-align: right">
<?php echo Text::_('COM_SPORTSMANAGER_SCHEDULE_DATE'); ?>: <?php echo Text::_('COM_SPORTSMANAGER_SCHEDULE_DATE'); ?>:
@@ -10258,9 +10256,6 @@ class HTML_sportsmanager_admin
onchange="tag_changed();"> onchange="tag_changed();">
<?php <?php
$datum = "0000-00-00"; $datum = "0000-00-00";
if ($row != null)
if ($row->zeitpunkt != null)
$datum = substr($row->zeitpunkt, 0, 10);
$datum_tag = substr($datum, 8, 2); $datum_tag = substr($datum, 8, 2);
echo "<option value=\"\"></option>"; echo "<option value=\"\"></option>";
echo "<optgroup label=\"" . Text::_('COM_SPORTSMANAGER_DAY') . "\" />"; echo "<optgroup label=\"" . Text::_('COM_SPORTSMANAGER_DAY') . "\" />";
@@ -10298,9 +10293,6 @@ class HTML_sportsmanager_admin
aria-label="<?php echo Text::_('COM_SPORTSMANAGER_ARIA_LABEL_SCHEDULE_DATE_HOUR'); ?>"> aria-label="<?php echo Text::_('COM_SPORTSMANAGER_ARIA_LABEL_SCHEDULE_DATE_HOUR'); ?>">
<?php <?php
$stunden = -1; $stunden = -1;
if ($row != null)
if ($row->zeitpunkt != null)
$stunden = intval(substr($row->zeitpunkt, 11, 2));
echo "<option value=\"\"></option>"; echo "<option value=\"\"></option>";
for ($i = 0; $i <= 23; $i++) { for ($i = 0; $i <= 23; $i++) {
echo "<option value=\"" . $i . "\" " . ($datum_jahr > 0 && $stunden == $i ? "selected" : "") . ">" . sprintf("%02d", $i) . "</option>"; echo "<option value=\"" . $i . "\" " . ($datum_jahr > 0 && $stunden == $i ? "selected" : "") . ">" . sprintf("%02d", $i) . "</option>";
@@ -10311,9 +10303,6 @@ class HTML_sportsmanager_admin
aria-label="<?php echo Text::_('COM_SPORTSMANAGER_ARIA_LABEL_SCHEDULE_DATE_MINUTE'); ?>"> aria-label="<?php echo Text::_('COM_SPORTSMANAGER_ARIA_LABEL_SCHEDULE_DATE_MINUTE'); ?>">
<?php <?php
$minuten = -1; $minuten = -1;
if ($row != null)
if ($row->zeitpunkt != null)
$minuten = intval(substr($row->zeitpunkt, 14, 2));
echo "<option value=\"\"></option>"; echo "<option value=\"\"></option>";
for ($i = 0; $i <= 59; $i += 5) { for ($i = 0; $i <= 59; $i += 5) {
echo "<option value=\"" . $i . "\" " . ($datum_jahr > 0 && $minuten == $i ? "selected" : "") . ">" . sprintf("%02d", $i) . "</option>"; echo "<option value=\"" . $i . "\" " . ($datum_jahr > 0 && $minuten == $i ? "selected" : "") . ">" . sprintf("%02d", $i) . "</option>";
@@ -10357,9 +10346,9 @@ class HTML_sportsmanager_admin
<td nowrap> <td nowrap>
<select class="uk-select uk-form-width-medium" name="spielumplatz3" id="spielumplatz3" size="1"> <select class="uk-select uk-form-width-medium" name="spielumplatz3" id="spielumplatz3" size="1">
<?php <?php
$direktervergleich = array(Text::_('COM_SPORTSMANAGER_NO'), Text::_('COM_SPORTSMANAGER_YES')); $spielumplatz3 = array(Text::_('COM_SPORTSMANAGER_NO'), Text::_('COM_SPORTSMANAGER_YES'));
for ($i = 0; $i <= 1; $i++) { for ($i = 0; $i <= 1; $i++) {
echo "<option value=\"" . $i . "\"" . ($row != null ? ($row->direktervergleich == $i ? " selected" : "") : "") . ">" . htmlentities_utf8($direktervergleich[$i]) . "</option>"; echo "<option value=\"" . $i . "\">" . htmlentities_utf8($spielumplatz3[$i]) . "</option>";
} }
?> ?>
</select> </select>
@@ -10391,7 +10380,7 @@ class HTML_sportsmanager_admin
?> ?>
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm"> <form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
<div class="uk-overflow-auto"> <div class="uk-overflow-auto">
<table class="" style="width: 500px"> <table style="width: 500px">
<tr> <tr>
<th style="text-align: center" colspan='2'><?php echo Text::_('COM_SPORTSMANAGER_EXPORT'); ?></th> <th style="text-align: center" colspan='2'><?php echo Text::_('COM_SPORTSMANAGER_EXPORT'); ?></th>
</tr> </tr>