Überarbeitung Hall of Fame

## Neue Frontend-Darstellungen (gruppierung)
- gruppierung=jahr - Jahresrückblick: eine Tabelle je Jahr mit allen Disziplinen, inkl. mehrerer Plätze, Team-Mitspielern und Spalten-/Zeilen-Layout wie auf der Detailseite.
- gruppierung=summe - Ranking über alle Disziplinen hinweg: ein Eintrag je Spieler/Team mit mindestens einem 1. Platz, inkl. Titelanzahl und Auflistung aller Titel (Disziplin, Jahre).
- gruppierung=summedisziplin - wie summe, aber eine eigene Rangliste je Disziplin.

## Neue/erweiterte Steuerungsparameter
- platzierung (inspalten/inzeilen), plaetzezeigen, sortierung (kontextabhängig: Jahresreihenfolge oder anzahl/name in den Summen-Ansichten).
- anzahltitel - Mindestanzahl an Titeln für die Summen-Ansichten.
- halloffame_id und jahr als Filter für alle Hall-of-Fame-Seiten, mit Komma- und Bereichs-Syntax (2006-2010,2015).
- Titel fällt auf den Joomla-Menütitel zurück, wenn kein eigener Titel im Menüpunkt gesetzt ist.
- Überschrift semantisch als h1 statt div.

## Mannschaftsspieler-Feld
- Neues Datenbankfeld teamspieler (TEXT) an #__sportsmanager_mitglied_von_halloffame, Eingabe im Backend als Textarea (nur bei Mannschaftsdisziplinen).
- Anzeige im Frontend bei platzierung=inzeilen oder wenn nur ein Platz gezeigt wird, sofern mindestens ein Eintrag >= 3 Zeichen vorhanden ist.

## Verlinkung & Bilder
- Spieler-, Vereins- und Mannschaftsnamen sind jetzt überall anklickbar (Detailseite, Jahresübersicht, Summen-Ansichten) und führen zur jeweiligen Profilseite - inaktive Spieler (ohne aktuellen Verein) bleiben unverlinkt.
- Dummybilder: neues geschlechtsneutrales Bild (spieler-n.png) für Spieler ohne Datenbank-ID; deren Geschlecht wird zusätzlich anhand der übrigen Spieler mit ID derselben Disziplin geschätzt, bevor auf das neutrale Bild zurückgefallen wird.
- Fehlt der Name zu einer Platzierung, wird in der Spaltenansicht nur das Bild weggelassen, in der Zeilenansicht die komplette Zeile.

## Neues Feld "nicht_ausgespielt"
- Neue Spalte nicht_ausgespielt (BOOL) hinter jahr an #__sportsmanager_mitglied_von_halloffame (Teil von Datenbank-Version 121).
- Admin-Formular: Checkbox neben dem Jahr-Feld; bei Aktivierung werden alle anderen Felder deaktiviert, beim Speichern werden Platz 2/3 gelöscht und Platz 1 auf reines nicht_ausgespielt=1 ohne Team-/Spielerdaten gesetzt.
- Frontend-Detailseite und Backend-Jahresliste zeigen bei solchen Einträgen "Nicht ausgespielt" statt Team-/Spielername an.
- Jahresübersicht und beide Summen-Ansichten überspringen solche Einträge vollständig.

## Vereins-Dropdown im Backend gruppiert
- Die Vereinsliste im Auswahlfeld (Plätze 1-3) ist jetzt in zwei optgroup-Blöcke aufgeteilt: "Aktive Vereine" / "Inaktive Vereine" (neue Sprachkonstanten COM_SPORTSMANAGER_ACTIVE_CLUBS / COM_SPORTSMANAGER_INACTIVE_CLUBS). Innerhalb jeder Gruppe bleibt die alphabetische Sortierung erhalten.

## Routing-Fix
- task=team_details und task=verein_details funktionierten nur, wenn der aktuelle Menüpunkt bereits auf content=teams bzw. content=vereine stand (z. B. beim Verlinken von der Hall-of-Fame-Seite aus nicht). Beide Tasks laufen jetzt wie spieler_details über eine content-unabhängige Route.

## Performance
- Options-Liste für Vereins-/Spieler-Dropdowns im Backend-Formular wurde bis zu 6x komplett neu gerendert (3 Plätze x 2 Spieler bzw. 3x Vereinsliste). Jetzt wird sie nur noch 1x aufgebaut, in einem <template>-Element abgelegt und per JavaScript in die <select>-Felder befüllt.
- Team-ID-Auflösung für Mannschaften ohne Vereinszuordnung läuft jetzt über eine einmalig geladene Liste statt einer Datenbankabfrage pro Zeile.

## Bugfixes
- halloffameTeamIdFuerTeamname() erwartete einen nicht-nullbaren string und stürzte bei nicht_ausgespielt-Einträgen (teamname = NULL) mit einem TypeError ab. Parameter ist jetzt nullable, leerer/NULL-Teamname liefert direkt null zurück.
- Bei Einzel-Disziplinen wurden Jahre in den Summen-Ansichten doppelt gezählt, wenn in der Datenbank (z. B. aus Altdaten) noch ein spieler2_id hinterlegt war; wird jetzt nur noch bei echten Doppel-Disziplinen berücksichtigt.

