fix: code review changes

This commit is contained in:
Marvin Flock
2025-09-01 18:02:20 +02:00
parent bc6c44e82a
commit b16638ed47
3 changed files with 51 additions and 54 deletions
@@ -726,10 +726,10 @@ if ($task == "spielerbild") {
vereinBegegnungeniCal(); vereinBegegnungeniCal();
break; break;
case 'sort_by_vereinsname': case 'sort_by_vereinsname':
vereine($sort="vereinsname"); vereine("vereinsname");
break; break;
default: default:
vereine($sort="mitglieder"); vereine("mitglieder");
break; break;
} }
} else if ($content == "turniervoranmeldungen") { } else if ($content == "turniervoranmeldungen") {
@@ -3476,7 +3476,7 @@ function vereine($sort): void
global $params; global $params;
$query = "SELECT COUNT(DISTINCT veranstalter_id) FROM #__sportsmanager_verein WHERE NOT ausgetreten"; $query = "SELECT COUNT(DISTINCT veranstalter_id) FROM #__sportsmanager_verein WHERE NOT ausgetreten";
$organisationAnzeigen = loadResult($db, $query) > 1; $organisationAnzeigen = loadResult($db, $query) > 1;
$query = "SELECT t1.verein_id, t1.vereinsname, t1.vereinssitz," $query = "SELECT t1.verein_id, t1.vereinsname, t1.vereinssitz,"
. "\n t2.veranstalterbezeichnung, COUNT(*) As mitglieder" . "\n t2.veranstalterbezeichnung, COUNT(*) As mitglieder"
. "\n FROM #__sportsmanager_verein AS t1" . "\n FROM #__sportsmanager_verein AS t1"
@@ -3536,7 +3536,7 @@ function vereinDetails(): void
. "\n WHERE verein_id = $id AND NOT #__sportsmanager_mitglied_von_verein.ausgetreten AND email != ''" . "\n WHERE verein_id = $id AND NOT #__sportsmanager_mitglied_von_verein.ausgetreten AND email != ''"
. "\n ORDER BY vorname, nachname, email"; . "\n ORDER BY vorname, nachname, email";
$rows = loadObjectList($db, $query); $rows = loadObjectList($db, $query);
// Mailverteiler ermitteln // Mailverteiler ermitteln
$mailverteiler = array(); $mailverteiler = array();
$mailverteiler["u"] = ""; $mailverteiler["u"] = "";
@@ -983,7 +983,7 @@ static function turnierdisziplin($turnier, $disziplin, $meldungen, $meldungenSpi
?> ?>
<script> <script>
function bilder_zeigen(){ function bilder_zeigen(){
let breite = window.innerWidth; let breite = window.innerWidth;
let id = 0; let id = 0;
@@ -1000,16 +1000,16 @@ static function turnierdisziplin($turnier, $disziplin, $meldungen, $meldungenSpi
document.getElementById(id).style.display = anzeige; document.getElementById(id).style.display = anzeige;
} }
} }
bilder_zeigen(); bilder_zeigen();
function onResize() { function onResize() {
bilder_zeigen(); bilder_zeigen();
} }
window.addEventListener("resize", onResize); window.addEventListener("resize", onResize);
</script> </script>
<?php <?php
} }
@@ -1228,7 +1228,7 @@ static function begegnungenAnzeigen($veranstaltung, $modus, $rows, $zeitfenster,
} }
} }
static function begegnungSpielplan($veranstaltung, $modus, $begegnung, $heim_team, $gast_team, $spiele, $vorherige_begegnung_id, $naechste_begegnung_id, $teamansicht_team, $details_anzeigen):void static function begegnungSpielplan($veranstaltung, $modus, $begegnung, $heim_team, $gast_team, $spiele, $vorherige_begegnung_id, $naechste_begegnung_id, $teamansicht_team, $details_anzeigen):void
{ {
global $params; global $params;
?> ?>
@@ -1252,8 +1252,8 @@ global $params;
<?php echo Text::_('COM_SPORTSMANAGER_COMPETITIONS'); ?></a> &gt; <?php echo Text::_('COM_SPORTSMANAGER_COMPETITIONS'); ?></a> &gt;
<a href="<?php echo SportsManagerURL('&task=veranstaltung&veranstaltungid=' . $veranstaltung->veranstaltung_id . '#id' . $begegnung->begegnung_id); ?>"> <a href="<?php echo SportsManagerURL('&task=veranstaltung&veranstaltungid=' . $veranstaltung->veranstaltung_id . '#id' . $begegnung->begegnung_id); ?>">
<?php echo htmlentities_utf8($veranstaltung->bezeichnung); ?></a> &gt; <?php echo htmlentities_utf8($veranstaltung->bezeichnung); ?></a> &gt;
<?php <?php
echo htmlentities_utf8($heim_team->teamname)."&nbsp;"; echo htmlentities_utf8($heim_team->teamname)."&nbsp;";
echo Text::_('COM_SPORTSMANAGER_VERSUS_SHORTCUT'); echo Text::_('COM_SPORTSMANAGER_VERSUS_SHORTCUT');
echo "&nbsp;".htmlentities_utf8($gast_team->teamname); echo "&nbsp;".htmlentities_utf8($gast_team->teamname);
} }
@@ -1322,7 +1322,7 @@ global $params;
</td> </td>
<td rowspan=2 style="text-align: center"> <td rowspan=2 style="text-align: center">
<h2><?php echo $begegnung->heim_spielpunkte . ":" . $begegnung->gast_spielpunkte; ?></h2> <h2><?php echo $begegnung->heim_spielpunkte . ":" . $begegnung->gast_spielpunkte; ?></h2>
<?php if ($modus->spielpunkte_wertung_einzel != 2 || $modus->spielpunkte_wertung_doppel != 2) <?php if ($modus->spielpunkte_wertung_einzel != 2 || $modus->spielpunkte_wertung_doppel != 2)
echo "<h3>(" . $begegnung->heim_punkte . ":" . $begegnung->gast_punkte . ")</h3>"; ?> echo "<h3>(" . $begegnung->heim_punkte . ":" . $begegnung->gast_punkte . ")</h3>"; ?>
</td> </td>
</tr> </tr>
@@ -1390,9 +1390,9 @@ if (count($spiele) > 0) {
<td nowrap style="text-align: center;"><?php echo $spiel->teamspiel_nummer ?></td> <td nowrap style="text-align: center;"><?php echo $spiel->teamspiel_nummer ?></td>
<?php <?php
if ($bilder_anzeigen) { if ($bilder_anzeigen) {
?> ?>
<td id="bilder_heim_<?php echo $spiel->teamspiel_nummer ?>" style="display: block; text-align: center;" > <td id="bilder_heim_<?php echo $spiel->teamspiel_nummer ?>" style="display: block; text-align: center;" >
<?php <?php
$bild = bildHTML("mannschaftsmitglieder", !$details_anzeigen && $spiel->heim_spieler_1_bild_ausblenden ? '' : $spiel->heim_spieler_1_mitglied_id, 45, 60, 0, 0, 'border="1"'); $bild = bildHTML("mannschaftsmitglieder", !$details_anzeigen && $spiel->heim_spieler_1_bild_ausblenden ? '' : $spiel->heim_spieler_1_mitglied_id, 45, 60, 0, 0, 'border="1"');
@@ -1410,7 +1410,7 @@ if (count($spiele) > 0) {
} }
?> ?>
</td> </td>
<?php <?php
} }
?> ?>
@@ -1460,7 +1460,7 @@ if (count($spiele) > 0) {
if ($bild != null) if ($bild != null)
echo $bild; echo $bild;
if (!(empty($spiel->heim_spieler_2_id) && empty($spiel->gast_spieler_2_id))) { if (!(empty($spiel->heim_spieler_2_id) && empty($spiel->gast_spieler_2_id))) {
if (($details_anzeigen || !$spiel->gast_spieler_2_bild_ausblenden) && ($spiel->gast_spieler_2_mitglied_id != null || ($spiel->gast_spieler_2_id != null && $spiel->gast_spieler_2_id != 0))) { if (($details_anzeigen || !$spiel->gast_spieler_2_bild_ausblenden) && ($spiel->gast_spieler_2_mitglied_id != null || ($spiel->gast_spieler_2_id != null && $spiel->gast_spieler_2_id != 0))) {
$bild = bildHTML("mannschaftsmitglieder", !$details_anzeigen && $spiel->gast_spieler_2_bild_ausblenden ? '' : $spiel->gast_spieler_2_mitglied_id, 45, 60, 0, 0, 'border="1"'); $bild = bildHTML("mannschaftsmitglieder", !$details_anzeigen && $spiel->gast_spieler_2_bild_ausblenden ? '' : $spiel->gast_spieler_2_mitglied_id, 45, 60, 0, 0, 'border="1"');
if ($bild == null) if ($bild == null)
@@ -1485,15 +1485,15 @@ if (count($spiele) > 0) {
<?php <?php
} }
?> ?>
<script> <script>
function bilder_zeigen(){ function bilder_zeigen(){
let breite = window.innerWidth; let breite = window.innerWidth;
let id = 0; let id = 0;
let anzeige; let anzeige;
let anzahl_spiele = <?PHP echo count($spiele); ?>; let anzahl_spiele = <?PHP echo count($spiele); ?>;
if (breite < 480){ if (breite < 480){
anzeige = "none"; anzeige = "none";
} }
@@ -1511,11 +1511,11 @@ if (count($spiele) > 0) {
function onResize() { function onResize() {
bilder_zeigen(); bilder_zeigen();
} }
bilder_zeigen(); bilder_zeigen();
window.addEventListener("resize", onResize); window.addEventListener("resize", onResize);
</script> </script>
<?php <?php
@@ -2986,8 +2986,7 @@ static function tabelleAnzeigen($veranstaltung, $modus, $teams, $spieltag, $spie
</strong></th> </strong></th>
<th style='text-align: center;width: 120px;' nowrap><strong> <th style='text-align: center;width: 120px;' nowrap><strong>
<a href="verband/vereine?view=sportsmanager&task=sort_by_mitglieder"> <a href="verband/vereine?view=sportsmanager&task=sort_by_mitglieder">
<?php echo Text::_('COM_SPORTSMANAGER_MEMBERS'); ?></strong></th> <?php echo Text::_('COM_SPORTSMANAGER_MEMBERS'); ?></a></strong></th>
</a>
<th style='text-align: left;' nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_TEAM_SEAT'); ?></strong></th> <th style='text-align: left;' nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_TEAM_SEAT'); ?></strong></th>
<?php if ($organisationAnzeigen) { ?> <?php if ($organisationAnzeigen) { ?>
<th style='text-align: left;' nowrap>Organisation</th> <th style='text-align: left;' nowrap>Organisation</th>
@@ -2995,7 +2994,6 @@ static function tabelleAnzeigen($veranstaltung, $modus, $teams, $spieltag, $spie
</tr> </tr>
<?php <?php
$k = 0;
foreach ($rows as $row) { foreach ($rows as $row) {
?> ?>
<tr> <tr>
@@ -3017,15 +3015,14 @@ static function tabelleAnzeigen($veranstaltung, $modus, $teams, $spieltag, $spie
<a href="<?php echo SportsManagerURL('&task=verein_details&id=' . $row->verein_id); ?>"> <a href="<?php echo SportsManagerURL('&task=verein_details&id=' . $row->verein_id); ?>">
<?php echo htmlentities_utf8(NichtLeererString($row->vereinsname)); ?></a> <?php echo htmlentities_utf8(NichtLeererString($row->vereinsname)); ?></a>
</td> </td>
</td>
<td nowrap style="text-align: center"> <td nowrap style="text-align: center">
<?php echo $row->mitglieder; ?> <?php echo $row->mitglieder; ?>
</td> </td>
<td style='text-align: left;' nowrap><?php if (!empty($row->vereinssitz)) echo htmlentities_utf8($row->vereinssitz . (!empty($row->vereinssitz_ortsteil) ? ("-" . $row->vereinssitz_ortsteil) : "")); ?></td> <td style='text-align: left;' nowrap><?php if (!empty($row->vereinssitz)) echo htmlentities_utf8($row->vereinssitz . (!empty($row->vereinssitz_ortsteil) ? ("-" . $row->vereinssitz_ortsteil) : "")); ?></td>
<?php if ($organisationAnzeigen) { <?php if ($organisationAnzeigen) {
echo "<td nowrap style='text-align: left;'>" . $row->veranstalterbezeichnung . "<td>"; echo "<td nowrap style='text-align: left;'>" . $row->veranstalterbezeichnung . "</td>";
} ?> } ?>
</tr> </tr>
<?php <?php
} }
@@ -3300,8 +3297,8 @@ static function tabelleAnzeigen($veranstaltung, $modus, $teams, $spieltag, $spie
<?php <?php
foreach ($mitglieder as $row) { foreach ($mitglieder as $row) {
echo "<table style='display: inline-table;'><tr>"; echo "<table style='display: inline-table;'><tr>";
echo "<td style='text-align: center;vertical-align: center; width: 220px;' class=\"sectiontableentry" . (($n % 2) + 1) . $params->get('pageclass_sfx') . "\">"; echo "<td style='text-align: center;vertical-align: center; width: 220px;' class=\"sectiontableentry" . (($n % 2) + 1) . $params->get('pageclass_sfx') . "\">";
?> ?>
<a href="<?php echo SportsManagerURL('&task=spieler_details&id=' . $row->spieler_id); ?>"> <a href="<?php echo SportsManagerURL('&task=spieler_details&id=' . $row->spieler_id); ?>">
<?php echo htmlentities_utf8($row->nachname . ", " . $row->vorname); ?></a><?php <?php echo htmlentities_utf8($row->nachname . ", " . $row->vorname); ?></a><?php
if (!empty($row->spielernr)) if (!empty($row->spielernr))
@@ -3324,7 +3321,7 @@ static function tabelleAnzeigen($veranstaltung, $modus, $teams, $spieltag, $spie
} }
} }
echo "</td>"; echo "</td>";
echo "<td style='text-align: left; width: 120px;' class=\"sectiontableentry" . (($n % 2) + 1) . $params->get('pageclass_sfx') . "\">"; echo "<td style='text-align: left; width: 120px;' class=\"sectiontableentry" . (($n % 2) + 1) . $params->get('pageclass_sfx') . "\">";
$bild = bildHTML("spieler", !$details_anzeigen && $row->bild_ausblenden ? '' : $row->mitglied_von_team_id, 90, 120, 0, 0, 'border="1"'); $bild = bildHTML("spieler", !$details_anzeigen && $row->bild_ausblenden ? '' : $row->mitglied_von_team_id, 90, 120, 0, 0, 'border="1"');
if ($bild == null) if ($bild == null)
@@ -3340,7 +3337,7 @@ static function tabelleAnzeigen($veranstaltung, $modus, $teams, $spieltag, $spie
?> ?>
</tr> </tr>
</table> </table>
</div> </div>
<?php <?php
} }
?> ?>
@@ -5642,26 +5639,26 @@ static function tabelleAnzeigen($veranstaltung, $modus, $teams, $spieltag, $spie
?> ?>
<th nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_GAMES'); ?></strong></th> <th nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_GAMES'); ?></strong></th>
<th nowrap <th nowrap
title="<?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS'); ?> title="<?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS'); ?>
<?php echo Text::_('COM_SPORTSMANAGER_WON'); ?>"> <?php echo Text::_('COM_SPORTSMANAGER_WON'); ?>">
<strong><?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS_SHORTCUT'); ?> <strong><?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS_SHORTCUT'); ?>
+</strong></th> +</strong></th>
<th nowrap <th nowrap
title="<?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS'); ?> title="<?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS'); ?>
<?php echo Text::_('COM_SPORTSMANAGER_LOST'); ?>"> <?php echo Text::_('COM_SPORTSMANAGER_LOST'); ?>">
<strong><?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS_SHORTCUT'); ?> <strong><?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS_SHORTCUT'); ?>
-</strong></th> -</strong></th>
<th nowrap <th nowrap
title="<?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS'); ?> title="<?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS'); ?>
<?php echo Text::_('COM_SPORTSMANAGER_RATE'); ?>"> <?php echo Text::_('COM_SPORTSMANAGER_RATE'); ?>">
<strong><?php echo Text::_('COM_SPORTSMANAGER_RATE_SHORTCUT'); ?></strong></th> <strong><?php echo Text::_('COM_SPORTSMANAGER_RATE_SHORTCUT'); ?></strong></th>
<th nowrap <th nowrap
title="<?php echo Text::_('COM_SPORTSMANAGER_POINTS'); ?> title="<?php echo Text::_('COM_SPORTSMANAGER_POINTS'); ?>
<?php echo Text::_('COM_SPORTSMANAGER_WON'); ?>"> <?php echo Text::_('COM_SPORTSMANAGER_WON'); ?>">
<strong><?php echo Text::_('COM_SPORTSMANAGER_POINTS_SHORTCUT'); ?> +</strong> <strong><?php echo Text::_('COM_SPORTSMANAGER_POINTS_SHORTCUT'); ?> +</strong>
</th> </th>
<th nowrap <th nowrap
title="<?php echo Text::_('COM_SPORTSMANAGER_POINTS'); ?> title="<?php echo Text::_('COM_SPORTSMANAGER_POINTS'); ?>
<?php echo Text::_('COM_SPORTSMANAGER_LOST'); ?>"> <?php echo Text::_('COM_SPORTSMANAGER_LOST'); ?>">
<strong><?php echo Text::_('COM_SPORTSMANAGER_POINTS_SHORTCUT'); ?> -</strong> <strong><?php echo Text::_('COM_SPORTSMANAGER_POINTS_SHORTCUT'); ?> -</strong>
</th> </th>
@@ -2342,7 +2342,7 @@ class HTML_sportsmanager_admin
<td> <td>
<?php <?php
if ($spieler_anzahl > 0) { if ($spieler_anzahl > 0) {
echo Text::_('COM_SPORTSMANAGER_IMPORT_CONFLICTS_MESSAGE'); echo Text::_('COM_SPORTSMANAGER_IMPORT_CONFLICTS_MESSAGE');
} }
?> ?>
</td> </td>
@@ -2356,7 +2356,7 @@ class HTML_sportsmanager_admin
<tr> <tr>
<td nowrap class="contentheading<?php echo $params->get('pageclass_sfx'); ?>" <td nowrap class="contentheading<?php echo $params->get('pageclass_sfx'); ?>"
style="width: 100%"> style="width: 100%">
<?php <?php
if ($fehler == "konflikt") if ($fehler == "konflikt")
echo Text::_('COM_SPORTSMANAGER_IMPORT_DUPLICATE_MESSAGE'); echo Text::_('COM_SPORTSMANAGER_IMPORT_DUPLICATE_MESSAGE');
if ($fehler == "Passnummer") if ($fehler == "Passnummer")
@@ -3505,7 +3505,7 @@ class HTML_sportsmanager_admin
<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 tyle="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
@@ -7467,7 +7467,7 @@ class HTML_sportsmanager_admin
<input type="hidden" name="task" value="admin_veranstaltung_save"/> <input type="hidden" name="task" value="admin_veranstaltung_save"/>
<input type="hidden" name="id" value="<?php echo($row != null ? $row->veranstaltung_id : "0"); ?>"/> <input type="hidden" name="id" value="<?php echo($row != null ? $row->veranstaltung_id : "0"); ?>"/>
</form> </form>
<script> <script>
// Auswahlfeld Direkter Vergleich in Abhaengigkeit von Tabellenwertung anzeigen // Auswahlfeld Direkter Vergleich in Abhaengigkeit von Tabellenwertung anzeigen
const dropdown = document.getElementById("table_evaluation"); const dropdown = document.getElementById("table_evaluation");
@@ -14499,17 +14499,17 @@ class HTML_sportsmanager_admin
:</label> :</label>
</td> </td>
<td nowrap> <td nowrap>
<input class="inputbox" type="text" name="ort" list="location" id="location" size="50" <input class="inputbox" type="text" name="ort" list="locationList" id="location" size="50"
maxlength="100" maxlength="100"
value="<?php if (!empty($termin)) echo htmlentities_utf8($termin->ort); ?>"/> value="<?php if (!empty($termin)) echo htmlentities_utf8($termin->ort); ?>"/>
<datalist id="locationList">
<?php
foreach ($orte As $ort){
echo "<option value=\"" . $ort->ort ."\">";
}
?>
</datalist>
</td> </td>
<datalist id="location">
<?php
foreach ($orte As $ort){
echo "<option value=\"" . $ort->ort ."\">";
}
?>
</datalist>
</tr> </tr>
<tr> <tr>
<td nowrap style="width: 20%; text-align: right"> <td nowrap style="width: 20%; text-align: right">