From 43a03bbb09d9d252d973da240fad0d69a20ca5ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Meyer?= Date: Wed, 1 Apr 2026 15:51:23 +0200 Subject: [PATCH] =?UTF-8?q?Hall=20of=20Fame=20-=20Zuordnung=20Mannschaftsw?= =?UTF-8?q?appen=20=C3=BCber=20Teamname?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/structure/components/com_sportsmanager/admin.php | 9 +++++++++ .../components/com_sportsmanager/sportsmanager.php | 9 +++++++++ .../com_sportsmanager/views/sportsmanager/view.html.php | 5 ++++- .../com_sportsmanager/views/sportsmanager/view_admin.php | 6 +++++- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/structure/components/com_sportsmanager/admin.php b/src/structure/components/com_sportsmanager/admin.php index 20b3eff..a2cfd9d 100644 --- a/src/structure/components/com_sportsmanager/admin.php +++ b/src/structure/components/com_sportsmanager/admin.php @@ -7788,6 +7788,7 @@ function adminHalloffameMitglieder(): void if ($halloffame->spielform == 1){ foreach ($rows as $row) { $index_vereinid = "verein_id_" . $row->platz; + $index_teamid = "team_id_" . $row->platz; $index_team = "teamname_" . $row->platz; if (!isset($mitglieder[$row->jahr])) { $mitglieder[$row->jahr] = new stdClass(); @@ -7799,6 +7800,14 @@ function adminHalloffameMitglieder(): void $halloffame->platz2_zeigen = 1; if ($row->platz == 3 && !empty($row->teamname)) $halloffame->platz3_zeigen = 1; + + //Suche team_id wenn keine verein_id vorhanden + if (empty($row->verein_id)){ + $query = "SELECT team_id FROM #__sportsmanager_team WHERE teamname LIKE '$row->teamname%' ORDER BY team_id DESC LIMIT 1;"; + $mitglieder[$row->jahr]->$index_teamid = loadResult($db, $query); + } else { + $mitglieder[$row->jahr]->$index_teamid = ""; + } } } if ($halloffame->spielform == 2 || $halloffame->spielform == 3){ diff --git a/src/structure/components/com_sportsmanager/sportsmanager.php b/src/structure/components/com_sportsmanager/sportsmanager.php index 5757739..82f60ec 100644 --- a/src/structure/components/com_sportsmanager/sportsmanager.php +++ b/src/structure/components/com_sportsmanager/sportsmanager.php @@ -4484,6 +4484,7 @@ function halloffameDetails($uebergabe_id = 0): void if ($halloffame->spielform == 1){ foreach ($rows as $row) { $index_vereinid = "verein_id_" . $row->platz; + $index_teamid = "team_id_" . $row->platz; $index_team = "teamname_" . $row->platz; if (!isset($mitglieder[$row->jahr])) { $mitglieder[$row->jahr] = new stdClass(); @@ -4495,6 +4496,14 @@ function halloffameDetails($uebergabe_id = 0): void $halloffame->platz2_zeigen = 1; if ($row->platz == 3 && !empty($row->teamname)) $halloffame->platz3_zeigen = 1; + + //Suche team_id wenn keine verein_id vorhanden + if (empty($row->verein_id)){ + $query = "SELECT team_id FROM #__sportsmanager_team WHERE teamname LIKE '$row->teamname%' ORDER BY team_id DESC LIMIT 1;"; + $mitglieder[$row->jahr]->$index_teamid = loadResult($db, $query); + } else { + $mitglieder[$row->jahr]->$index_teamid = ""; + } } } if ($halloffame->spielform == 2 || $halloffame->spielform == 3){ diff --git a/src/structure/components/com_sportsmanager/views/sportsmanager/view.html.php b/src/structure/components/com_sportsmanager/views/sportsmanager/view.html.php index bfdebfd..b4147ff 100644 --- a/src/structure/components/com_sportsmanager/views/sportsmanager/view.html.php +++ b/src/structure/components/com_sportsmanager/views/sportsmanager/view.html.php @@ -4292,7 +4292,6 @@ static function halloffameDetails($titel, $beschreibung, $rows, $halloffame): vo - jahr; ?> @@ -4304,6 +4303,10 @@ static function halloffameDetails($titel, $beschreibung, $rows, $halloffame): vo $id = "verein_id_" . $i; $txt = "teamname_" . $i; $type = "vereine"; + if ($row->$id == ""){ + $id = "team_id_" . $i; + $type = "mannschaften"; + } } else { $id = "spieler1_id_" . $i; $txt = "spieler1_" . $i; diff --git a/src/structure/components/com_sportsmanager/views/sportsmanager/view_admin.php b/src/structure/components/com_sportsmanager/views/sportsmanager/view_admin.php index 678bf30..4103117 100644 --- a/src/structure/components/com_sportsmanager/views/sportsmanager/view_admin.php +++ b/src/structure/components/com_sportsmanager/views/sportsmanager/view_admin.php @@ -8228,9 +8228,13 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void if ($i == 2 && !$halloffame->platz2_zeigen) continue; if ($i == 3 && !$halloffame->platz3_zeigen) continue; if ($halloffame->spielform == 1) { - $id = "verein_id_" . $i; $txt = "teamname_" . $i; + $id = "verein_id_" . $i; $type = "vereine"; + if ($row->$id == ""){ + $id = "team_id_" . $i; + $type = "mannschaften"; + } } else { $id = "spieler1_id_" . $i; $txt = "spieler1_" . $i;