## Migration
- Datenbank-Version 121: neues Feld teamspieler, neue Spalte nicht_ausgespielt, Bereitstellung des neutralen Dummybilds für Bestandsinstallationen.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Jürgen Meyer
2026-09-02 11:33:38 +02:00
co-authored by Claude Sonnet 5
parent ca827a049f
commit 12da0a9c00
11 changed files with 1494 additions and 89 deletions
+19 -5
View File
@@ -52,7 +52,6 @@
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.0.tgz", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.0.tgz",
"integrity": "sha512-iV7Gwg0DePKvdDZZWRTkj4MW+6/AbVWd4ZCg+zk8H1RVt5xBpUZS6vLQWwb3pyLg4BFTaGiQCPoJ4Ibmbne4fA==", "integrity": "sha512-iV7Gwg0DePKvdDZZWRTkj4MW+6/AbVWd4ZCg+zk8H1RVt5xBpUZS6vLQWwb3pyLg4BFTaGiQCPoJ4Ibmbne4fA==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"@babel/code-frame": "^7.10.4", "@babel/code-frame": "^7.10.4",
"@babel/generator": "^7.12.0", "@babel/generator": "^7.12.0",
@@ -2695,10 +2694,25 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001148", "version": "1.0.30001810",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001148.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz",
"integrity": "sha512-E66qcd0KMKZHNJQt9hiLZGE3J4zuTqE1OnU53miEVtylFbwOEmeA5OsRu90noZful+XGSQOni1aT2tiqu/9yYw==", "integrity": "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==",
"dev": true "dev": true,
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "CC-BY-4.0"
}, },
"node_modules/chalk": { "node_modules/chalk": {
"version": "1.1.3", "version": "1.1.3",
@@ -7839,6 +7839,27 @@ function adminHalloffameMitglieder(): void
if (count($rows) > 0){ if (count($rows) > 0){
$mitglieder = []; $mitglieder = [];
if ($halloffame->spielform == 1){ if ($halloffame->spielform == 1){
// team_id fuer alle Zeilen ohne verein_id in einer einzigen Abfrage ermitteln statt einer Query je Zeile
$benoetigteTeamnamen = array();
foreach ($rows as $row) {
if (empty($row->verein_id))
$benoetigteTeamnamen[(string) $row->teamname] = true;
}
$teamIdsByTeamname = array();
if (count($benoetigteTeamnamen) > 0) {
$subqueries = array();
foreach (array_keys($benoetigteTeamnamen) as $teamname) {
$subqueries[] = "(SELECT '" . $db->escape($teamname) . "' AS teamname, team_id"
. " FROM #__sportsmanager_team"
. " WHERE teamname LIKE '" . $db->escape($teamname) . "%'"
. " ORDER BY team_id DESC LIMIT 1)";
}
$query = implode("\n UNION ALL\n", $subqueries);
foreach (loadObjectList($db, $query) as $treffer) {
$teamIdsByTeamname[$treffer->teamname] = $treffer->team_id;
}
}
foreach ($rows as $row) { foreach ($rows as $row) {
$index_vereinid = "verein_id_" . $row->platz; $index_vereinid = "verein_id_" . $row->platz;
$index_teamid = "team_id_" . $row->platz; $index_teamid = "team_id_" . $row->platz;
@@ -7848,16 +7869,15 @@ function adminHalloffameMitglieder(): void
} }
$mitglieder[$row->jahr]->jahr = $row->jahr; $mitglieder[$row->jahr]->jahr = $row->jahr;
$mitglieder[$row->jahr]->$index_vereinid = $row->verein_id; $mitglieder[$row->jahr]->$index_vereinid = $row->verein_id;
$mitglieder[$row->jahr]->$index_team = $row->teamname; $mitglieder[$row->jahr]->$index_team = !empty($row->nicht_ausgespielt) ? Text::_('COM_SPORTSMANAGER_HALL_OF_FAME_NOT_HELD') : $row->teamname;
if ($row->platz == 2 && !empty($row->teamname)) if ($row->platz == 2 && !empty($row->teamname))
$halloffame->platz2_zeigen = 1; $halloffame->platz2_zeigen = 1;
if ($row->platz == 3 && !empty($row->teamname)) if ($row->platz == 3 && !empty($row->teamname))
$halloffame->platz3_zeigen = 1; $halloffame->platz3_zeigen = 1;
//Suche team_id wenn keine verein_id vorhanden //team_id wenn keine verein_id vorhanden
if (empty($row->verein_id)){ 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 = $teamIdsByTeamname[(string) $row->teamname] ?? null;
$mitglieder[$row->jahr]->$index_teamid = loadResult($db, $query);
} else { } else {
$mitglieder[$row->jahr]->$index_teamid = ""; $mitglieder[$row->jahr]->$index_teamid = "";
} }
@@ -7875,7 +7895,7 @@ function adminHalloffameMitglieder(): void
} }
$mitglieder[$row->jahr]->jahr = $row->jahr; $mitglieder[$row->jahr]->jahr = $row->jahr;
$mitglieder[$row->jahr]->$index_spieler1id = $row->spieler1_id; $mitglieder[$row->jahr]->$index_spieler1id = $row->spieler1_id;
$mitglieder[$row->jahr]->$index_spieler1 = $row->spieler1; $mitglieder[$row->jahr]->$index_spieler1 = !empty($row->nicht_ausgespielt) ? Text::_('COM_SPORTSMANAGER_HALL_OF_FAME_NOT_HELD') : $row->spieler1;
$mitglieder[$row->jahr]->$index_spieler2id = $row->spieler2_id; $mitglieder[$row->jahr]->$index_spieler2id = $row->spieler2_id;
$mitglieder[$row->jahr]->$index_spieler2 = $row->spieler2; $mitglieder[$row->jahr]->$index_spieler2 = $row->spieler2;
if ($row->platz == 2 && (!empty($row->spieler1) || !empty($row->spieler2))) if ($row->platz == 2 && (!empty($row->spieler1) || !empty($row->spieler2)))
@@ -7908,15 +7928,19 @@ function adminEditHalloffameMitglied(): void
} }
$halloffame = $rows[0]; $halloffame = $rows[0];
$query = "SELECT verein_id, vereinsname As verein" $vereine = array();
. "\n FROM #__sportsmanager_verein" $spieler = array();
. "\n ORDER BY vereinsname"; if ($halloffame->spielform == 1) {
$vereine = loadObjectList($db, $query); $query = "SELECT verein_id, vereinsname As verein, ausgetreten"
. "\n FROM #__sportsmanager_verein"
$query = "SELECT spieler_id, CONCAT(nachname, ', ', vorname, ' (', spielernr, ')') AS spieler" . "\n ORDER BY vereinsname";
. "\n FROM #__sportsmanager_spieler" $vereine = loadObjectList($db, $query);
. "\n ORDER BY nachname, vorname, spielernr"; } else {
$spieler = loadObjectList($db, $query); $query = "SELECT spieler_id, CONCAT(nachname, ', ', vorname, ' (', spielernr, ')') AS spieler"
. "\n FROM #__sportsmanager_spieler"
. "\n ORDER BY nachname, vorname, spielernr";
$spieler = loadObjectList($db, $query);
}
$query = "SELECT t2.*, t1.halloffame" $query = "SELECT t2.*, t1.halloffame"
. "\n FROM #__sportsmanager_halloffame t1" . "\n FROM #__sportsmanager_halloffame t1"
@@ -7932,9 +7956,13 @@ function adminEditHalloffameMitglied(): void
foreach ($rows as $row) { foreach ($rows as $row) {
$index_vereinid = "verein_id_" . $row->platz; $index_vereinid = "verein_id_" . $row->platz;
$index_team = "teamname_" . $row->platz; $index_team = "teamname_" . $row->platz;
$index_teamspieler = "teamspieler_" . $row->platz;
$mitglieder->jahr = $row->jahr; $mitglieder->jahr = $row->jahr;
$mitglieder->$index_vereinid = $row->verein_id; $mitglieder->$index_vereinid = $row->verein_id;
$mitglieder->$index_team = $row->teamname; $mitglieder->$index_team = $row->teamname;
$mitglieder->$index_teamspieler = $row->teamspieler;
if ($row->platz == 1)
$mitglieder->nicht_ausgespielt = $row->nicht_ausgespielt;
} }
} }
if ($halloffame->spielform == 2 || $halloffame->spielform == 3){ if ($halloffame->spielform == 2 || $halloffame->spielform == 3){
@@ -7949,6 +7977,8 @@ function adminEditHalloffameMitglied(): void
$mitglieder->$index_spieler1 = $row->spieler1; $mitglieder->$index_spieler1 = $row->spieler1;
$mitglieder->$index_spieler2id = $row->spieler2_id; $mitglieder->$index_spieler2id = $row->spieler2_id;
$mitglieder->$index_spieler2 = $row->spieler2; $mitglieder->$index_spieler2 = $row->spieler2;
if ($row->platz == 1)
$mitglieder->nicht_ausgespielt = $row->nicht_ausgespielt;
} }
} }
} }
@@ -7992,14 +8022,41 @@ function adminEditHalloffameMitglied(): void
$halloffame_id = $jInput->get('halloffame_id', 0, 'INT'); $halloffame_id = $jInput->get('halloffame_id', 0, 'INT');
$spielform = $jInput->get('spielform', 0, 'INT'); $spielform = $jInput->get('spielform', 0, 'INT');
$jahr = $jInput->get('jahr', 0, 'INT'); $jahr = $jInput->get('jahr', 0, 'INT');
$nicht_ausgespielt = $jInput->get('nicht_ausgespielt', false, 'BOOL');
if ($jInput->get('cancel', false, 'BOOL')) if ($jInput->get('cancel', false, 'BOOL'))
redirectSportsManagerURL('&task=admin_halloffame_mitglieder&id=' . $halloffame_id); redirectSportsManagerURL('&task=admin_halloffame_mitglieder&id=' . $halloffame_id);
if ($nicht_ausgespielt) {
$query = "DELETE FROM #__sportsmanager_mitglied_von_halloffame"
. "\n WHERE halloffame_id = $halloffame_id"
. "\n AND jahr = $jahr"
. "\n AND platz > 1";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
$query = "INSERT INTO #__sportsmanager_mitglied_von_halloffame"
. "\n (halloffame_id,jahr,platz,nicht_ausgespielt) VALUES"
. "\n ($halloffame_id,$jahr,1,1)"
. "\n ON DUPLICATE KEY UPDATE"
. "\n nicht_ausgespielt = 1,"
. "\n verein_id = NULL, teamname = NULL, teamspieler = NULL,"
. "\n spieler1_id = NULL, spieler1 = NULL, spieler2_id = NULL, spieler2 = NULL;";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
redirectSportsManagerURL('&task=admin_halloffame_mitglieder&id=' . $halloffame_id);
}
if ($spielform == 1){ if ($spielform == 1){
for ($p = 1; $p <= 3; $p++){ for ($p = 1; $p <= 3; $p++){
$verein_id[$p] = $jInput->get('verein_id_' . $p, 0, 'INT'); $verein_id[$p] = $jInput->get('verein_id_' . $p, 0, 'INT');
$teamname[$p] = $db->escape(trim($jInput->get('teamname_' . $p, '', 'RAW'))); $teamname[$p] = $db->escape(trim($jInput->get('teamname_' . $p, '', 'RAW')));
$teamspieler[$p] = $db->escape(trim($jInput->get('teamspieler_' . $p, '', 'RAW')));
if (empty($teamname[$p]) && !empty($verein_id[$p])){ if (empty($teamname[$p]) && !empty($verein_id[$p])){
$query = "SELECT vereinsname FROM #__sportsmanager_verein WHERE verein_id = '" . $verein_id[$p] . "';"; $query = "SELECT vereinsname FROM #__sportsmanager_verein WHERE verein_id = '" . $verein_id[$p] . "';";
$verein = loadObjectList($db, $query); $verein = loadObjectList($db, $query);
@@ -8007,10 +8064,12 @@ function adminEditHalloffameMitglied(): void
} }
if (!empty($teamname[$p])){ if (!empty($teamname[$p])){
$query = "INSERT INTO #__sportsmanager_mitglied_von_halloffame" $query = "INSERT INTO #__sportsmanager_mitglied_von_halloffame"
. "\n (halloffame_id,jahr,platz,verein_id,teamname) VALUES" . "\n (halloffame_id,jahr,platz,verein_id,teamname,teamspieler,nicht_ausgespielt) VALUES"
. "\n ($halloffame_id,$jahr,$p," . (($verein_id[$p] != 0) ? $verein_id[$p] : 'NULL') . ",'" . $teamname[$p] . "')" . "\n ($halloffame_id,$jahr,$p," . (($verein_id[$p] != 0) ? $verein_id[$p] : 'NULL') . ",'" . $teamname[$p] . "','" . $teamspieler[$p] . "',0)"
. "\n ON DUPLICATE KEY UPDATE verein_id = " . (($verein_id[$p] != 0) ? $verein_id[$p] : 'NULL') . "," . "\n ON DUPLICATE KEY UPDATE verein_id = " . (($verein_id[$p] != 0) ? $verein_id[$p] : 'NULL') . ","
. "\n teamname = '" . $teamname[$p] . "';"; . "\n teamname = '" . $teamname[$p] . "',"
. "\n teamspieler = '" . $teamspieler[$p] . "',"
. "\n nicht_ausgespielt = 0;";
} else { } else {
$query = "DELETE FROM #__sportsmanager_mitglied_von_halloffame" $query = "DELETE FROM #__sportsmanager_mitglied_von_halloffame"
@@ -8047,13 +8106,14 @@ function adminEditHalloffameMitglied(): void
} }
if (!empty($spieler1[$p])){ if (!empty($spieler1[$p])){
$query = "INSERT INTO #__sportsmanager_mitglied_von_halloffame" $query = "INSERT INTO #__sportsmanager_mitglied_von_halloffame"
. "\n (halloffame_id,jahr,platz,spieler1_id,spieler1,spieler2_id,spieler2) VALUES" . "\n (halloffame_id,jahr,platz,spieler1_id,spieler1,spieler2_id,spieler2,nicht_ausgespielt) VALUES"
. "\n ($halloffame_id,$jahr,$p," . (($spieler1_id[$p] != 0) ? $spieler1_id[$p] : 'NULL') . ",'" . $spieler1[$p] . "'," . (($spieler2_id[$p] != 0) ? $spieler2_id[$p] : 'NULL') . ",'" . $spieler2[$p] . "')" . "\n ($halloffame_id,$jahr,$p," . (($spieler1_id[$p] != 0) ? $spieler1_id[$p] : 'NULL') . ",'" . $spieler1[$p] . "'," . (($spieler2_id[$p] != 0) ? $spieler2_id[$p] : 'NULL') . ",'" . $spieler2[$p] . "',0)"
. "\n ON DUPLICATE KEY UPDATE" . "\n ON DUPLICATE KEY UPDATE"
. "\n spieler1_id = " . (($spieler1_id[$p] != 0) ? $spieler1_id[$p] : 'NULL') . "," . "\n spieler1_id = " . (($spieler1_id[$p] != 0) ? $spieler1_id[$p] : 'NULL') . ","
. "\n spieler1 = '" . $spieler1[$p] . "'," . "\n spieler1 = '" . $spieler1[$p] . "',"
. "\n spieler2_id = " . (($spieler2_id[$p] != 0) ? $spieler2_id[$p] : 'NULL') . "," . "\n spieler2_id = " . (($spieler2_id[$p] != 0) ? $spieler2_id[$p] : 'NULL') . ","
. "\n spieler2 = '" . $spieler2[$p] . "';"; . "\n spieler2 = '" . $spieler2[$p] . "',"
. "\n nicht_ausgespielt = 0;";
} else { } else {
$query = "DELETE FROM #__sportsmanager_mitglied_von_halloffame" $query = "DELETE FROM #__sportsmanager_mitglied_von_halloffame"
. "\n WHERE halloffame_id = $halloffame_id" . "\n WHERE halloffame_id = $halloffame_id"
@@ -5741,6 +5741,42 @@ function updateDatabase(): void
} }
} }
if ($datenbank_version < 121) {
$columns = $db->getTableColumns('#__sportsmanager_mitglied_von_halloffame');
if (!array_key_exists('teamspieler', $columns)){
$query = "ALTER TABLE `#__sportsmanager_mitglied_von_halloffame`"
. "\n ADD `teamspieler` TEXT NULL DEFAULT NULL AFTER `teamname`;";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
}
if (!array_key_exists('nicht_ausgespielt', $columns)){
$query = "ALTER TABLE `#__sportsmanager_mitglied_von_halloffame`"
. "\n ADD `nicht_ausgespielt` TINYINT(1) NOT NULL DEFAULT '0' AFTER `jahr`;";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
}
$zielpfad = JPATH_ROOT . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'sportsmanager' . DIRECTORY_SEPARATOR . 'spieler' . DIRECTORY_SEPARATOR . 'n.png';
if (!is_file($zielpfad)) {
$quellpfad = JPATH_SITE . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_sportsmanager' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'spieler-n.png';
bildKopierenAngepasst($quellpfad, $zielpfad, 180, 240, 1);
}
$query = "UPDATE #__sportsmanager_einstellungen"
. "\n SET wert = '121'"
. "\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";
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -93,6 +93,10 @@ if ($task == "spielerbild") {
terminDokument(); terminDokument();
} else if ($task == "spieler_details") { } else if ($task == "spieler_details") {
spielerDetails(); spielerDetails();
} else if ($task == "team_details") {
mannschaftDetails($content == "teams_vereinigt", $content != "teams" && $content != "teams_vereinigt");
} else if ($task == "verein_details") {
vereinDetails();
} else if ($task !== null && str_starts_with($task, "admin_")) { } else if ($task !== null && str_starts_with($task, "admin_")) {
// in some cases there are no breaks needed due to no return from method // in some cases there are no breaks needed due to no return from method
switch ($task) { switch ($task) {
@@ -866,9 +870,6 @@ if ($task == "spielerbild") {
case 'begegnung_spielplan': case 'begegnung_spielplan':
begegnungSpielplan(true); begegnungSpielplan(true);
break; break;
case 'team_details':
mannschaftDetails($content == "teams_vereinigt");
break;
case 'team_spielplan_xml': case 'team_spielplan_xml':
teamSpielplanXML(); teamSpielplanXML();
case 'team_begegnungen_ical': case 'team_begegnungen_ical':
@@ -879,9 +880,6 @@ if ($task == "spielerbild") {
} }
} else if ($content == "vereine") { } else if ($content == "vereine") {
switch ($task) { switch ($task) {
case 'verein_details':
vereinDetails();
break;
case 'verein_begegnungen_ical': case 'verein_begegnungen_ical':
vereinBegegnungeniCal(); vereinBegegnungeniCal();
break; break;
@@ -4469,11 +4467,34 @@ function halloffame(): void
{ {
$db = getDatabase(); $db = getDatabase();
global $params; global $params;
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
$gruppierung = $jInput->get('gruppierung', '', 'STRING');
if ($gruppierung !== 'jahr' && $gruppierung !== 'summe' && $gruppierung !== 'summedisziplin')
$gruppierung = '';
if ($gruppierung === 'jahr') {
halloffameNachJahrGruppiert();
return;
}
if ($gruppierung === 'summe') {
halloffameNachSummeGruppiert();
return;
}
if ($gruppierung === 'summedisziplin') {
halloffameNachSummeDisziplinGruppiert();
return;
}
$query = "SELECT t1.*, COUNT(DISTINCT t2.jahr) AS anzahl," $query = "SELECT t1.*, COUNT(DISTINCT t2.jahr) AS anzahl,"
. "\n IF (COUNT(DISTINCT t2.jahr) > 0, CONCAT(min(t2.jahr), ' - ', max(t2.jahr)), '" . Text::_('COM_SPORTSMANAGER_NO_ENTRY') . "') AS zeitspanne" . "\n IF (COUNT(DISTINCT t2.jahr) > 0, CONCAT(min(t2.jahr), ' - ', max(t2.jahr)), '" . Text::_('COM_SPORTSMANAGER_NO_ENTRY') . "') AS zeitspanne"
. "\n FROM #__sportsmanager_halloffame t1" . "\n FROM #__sportsmanager_halloffame t1"
. "\n LEFT JOIN #__sportsmanager_mitglied_von_halloffame t2 ON t2.halloffame_id = t1.halloffame_id" . "\n LEFT JOIN #__sportsmanager_mitglied_von_halloffame t2 ON t2.halloffame_id = t1.halloffame_id"
. "\n WHERE 1=1"
. halloffameIdFilter("AND t1.halloffame_id IN")
. halloffameJahrFilter("AND t2.jahr IN")
. "\n GROUP BY t1.halloffame_id" . "\n GROUP BY t1.halloffame_id"
. kategorieFilter("HAVING t1.kategorie IN") . kategorieFilter("HAVING t1.kategorie IN")
. "\n ORDER BY t1.reihenfolge;"; . "\n ORDER BY t1.reihenfolge;";
@@ -4485,11 +4506,360 @@ function halloffame(): void
if (isJson()) { if (isJson()) {
echo json_encode($halloffame); echo json_encode($halloffame);
} else { } else {
HTML_sportsmanager::halloffame($params->get('titel'), $params->get('beschreibung'), $halloffame); HTML_sportsmanager::halloffame(halloffameTitel(), $params->get('beschreibung'), $halloffame);
} }
} }
} }
function halloffameNachJahrGruppiert(): void
{
$db = getDatabase();
global $params;
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
$platzierung = $jInput->get('platzierung', '', 'STRING');
if ($platzierung !== 'inspalten' && $platzierung !== 'inzeilen')
$platzierung = '';
$plaetzezeigen = $jInput->get('plaetzezeigen', 0, 'INT');
$sortierung = $jInput->get('sortierung', 'jahrabwaerts', 'STRING');
if ($sortierung !== 'jahraufwaerts')
$sortierung = 'jahrabwaerts';
$jahrSortierung = $sortierung === 'jahraufwaerts' ? 'ASC' : 'DESC';
$query = "SELECT t2.*, t1.halloffame, t1.spielform, t1.reihenfolge"
. "\n FROM #__sportsmanager_halloffame t1"
. "\n LEFT JOIN #__sportsmanager_mitglied_von_halloffame t2 ON t2.halloffame_id = t1.halloffame_id"
. "\n WHERE t2.jahr IS NOT NULL"
. kategorieFilter("AND t1.kategorie IN")
. halloffameIdFilter("AND t1.halloffame_id IN")
. halloffameJahrFilter("AND t2.jahr IN")
. "\n ORDER BY t2.jahr $jahrSortierung, t1.reihenfolge, t2.platz ASC;";
$rows = loadObjectList($db, $query);
$alleTeams = halloffameAlleTeams($db);
$alleSpielerInfo = halloffameAlleSpielerInfo($db);
$disziplinen = [];
$jahresDaten = [];
foreach ($rows as $row) {
if (!isset($disziplinen[$row->halloffame_id])) {
$disziplinen[$row->halloffame_id] = (object) [
'halloffame_id' => $row->halloffame_id,
'halloffame' => $row->halloffame,
'spielform' => $row->spielform,
'reihenfolge' => $row->reihenfolge,
'platz2_zeigen' => 0,
'platz3_zeigen' => 0,
'teamspieler_zeigen' => 0,
'anzahl_m' => 0,
'anzahl_w' => 0,
];
}
$disziplin = $disziplinen[$row->halloffame_id];
if (!empty($row->nicht_ausgespielt)) continue;
if (!isset($jahresDaten[$row->jahr]))
$jahresDaten[$row->jahr] = [];
if (!isset($jahresDaten[$row->jahr][$row->halloffame_id]))
$jahresDaten[$row->jahr][$row->halloffame_id] = new stdClass();
$ziel = $jahresDaten[$row->jahr][$row->halloffame_id];
if ($disziplin->spielform == 1) {
$index_vereinid = "verein_id_" . $row->platz;
$index_teamid = "team_id_" . $row->platz;
$index_team = "teamname_" . $row->platz;
$index_teamspieler = "teamspieler_" . $row->platz;
$ziel->$index_vereinid = $row->verein_id;
$ziel->$index_team = $row->teamname;
$ziel->$index_teamspieler = $row->teamspieler;
if (empty($row->verein_id)) {
$ziel->$index_teamid = halloffameTeamIdFuerTeamname($alleTeams, $row->teamname);
} else {
$ziel->$index_teamid = "";
}
if ($row->platz == 2 && !empty($row->teamname))
$disziplin->platz2_zeigen = 1;
if ($row->platz == 3 && !empty($row->teamname))
$disziplin->platz3_zeigen = 1;
if (mb_strlen(trim((string) $row->teamspieler)) >= 3)
$disziplin->teamspieler_zeigen = 1;
} else {
$index_spieler1id = "spieler1_id_" . $row->platz;
$index_spieler1 = "spieler1_" . $row->platz;
$index_spieler2id = "spieler2_id_" . $row->platz;
$index_spieler2 = "spieler2_" . $row->platz;
$ziel->$index_spieler1id = $row->spieler1_id;
$ziel->$index_spieler1 = $row->spieler1;
$ziel->$index_spieler2id = $row->spieler2_id;
$ziel->$index_spieler2 = $row->spieler2;
if ($row->platz == 2 && (!empty($row->spieler1) || !empty($row->spieler2)))
$disziplin->platz2_zeigen = 1;
if ($row->platz == 3 && (!empty($row->spieler1) || !empty($row->spieler2)))
$disziplin->platz3_zeigen = 1;
halloffameGeschlechtZaehlen($disziplin, $alleSpielerInfo, $row->spieler1_id, $disziplin->spielform == 2 ? $row->spieler2_id : null);
}
}
foreach ($disziplinen as $disziplin)
$disziplin->geschaetztes_geschlecht = halloffameGeschaetztesGeschlecht($disziplin->anzahl_m, $disziplin->anzahl_w);
if ($plaetzezeigen > 0) {
foreach ($disziplinen as $disziplin) {
if ($plaetzezeigen < 2)
$disziplin->platz2_zeigen = 0;
if ($plaetzezeigen < 3)
$disziplin->platz3_zeigen = 0;
}
}
usort($disziplinen, fn($a, $b) => $a->reihenfolge <=> $b->reihenfolge);
if (isJson()) {
echo json_encode(['disziplinen' => $disziplinen, 'jahre' => $jahresDaten]);
} else {
HTML_sportsmanager::halloffameNachJahrGruppiert(halloffameTitel(), $params->get('beschreibung'), $disziplinen, $jahresDaten, $platzierung, $alleSpielerInfo);
}
}
function halloffameSummeTitelHinzufuegen(object $traegerEintrag, object $row): void
{
if (!isset($traegerEintrag->titel[$row->halloffame_id])) {
$traegerEintrag->titel[$row->halloffame_id] = (object) [
'halloffame' => $row->halloffame,
'jahre' => [],
];
}
$traegerEintrag->titel[$row->halloffame_id]->jahre[] = $row->jahr;
}
function halloffameNachSummeGruppiert(): void
{
$db = getDatabase();
global $params;
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
$anzahltitel = $jInput->get('anzahltitel', 0, 'INT');
$sortierung = $jInput->get('sortierung', 'anzahl', 'STRING');
if ($sortierung !== 'name')
$sortierung = 'anzahl';
$query = "SELECT t2.*, t1.halloffame, t1.spielform, t1.reihenfolge"
. "\n FROM #__sportsmanager_halloffame t1"
. "\n LEFT JOIN #__sportsmanager_mitglied_von_halloffame t2 ON t2.halloffame_id = t1.halloffame_id"
. "\n WHERE t2.jahr IS NOT NULL AND t2.platz = 1"
. kategorieFilter("AND t1.kategorie IN")
. halloffameIdFilter("AND t1.halloffame_id IN")
. halloffameJahrFilter("AND t2.jahr IN")
. "\n ORDER BY t1.reihenfolge, t2.jahr ASC;";
$rows = loadObjectList($db, $query);
$alleTeams = halloffameAlleTeams($db);
$alleSpielerInfo = halloffameAlleSpielerInfo($db);
$traeger = [];
foreach ($rows as $row) {
if (!empty($row->nicht_ausgespielt)) continue;
if ($row->spielform == 1) {
$name = trim($row->teamname);
if ($name === '') continue;
$key = 'team:' . $name;
if (!isset($traeger[$key])) {
if (empty($row->verein_id)) {
$bild_type = 'mannschaften';
$bild_id = halloffameTeamIdFuerTeamname($alleTeams, $row->teamname);
} else {
$bild_type = 'vereine';
$bild_id = $row->verein_id;
}
$traeger[$key] = (object) [
'name' => $name,
'bild_type' => $bild_type,
'bild_id' => $bild_id,
'aktiv' => true,
'geschlecht' => null,
'titel' => [],
];
}
halloffameSummeTitelHinzufuegen($traeger[$key], $row);
} else {
if (!empty($row->spieler1_id)) {
$key = 'spieler:' . $row->spieler1_id;
if (!isset($traeger[$key])) {
$traeger[$key] = (object) [
'name' => $row->spieler1,
'bild_type' => 'spieler',
'bild_id' => $row->spieler1_id,
'aktiv' => halloffameSpielerAktiv($alleSpielerInfo, $row->spieler1_id),
'geschlecht' => $alleSpielerInfo[$row->spieler1_id]->geschlecht ?? null,
'titel' => [],
];
}
halloffameSummeTitelHinzufuegen($traeger[$key], $row);
}
if ($row->spielform == 2 && !empty($row->spieler2_id)) {
$key = 'spieler:' . $row->spieler2_id;
if (!isset($traeger[$key])) {
$traeger[$key] = (object) [
'name' => $row->spieler2,
'bild_type' => 'spieler',
'bild_id' => $row->spieler2_id,
'aktiv' => halloffameSpielerAktiv($alleSpielerInfo, $row->spieler2_id),
'geschlecht' => $alleSpielerInfo[$row->spieler2_id]->geschlecht ?? null,
'titel' => [],
];
}
halloffameSummeTitelHinzufuegen($traeger[$key], $row);
}
}
}
foreach ($traeger as $t) {
$t->anzahl = 0;
foreach ($t->titel as $titel)
$t->anzahl += count($titel->jahre);
}
if ($anzahltitel > 0)
$traeger = array_filter($traeger, fn($t) => $t->anzahl >= $anzahltitel);
if ($sortierung === 'name') {
usort($traeger, fn($a, $b) => strcasecmp($a->name, $b->name));
} else {
usort($traeger, fn($a, $b) => ($b->anzahl <=> $a->anzahl) ?: strcasecmp($a->name, $b->name));
}
if (isJson()) {
echo json_encode($traeger);
} else {
HTML_sportsmanager::halloffameNachSummeGruppiert(halloffameTitel(), $params->get('beschreibung'), $traeger);
}
}
function halloffameNachSummeDisziplinGruppiert(): void
{
$db = getDatabase();
global $params;
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
$anzahltitel = $jInput->get('anzahltitel', 0, 'INT');
$sortierung = $jInput->get('sortierung', 'anzahl', 'STRING');
if ($sortierung !== 'name')
$sortierung = 'anzahl';
$query = "SELECT t2.*, t1.halloffame, t1.spielform, t1.reihenfolge"
. "\n FROM #__sportsmanager_halloffame t1"
. "\n LEFT JOIN #__sportsmanager_mitglied_von_halloffame t2 ON t2.halloffame_id = t1.halloffame_id"
. "\n WHERE t2.jahr IS NOT NULL AND t2.platz = 1"
. kategorieFilter("AND t1.kategorie IN")
. halloffameIdFilter("AND t1.halloffame_id IN")
. halloffameJahrFilter("AND t2.jahr IN")
. "\n ORDER BY t1.reihenfolge, t2.jahr ASC;";
$rows = loadObjectList($db, $query);
$alleTeams = halloffameAlleTeams($db);
$alleSpielerInfo = halloffameAlleSpielerInfo($db);
$disziplinen = [];
foreach ($rows as $row) {
if (!isset($disziplinen[$row->halloffame_id])) {
$disziplinen[$row->halloffame_id] = (object) [
'halloffame_id' => $row->halloffame_id,
'halloffame' => $row->halloffame,
'reihenfolge' => $row->reihenfolge,
'traeger' => [],
];
}
$disziplin = $disziplinen[$row->halloffame_id];
if (!empty($row->nicht_ausgespielt)) continue;
if ($row->spielform == 1) {
$name = trim($row->teamname);
if ($name === '') continue;
$key = 'team:' . $name;
if (!isset($disziplin->traeger[$key])) {
if (empty($row->verein_id)) {
$bild_type = 'mannschaften';
$bild_id = halloffameTeamIdFuerTeamname($alleTeams, $row->teamname);
} else {
$bild_type = 'vereine';
$bild_id = $row->verein_id;
}
$disziplin->traeger[$key] = (object) [
'name' => $name,
'bild_type' => $bild_type,
'bild_id' => $bild_id,
'aktiv' => true,
'geschlecht' => null,
'jahre' => [],
];
}
$disziplin->traeger[$key]->jahre[] = $row->jahr;
} else {
if (!empty($row->spieler1_id)) {
$key = 'spieler:' . $row->spieler1_id;
if (!isset($disziplin->traeger[$key])) {
$disziplin->traeger[$key] = (object) [
'name' => $row->spieler1,
'bild_type' => 'spieler',
'bild_id' => $row->spieler1_id,
'aktiv' => halloffameSpielerAktiv($alleSpielerInfo, $row->spieler1_id),
'geschlecht' => $alleSpielerInfo[$row->spieler1_id]->geschlecht ?? null,
'jahre' => [],
];
}
$disziplin->traeger[$key]->jahre[] = $row->jahr;
}
if ($row->spielform == 2 && !empty($row->spieler2_id)) {
$key = 'spieler:' . $row->spieler2_id;
if (!isset($disziplin->traeger[$key])) {
$disziplin->traeger[$key] = (object) [
'name' => $row->spieler2,
'bild_type' => 'spieler',
'bild_id' => $row->spieler2_id,
'aktiv' => halloffameSpielerAktiv($alleSpielerInfo, $row->spieler2_id),
'geschlecht' => $alleSpielerInfo[$row->spieler2_id]->geschlecht ?? null,
'jahre' => [],
];
}
$disziplin->traeger[$key]->jahre[] = $row->jahr;
}
}
}
foreach ($disziplinen as $disziplin) {
foreach ($disziplin->traeger as $t)
$t->anzahl = count($t->jahre);
if ($anzahltitel > 0)
$disziplin->traeger = array_filter($disziplin->traeger, fn($t) => $t->anzahl >= $anzahltitel);
if ($sortierung === 'name') {
usort($disziplin->traeger, fn($a, $b) => strcasecmp($a->name, $b->name));
} else {
usort($disziplin->traeger, fn($a, $b) => ($b->anzahl <=> $a->anzahl) ?: strcasecmp($a->name, $b->name));
}
}
usort($disziplinen, fn($a, $b) => $a->reihenfolge <=> $b->reihenfolge);
if (isJson()) {
echo json_encode($disziplinen);
} else {
HTML_sportsmanager::halloffameNachSummeDisziplinGruppiert(halloffameTitel(), $params->get('beschreibung'), $disziplinen);
}
}
function halloffameDetails($uebergabe_id = 0): void function halloffameDetails($uebergabe_id = 0): void
{ {
$db = getDatabase(); $db = getDatabase();
@@ -4503,9 +4873,21 @@ function halloffameDetails($uebergabe_id = 0): void
else else
$id = $uebergabe_id; $id = $uebergabe_id;
$platzierung = $jInput->get('platzierung', '', 'STRING');
if ($platzierung !== 'inspalten' && $platzierung !== 'inzeilen')
$platzierung = '';
$plaetzezeigen = $jInput->get('plaetzezeigen', 0, 'INT');
$sortierung = $jInput->get('sortierung', 'jahrabwaerts', 'STRING');
if ($sortierung !== 'jahraufwaerts')
$sortierung = 'jahrabwaerts';
$jahrSortierung = $sortierung === 'jahraufwaerts' ? 'ASC' : 'DESC';
$mitglieder = null; $mitglieder = null;
$query = "SELECT * FROM #__sportsmanager_halloffame WHERE halloffame_id = $id"; $query = "SELECT * FROM #__sportsmanager_halloffame WHERE halloffame_id = $id"
. halloffameIdFilter("AND halloffame_id IN");
$rows = loadObjectList($db, $query); $rows = loadObjectList($db, $query);
if (count($rows) < 1) { if (count($rows) < 1) {
abortWithError("Wrong id!"); abortWithError("Wrong id!");
@@ -4513,36 +4895,45 @@ function halloffameDetails($uebergabe_id = 0): void
$halloffame = $rows[0]; $halloffame = $rows[0];
$halloffame->platz2_zeigen = 0; $halloffame->platz2_zeigen = 0;
$halloffame->platz3_zeigen = 0; $halloffame->platz3_zeigen = 0;
$halloffame->teamspieler_zeigen = 0;
$halloffame->anzahl_m = 0;
$halloffame->anzahl_w = 0;
$query = "SELECT t2.*, t1.halloffame" $query = "SELECT t2.*, t1.halloffame"
. "\n FROM #__sportsmanager_halloffame t1" . "\n FROM #__sportsmanager_halloffame t1"
. "\n LEFT JOIN #__sportsmanager_mitglied_von_halloffame t2 ON t2.halloffame_id = t1.halloffame_id" . "\n LEFT JOIN #__sportsmanager_mitglied_von_halloffame t2 ON t2.halloffame_id = t1.halloffame_id"
. "\n WHERE t2.halloffame_id = $id" . "\n WHERE t2.halloffame_id = $id"
. "\n ORDER BY t2.jahr DESC, platz ASC;"; . halloffameJahrFilter("AND t2.jahr IN")
. "\n ORDER BY t2.jahr $jahrSortierung, platz ASC;";
$rows = loadObjectList($db, $query); $rows = loadObjectList($db, $query);
$alleSpielerInfo = halloffameAlleSpielerInfo($db);
if (count($rows) > 0){ if (count($rows) > 0){
$mitglieder = []; $mitglieder = [];
if ($halloffame->spielform == 1){ if ($halloffame->spielform == 1){
$alleTeams = halloffameAlleTeams($db);
foreach ($rows as $row) { foreach ($rows as $row) {
$index_vereinid = "verein_id_" . $row->platz; $index_vereinid = "verein_id_" . $row->platz;
$index_teamid = "team_id_" . $row->platz; $index_teamid = "team_id_" . $row->platz;
$index_team = "teamname_" . $row->platz; $index_team = "teamname_" . $row->platz;
$index_teamspieler = "teamspieler_" . $row->platz;
if (!isset($mitglieder[$row->jahr])) { if (!isset($mitglieder[$row->jahr])) {
$mitglieder[$row->jahr] = new stdClass(); $mitglieder[$row->jahr] = new stdClass();
} }
$mitglieder[$row->jahr]->jahr = $row->jahr; $mitglieder[$row->jahr]->jahr = $row->jahr;
$mitglieder[$row->jahr]->$index_vereinid = $row->verein_id; $mitglieder[$row->jahr]->$index_vereinid = $row->verein_id;
$mitglieder[$row->jahr]->$index_team = $row->teamname; $mitglieder[$row->jahr]->$index_team = !empty($row->nicht_ausgespielt) ? Text::_('COM_SPORTSMANAGER_HALL_OF_FAME_NOT_HELD') : $row->teamname;
$mitglieder[$row->jahr]->$index_teamspieler = $row->teamspieler;
if ($row->platz == 2 && !empty($row->teamname)) if ($row->platz == 2 && !empty($row->teamname))
$halloffame->platz2_zeigen = 1; $halloffame->platz2_zeigen = 1;
if ($row->platz == 3 && !empty($row->teamname)) if ($row->platz == 3 && !empty($row->teamname))
$halloffame->platz3_zeigen = 1; $halloffame->platz3_zeigen = 1;
if (mb_strlen(trim((string) $row->teamspieler)) >= 3)
$halloffame->teamspieler_zeigen = 1;
//Suche team_id wenn keine verein_id vorhanden //Suche team_id wenn keine verein_id vorhanden
if (empty($row->verein_id)){ 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 = halloffameTeamIdFuerTeamname($alleTeams, $row->teamname);
$mitglieder[$row->jahr]->$index_teamid = loadResult($db, $query);
} else { } else {
$mitglieder[$row->jahr]->$index_teamid = ""; $mitglieder[$row->jahr]->$index_teamid = "";
} }
@@ -4560,21 +4951,31 @@ function halloffameDetails($uebergabe_id = 0): void
} }
$mitglieder[$row->jahr]->jahr = $row->jahr; $mitglieder[$row->jahr]->jahr = $row->jahr;
$mitglieder[$row->jahr]->$index_spieler1id = $row->spieler1_id; $mitglieder[$row->jahr]->$index_spieler1id = $row->spieler1_id;
$mitglieder[$row->jahr]->$index_spieler1 = $row->spieler1; $mitglieder[$row->jahr]->$index_spieler1 = !empty($row->nicht_ausgespielt) ? Text::_('COM_SPORTSMANAGER_HALL_OF_FAME_NOT_HELD') : $row->spieler1;
$mitglieder[$row->jahr]->$index_spieler2id = $row->spieler2_id; $mitglieder[$row->jahr]->$index_spieler2id = $row->spieler2_id;
$mitglieder[$row->jahr]->$index_spieler2 = $row->spieler2; $mitglieder[$row->jahr]->$index_spieler2 = $row->spieler2;
if ($row->platz == 2 && (!empty($row->spieler1) || !empty($row->spieler2))) if ($row->platz == 2 && (!empty($row->spieler1) || !empty($row->spieler2)))
$halloffame->platz2_zeigen = 1; $halloffame->platz2_zeigen = 1;
if ($row->platz == 3 && (!empty($row->spieler1) || !empty($row->spieler2))) if ($row->platz == 3 && (!empty($row->spieler1) || !empty($row->spieler2)))
$halloffame->platz3_zeigen = 1; $halloffame->platz3_zeigen = 1;
halloffameGeschlechtZaehlen($halloffame, $alleSpielerInfo, $row->spieler1_id, $halloffame->spielform == 2 ? $row->spieler2_id : null);
} }
} }
} }
$halloffame->geschaetztes_geschlecht = halloffameGeschaetztesGeschlecht($halloffame->anzahl_m, $halloffame->anzahl_w);
if ($plaetzezeigen > 0) {
if ($plaetzezeigen < 2)
$halloffame->platz2_zeigen = 0;
if ($plaetzezeigen < 3)
$halloffame->platz3_zeigen = 0;
}
if (isJson()) { if (isJson()) {
echo json_encode($mitglieder); echo json_encode($mitglieder);
} else { } else {
HTML_sportsmanager::halloffameDetails($params->get('titel'), $params->get('beschreibung'), $mitglieder, $halloffame); HTML_sportsmanager::halloffameDetails(halloffameTitel(), $params->get('beschreibung'), $mitglieder, $halloffame, $platzierung, $alleSpielerInfo);
} }
} }
@@ -232,6 +232,160 @@ function kategorieFilter($prefix, $suffix = ""): string
return " $prefix (" . implode(", ", $filter) . ") $suffix"; return " $prefix (" . implode(", ", $filter) . ") $suffix";
} }
function idListeParameterFilter(string $parameterName, string $prefix, string $suffix = ""): string
{
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
$werte = $jInput->get($parameterName, '', 'STRING');
$result = [];
foreach (explode(",", $werte) as $item) {
$item = trim($item);
if ($item === '') continue;
// Prüfen, ob es ein Bereich ist
if (strpos($item, '-') !== false) {
$rangeParts = explode('-', $item);
// genau 2 Teile für einen gültigen Bereich
if (count($rangeParts) !== 2) continue;
$start = intval(trim($rangeParts[0]));
$end = intval(trim($rangeParts[1]));
if ($start <= 0 || $end <= 0 || $start > $end) continue;
for ($i = $start; $i <= $end; $i++) {
$result[$i] = true; // Duplikate vermeiden
}
} else {
$num = intval($item);
if ($num > 0) {
$result[$num] = true;
}
}
}
if (empty($result)) {
return "";
}
$filter = array_keys($result);
sort($filter, SORT_NUMERIC);
return " $prefix (" . implode(", ", $filter) . ") $suffix";
}
function halloffameIdFilter($prefix): string
{
return idListeParameterFilter('halloffame_id', $prefix);
}
function halloffameJahrFilter($prefix): string
{
return idListeParameterFilter('jahr', $prefix);
}
function halloffameAlleTeams($db): array
{
return loadObjectList($db, "SELECT team_id, teamname FROM #__sportsmanager_team ORDER BY team_id DESC");
}
function halloffameTeamIdFuerTeamname(array $alleTeams, ?string $teamname)
{
if (empty($teamname))
return null;
foreach ($alleTeams as $team) {
if (str_starts_with($team->teamname, $teamname))
return $team->team_id;
}
return null;
}
function halloffameAlleSpielerInfo($db): array
{
// "Aktiv" = hat einen aktuellen Verein; ohne aktuellen Verein liefert spieler_details ohnehin keine Daten
$rows = loadObjectList($db, "SELECT spieler_id, geschlecht, aktueller_verein_id FROM #__sportsmanager_spieler");
$result = [];
foreach ($rows as $row) {
$result[$row->spieler_id] = (object) [
'geschlecht' => $row->geschlecht,
'aktiv' => !empty($row->aktueller_verein_id),
];
}
return $result;
}
function halloffameSpielerAktiv(array $alleSpielerInfo, $spieler_id): bool
{
return empty($spieler_id) || !isset($alleSpielerInfo[$spieler_id]) || $alleSpielerInfo[$spieler_id]->aktiv;
}
function halloffameSpielerBildId(array $alleSpielerInfo, $spieler_id)
{
return halloffameSpielerAktiv($alleSpielerInfo, $spieler_id) ? $spieler_id : '';
}
function halloffameSpielerBildAlternativ(array $alleSpielerInfo, $spieler_id, string $geschaetztesGeschlecht = ''): string
{
if (!empty($spieler_id) && isset($alleSpielerInfo[$spieler_id]))
return $alleSpielerInfo[$spieler_id]->geschlecht == 'M' ? 'm' : 'w';
if ($geschaetztesGeschlecht === 'M')
return 'm';
if ($geschaetztesGeschlecht === 'W')
return 'w';
return 'n';
}
function halloffameGeschlechtZaehlen(object $ziel, array $alleSpielerInfo, $spieler1_id, $spieler2_id): void
{
foreach ([$spieler1_id, $spieler2_id] as $id) {
if (empty($id) || !isset($alleSpielerInfo[$id]))
continue;
if ($alleSpielerInfo[$id]->geschlecht == 'M')
$ziel->anzahl_m++;
else
$ziel->anzahl_w++;
}
}
function halloffameGeschaetztesGeschlecht($anzahl_m, $anzahl_w): string
{
if ($anzahl_m > $anzahl_w)
return 'M';
if ($anzahl_w > $anzahl_m)
return 'W';
return '';
}
function halloffameNameLink(string $bild_type, $id, array $alleSpielerInfo, string $nameHtml): string
{
if (empty($id))
return $nameHtml;
if ($bild_type === 'spieler' && !halloffameSpielerAktiv($alleSpielerInfo, $id))
return $nameHtml;
$tasks = ['spieler' => 'spieler_details', 'vereine' => 'verein_details', 'mannschaften' => 'team_details'];
if (!isset($tasks[$bild_type]))
return $nameHtml;
return '<a href="' . SportsManagerURL('&task=' . $tasks[$bild_type] . '&id=' . $id) . '">' . $nameHtml . '</a>';
}
function halloffameTitel(): string
{
global $params;
$titel = trim((string) $params->get('titel', ''));
if ($titel !== '')
return $titel;
$menu = Factory::getContainer()->get(SiteApplication::class)->getMenu()->getActive();
if ($menu !== null && trim((string) $menu->title) !== '')
return $menu->title;
return '';
}
function turnierFilter($prefix): string function turnierFilter($prefix): string
{ {
$user_id = isExternalDatabase() ? 0 : Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id; $user_id = isExternalDatabase() ? 0 : Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id;
@@ -4166,8 +4166,8 @@ static function halloffame($titel, $beschreibung, $rows): void
global $params; global $params;
if (!empty($titel)) { ?> if (!empty($titel)) { ?>
<style>td{padding: 3px;}</style> <style>td{padding: 3px;}</style>
<div <h1
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo htmlentities_utf8($titel); ?></div><?php } class="componentheading<?php echo $params->get('pageclass_sfx'); ?>" style="font-size: inherit; margin: 0;"><?php echo htmlentities_utf8($titel); ?></h1><?php }
if (!empty($beschreibung)) { if (!empty($beschreibung)) {
?> ?>
<div class="uk-overflow-auto"> <div class="uk-overflow-auto">
@@ -4217,13 +4217,490 @@ static function halloffame($titel, $beschreibung, $rows): void
<?php <?php
} }
static function halloffameDetails($titel, $beschreibung, $rows, $halloffame): void static function halloffameNachJahrGruppiert($titel, $beschreibung, $disziplinen, $jahresDaten, $platzierung = '', $alleSpielerInfo = []): void
{ {
global $params; global $params;
if (!empty($titel)) { ?> if (!empty($titel)) { ?>
<style>td{padding: 3px;}</style> <style>td{padding: 3px;}</style>
<div <h1
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo htmlentities_utf8($titel); ?></div><?php } class="componentheading<?php echo $params->get('pageclass_sfx'); ?>" style="font-size: inherit; margin: 0;"><?php echo htmlentities_utf8($titel); ?></h1><?php }
if (!empty($beschreibung)) {
?>
<div class="uk-overflow-auto">
<table class="contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
<tr>
<td><?php echo str_contains($beschreibung, ">") ? $beschreibung : htmlentities_utf8($beschreibung); ?></td>
</tr>
</table>
</div>
<?php
}
if (count($disziplinen) > 0 && count($jahresDaten) > 0) {
?>
<style>
.sm-halloffame-disziplin-link { color: inherit; text-decoration: none; }
.sm-halloffame-disziplin-link:hover { text-decoration: underline; }
</style>
<?php
$maxPlatz = 1;
foreach ($disziplinen as $disziplin) {
if ($disziplin->platz3_zeigen) $maxPlatz = 3;
else if ($disziplin->platz2_zeigen && $maxPlatz < 2) $maxPlatz = 2;
}
$nurPlatz1 = $maxPlatz == 1;
$disziplinBreite = $nurPlatz1 ? 400 : 280;
$breite = 2;
foreach ($disziplinen as $disziplin) {
if ($disziplin->spielform == 2) $breite = 4;
}
$teamspielerZeigen = false;
if ($platzierung === 'inzeilen' || $nurPlatz1) {
foreach ($disziplinen as $disziplin) {
if ($disziplin->spielform == 1 && $disziplin->teamspieler_zeigen) {
$teamspielerZeigen = true;
break;
}
}
}
foreach ($jahresDaten as $jahr => $disziplinenDesJahres) {
?>
<h4><?php echo htmlentities_utf8($jahr); ?></h4>
<div class="uk-overflow-auto">
<table style='border-collapse: collapse; table-layout: fixed;'
class="uk-table-hover uk-table-divider uk-table-middle dtfl-table-medium contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
<?php if ($platzierung === 'inzeilen') { ?>
<colgroup>
<col style="width:400px;">
<?php if (!$nurPlatz1) { ?><col style="width:70px;"><?php } ?>
<col style="width:70px;">
<col style="width:300px;">
<?php if ($breite == 4) { ?>
<col style="width:70px;">
<col style="width:300px;">
<?php } ?>
<?php if ($teamspielerZeigen) { ?>
<col style="width:300px;">
<?php } ?>
</colgroup>
<tr class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>">
<th style="text-align:left;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME'); ?></strong></th>
<?php if (!$nurPlatz1) { ?>
<th style="text-align:center;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_PLACE'); ?></strong></th>
<?php } ?>
<th colspan="<?php echo $breite; ?>" nowrap></th>
<?php if ($teamspielerZeigen) { ?>
<th style="text-align:left;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME_TEAM_PLAYERS'); ?></strong></th>
<?php } ?>
</tr>
<?php
$k = 0;
foreach ($disziplinen as $disziplin) {
if (!isset($disziplinenDesJahres[$disziplin->halloffame_id])) continue;
$row = $disziplinenDesJahres[$disziplin->halloffame_id];
$rowclass = "sectiontableentry" . ($k + 1) . $params->get('pageclass_sfx');
$k = ($k + 1) % 2;
$plaetzeVorhanden = [];
for ($i = 1; $i <= 3; $i++) {
if ($i == 2 && !$disziplin->platz2_zeigen) continue;
if ($i == 3 && !$disziplin->platz3_zeigen) continue;
if ($disziplin->spielform == 2) {
$spieler1 = "spieler1_" . $i;
$spieler2 = "spieler2_" . $i;
if (empty($row->$spieler1) && empty($row->$spieler2)) continue;
} else {
$txt = ($disziplin->spielform == 1 ? "teamname_" : "spieler1_") . $i;
if (empty($row->$txt)) continue;
}
$plaetzeVorhanden[] = $i;
}
if (empty($plaetzeVorhanden)) $plaetzeVorhanden = [1];
$anzahlPlatzZeilen = count($plaetzeVorhanden);
$ersteZeile = true;
foreach ($plaetzeVorhanden as $i) {
?>
<tr class="<?php echo $rowclass; ?>">
<?php if ($ersteZeile) { ?>
<td rowspan="<?php echo $anzahlPlatzZeilen; ?>" style="word-wrap: break-word; padding-right: 20px;">
<a class="sm-halloffame-disziplin-link" href="<?php echo SportsManagerURL('&task=hall_of_fame_details&id=' . $disziplin->halloffame_id); ?>">
<?php echo htmlentities_utf8(NichtLeererString($disziplin->halloffame)); ?>
</a>
</td>
<?php } ?>
<?php if (!$nurPlatz1) { ?>
<td style="text-align:center;">
<?php echo $i; ?>
</td>
<?php } ?>
<?php if ($disziplin->spielform == 2) {
$spieler1_id = "spieler1_id_" . $i;
$spieler1 = "spieler1_" . $i;
$spieler2_id = "spieler2_id_" . $i;
$spieler2 = "spieler2_" . $i;
?>
<td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML("spieler", halloffameSpielerBildId($alleSpielerInfo, $row->$spieler1_id), 45, 60, 0, 0, 'border="0"', halloffameSpielerBildAlternativ($alleSpielerInfo, $row->$spieler1_id, $disziplin->geschaetztes_geschlecht)); ?>
</td>
<td style="text-align:left; word-wrap: break-word;">
<?php echo halloffameNameLink('spieler', $row->$spieler1_id, $alleSpielerInfo, htmlentities_utf8($row->$spieler1)); ?>
</td>
<td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML("spieler", halloffameSpielerBildId($alleSpielerInfo, $row->$spieler2_id), 45, 60, 0, 0, 'border="0"', halloffameSpielerBildAlternativ($alleSpielerInfo, $row->$spieler2_id, $disziplin->geschaetztes_geschlecht)); ?>
</td>
<td style="text-align:left; word-wrap: break-word;">
<?php echo halloffameNameLink('spieler', $row->$spieler2_id, $alleSpielerInfo, htmlentities_utf8($row->$spieler2)); ?>
</td>
<?php } else {
if ($disziplin->spielform == 1) {
$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;
$type = "spieler";
}
?>
<td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML($type, $type === 'spieler' ? halloffameSpielerBildId($alleSpielerInfo, $row->$id) : $row->$id, 45, 60, 0, 0, 'border="0"', $type === 'spieler' ? halloffameSpielerBildAlternativ($alleSpielerInfo, $row->$id, $disziplin->geschaetztes_geschlecht) : ''); ?>
</td>
<td style="text-align:left; word-wrap: break-word;">
<?php echo halloffameNameLink($type, $row->$id, $alleSpielerInfo, htmlentities_utf8($row->$txt)); ?>
</td>
<?php if ($breite == 4) { ?>
<td colspan="2"></td>
<?php } ?>
<?php } ?>
<?php if ($teamspielerZeigen) {
$index_teamspieler = "teamspieler_" . $i;
?>
<td style="text-align:left; word-wrap: break-word;">
<?php echo $disziplin->spielform == 1 ? nl2br(htmlentities_utf8($row->$index_teamspieler)) : ''; ?>
</td>
<?php } ?>
</tr>
<?php
$ersteZeile = false;
}
}
?>
<?php } else { ?>
<colgroup>
<col style="width:<?php echo $disziplinBreite; ?>px;">
<?php for ($i = 1; $i <= $maxPlatz; $i++) { ?>
<col style="width:70px;">
<col style="width:300px;">
<?php if ($breite == 4) { ?>
<col style="width:70px;">
<col style="width:300px;">
<?php } ?>
<?php } ?>
<?php if ($teamspielerZeigen) { ?>
<col style="width:300px;">
<?php } ?>
</colgroup>
<?php if (!$nurPlatz1 || $teamspielerZeigen) { ?>
<tr class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>">
<th style="text-align:left;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME'); ?></strong></th>
<?php for ($i = 1; $i <= $maxPlatz; $i++) { ?>
<th style="text-align:left; padding-left:70px;" colspan="<?php echo $breite; ?>" nowrap>
<?php if (!$nurPlatz1) { ?>
<strong><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $i; ?></strong>
<?php } ?>
</th>
<?php } ?>
<?php if ($teamspielerZeigen) { ?>
<th style="text-align:left;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME_TEAM_PLAYERS'); ?></strong></th>
<?php } ?>
</tr>
<?php } ?>
<?php
$k = 0;
foreach ($disziplinen as $disziplin) {
if (!isset($disziplinenDesJahres[$disziplin->halloffame_id])) continue;
$row = $disziplinenDesJahres[$disziplin->halloffame_id];
$rowclass = "sectiontableentry" . ($k + 1) . $params->get('pageclass_sfx');
$k = ($k + 1) % 2;
?>
<tr class="<?php echo $rowclass; ?>">
<td style="word-wrap: break-word; padding-right: 20px;">
<a class="sm-halloffame-disziplin-link" href="<?php echo SportsManagerURL('&task=hall_of_fame_details&id=' . $disziplin->halloffame_id); ?>">
<?php echo htmlentities_utf8(NichtLeererString($disziplin->halloffame)); ?>
</a>
</td>
<?php for ($i = 1; $i <= $maxPlatz; $i++) {
$vorhanden = $i == 1 || ($i == 2 && $disziplin->platz2_zeigen) || ($i == 3 && $disziplin->platz3_zeigen);
if (!$vorhanden) { ?>
<td colspan="<?php echo $breite; ?>"></td>
<?php continue; ?>
<?php } ?>
<?php if ($disziplin->spielform == 2) {
$spieler1_id = "spieler1_id_" . $i;
$spieler1 = "spieler1_" . $i;
$spieler2_id = "spieler2_id_" . $i;
$spieler2 = "spieler2_" . $i;
?>
<td nowrap style="text-align:center; width:70px;">
<?php if (!empty($row->$spieler1)) echo bildHTML("spieler", halloffameSpielerBildId($alleSpielerInfo, $row->$spieler1_id), 45, 60, 0, 0, 'border="0"', halloffameSpielerBildAlternativ($alleSpielerInfo, $row->$spieler1_id, $disziplin->geschaetztes_geschlecht)); ?>
</td>
<td style="text-align:left; word-wrap: break-word;">
<?php echo halloffameNameLink('spieler', $row->$spieler1_id, $alleSpielerInfo, htmlentities_utf8($row->$spieler1)); ?>
</td>
<td nowrap style="text-align:center; width:70px;">
<?php if (!empty($row->$spieler2)) echo bildHTML("spieler", halloffameSpielerBildId($alleSpielerInfo, $row->$spieler2_id), 45, 60, 0, 0, 'border="0"', halloffameSpielerBildAlternativ($alleSpielerInfo, $row->$spieler2_id, $disziplin->geschaetztes_geschlecht)); ?>
</td>
<td style="text-align:left; word-wrap: break-word;">
<?php echo halloffameNameLink('spieler', $row->$spieler2_id, $alleSpielerInfo, htmlentities_utf8($row->$spieler2)); ?>
</td>
<?php } else {
if ($disziplin->spielform == 1) {
$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;
$type = "spieler";
}
?>
<td nowrap style="text-align:center; width:70px;">
<?php if (!empty($row->$txt)) echo bildHTML($type, $type === 'spieler' ? halloffameSpielerBildId($alleSpielerInfo, $row->$id) : $row->$id, 45, 60, 0, 0, 'border="0"', $type === 'spieler' ? halloffameSpielerBildAlternativ($alleSpielerInfo, $row->$id, $disziplin->geschaetztes_geschlecht) : ''); ?>
</td>
<td style="text-align:left; word-wrap: break-word;">
<?php echo halloffameNameLink($type, $row->$id, $alleSpielerInfo, htmlentities_utf8($row->$txt)); ?>
</td>
<?php if ($breite == 4) { ?>
<td colspan="2"></td>
<?php } ?>
<?php } ?>
<?php } ?>
<?php if ($teamspielerZeigen) {
$index_teamspieler = "teamspieler_1";
?>
<td style="text-align:left; word-wrap: break-word;">
<?php echo $disziplin->spielform == 1 ? nl2br(htmlentities_utf8($row->$index_teamspieler)) : ''; ?>
</td>
<?php } ?>
</tr>
<?php } ?>
<?php } ?>
</table>
</div>
<?php
}
}
?>
<span class="article_seperator<?php echo $params->get('pageclass_sfx'); ?>">&nbsp;</span>
<?php
}
static function halloffameNachSummeGruppiert($titel, $beschreibung, $traeger): void
{
global $params;
if (!empty($titel)) { ?>
<style>td{padding: 3px;}</style>
<h1
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>" style="font-size: inherit; margin: 0;"><?php echo htmlentities_utf8($titel); ?></h1><?php }
if (!empty($beschreibung)) {
?>
<div class="uk-overflow-auto">
<table class="contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
<tr>
<td><?php echo str_contains($beschreibung, ">") ? $beschreibung : htmlentities_utf8($beschreibung); ?></td>
</tr>
</table>
</div>
<?php
}
if (count($traeger) > 0) {
?>
<div class="uk-overflow-auto">
<table style='border-collapse: collapse; table-layout: fixed;'
class="uk-table-hover uk-table-divider uk-table-middle dtfl-table-medium contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
<colgroup>
<col style="width:70px;">
<col style="width:250px;">
<col style="width:80px;">
<col>
</colgroup>
<tr class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>">
<th colspan="2" style="text-align:left;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME'); ?></strong></th>
<th style="text-align:center;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME_TITLE_COUNT'); ?></strong></th>
<th style="text-align:left;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME_TITLES'); ?></strong></th>
</tr>
<?php
$k = 0;
foreach ($traeger as $t) {
$rowclass = "sectiontableentry" . ($k + 1) . $params->get('pageclass_sfx');
$k = ($k + 1) % 2;
$titelTexte = [];
foreach ($t->titel as $titel) {
$titelTexte[] = htmlentities_utf8(NichtLeererString($titel->halloffame)) . " (" . count($titel->jahre) . ") (" . implode(", ", $titel->jahre) . ")";
}
?>
<tr class="<?php echo $rowclass; ?>">
<td nowrap style="text-align:center; width:70px;">
<?php
$traegerBildId = $t->bild_type === 'spieler' && !$t->aktiv ? '' : $t->bild_id;
$traegerBildAlt = $t->bild_type === 'spieler' ? ($t->geschlecht == 'M' ? 'm' : 'w') : '';
echo bildHTML($t->bild_type, $traegerBildId, 45, 60, 0, 0, 'border="0"', $traegerBildAlt);
?>
</td>
<td style="text-align:left; word-wrap: break-word;">
<?php
$traegerDetailsTask = ['spieler' => 'spieler_details', 'vereine' => 'verein_details', 'mannschaften' => 'team_details'][$t->bild_type] ?? '';
if ($traegerDetailsTask !== '' && !empty($t->bild_id) && $t->aktiv) {
echo '<a href="' . SportsManagerURL('&task=' . $traegerDetailsTask . '&id=' . $t->bild_id) . '">' . htmlentities_utf8($t->name) . '</a>';
} else {
echo htmlentities_utf8($t->name);
}
?>
</td>
<td style="text-align:center;">
<?php echo $t->anzahl; ?>
</td>
<td style="text-align:left; word-wrap: break-word;">
<?php echo implode("<br>", $titelTexte); ?>
</td>
</tr>
<?php } ?>
</table>
</div>
<?php
}
?>
<span class="article_seperator<?php echo $params->get('pageclass_sfx'); ?>">&nbsp;</span>
<?php
}
static function halloffameNachSummeDisziplinGruppiert($titel, $beschreibung, $disziplinen): void
{
global $params;
if (!empty($titel)) { ?>
<style>td{padding: 3px;}</style>
<h1
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>" style="font-size: inherit; margin: 0;"><?php echo htmlentities_utf8($titel); ?></h1><?php }
if (!empty($beschreibung)) {
?>
<div class="uk-overflow-auto">
<table class="contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
<tr>
<td><?php echo str_contains($beschreibung, ">") ? $beschreibung : htmlentities_utf8($beschreibung); ?></td>
</tr>
</table>
</div>
<?php
}
?>
<style>
.sm-halloffame-disziplin-link { color: inherit; text-decoration: none; }
.sm-halloffame-disziplin-link:hover { text-decoration: underline; }
</style>
<?php
foreach ($disziplinen as $disziplin) {
if (count($disziplin->traeger) == 0) continue;
?>
<h4>
<a class="sm-halloffame-disziplin-link" href="<?php echo SportsManagerURL('&task=hall_of_fame_details&id=' . $disziplin->halloffame_id); ?>">
<?php echo htmlentities_utf8(NichtLeererString($disziplin->halloffame)); ?>
</a>
</h4>
<div class="uk-overflow-auto">
<table style='border-collapse: collapse; table-layout: fixed;'
class="uk-table-hover uk-table-divider uk-table-middle dtfl-table-medium contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
<colgroup>
<col style="width:70px;">
<col style="width:250px;">
<col style="width:80px;">
<col>
</colgroup>
<tr class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>">
<th colspan="2" style="text-align:left;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME'); ?></strong></th>
<th style="text-align:center;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME_TITLE_COUNT'); ?></strong></th>
<th style="text-align:left;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_YEARS'); ?></strong></th>
</tr>
<?php
$k = 0;
foreach ($disziplin->traeger as $t) {
$rowclass = "sectiontableentry" . ($k + 1) . $params->get('pageclass_sfx');
$k = ($k + 1) % 2;
?>
<tr class="<?php echo $rowclass; ?>">
<td nowrap style="text-align:center; width:70px;">
<?php
$traegerBildId = $t->bild_type === 'spieler' && !$t->aktiv ? '' : $t->bild_id;
$traegerBildAlt = $t->bild_type === 'spieler' ? ($t->geschlecht == 'M' ? 'm' : 'w') : '';
echo bildHTML($t->bild_type, $traegerBildId, 45, 60, 0, 0, 'border="0"', $traegerBildAlt);
?>
</td>
<td style="text-align:left; word-wrap: break-word;">
<?php
$traegerDetailsTask = ['spieler' => 'spieler_details', 'vereine' => 'verein_details', 'mannschaften' => 'team_details'][$t->bild_type] ?? '';
if ($traegerDetailsTask !== '' && !empty($t->bild_id) && $t->aktiv) {
echo '<a href="' . SportsManagerURL('&task=' . $traegerDetailsTask . '&id=' . $t->bild_id) . '">' . htmlentities_utf8($t->name) . '</a>';
} else {
echo htmlentities_utf8($t->name);
}
?>
</td>
<td style="text-align:center;">
<?php echo $t->anzahl; ?>
</td>
<td style="text-align:left; word-wrap: break-word;">
<?php echo implode(", ", $t->jahre); ?>
</td>
</tr>
<?php } ?>
</table>
</div>
<?php } ?>
<span class="article_seperator<?php echo $params->get('pageclass_sfx'); ?>">&nbsp;</span>
<?php
}
static function halloffameDetails($titel, $beschreibung, $rows, $halloffame, $platzierung = '', $alleSpielerInfo = []): void
{
global $params;
if (!empty($titel)) { ?>
<style>td{padding: 3px;}</style>
<h1
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>" style="font-size: inherit; margin: 0;"><?php echo htmlentities_utf8($titel); ?></h1><?php }
if (!empty($beschreibung)) { if (!empty($beschreibung)) {
?> ?>
<div class="uk-overflow-auto"> <div class="uk-overflow-auto">
@@ -4239,24 +4716,26 @@ static function halloffameDetails($titel, $beschreibung, $rows, $halloffame): vo
echo "<H3>" . htmlentities_utf8($halloffame->halloffame) . "</H3>"; echo "<H3>" . htmlentities_utf8($halloffame->halloffame) . "</H3>";
if ($rows != null) { if ($rows != null) {
$nurPlatz1 = !$halloffame->platz2_zeigen && !$halloffame->platz3_zeigen;
$teamspielerZeigen = $halloffame->spielform == 1 && $halloffame->teamspieler_zeigen && ($platzierung === 'inzeilen' || $nurPlatz1);
?> ?>
<div class="uk-overflow-auto"> <div class="uk-overflow-auto">
<table style='border-collapse: collapse;' <table style='border-collapse: collapse;'
class="uk-table-hover uk-table-divider uk-table-middle dtfl-table-medium contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>"> class="uk-table-hover uk-table-divider uk-table-middle dtfl-table-medium contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
<?php if ($platzierung === 'inzeilen') { ?>
<tr class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>"> <tr class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>">
<th style="text-align:center; width:100px;" nowrap> <th style="text-align:center; width:100px;" nowrap>
<strong><?php echo Text::_('COM_SPORTSMANAGER_YEAR'); ?></strong> <strong><?php echo Text::_('COM_SPORTSMANAGER_YEAR'); ?></strong>
</th> </th>
<?php if (!$nurPlatz1) { ?>
<?php <th style="text-align:center; width:100px;" nowrap>
for ($i = 1; $i <= 3; $i++) { <strong><?php echo Text::_('COM_SPORTSMANAGER_PLACE'); ?></strong>
if ($i == 2 && !$halloffame->platz2_zeigen) continue; </th>
if ($i == 3 && !$halloffame->platz3_zeigen) continue; <?php } ?>
?> <th style="text-align:center;" colspan="<?php echo $halloffame->spielform == 2 ? 4 : 2; ?>" nowrap></th>
<th style="text-align:center;" colspan="2" nowrap> <?php if ($teamspielerZeigen) { ?>
<strong><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $i; ?></strong> <th style="text-align:left;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME_TEAM_PLAYERS'); ?></strong></th>
</th>
<?php } ?> <?php } ?>
</tr> </tr>
@@ -4267,10 +4746,148 @@ static function halloffameDetails($titel, $beschreibung, $rows, $halloffame): vo
$rowclass = "sectiontableentry" . ($k + 1) . $params->get('pageclass_sfx'); $rowclass = "sectiontableentry" . ($k + 1) . $params->get('pageclass_sfx');
$k = ($k + 1) % 2; $k = ($k + 1) % 2;
if ($halloffame->spielform == 2) { $plaetzeVorhanden = [];
for ($i = 1; $i <= 3; $i++) {
if ($i == 2 && !$halloffame->platz2_zeigen) continue;
if ($i == 3 && !$halloffame->platz3_zeigen) continue;
if ($halloffame->spielform == 2) {
$spieler1 = "spieler1_" . $i;
$spieler2 = "spieler2_" . $i;
if (empty($row->$spieler1) && empty($row->$spieler2)) continue;
} else {
$txt = ($halloffame->spielform == 1 ? "teamname_" : "spieler1_") . $i;
if (empty($row->$txt)) continue;
}
$plaetzeVorhanden[] = $i;
}
if (empty($plaetzeVorhanden)) $plaetzeVorhanden = [1];
$anzahlPlatzZeilen = count($plaetzeVorhanden);
$ersteZeile = true;
foreach ($plaetzeVorhanden as $i) {
?>
<tr class="<?php echo $rowclass; ?>"<?php echo $ersteZeile ? ' style="border-top-width: 3px;"' : ''; ?>>
<?php if ($ersteZeile) { ?>
<td rowspan="<?php echo $anzahlPlatzZeilen; ?>" nowrap style="text-align:center;">
<?php echo $row->jahr; ?>
</td>
<?php } ?>
<?php if (!$nurPlatz1) { ?>
<td nowrap style="text-align:center;">
<?php echo $i; ?>
</td>
<?php } ?>
<?php if ($halloffame->spielform == 2) {
$spieler1_id = "spieler1_id_" . $i;
$spieler1 = "spieler1_" . $i;
$spieler2_id = "spieler2_id_" . $i;
$spieler2 = "spieler2_" . $i;
?>
<td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML("spieler", halloffameSpielerBildId($alleSpielerInfo, $row->$spieler1_id), 45, 60, 0, 0, 'border="0"', halloffameSpielerBildAlternativ($alleSpielerInfo, $row->$spieler1_id, $halloffame->geschaetztes_geschlecht)); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo halloffameNameLink('spieler', $row->$spieler1_id, $alleSpielerInfo, htmlentities_utf8($row->$spieler1)); ?>
</td>
<td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML("spieler", halloffameSpielerBildId($alleSpielerInfo, $row->$spieler2_id), 45, 60, 0, 0, 'border="0"', halloffameSpielerBildAlternativ($alleSpielerInfo, $row->$spieler2_id, $halloffame->geschaetztes_geschlecht)); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo halloffameNameLink('spieler', $row->$spieler2_id, $alleSpielerInfo, htmlentities_utf8($row->$spieler2)); ?>
</td>
<?php } else {
if ($halloffame->spielform == 1) {
$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;
$type = "spieler";
}
?>
<td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML($type, $type === 'spieler' ? halloffameSpielerBildId($alleSpielerInfo, $row->$id) : $row->$id, 45, 60, 0, 0, 'border="0"', $type === 'spieler' ? halloffameSpielerBildAlternativ($alleSpielerInfo, $row->$id, $halloffame->geschaetztes_geschlecht) : ''); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo halloffameNameLink($type, $row->$id, $alleSpielerInfo, htmlentities_utf8($row->$txt)); ?>
</td>
<?php if ($teamspielerZeigen) {
$index_teamspieler = "teamspieler_" . $i;
?>
<td style="text-align:left; word-wrap: break-word;">
<?php echo nl2br(htmlentities_utf8($row->$index_teamspieler)); ?>
</td>
<?php } ?>
<?php } ?>
</tr>
<?php
$ersteZeile = false;
}
}
?>
<?php } else {
$einspaltigesDoppel = ($platzierung === '' && $halloffame->spielform == 2 && !$halloffame->platz2_zeigen && !$halloffame->platz3_zeigen);
?>
<tr class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>">
<th style="text-align:center; width:100px;" nowrap>
<strong><?php echo Text::_('COM_SPORTSMANAGER_YEAR'); ?></strong>
</th>
<?php
for ($i = 1; $i <= 3; $i++) {
if ($i == 2 && !$halloffame->platz2_zeigen) continue;
if ($i == 3 && !$halloffame->platz3_zeigen) continue;
?>
<th style="text-align:left; padding-left:70px;" colspan="<?php echo $einspaltigesDoppel ? 4 : 2; ?>" nowrap>
<?php if (!$nurPlatz1) { ?>
<strong><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $i; ?></strong>
<?php } ?>
</th>
<?php } ?>
<?php if ($teamspielerZeigen) { ?>
<th style="text-align:left;" nowrap><strong><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME_TEAM_PLAYERS'); ?></strong></th>
<?php } ?>
</tr>
<?php
$k = 0;
foreach ($rows as $row) {
$rowclass = "sectiontableentry" . ($k + 1) . $params->get('pageclass_sfx');
$k = ($k + 1) % 2;
if ($halloffame->spielform == 2 && $einspaltigesDoppel) {
?>
<tr class="<?php echo $rowclass; ?>" style="border-top-width: 3px;">
<td nowrap style="text-align:center;">
<?php echo $row->jahr; ?>
</td>
<td nowrap style="text-align:center; width:70px;">
<?php if (!empty($row->spieler1_1)) echo bildHTML("spieler", halloffameSpielerBildId($alleSpielerInfo, $row->spieler1_id_1), 45, 60, 0, 0, 'border="0"', halloffameSpielerBildAlternativ($alleSpielerInfo, $row->spieler1_id_1, $halloffame->geschaetztes_geschlecht)); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo halloffameNameLink('spieler', $row->spieler1_id_1, $alleSpielerInfo, htmlentities_utf8($row->spieler1_1)); ?>
</td>
<td nowrap style="text-align:center; width:70px;">
<?php if (!empty($row->spieler2_1)) echo bildHTML("spieler", halloffameSpielerBildId($alleSpielerInfo, $row->spieler2_id_1), 45, 60, 0, 0, 'border="0"', halloffameSpielerBildAlternativ($alleSpielerInfo, $row->spieler2_id_1, $halloffame->geschaetztes_geschlecht)); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo halloffameNameLink('spieler', $row->spieler2_id_1, $alleSpielerInfo, htmlentities_utf8($row->spieler2_1)); ?>
</td>
</tr>
<?php
} else if ($halloffame->spielform == 2) {
?> ?>
<!-- Erste Zeile --> <!-- Erste Zeile -->
<tr class="<?php echo $rowclass; ?>"> <tr class="<?php echo $rowclass; ?>" style="border-top-width: 3px;">
<td rowspan="2" nowrap style="text-align:center;"> <td rowspan="2" nowrap style="text-align:center;">
<?php echo $row->jahr; ?> <?php echo $row->jahr; ?>
@@ -4283,10 +4900,10 @@ static function halloffameDetails($titel, $beschreibung, $rows, $halloffame): vo
$spieler1 = "spieler1_" . $i; $spieler1 = "spieler1_" . $i;
?> ?>
<td nowrap style="text-align:center; width:70px;"> <td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML("spieler", $row->$spieler1_id, 45, 60, 0, 0, 'border="0"'); ?> <?php if (!empty($row->$spieler1)) echo bildHTML("spieler", halloffameSpielerBildId($alleSpielerInfo, $row->$spieler1_id), 45, 60, 0, 0, 'border="0"', halloffameSpielerBildAlternativ($alleSpielerInfo, $row->$spieler1_id, $halloffame->geschaetztes_geschlecht)); ?>
</td> </td>
<td nowrap style="text-align:left; width:300px;"> <td nowrap style="text-align:left; width:300px;">
<?php echo htmlentities_utf8($row->$spieler1); ?> <?php echo halloffameNameLink('spieler', $row->$spieler1_id, $alleSpielerInfo, htmlentities_utf8($row->$spieler1)); ?>
</td> </td>
<?php } ?> <?php } ?>
</tr> </tr>
@@ -4299,17 +4916,17 @@ static function halloffameDetails($titel, $beschreibung, $rows, $halloffame): vo
$spieler2 = "spieler2_" . $i; $spieler2 = "spieler2_" . $i;
?> ?>
<td nowrap style="text-align:center; width:70px;"> <td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML("spieler", $row->$spieler2_id, 45, 60, 0, 0, 'border="0"'); ?> <?php if (!empty($row->$spieler2)) echo bildHTML("spieler", halloffameSpielerBildId($alleSpielerInfo, $row->$spieler2_id), 45, 60, 0, 0, 'border="0"', halloffameSpielerBildAlternativ($alleSpielerInfo, $row->$spieler2_id, $halloffame->geschaetztes_geschlecht)); ?>
</td> </td>
<td nowrap style="text-align:left; width:300px;"> <td nowrap style="text-align:left; width:300px;">
<?php echo htmlentities_utf8($row->$spieler2); ?> <?php echo halloffameNameLink('spieler', $row->$spieler2_id, $alleSpielerInfo, htmlentities_utf8($row->$spieler2)); ?>
</td> </td>
<?php } ?> <?php } ?>
</tr> </tr>
<?php <?php
} else { } else {
?> ?>
<tr class="<?php echo $rowclass; ?>"> <tr class="<?php echo $rowclass; ?>" style="border-top-width: 3px;">
<td nowrap style="text-align:center;"> <td nowrap style="text-align:center;">
<?php echo $row->jahr; ?> <?php echo $row->jahr; ?>
</td> </td>
@@ -4331,17 +4948,24 @@ static function halloffameDetails($titel, $beschreibung, $rows, $halloffame): vo
} }
?> ?>
<td nowrap style="text-align:center; width:70px;"> <td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML($type, $row->$id, 45, 60, 0, 0, 'border="0"'); ?> <?php if (!empty($row->$txt)) echo bildHTML($type, $type === 'spieler' ? halloffameSpielerBildId($alleSpielerInfo, $row->$id) : $row->$id, 45, 60, 0, 0, 'border="0"', $type === 'spieler' ? halloffameSpielerBildAlternativ($alleSpielerInfo, $row->$id, $halloffame->geschaetztes_geschlecht) : ''); ?>
</td> </td>
<td nowrap style="text-align:left; width:300px;"> <td nowrap style="text-align:left; width:300px;">
<?php echo htmlentities_utf8($row->$txt); ?> <?php echo halloffameNameLink($type, $row->$id, $alleSpielerInfo, htmlentities_utf8($row->$txt)); ?>
</td> </td>
<?php if ($teamspielerZeigen) {
$index_teamspieler = "teamspieler_" . $i;
?>
<td style="text-align:left; word-wrap: break-word;">
<?php echo nl2br(htmlentities_utf8($row->$index_teamspieler)); ?>
</td>
<?php } ?>
<?php } ?> <?php } ?>
</tr> </tr>
<?php <?php
} }
} }
?> } ?>
</table> </table>
<?php <?php
} }
@@ -8167,6 +8167,7 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
<?php <?php
if ($rows != null) { if ($rows != null) {
$einspaltigesDoppel = ($halloffame->spielform == 2 && !$halloffame->platz2_zeigen && !$halloffame->platz3_zeigen);
?> ?>
<div class="uk-overflow-auto"> <div class="uk-overflow-auto">
<table style='border-collapse: collapse;' <table style='border-collapse: collapse;'
@@ -8182,7 +8183,7 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
if ($i == 2 && !$halloffame->platz2_zeigen) continue; if ($i == 2 && !$halloffame->platz2_zeigen) continue;
if ($i == 3 && !$halloffame->platz3_zeigen) continue; if ($i == 3 && !$halloffame->platz3_zeigen) continue;
?> ?>
<th style="text-align:center;" colspan="2" nowrap> <th style="text-align:center;" colspan="<?php echo $einspaltigesDoppel ? 4 : 2; ?>" nowrap>
<strong><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $i; ?></strong> <strong><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $i; ?></strong>
</th> </th>
<?php } ?> <?php } ?>
@@ -8198,7 +8199,42 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
$rowclass = "sectiontableentry" . ($k + 1) . $params->get('pageclass_sfx'); $rowclass = "sectiontableentry" . ($k + 1) . $params->get('pageclass_sfx');
$k = ($k + 1) % 2; $k = ($k + 1) % 2;
if ($halloffame->spielform == 2) { if ($halloffame->spielform == 2 && $einspaltigesDoppel) {
?>
<tr class="<?php echo $rowclass; ?>">
<td nowrap style="text-align:center;">
<a href="<?php echo SportsManagerURL('&task=admin_halloffame_mitglied_edit&halloffame_id=' . $halloffame->halloffame_id . '&jahr=' . $row->jahr); ?>">
<?php echo $row->jahr; ?>
</a>
</td>
<td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML("spieler", $row->spieler1_id_1, 45, 60, 0, 0, 'border="0"'); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo htmlentities_utf8($row->spieler1_1); ?>
</td>
<td nowrap style="text-align:center; width:70px;">
<?php echo bildHTML("spieler", $row->spieler2_id_1, 45, 60, 0, 0, 'border="0"'); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo htmlentities_utf8($row->spieler2_1); ?>
</td>
<td nowrap>
<small>
<a href="<?php echo SportsManagerURL('&task=admin_halloffame_mitglied_remove&halloffame_id=' . $halloffame->halloffame_id . '&jahr=' . $row->jahr); ?>"
onclick="return confirm('<?php echo Text::_('COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME_YEAR'); ?>');"
title="<?php echo Text::_('COM_SPORTSMANAGER_REMOVE'); ?>">
X
</a>
</small>
</td>
</tr>
<?php
} else if ($halloffame->spielform == 2) {
?> ?>
<!-- Erste Zeile --> <!-- Erste Zeile -->
@@ -8310,11 +8346,58 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
static function adminEditHalloffameMitglied($row,$halloffame,$vereine,$spieler,$jahre): void static function adminEditHalloffameMitglied($row,$halloffame,$vereine,$spieler,$jahre): void
{ {
global $params; global $params;
// Options nur einmal aufbauen (statt bis zu 6x je Formular) - bei grossen Spieler-/Vereinslisten deutlich schneller
$vereineOptionsHtml = '';
$spielerOptionsHtml = '';
if ($halloffame->spielform == 1) {
$vereineAktiv = array();
$vereineInaktiv = array();
foreach ($vereine as $v) {
if (empty($v->ausgetreten))
$vereineAktiv[] = $v;
else
$vereineInaktiv[] = $v;
}
$ausgetretenSuffix = " (" . Text::_('COM_SPORTSMANAGER_BEATEN') . ")";
$vereineOptionsHtml = '<option value="0"></option>';
$vereineOptionsHtml .= '<optgroup label="' . htmlentities_utf8(Text::_('COM_SPORTSMANAGER_ACTIVE_CLUBS')) . '">';
foreach ($vereineAktiv as $v)
$vereineOptionsHtml .= '<option value="' . $v->verein_id . '">' . htmlentities_utf8($v->verein) . '</option>';
$vereineOptionsHtml .= '</optgroup>';
$vereineOptionsHtml .= '<optgroup label="' . htmlentities_utf8(Text::_('COM_SPORTSMANAGER_INACTIVE_CLUBS')) . '">';
foreach ($vereineInaktiv as $v)
$vereineOptionsHtml .= '<option value="' . $v->verein_id . '">' . htmlentities_utf8($v->verein . $ausgetretenSuffix) . '</option>';
$vereineOptionsHtml .= '</optgroup>';
} else {
$spielerOptionsHtml = '<option value="0"></option>';
foreach ($spieler as $s)
$spielerOptionsHtml .= '<option value="' . $s->spieler_id . '">' . htmlentities_utf8($s->spieler) . '</option>';
}
?> ?>
<div <div
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo htmlentities_utf8($halloffame->halloffame); ?> class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo htmlentities_utf8($halloffame->halloffame); ?>
: <?php echo($row != null ? Text::_('COM_SPORTSMANAGER_CHANGING') : Text::_('COM_SPORTSMANAGER_ADD')); ?></div> : <?php echo($row != null ? Text::_('COM_SPORTSMANAGER_CHANGING') : Text::_('COM_SPORTSMANAGER_ADD')); ?></div>
<template id="halloffame-vereine-options"><?php echo $vereineOptionsHtml; ?></template>
<template id="halloffame-spieler-options"><?php echo $spielerOptionsHtml; ?></template>
<script type="text/javascript">
function halloffameNichtAusgespieltUmschalten(deaktiviert) {
document.querySelectorAll('.halloffame-platz-zeile input, .halloffame-platz-zeile select, .halloffame-platz-zeile textarea').forEach(function (feld) {
feld.disabled = deaktiviert;
});
}
function halloffameOptionenFuellen(selectId, templateId, wert) {
var select = document.getElementById(selectId);
var template = document.getElementById(templateId);
select.innerHTML = template.innerHTML;
if (wert) select.value = wert;
}
</script>
<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">
@@ -8333,6 +8416,13 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
} }
?> ?>
</select> </select>
&nbsp;&nbsp;
<label for="nicht_ausgespielt">
<input type="checkbox" name="nicht_ausgespielt" id="nicht_ausgespielt" value="1"
onclick="halloffameNichtAusgespieltUmschalten(this.checked);"
<?php echo ($row != null && !empty($row->nicht_ausgespielt)) ? " checked" : ""; ?> />
<?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME_NOT_HELD'); ?>
</label>
</td> </td>
</tr> </tr>
<?php <?php
@@ -8340,26 +8430,35 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
if ($halloffame->spielform == 1){ if ($halloffame->spielform == 1){
$index_vereinid = "verein_id_" . $p; $index_vereinid = "verein_id_" . $p;
$index_team = "teamname_" . $p; $index_team = "teamname_" . $p;
$index_teamspieler = "teamspieler_" . $p;
?> ?>
<tr> <tr class="halloffame-platz-zeile">
<td nowrap style="width: 20%; text-align: right"> <td nowrap style="width: 20%; text-align: right">
<label for="verein1_<?php echo $p; ?>"><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $p; ?> <label for="verein1_<?php echo $p; ?>"><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $p; ?>
:</label> :</label>
</td> </td>
<td nowrap> <td nowrap>
<select class="uk-select uk-form-width-large" name="verein_id_<?php echo $p; ?>" <select class="uk-select uk-form-width-large" name="verein_id_<?php echo $p; ?>"
id="verein_id_<?php echo $p; ?>" size="1" style="width: 370px;"> id="verein_id_<?php echo $p; ?>" size="1" style="width: 370px;"></select>
<?php <script type="text/javascript">
echo "<option value=\"0\"></option>"; halloffameOptionenFuellen('verein_id_<?php echo $p; ?>', 'halloffame-vereine-options', '<?php echo $row != null ? (int) $row->$index_vereinid : 0; ?>');
foreach ($vereine as $v) </script>
echo "<option value=\"" . $v->verein_id . "\"" . ($row != null ? ($row->$index_vereinid == $v->verein_id ? " selected" : "") : "") . ">" . htmlentities_utf8($v->verein) . "</option>";
?>
</select>
<input class="inputbox uk-select" type="text" style="width: 370px; height: 35px;" <input class="inputbox uk-select" type="text" style="width: 370px; height: 35px;"
name="teamname_<?php echo $p; ?>" id="verein_<?php echo $p; ?>" size="50" maxlength="64" name="teamname_<?php echo $p; ?>" id="verein_<?php echo $p; ?>" size="50" maxlength="64"
value="<?php echo $row != null ? htmlentities_utf8($row->$index_team) : ''; ?>"/> value="<?php echo $row != null ? htmlentities_utf8($row->$index_team) : ''; ?>"/>
</td> </td>
</tr> </tr>
<tr class="halloffame-platz-zeile">
<td nowrap style="width: 20%; text-align: right">
<label for="teamspieler_<?php echo $p; ?>"><?php echo Text::_('COM_SPORTSMANAGER_HALL_OF_FAME_TEAM_PLAYERS'); ?>
:</label>
</td>
<td nowrap>
<textarea class="uk-textarea" style="width: 740px; height: 70px;"
name="teamspieler_<?php echo $p; ?>" id="teamspieler_<?php echo $p; ?>"
><?php echo $row != null ? htmlentities_utf8($row->$index_teamspieler) : ''; ?></textarea>
</td>
</tr>
<?php <?php
} }
@@ -8369,33 +8468,27 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
$index_spieler2id = "spieler2_id_" . $p; $index_spieler2id = "spieler2_id_" . $p;
$index_spieler2 = "spieler2_" . $p; $index_spieler2 = "spieler2_" . $p;
?> ?>
<tr> <tr class="halloffame-platz-zeile">
<td nowrap style="width: 20%; text-align: right"> <td nowrap style="width: 20%; text-align: right">
<label for="player1_<?php echo $p; ?>"><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $p; ?> <label for="player1_<?php echo $p; ?>"><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $p; ?>
:</label> :</label>
</td> </td>
<td nowrap> <td nowrap>
<select class="uk-select uk-form-width-large" name="spieler1_id_<?php echo $p; ?>" <select class="uk-select uk-form-width-large" name="spieler1_id_<?php echo $p; ?>"
id="player1_id_<?php echo $p; ?>" size="1" style="width: 370px;"> id="player1_id_<?php echo $p; ?>" size="1" style="width: 370px;"></select>
<?php <script type="text/javascript">
echo "<option value=\"0\"></option>"; halloffameOptionenFuellen('player1_id_<?php echo $p; ?>', 'halloffame-spieler-options', '<?php echo $row != null ? (int) $row->$index_spieler1id : 0; ?>');
foreach ($spieler as $s) </script>
echo "<option value=\"" . $s->spieler_id . "\"" . ($row != null ? ($row->$index_spieler1id == $s->spieler_id ? " selected" : "") : "") . ">" . htmlentities_utf8($s->spieler) . "</option>";
?>
</select>
<input class="inputbox uk-select" type="text" style="width: 370px; height: 35px;" <input class="inputbox uk-select" type="text" style="width: 370px; height: 35px;"
name="spieler1_<?php echo $p; ?>" id="player1_<?php echo $p; ?>" size="50" maxlength="64" name="spieler1_<?php echo $p; ?>" id="player1_<?php echo $p; ?>" size="50" maxlength="64"
value="<?php echo $row != null ? htmlentities_utf8($row->$index_spieler1) : ''; ?>"/> value="<?php echo $row != null ? htmlentities_utf8($row->$index_spieler1) : ''; ?>"/>
<?PHP if ($halloffame->spielform == 2){ ?> <?PHP if ($halloffame->spielform == 2){ ?>
<br> <br>
<select class="uk-select uk-form-width-large" name="spieler2_id_<?php echo $p; ?>" <select class="uk-select uk-form-width-large" name="spieler2_id_<?php echo $p; ?>"
id="player2_id_<?php echo $p; ?>" size="1" style="width: 370px;"> id="player2_id_<?php echo $p; ?>" size="1" style="width: 370px;"></select>
<?php <script type="text/javascript">
echo "<option value=\"0\"></option>"; halloffameOptionenFuellen('player2_id_<?php echo $p; ?>', 'halloffame-spieler-options', '<?php echo $row != null ? (int) $row->$index_spieler2id : 0; ?>');
foreach ($spieler as $s) </script>
echo "<option value=\"" . $s->spieler_id . "\"" . ($row != null ? ($row->$index_spieler2id == $s->spieler_id ? " selected" : "") : "") . ">" . htmlentities_utf8($s->spieler) . "</option>";
?>
</select>
<input class="inputbox uk-select" type="text" style="width: 370px; height: 35px;" <input class="inputbox uk-select" type="text" style="width: 370px; height: 35px;"
name="spieler2_<?php echo $p; ?>" id="player2_<?php echo $p; ?>" size="50" maxlength="64" name="spieler2_<?php echo $p; ?>" id="player2_<?php echo $p; ?>" size="50" maxlength="64"
value="<?php echo $row != null ? htmlentities_utf8($row->$index_spieler2) : ''; ?>"/> value="<?php echo $row != null ? htmlentities_utf8($row->$index_spieler2) : ''; ?>"/>
@@ -8418,6 +8511,9 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
<input type="hidden" name="halloffame_id" value="<?php echo $halloffame->halloffame_id; ?>"/> <input type="hidden" name="halloffame_id" value="<?php echo $halloffame->halloffame_id; ?>"/>
<input type="hidden" name="spielform" value="<?php echo $halloffame->spielform; ?>"/> <input type="hidden" name="spielform" value="<?php echo $halloffame->spielform; ?>"/>
</form> </form>
<script type="text/javascript">
halloffameNichtAusgespieltUmschalten(document.getElementById('nicht_ausgespielt').checked);
</script>
<?php <?php
} }
@@ -395,6 +395,8 @@ COM_SPORTSMANAGER_BEATEN="Ausgetreten"
COM_SPORTSMANAGER_HIDE="Verstecken" COM_SPORTSMANAGER_HIDE="Verstecken"
COM_SPORTSMANAGER_PASSIVE="Passiv" COM_SPORTSMANAGER_PASSIVE="Passiv"
COM_SPORTSMANAGER_BEATEN_CLUB="Verein ausgetreten" COM_SPORTSMANAGER_BEATEN_CLUB="Verein ausgetreten"
COM_SPORTSMANAGER_ACTIVE_CLUBS="Aktive Vereine"
COM_SPORTSMANAGER_INACTIVE_CLUBS="Inaktive Vereine"
COM_SPORTSMANAGER_SINGLE_SEED="Elo-Startwert Einzel" COM_SPORTSMANAGER_SINGLE_SEED="Elo-Startwert Einzel"
COM_SPORTSMANAGER_DOUBLE_SEED="Elo-Startwert Doppel" COM_SPORTSMANAGER_DOUBLE_SEED="Elo-Startwert Doppel"
COM_SPORTSMANAGER_PLAYER_EXPORT="Spieler: Exportieren" COM_SPORTSMANAGER_PLAYER_EXPORT="Spieler: Exportieren"
@@ -1107,6 +1109,10 @@ COM_SPORTSMANAGER_MATCH_TYPE="Spielform"
COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME_YEAR="Willst Du wirklich dieses Hall of Fame Jahr l&ouml;schen?" COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME_YEAR="Willst Du wirklich dieses Hall of Fame Jahr l&ouml;schen?"
COM_SPORTSMANAGER_YEARS="Jahre" COM_SPORTSMANAGER_YEARS="Jahre"
COM_SPORTSMANAGER_ADD_HALL_OF_FAME_YEAR="Hall of Fame Jahr hinzuf&uuml;gen" COM_SPORTSMANAGER_ADD_HALL_OF_FAME_YEAR="Hall of Fame Jahr hinzuf&uuml;gen"
COM_SPORTSMANAGER_HALL_OF_FAME_TITLE_COUNT="Anzahl"
COM_SPORTSMANAGER_HALL_OF_FAME_TITLES="Titel"
COM_SPORTSMANAGER_HALL_OF_FAME_TEAM_PLAYERS="Mannschaftsspieler"
COM_SPORTSMANAGER_HALL_OF_FAME_NOT_HELD="Nicht ausgespielt"
COM_SPORTSMANAGER_NO_ENTRY="kein Eintrag" COM_SPORTSMANAGER_NO_ENTRY="kein Eintrag"
COM_SPORTSMANAGER_REALLY_SWAP_MATCH="Willst Du wirklich das Heimrecht tauschen?" COM_SPORTSMANAGER_REALLY_SWAP_MATCH="Willst Du wirklich das Heimrecht tauschen?"
COM_SPORTSMANAGER_SWAP_MATCH="Heimrechttausch" COM_SPORTSMANAGER_SWAP_MATCH="Heimrechttausch"
@@ -395,6 +395,8 @@ COM_SPORTSMANAGER_BEATEN="Excreted"
COM_SPORTSMANAGER_HIDE="Hide" COM_SPORTSMANAGER_HIDE="Hide"
COM_SPORTSMANAGER_PASSIVE="Passive" COM_SPORTSMANAGER_PASSIVE="Passive"
COM_SPORTSMANAGER_BEATEN_CLUB="Club excreted" COM_SPORTSMANAGER_BEATEN_CLUB="Club excreted"
COM_SPORTSMANAGER_ACTIVE_CLUBS="Active clubs"
COM_SPORTSMANAGER_INACTIVE_CLUBS="Inactive clubs"
COM_SPORTSMANAGER_SINGLE_SEED="Elo starting value singles" COM_SPORTSMANAGER_SINGLE_SEED="Elo starting value singles"
COM_SPORTSMANAGER_DOUBLE_SEED="Elo starting value doubles" COM_SPORTSMANAGER_DOUBLE_SEED="Elo starting value doubles"
COM_SPORTSMANAGER_PLAYER_EXPORT="Players: Export" COM_SPORTSMANAGER_PLAYER_EXPORT="Players: Export"
@@ -1107,6 +1109,10 @@ COM_SPORTSMANAGER_MATCH_TYPE="Game Type"
COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME_YEAR="Are you sure you want to delete this Hall of Fame year?" COM_SPORTSMANAGER_REALLY_REMOVE_HALL_OF_FAME_YEAR="Are you sure you want to delete this Hall of Fame year?"
COM_SPORTSMANAGER_YEARS="Years" COM_SPORTSMANAGER_YEARS="Years"
COM_SPORTSMANAGER_ADD_HALL_OF_FAME_YEAR="Add Hall of Fame Year" COM_SPORTSMANAGER_ADD_HALL_OF_FAME_YEAR="Add Hall of Fame Year"
COM_SPORTSMANAGER_HALL_OF_FAME_TITLE_COUNT="Number"
COM_SPORTSMANAGER_HALL_OF_FAME_TITLES="Titles"
COM_SPORTSMANAGER_HALL_OF_FAME_TEAM_PLAYERS="Team Players"
COM_SPORTSMANAGER_HALL_OF_FAME_NOT_HELD="Not held"
COM_SPORTSMANAGER_NO_ENTRY="no entry" COM_SPORTSMANAGER_NO_ENTRY="no entry"
COM_SPORTSMANAGER_REALLY_SWAP_MATCH="Do you really want to swap the home advantage?" COM_SPORTSMANAGER_REALLY_SWAP_MATCH="Do you really want to swap the home advantage?"
COM_SPORTSMANAGER_SWAP_MATCH="Swap home advantage" COM_SPORTSMANAGER_SWAP_MATCH="Swap home advantage"
+9 -1
View File
@@ -94,6 +94,12 @@ return new class () implements InstallerScriptInterface
return false; return false;
} }
if (!bildKopierenAngepasst(JPATH_ROOT.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_sportsmanager'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'spieler-n.png', JPATH_ROOT.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'sportsmanager'.DIRECTORY_SEPARATOR.'spieler'.DIRECTORY_SEPARATOR.'n.png', 180, 240, 1)) {
Log::add('Image /components/com_sportsmanager/images/spieler-n.png could not be copied to /images/sportsmanager/spieler/n.png', Log::ERROR);
echo '<p>Fehler: Bild spieler-n.png konnte nicht nach /images/sportsmanager/spieler/n.png verschoben werden</p>';
return false;
}
} }
$adapter->getParent()->setRedirectURL('index.php?option=com_sportsmanager'); $adapter->getParent()->setRedirectURL('index.php?option=com_sportsmanager');
return true; return true;
@@ -1251,9 +1257,11 @@ return new class () implements InstallerScriptInterface
. "\n `mitglied_halloffame_id` int(11) NOT NULL AUTO_INCREMENT," . "\n `mitglied_halloffame_id` int(11) NOT NULL AUTO_INCREMENT,"
. "\n `halloffame_id` int(11) NOT NULL," . "\n `halloffame_id` int(11) NOT NULL,"
. "\n `jahr` int(4) DEFAULT NULL," . "\n `jahr` int(4) DEFAULT NULL,"
. "\n `nicht_ausgespielt` tinyint(1) NOT NULL DEFAULT '0',"
. "\n `platz` int(11) DEFAULT NULL," . "\n `platz` int(11) DEFAULT NULL,"
. "\n `verein_id` int(11) DEFAULT NULL," . "\n `verein_id` int(11) DEFAULT NULL,"
. "\n `teamname` varchar(64) DEFAULT NULL," . "\n `teamname` varchar(64) DEFAULT NULL,"
. "\n `teamspieler` text DEFAULT NULL,"
. "\n `spieler1_id` int(11) DEFAULT NULL," . "\n `spieler1_id` int(11) DEFAULT NULL,"
. "\n `spieler1` varchar(64) DEFAULT NULL," . "\n `spieler1` varchar(64) DEFAULT NULL,"
. "\n `spieler2_id` int(11) DEFAULT NULL," . "\n `spieler2_id` int(11) DEFAULT NULL,"
@@ -1274,7 +1282,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 = '120';"; $query = "INSERT IGNORE #__sportsmanager_einstellungen SET name = 'datenbank_version', wert = '121';";
$db->setQuery( $query ); $db->setQuery( $query );
if (!$db->execute()) { die($db->stderr(true)); } if (!$db->execute()) { die($db->stderr(true)); }