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();
break;
case 'sort_by_vereinsname':
vereine($sort="vereinsname");
vereine("vereinsname");
break;
default:
vereine($sort="mitglieder");
vereine("mitglieder");
break;
}
} else if ($content == "turniervoranmeldungen") {
@@ -3476,7 +3476,7 @@ function vereine($sort): void
global $params;
$query = "SELECT COUNT(DISTINCT veranstalter_id) FROM #__sportsmanager_verein WHERE NOT ausgetreten";
$organisationAnzeigen = loadResult($db, $query) > 1;
$query = "SELECT t1.verein_id, t1.vereinsname, t1.vereinssitz,"
. "\n t2.veranstalterbezeichnung, COUNT(*) As mitglieder"
. "\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 ORDER BY vorname, nachname, email";
$rows = loadObjectList($db, $query);
// Mailverteiler ermitteln
$mailverteiler = array();
$mailverteiler["u"] = "";
@@ -983,7 +983,7 @@ static function turnierdisziplin($turnier, $disziplin, $meldungen, $meldungenSpi
?>
<script>
function bilder_zeigen(){
let breite = window.innerWidth;
let id = 0;
@@ -1000,16 +1000,16 @@ static function turnierdisziplin($turnier, $disziplin, $meldungen, $meldungenSpi
document.getElementById(id).style.display = anzeige;
}
}
bilder_zeigen();
function onResize() {
bilder_zeigen();
}
window.addEventListener("resize", onResize);
window.addEventListener("resize", onResize);
</script>
<?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;
?>
@@ -1252,8 +1252,8 @@ global $params;
<?php echo Text::_('COM_SPORTSMANAGER_COMPETITIONS'); ?></a> &gt;
<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($heim_team->teamname)."&nbsp;";
<?php
echo htmlentities_utf8($heim_team->teamname)."&nbsp;";
echo Text::_('COM_SPORTSMANAGER_VERSUS_SHORTCUT');
echo "&nbsp;".htmlentities_utf8($gast_team->teamname);
}
@@ -1322,7 +1322,7 @@ global $params;
</td>
<td rowspan=2 style="text-align: center">
<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>"; ?>
</td>
</tr>
@@ -1390,9 +1390,9 @@ if (count($spiele) > 0) {
<td nowrap style="text-align: center;"><?php echo $spiel->teamspiel_nummer ?></td>
<?php
if ($bilder_anzeigen) {
?>
<td id="bilder_heim_<?php echo $spiel->teamspiel_nummer ?>" style="display: block; text-align: center;" >
<?php
$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>
<?php
}
?>
@@ -1460,7 +1460,7 @@ if (count($spiele) > 0) {
if ($bild != null)
echo $bild;
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))) {
$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)
@@ -1485,15 +1485,15 @@ if (count($spiele) > 0) {
<?php
}
?>
<script>
function bilder_zeigen(){
let breite = window.innerWidth;
let id = 0;
let anzeige;
let anzahl_spiele = <?PHP echo count($spiele); ?>;
if (breite < 480){
anzeige = "none";
}
@@ -1511,11 +1511,11 @@ if (count($spiele) > 0) {
function onResize() {
bilder_zeigen();
}
bilder_zeigen();
window.addEventListener("resize", onResize);
window.addEventListener("resize", onResize);
</script>
<?php
@@ -2986,8 +2986,7 @@ static function tabelleAnzeigen($veranstaltung, $modus, $teams, $spieltag, $spie
</strong></th>
<th style='text-align: center;width: 120px;' nowrap><strong>
<a href="verband/vereine?view=sportsmanager&task=sort_by_mitglieder">
<?php echo Text::_('COM_SPORTSMANAGER_MEMBERS'); ?></strong></th>
</a>
<?php echo Text::_('COM_SPORTSMANAGER_MEMBERS'); ?></a></strong></th>
<th style='text-align: left;' nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_TEAM_SEAT'); ?></strong></th>
<?php if ($organisationAnzeigen) { ?>
<th style='text-align: left;' nowrap>Organisation</th>
@@ -2995,7 +2994,6 @@ static function tabelleAnzeigen($veranstaltung, $modus, $teams, $spieltag, $spie
</tr>
<?php
$k = 0;
foreach ($rows as $row) {
?>
<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); ?>">
<?php echo htmlentities_utf8(NichtLeererString($row->vereinsname)); ?></a>
</td>
</td>
<td nowrap style="text-align: center">
<?php echo $row->mitglieder; ?>
</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) {
echo "<td nowrap style='text-align: left;'>" . $row->veranstalterbezeichnung . "<td>";
<?php if ($organisationAnzeigen) {
echo "<td nowrap style='text-align: left;'>" . $row->veranstalterbezeichnung . "</td>";
} ?>
</tr>
<?php
}
@@ -3300,8 +3297,8 @@ static function tabelleAnzeigen($veranstaltung, $modus, $teams, $spieltag, $spie
<?php
foreach ($mitglieder as $row) {
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); ?>">
<?php echo htmlentities_utf8($row->nachname . ", " . $row->vorname); ?></a><?php
if (!empty($row->spielernr))
@@ -3324,7 +3321,7 @@ static function tabelleAnzeigen($veranstaltung, $modus, $teams, $spieltag, $spie
}
}
echo "</td>";
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"');
if ($bild == null)
@@ -3340,7 +3337,7 @@ static function tabelleAnzeigen($veranstaltung, $modus, $teams, $spieltag, $spie
?>
</tr>
</table>
</div>
</div>
<?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
title="<?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS'); ?>
title="<?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS'); ?>
<?php echo Text::_('COM_SPORTSMANAGER_WON'); ?>">
<strong><?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS_SHORTCUT'); ?>
+</strong></th>
<th nowrap
title="<?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS'); ?>
title="<?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS'); ?>
<?php echo Text::_('COM_SPORTSMANAGER_LOST'); ?>">
<strong><?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS_SHORTCUT'); ?>
-</strong></th>
<th nowrap
title="<?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS'); ?>
title="<?php echo Text::_('COM_SPORTSMANAGER_GAME_POINTS'); ?>
<?php echo Text::_('COM_SPORTSMANAGER_RATE'); ?>">
<strong><?php echo Text::_('COM_SPORTSMANAGER_RATE_SHORTCUT'); ?></strong></th>
<th nowrap
title="<?php echo Text::_('COM_SPORTSMANAGER_POINTS'); ?>
title="<?php echo Text::_('COM_SPORTSMANAGER_POINTS'); ?>
<?php echo Text::_('COM_SPORTSMANAGER_WON'); ?>">
<strong><?php echo Text::_('COM_SPORTSMANAGER_POINTS_SHORTCUT'); ?> +</strong>
</th>
<th nowrap
title="<?php echo Text::_('COM_SPORTSMANAGER_POINTS'); ?>
title="<?php echo Text::_('COM_SPORTSMANAGER_POINTS'); ?>
<?php echo Text::_('COM_SPORTSMANAGER_LOST'); ?>">
<strong><?php echo Text::_('COM_SPORTSMANAGER_POINTS_SHORTCUT'); ?> -</strong>
</th>
@@ -2342,7 +2342,7 @@ class HTML_sportsmanager_admin
<td>
<?php
if ($spieler_anzahl > 0) {
echo Text::_('COM_SPORTSMANAGER_IMPORT_CONFLICTS_MESSAGE');
echo Text::_('COM_SPORTSMANAGER_IMPORT_CONFLICTS_MESSAGE');
}
?>
</td>
@@ -2356,7 +2356,7 @@ class HTML_sportsmanager_admin
<tr>
<td nowrap class="contentheading<?php echo $params->get('pageclass_sfx'); ?>"
style="width: 100%">
<?php
<?php
if ($fehler == "konflikt")
echo Text::_('COM_SPORTSMANAGER_IMPORT_DUPLICATE_MESSAGE');
if ($fehler == "Passnummer")
@@ -3505,7 +3505,7 @@ class HTML_sportsmanager_admin
<tr>
<td nowrap style="width: 60%; vertical-align: top">
<div class="uk-overflow-auto">
<table tyle="width: 100%">
<table style="width: 100%">
<tr>
<td nowrap style="width: 20%; text-align: right">
<label
@@ -7467,7 +7467,7 @@ class HTML_sportsmanager_admin
<input type="hidden" name="task" value="admin_veranstaltung_save"/>
<input type="hidden" name="id" value="<?php echo($row != null ? $row->veranstaltung_id : "0"); ?>"/>
</form>
<script>
// Auswahlfeld Direkter Vergleich in Abhaengigkeit von Tabellenwertung anzeigen
const dropdown = document.getElementById("table_evaluation");
@@ -14499,17 +14499,17 @@ class HTML_sportsmanager_admin
:</label>
</td>
<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"
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>
<datalist id="location">
<?php
foreach ($orte As $ort){
echo "<option value=\"" . $ort->ort ."\">";
}
?>
</datalist>
</tr>
<tr>
<td nowrap style="width: 20%; text-align: right">