Compare commits

..
Author SHA1 Message Date
Marvin Flock c3dff8bcbd fix: change IN_PROGRESS to RUNNING 2026-05-17 15:57:46 +02:00
Marvin Flock 77f8b82a25 feat: add sportshub export functionality 2026-05-15 23:09:49 +02:00
16 changed files with 1224 additions and 2148 deletions
-84
View File
@@ -1,84 +0,0 @@
# Builds the codebase and publishes a rolling dev-preview release (no version bump).
# The release uses a fixed tag "dev-preview" so each run replaces the previous one.
name: Sportsmanager Dev Preview
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to build'
required: true
default: 'sportsmanager2-prod'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install npm dependencies
run: npm ci
- name: Run build script
run: npm run release
- name: Delete existing dev-preview release (if any)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
run: |
release_id=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/$REPO/releases/tags/dev-preview" \
| jq -r '.id // empty')
if [ -n "$release_id" ]; then
curl -s -X DELETE -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/$REPO/releases/$release_id"
echo "Deleted existing dev-preview release (ID: $release_id)"
else
echo "No existing dev-preview release found"
fi
- name: Delete existing dev-preview tag (if any)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
run: |
status=$(curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/$REPO/git/refs/tags/dev-preview")
if [ "$status" = "200" ]; then
curl -s -X DELETE -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/$REPO/git/refs/tags/dev-preview"
echo "Deleted existing dev-preview tag"
else
echo "No existing dev-preview tag found"
fi
- name: Publish dev-preview release
uses: softprops/action-gh-release@v2
with:
tag_name: dev-preview
name: "Dev Preview (${{ github.run_number }})"
body: |
Automated dev preview build from branch `${{ inputs.branch }}`.
Commit: ${{ github.sha }}
Run: ${{ github.run_number }}
> This is a temporary preview release and will be replaced on the next run.
files: package/packages/com_sportsmanager.zip
draft: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+5 -19
View File
@@ -52,6 +52,7 @@
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.0.tgz",
"integrity": "sha512-iV7Gwg0DePKvdDZZWRTkj4MW+6/AbVWd4ZCg+zk8H1RVt5xBpUZS6vLQWwb3pyLg4BFTaGiQCPoJ4Ibmbne4fA==",
"dev": true,
"peer": true,
"dependencies": {
"@babel/code-frame": "^7.10.4",
"@babel/generator": "^7.12.0",
@@ -2694,25 +2695,10 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001810",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz",
"integrity": "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==",
"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"
"version": "1.0.30001148",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001148.tgz",
"integrity": "sha512-E66qcd0KMKZHNJQt9hiLZGE3J4zuTqE1OnU53miEVtylFbwOEmeA5OsRu90noZful+XGSQOni1aT2tiqu/9yYw==",
"dev": true
},
"node_modules/chalk": {
"version": "1.1.3",
@@ -30,8 +30,6 @@ COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_DESCRIPTION="Beschreibung"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_DESCRIPTION_DESC="Beschreibung, die unterhalb des Titels angezeigt wird (WICHTIG: Werden HTML-Tags verwendet, müssen auch Umlaute in HTML-Code angeben werden)"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_CATEGORIES="Kategorien"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_CATEGORIES_DESC="Eine optionale Auswahl von Kategorienummern durch Kommata oder Spiegelstrich getrennt"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_EXTRA_PARAMS="Zusätzliche Parameter"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_EXTRA_PARAMS_DESC="Optionale zusätzliche Parameter für den Link in der Form Name1=Wert1&Name2=Wert2, die bei Aufruf dieses Menüpunkts wie GET-Parameter zur Verfügung stehen"
COM_SPORTSMANAGER_LAYOUT_ELO_RANKING_TITLE="Layout: Elo-Rangliste"
COM_SPORTSMANAGER_LAYOUT_ELO_RANKING_DESC="Auflistung der Spieler sortiert nach Elo-Wertung"
COM_SPORTSMANAGER_LAYOUT_ELO_RANKING_OPTION_ELO_RANKING="Elo-Rangliste"
@@ -30,8 +30,6 @@ COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_DESCRIPTION="Description"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_DESCRIPTION_DESC="Description that will be shows below the titel (IMPORTANT: if html tags are used, special characters must be maskeraded)"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_CATEGORIES="Categories"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_CATEGORIES_DESC="An optional selection of category numbers seperated by commas or bullet point"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_EXTRA_PARAMS="Additional parameters"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_EXTRA_PARAMS_DESC="Optional additional parameters for the link in the form name1=value1&name2=value2, made available as GET parameters whenever this menu item is called"
COM_SPORTSMANAGER_LAYOUT_ELO_RANKING_TITLE="Layout: elo ranking"
COM_SPORTSMANAGER_LAYOUT_ELO_RANKING_DESC="Listing of players sorted by elo rating"
COM_SPORTSMANAGER_LAYOUT_ELO_RANKING_OPTION_ELO_RANKING="Elo ranking"
File diff suppressed because it is too large Load Diff
@@ -5741,52 +5741,6 @@ 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));
}
}
$columns = $db->getTableColumns('#__sportsmanager_spielort');
if (!array_key_exists('zusatzinfo', $columns)){
$query = "ALTER TABLE `#__sportsmanager_spielort`"
. "\n ADD `zusatzinfo` TEXT NULL DEFAULT NULL AFTER `ruhetage`;";
$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) {
$query = "SELECT aktion_user_id, termin_aktion_id"
. "\n FROM #__sportsmanager_termin_aktion";
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

@@ -43,6 +43,7 @@ require_once JPATH_SITE . '/components/com_sportsmanager/views/sportsmanager/vie
require_once JPATH_SITE . '/components/com_sportsmanager/views/sportsmanager/view_ticker.php';
require_once JPATH_SITE . '/components/com_sportsmanager/util/image.php';
require_once JPATH_SITE . '/components/com_sportsmanager/util/email.php';
require_once JPATH_SITE . '/components/com_sportsmanager/util/export.php';
require_once JPATH_SITE . '/components/com_sportsmanager/database/update.php'; // will also include init.php and util.php
initDatabase();
@@ -61,27 +62,8 @@ global $params;
$app = Factory::getContainer()->get(SiteApplication::class);
$jInput = $app->input;
$params = $app->getParams('com_sportsmanager');
// zusätzliche, im Menüpunkt hinterlegte Parameter (z.B. "test=test&foo=bar") wie GET-Parameter verfügbar machen;
// tatsächlich in der URL übergebene Werte haben weiterhin Vorrang (def() setzt nur, wenn noch nicht vorhanden);
// muss vor dem Auslesen von task/content erfolgen, damit diese die Zusatzparameter berücksichtigen
$zusatzparameter = trim((string) $params->get('zusatzparameter', ''));
if ($zusatzparameter !== '') {
// Namen, die den gesamten Seitenaufbau umstellen würden, nicht über einen Menüparameter
$gesperrteNamen = ['option', 'Itemid', 'format', 'tmpl', 'lang'];
parse_str($zusatzparameter, $zusatzparameterWerte);
foreach ($zusatzparameterWerte as $zusatzparameterName => $zusatzparameterWert) {
// Arrays (z.B. "task[]=x") würden weiter unten zu einem TypeError führen
if (!is_scalar($zusatzparameterWert)
|| in_array($zusatzparameterName, $gesperrteNamen, true)) {
continue;
}
$jInput->def($zusatzparameterName, $zusatzparameterWert);
}
}
$task = $jInput->getCmd('task');
$params = $app->getParams('com_sportsmanager');
$content = isJson() && $jInput->getCmd('content', NULL) != NULL ? $jInput->getCmd('content') : $params->get('content');
if (berechnungen())
@@ -93,10 +75,6 @@ if ($task == "spielerbild") {
terminDokument();
} else if ($task == "spieler_details") {
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_")) {
// in some cases there are no breaks needed due to no return from method
switch ($task) {
@@ -106,6 +84,9 @@ if ($task == "spielerbild") {
case 'admin_einstellungen_save':
adminSaveEinstellungen();
break;
case 'admin_sportshub':
adminSportshub();
break;
case 'admin_datenbank':
adminDatenbank();
break;
@@ -870,6 +851,9 @@ if ($task == "spielerbild") {
case 'begegnung_spielplan':
begegnungSpielplan(true);
break;
case 'team_details':
mannschaftDetails($content == "teams_vereinigt");
break;
case 'team_spielplan_xml':
teamSpielplanXML();
case 'team_begegnungen_ical':
@@ -880,6 +864,9 @@ if ($task == "spielerbild") {
}
} else if ($content == "vereine") {
switch ($task) {
case 'verein_details':
vereinDetails();
break;
case 'verein_begegnungen_ical':
vereinBegegnungeniCal();
break;
@@ -1163,7 +1150,7 @@ if ($task == "spielerbild") {
return;
#[NoReturn] function redirectSportsManagerURL($weitereParameter = NULL, $nachricht = '', $nachrichtTyp = 'message'): void
#[NoReturn] function redirectSportsManagerURL($weitereParameter = NULL, $nachricht = ''): void
{
global $redirect_session_id;
if (!empty($redirect_session_id)) {
@@ -1173,7 +1160,7 @@ return;
}
$app = Factory::getContainer()->get(SiteApplication::class);
if ($nachricht != '') {
$app->enqueueMessage($nachricht, $nachrichtTyp);
$app->enqueueMessage($nachricht);
}
$app->redirect(SportsManagerURL($weitereParameter), 200);
exit;
@@ -4467,34 +4454,11 @@ function halloffame(): void
{
$db = getDatabase();
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,"
. "\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 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"
. kategorieFilter("HAVING t1.kategorie IN")
. "\n ORDER BY t1.reihenfolge;";
@@ -4506,363 +4470,11 @@ function halloffame(): void
if (isJson()) {
echo json_encode($halloffame);
} else {
HTML_sportsmanager::halloffame(halloffameTitel(), $params->get('beschreibung'), $halloffame);
HTML_sportsmanager::halloffame($params->get('titel'), $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);
$alleVereineInfo = halloffameAlleVereineInfo($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, $alleVereineInfo);
}
}
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);
$alleVereineInfo = halloffameAlleVereineInfo($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' => $bild_type === 'vereine' ? halloffameVereinAktiv($alleVereineInfo, $bild_id) : 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);
$alleVereineInfo = halloffameAlleVereineInfo($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' => $bild_type === 'vereine' ? halloffameVereinAktiv($alleVereineInfo, $bild_id) : 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
{
$db = getDatabase();
@@ -4876,21 +4488,9 @@ function halloffameDetails($uebergabe_id = 0): void
else
$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;
$query = "SELECT * FROM #__sportsmanager_halloffame WHERE halloffame_id = $id"
. halloffameIdFilter("AND halloffame_id IN");
$query = "SELECT * FROM #__sportsmanager_halloffame WHERE halloffame_id = $id";
$rows = loadObjectList($db, $query);
if (count($rows) < 1) {
abortWithError("Wrong id!");
@@ -4898,46 +4498,36 @@ function halloffameDetails($uebergabe_id = 0): void
$halloffame = $rows[0];
$halloffame->platz2_zeigen = 0;
$halloffame->platz3_zeigen = 0;
$halloffame->teamspieler_zeigen = 0;
$halloffame->anzahl_m = 0;
$halloffame->anzahl_w = 0;
$query = "SELECT t2.*, t1.halloffame"
. "\n FROM #__sportsmanager_halloffame t1"
. "\n LEFT JOIN #__sportsmanager_mitglied_von_halloffame t2 ON t2.halloffame_id = t1.halloffame_id"
. "\n WHERE t2.halloffame_id = $id"
. halloffameJahrFilter("AND t2.jahr IN")
. "\n ORDER BY t2.jahr $jahrSortierung, platz ASC;";
. "\n ORDER BY t2.jahr DESC, platz ASC;";
$rows = loadObjectList($db, $query);
$alleSpielerInfo = halloffameAlleSpielerInfo($db);
$alleVereineInfo = halloffameAlleVereineInfo($db);
if (count($rows) > 0){
$mitglieder = [];
if ($halloffame->spielform == 1){
$alleTeams = halloffameAlleTeams($db);
foreach ($rows as $row) {
$index_vereinid = "verein_id_" . $row->platz;
$index_teamid = "team_id_" . $row->platz;
$index_team = "teamname_" . $row->platz;
$index_teamspieler = "teamspieler_" . $row->platz;
if (!isset($mitglieder[$row->jahr])) {
$mitglieder[$row->jahr] = new stdClass();
}
$mitglieder[$row->jahr]->jahr = $row->jahr;
$mitglieder[$row->jahr]->$index_vereinid = $row->verein_id;
$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;
$mitglieder[$row->jahr]->$index_team = $row->teamname;
if ($row->platz == 2 && !empty($row->teamname))
$halloffame->platz2_zeigen = 1;
if ($row->platz == 3 && !empty($row->teamname))
$halloffame->platz3_zeigen = 1;
if (mb_strlen(trim((string) $row->teamspieler)) >= 3)
$halloffame->teamspieler_zeigen = 1;
//Suche team_id wenn keine verein_id vorhanden
if (empty($row->verein_id)){
$mitglieder[$row->jahr]->$index_teamid = halloffameTeamIdFuerTeamname($alleTeams, $row->teamname);
$query = "SELECT team_id FROM #__sportsmanager_team WHERE teamname LIKE '$row->teamname%' ORDER BY team_id DESC LIMIT 1;";
$mitglieder[$row->jahr]->$index_teamid = loadResult($db, $query);
} else {
$mitglieder[$row->jahr]->$index_teamid = "";
}
@@ -4955,31 +4545,21 @@ function halloffameDetails($uebergabe_id = 0): void
}
$mitglieder[$row->jahr]->jahr = $row->jahr;
$mitglieder[$row->jahr]->$index_spieler1id = $row->spieler1_id;
$mitglieder[$row->jahr]->$index_spieler1 = !empty($row->nicht_ausgespielt) ? Text::_('COM_SPORTSMANAGER_HALL_OF_FAME_NOT_HELD') : $row->spieler1;
$mitglieder[$row->jahr]->$index_spieler1 = $row->spieler1;
$mitglieder[$row->jahr]->$index_spieler2id = $row->spieler2_id;
$mitglieder[$row->jahr]->$index_spieler2 = $row->spieler2;
if ($row->platz == 2 && (!empty($row->spieler1) || !empty($row->spieler2)))
$halloffame->platz2_zeigen = 1;
if ($row->platz == 3 && (!empty($row->spieler1) || !empty($row->spieler2)))
$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()) {
echo json_encode($mitglieder);
} else {
HTML_sportsmanager::halloffameDetails(halloffameTitel(), $params->get('beschreibung'), $mitglieder, $halloffame, $platzierung, $alleSpielerInfo, $alleVereineInfo);
HTML_sportsmanager::halloffameDetails($params->get('titel'), $params->get('beschreibung'), $mitglieder, $halloffame);
}
}
@@ -19,17 +19,11 @@ require_once JPATH_SITE . '/components/com_sportsmanager/database/init.php';
/** @noinspection PhpUnused */
function mathParserVerteilung($rohpunkte, $platz, $teilnehmer, $multiplikator) {
if ($teilnehmer <= 1){
return 0;
}
return max(round($multiplikator * round(((($rohpunkte - 1) * (-log($platz / $teilnehmer) * (1 - ($platz / $teilnehmer)))) / (-log(1 / $teilnehmer) * (1 - (1 / $teilnehmer)))) + 1)), 1);
}
/** @noinspection PhpUnused */
function mathParserVerteilungR($rohpunkte, $platz, $teilnehmer, $multiplikator) {
if ($teilnehmer <= 1){
return 0;
}
return max(round(((($multiplikator * $rohpunkte - 1) * (-log($platz / $teilnehmer) * (1 - ($platz / $teilnehmer)))) / (-log(1 / $teilnehmer) * (1 - (1 / $teilnehmer)))) + 1), 1);
}
@@ -232,217 +226,6 @@ function kategorieFilter($prefix, $suffix = ""): string
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;
$num = intval($item);
if ($num > 0) {
$result[$num] = true; // Duplikate vermeiden
}
}
if (empty($result)) {
return "";
}
$filter = array_keys($result);
sort($filter, SORT_NUMERIC);
return " $prefix (" . implode(", ", $filter) . ") $suffix";
}
function halloffameIdFilter($prefix): string
{
// Keine Bereichssuche bei der Halloffame-Id, nur einzelne Werte
return idListeParameterFilter('halloffame_id', $prefix);
}
function halloffameJahrFilter($prefix): string
{
$minJahr = 1900;
$maxJahr = (int) date('Y') + 5;
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
$werte = $jInput->get('jahr', '', '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) continue;
// Werte vertauschen, falls der 2. Wert kleiner als der 1. ist
if ($end < $start) {
[$start, $end] = [$end, $start];
}
// Bereich auf 1900 .. aktuelles Jahr+5 begrenzen
$start = max($start, $minJahr);
$end = min($end, $maxJahr);
if ($start > $end) continue;
for ($i = $start; $i <= $end; $i++) {
$result[$i] = true; // Duplikate vermeiden
}
} else {
$num = intval($item);
if ($num <= 0) continue;
// Einzelwert auf 1900 .. aktuelles Jahr+5 begrenzen
$num = max($minJahr, min($maxJahr, $num));
$result[$num] = true;
}
}
if (empty($result)) {
return "";
}
$filter = array_keys($result);
sort($filter, SORT_NUMERIC);
return " $prefix (" . implode(", ", $filter) . ")";
}
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 halloffameAlleVereineInfo($db): array
{
$rows = loadObjectList($db, "SELECT verein_id, ausgetreten FROM #__sportsmanager_verein");
$result = [];
foreach ($rows as $row) {
$result[$row->verein_id] = (object) [
'aktiv' => empty($row->ausgetreten),
];
}
return $result;
}
function halloffameVereinAktiv(array $alleVereineInfo, $verein_id): bool
{
return empty($verein_id) || !isset($alleVereineInfo[$verein_id]) || $alleVereineInfo[$verein_id]->aktiv;
}
function halloffameNameLink(string $bild_type, $id, array $alleSpielerInfo, array $alleVereineInfo, string $nameHtml): string
{
if (empty($id))
return $nameHtml;
if ($bild_type === 'spieler' && !halloffameSpielerAktiv($alleSpielerInfo, $id))
return $nameHtml;
if ($bild_type === 'vereine' && !halloffameVereinAktiv($alleVereineInfo, $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
{
$user_id = isExternalDatabase() ? 0 : Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id;
@@ -0,0 +1,804 @@
<?php
/**
* Joomla/PHP export to importFormat.json structure.
*
* Assumptions:
* - Joomla table prefix is used via #__.
* - Source timezone is Europe/Berlin; output is UTC ISO-8601 "Z".
* - For turnier:
* - rundenstufe = 10 => Vorrunde
* - rundenstufe = 1,2,3 => Hauptrunde with groups:
* 1 => Profifeld, 2 => Amateurfeld, 3 => Hobbyfeld
* - For team-based exports:
* - stage/group are synthesized as defaults.
*
* Place this in a Joomla context (CLI script, controller, or a small admin entry point).
*/
defined('_JEXEC') or die;
use Joomla\Database\DatabaseDriver;
final class SMExporter
{
private DatabaseDriver $db;
private DateTimeZone $sourceTz;
private DateTimeZone $outputTz;
// Optional filter; set to null for all seasons
private $exportSeasonId = null;
// Optional file output; set to null to echo JSON only
private string $outputFile = JPATH_ROOT . '/tsm.json';
private array $playerCache = [];
private array $meldungsPlayersCache = [];
private array $teamCache = [];
private array $disciplineShortNames = ['Offenes Doppel' => 'OD',
'Offenes Einzel' => 'OE',
'Damen Doppel' => 'DD',
'Damen Einzel' => 'DE',
'Herren Doppel' => 'HD',
'Herren Einzel' => 'HE',
'Junioren Doppel' => 'JD',
'Junioren Einzel' => 'JE',
'Senioren Doppel' => 'SD',
'Senioren Einzel' => 'SE',];
public function __construct(DatabaseDriver $db)
{
$this->db = $db;
$this->sourceTz = new DateTimeZone('Europe/Berlin');
$this->outputTz = new DateTimeZone('UTC');
}
/**
* Format a DB date/datetime into UTC ISO-8601.
*/
function isoUtc(?string $value, DateTimeZone $sourceTz, DateTimeZone $outputTz): ?string
{
if (!$value || $value === '0000-00-00' || $value === '0000-00-00 00:00:00') {
return null;
}
try {
$dt = new DateTimeImmutable($value, $sourceTz);
return $dt->setTimezone($outputTz)->format('Y-m-d\TH:i:s\Z');
} catch (Throwable $e) {
return null;
}
}
/**
* Build shortName from kuerzel or disziplin text.
*/
function disciplineShortName(?string $kuerzel, ?string $disziplin): string
{
$kuerzel = trim((string)$kuerzel);
if ($kuerzel !== '') {
return $kuerzel;
}
$disziplin = (string)$disziplin;
foreach ($this->disciplineShortNames as $needle => $short) {
if (mb_stripos($disziplin, $needle) !== false) {
return $short;
}
}
// Last-resort fallback: initials of the words
$words = preg_split('/\s+/', trim($disziplin));
$initials = '';
foreach ($words as $w) {
if ($w !== '') {
$initials .= mb_substr($w, 0, 1);
}
}
return $initials !== '' ? mb_strtoupper($initials) : 'X';
}
/**
* Build a person object from spieler_id or from turniermeldung_spieler_name.
*/
function getPersonForSpieler(
Joomla\Database\DatabaseInterface $db,
?int $spielerId,
?int $turniermeldungSpielerId,
array &$playerCache
): array
{
if ($spielerId && isset($playerCache[$spielerId])) {
return $playerCache[$spielerId];
}
if ($spielerId) {
$query = $db->getQuery(true)
->select(['spieler_id', 'vorname', 'nachname', 'spielernr'])
->from($db->quoteName('#__sportsmanager_spieler'))
->where($db->quoteName('spieler_id') . ' = ' . (int)$spielerId);
$db->setQuery($query);
$row = $db->loadObject();
$person = [
'name' => $row ? trim(($row->vorname ?? '') . ' ' . ($row->nachname ?? '')) : ('Spieler ' . $spielerId),
'playerNr' => $row && !empty($row->spielernr) ? (string)$row->spielernr : null,
];
$playerCache[$spielerId] = $person;
return $person;
}
if ($turniermeldungSpielerId) {
$query = $db->getQuery(true)
->select(['vorname', 'nachname', 'vereinsname'])
->from($db->quoteName('#__sportsmanager_turniermeldung_spieler_name'))
->where($db->quoteName('turniermeldung_spieler_id') . ' = ' . (int)$turniermeldungSpielerId)
->order('turniermeldung_spieler_name_id ASC');
$db->setQuery($query);
$row = $db->loadObject();
if ($row) {
return [
'name' => trim(($row->vorname ?? '') . ' ' . ($row->nachname ?? '')),
'playerNr' => null,
];
}
}
return [
'name' => 'Unknown',
'playerNr' => null,
];
}
/**
* Get all players assigned to a turniermeldung.
*/
function getMeldungPlayers(
Joomla\Database\DatabaseInterface $db,
int $turniermeldungId,
array &$meldungsPlayersCache,
array &$playerCache
): array
{
if (isset($meldungsPlayersCache[$turniermeldungId])) {
return $meldungsPlayersCache[$turniermeldungId];
}
$query = $db->getQuery(true)
->select(['tms.turniermeldung_spieler_id', 'tms.spieler_id'])
->from($db->quoteName('#__sportsmanager_turniermeldung_spieler', 'tms'))
->where('tms.turniermeldung_id = ' . $turniermeldungId)
->order('tms.turniermeldung_spieler_id ASC');
$db->setQuery($query);
$rows = $db->loadObjectList();
$players = [];
foreach ($rows as $row) {
$players[] = $this->getPersonForSpieler($db, $row->spieler_id ? (int)$row->spieler_id : null, (int)$row->turniermeldung_spieler_id, $playerCache);
}
$meldungsPlayersCache[$turniermeldungId] = $players;
return $players;
}
/**
* Build display name for a side.
*/
function buildSideName(array $players): string
{
if (count($players) === 0) {
return 'Unknown';
}
if (count($players) === 1) {
return $players[0]['name'];
}
$names = [];
foreach ($players as $p) {
$names[] = $p['name'];
}
return implode(' / ', $names);
}
/**
* Parse set scores from a result string.
* Supports patterns like "11:7;11:9", "11-7 11-9", etc.
*/
function parseSets(array $detail): array
{
$sets = [];
$n = 1;
foreach ($detail as $set) {
$set = trim((string)$set);
if ($set === '') {
continue;
}
preg_match_all('/(\d{1,2})\s*[:\-]\s*(\d{1,2})/', $set, $m, PREG_SET_ORDER);
foreach ($m as $match) {
$sets[] = [
'number' => $n++,
'scoreHome' => (int)$match[1],
'scoreAway' => (int)$match[2],
];
}
}
return $sets;
}
/**
* Determine match state.
*/
function determineMatchState($result, array $detail): string
{
if ($result !== null || ( !empty($detail) && !array_filter($detail, fn($v) => $v === null || trim((string)$v) === ''))) {
return 'PLAYED';
}
return 'SCHEDULED';
}
/**
* Determine match state.
*/
function determineWinner(array $detail, string $sourceType): string
{
if ($sourceType === 'TEAM') {
$sets = $this->parseSets($detail);
$homeSetsWon = 0;
$awaySetsWon = 0;
foreach ($sets as $set) {
if ($set['scoreHome'] > $set['scoreAway']) {
$homeSetsWon++;
} elseif ($set['scoreHome'] < $set['scoreAway']) {
$awaySetsWon++;
}
}
if ($homeSetsWon > $awaySetsWon) {
return 'HOME';
} elseif ($homeSetsWon < $awaySetsWon) {
return 'AWAY';
}
return 'DRAW';
} else {
if (count($detail) >0) {
if ($detail[0] == 1) {
return 'HOME';
} elseif ($detail[0] == 2) {
return 'AWAY';
} else {
return 'DRAW';
}
}
return 'UNKNOWN';
}
}
/**
* Determine group state based on a cutoff date.
*/
function determineFinishedState(?string $cutoffDate): string
{
if (!$cutoffDate || $cutoffDate === '0000-00-00') {
return 'PLANNED';
}
$today = new DateTimeImmutable('today');
$cutoff = new DateTimeImmutable($cutoffDate);
return ($cutoff < $today) ? 'FINISHED' : 'RUNNING';
}
/**
* Build one match object.
*/
function buildMatch(
array $homePlayers,
array $awayPlayers,
?string $startDate,
?string $endDate,
?int $result,
array $detail,
string $sourceType
): array
{
$type = (count($homePlayers) > 1 || count($awayPlayers) > 1) ? 'DOUBLE' : 'SINGLE';
$match = [
'startDate' => $startDate,
'endDate' => $endDate,
'type' => $type,
'state' => $this->determineMatchState($result, $detail),
'players' => [],
'sets' => $sourceType === 'TEAM' ? $this->parseSets($detail) : [],
'winner' => $this->determineWinner($detail, $sourceType),
];
foreach ($homePlayers as $p) {
$match['players'][] = [
'name' => $p['name'],
'playerNr' => $p['playerNr'],
'side' => 'HOME',
];
}
foreach ($awayPlayers as $p) {
$match['players'][] = [
'name' => $p['name'],
'playerNr' => $p['playerNr'],
'side' => 'AWAY',
];
}
// If detail parsing produced no sets, keep the structure valid by leaving it empty.
if ($sourceType === 'TEAM' && empty($match['sets']) && $result !== null) {
$match['sets'] = [];
}
return $match;
}
/**
* group matches. Based on String (e.g. E1E1, D1D1, D1D1, E2E2, D2D2 etc.)
*/
function groupMatches(array $pattern, array $games): array {
$grouped = [];
$order = []; // to preserve first appearance order
foreach ($pattern as $i => $slot) {
if (!array_key_exists($i, $games)) {
continue;
}
if (!isset($grouped[$slot])) {
$grouped[$slot] = [
'type' => $slot,
'sets' => []
];
$order[] = $slot; // remember order of first occurrence
}
$grouped[$slot]['sets'][] = $games[$i];
}
// rebuild ordered result
$result = [];
foreach ($order as $slot) {
$result[] = $grouped[$slot];
}
return $result;
}
function run(): void
{
set_time_limit(0);
$db = $this->db;
$export = [
'meta' => [
// Keep the organization value explicit, or replace it from settings if available.
'organisation' => 'TFVSH',
],
'seasons' => [],
];
// Seasons
$seasonSql = $db->getQuery(true)
->select(['saison_id', 'saisonbezeichnung'])
->from($db->quoteName('#__sportsmanager_saison'))
->order('saisonbezeichnung ASC, saison_id ASC');
if ($this->exportSeasonId !== null) {
$seasonSql->where('saison_id = ' . (int)$this->exportSeasonId);
}
$db->setQuery($seasonSql);
$seasons = $db->loadObjectList();
foreach ($seasons as $season) {
$seasonNode = [
'name' => (string)$season->saisonbezeichnung,
'events' => [],
];
/**
* Event type 1: turniere
*/
$turnierSql = $db->getQuery(true)
->select([
't.turnier_id',
't.turnierbezeichnung',
't.erster_tag',
't.letzter_tag',
])
->from($db->quoteName('#__sportsmanager_turnier', 't'))
->where('t.saison_id = ' . (int)$season->saison_id)
->order('t.erster_tag ASC, t.turnier_id ASC');
$db->setQuery($turnierSql);
$turniere = $db->loadObjectList();
foreach ($turniere as $turnier) {
$eventNode = [
'name' => (string)$turnier->turnierbezeichnung,
'disciplines' => [],
];
$discSql = $db->getQuery(true)
->select([
'd.turnierdisziplin_id',
'd.disziplin',
'd.kuerzel',
'd.beginn',
])
->from($db->quoteName('#__sportsmanager_turnierdisziplin', 'd'))
->where('d.turnier_id = ' . (int)$turnier->turnier_id)
->order('d.reihenfolge ASC, d.turnierdisziplin_id ASC');
$db->setQuery($discSql);
$disciplines = $db->loadObjectList();
foreach ($disciplines as $disc) {
$disciplineNode = [
'name' => (string)$disc->disziplin,
'shortName' => $this->disciplineShortName($disc->kuerzel, $disc->disziplin),
'stages' => [],
];
$spielSql = $db->getQuery(true)
->select([
'ts.turnierspiel_id',
'ts.turnierdisziplin_id',
'ts.spiel_nummer',
'ts.runde',
'ts.rundenstufe',
'ts.heim_meldung_id',
'ts.gast_meldung_id',
'ts.ergebnis',
'ts.ergebnis_detailliert',
'hm.meldungsgruppe_id AS heim_meldungsgruppe_id',
'gm.meldungsgruppe_id AS gast_meldungsgruppe_id',
])
->from($db->quoteName('#__sportsmanager_turnierspiel', 'ts'))
->leftJoin($db->quoteName('#__sportsmanager_turniermeldung', 'hm') . ' ON hm.turniermeldung_id = ts.heim_meldung_id')
->leftJoin($db->quoteName('#__sportsmanager_turniermeldung', 'gm') . ' ON gm.turniermeldung_id = ts.gast_meldung_id')
->where('ts.turnierdisziplin_id = ' . (int)$disc->turnierdisziplin_id)
->order('COALESCE(ts.rundenstufe, 99) ASC, COALESCE(ts.runde, 99) ASC, COALESCE(ts.spiel_nummer, 99) ASC, ts.turnierspiel_id ASC');
$db->setQuery($spielSql);
$spiele = $db->loadObjectList();
$stages = [];
foreach ($spiele as $spiel) {
$rundenstufe = (int)($spiel->rundenstufe ?? 0);
if ($rundenstufe === 10) {
$stageName = 'Vorrunde';
$groupName = 'Vorrunde';
} elseif (in_array($rundenstufe, [1, 2, 3], true)) {
$stageName = 'Hauptrunde';
$groupName = match ($rundenstufe) {
1 => 'Profifeld',
2 => 'Amateurfeld',
3 => 'Hobbyfeld',
};
} else {
$stageName = 'Stage A';
$groupName = 'Group A';
}
$groupKey = $stageName . '|' . $groupName;
if (!isset($stages[$stageName])) {
$stages[$stageName] = [];
}
if (!isset($stages[$stageName][$groupKey])) {
$stages[$stageName][$groupKey] = [
'name' => $groupName,
'rounds' => [],
'_dates' => [],
];
}
$homePlayers = $this->getMeldungPlayers($db, (int)$spiel->heim_meldung_id, $this->meldungsPlayersCache, $this->playerCache);
$awayPlayers = $this->getMeldungPlayers($db, (int)$spiel->gast_meldung_id, $this->meldungsPlayersCache, $this->playerCache);
$homeName = $this->buildSideName($homePlayers);
$awayName = $this->buildSideName($awayPlayers);
$startDate = $this->isoUtc((string)$disc->beginn, $this->sourceTz, $this->outputTz) ?: $this->isoUtc($turnier->erster_tag . ' 00:00:00', $this->sourceTz, $this->outputTz);
$endDate = $this->isoUtc((string)$disc->beginn, $this->sourceTz, $this->outputTz) ?: $this->isoUtc($turnier->letzter_tag . ' 23:59:59', $this->sourceTz, $this->outputTz);
$match = $this->buildMatch(
$homePlayers,
$awayPlayers,
$startDate,
$endDate,
$spiel->ergebnis !== null ? (int)$spiel->ergebnis : null,
[$spiel->ergebnis ?? null],
'TURNIER'
);
$roundIndex = $spiel->runde ?? 1;
$roundKey = (string)$roundIndex;
if (!isset($stages[$stageName][$groupKey]['rounds'][$roundKey])) {
$stages[$stageName][$groupKey]['rounds'][$roundKey] = [
'index' => $roundIndex,
'name' => 'Round ' . $roundIndex,
'matchdays' => [],
];
}
$matchdayName = 'Day ' . (int)($spiel->spiel_nummer ?: $spiel->turnierspiel_id);
$stages[$stageName][$groupKey]['rounds'][$roundKey]['matchdays'][] = [
'name' => $matchdayName,
'startDate' => $startDate,
'endDate' => $endDate,
'teamHome' => ['name' => $homeName],
'teamAway' => ['name' => $awayName],
'matches' => [$match],
];
$stages[$stageName][$groupKey]['_dates'][] = $turnier->letzter_tag ?: $turnier->erster_tag;
}
foreach ($stages as $stageName => $groupBucket) {
$stageNode = [
'name' => $stageName,
'groups' => [],
];
foreach ($groupBucket as $groupKey => $groupData) {
$cutoffDate = null;
if (!empty($groupData['_dates'])) {
$cutoffDate = max($groupData['_dates']);
}
$groupNode = [
'name' => $groupData['name'],
'tournamentMode' => 'unknown',
'state' => $this->determineFinishedState($cutoffDate),
'rounds' => [],
];
ksort($groupData['rounds'], SORT_NATURAL);
foreach ($groupData['rounds'] as $round) {
$groupNode['rounds'][] = $round;
}
$stageNode['groups'][] = $groupNode;
}
$disciplineNode['stages'][] = $stageNode;
}
$eventNode['disciplines'][] = $disciplineNode;
}
$seasonNode['events'][] = $eventNode;
}
/**
* Event type 2: team-based events from veranstaltung via team/begegnung/teamspiel
*/
$veranstaltungSql = $db->getQuery(true)
->select([
'v.veranstaltung_id',
'v.bezeichnung',
'v.erster_tag',
'v.letzter_tag',
'tsm.modus AS modus'
])
->from($db->quoteName('#__sportsmanager_veranstaltung', 'v'))
->innerJoin($db->quoteName('#__sportsmanager_team', 'tm') . ' ON tm.veranstaltung_id = v.veranstaltung_id')
->leftJoin($db->quoteName('#__sportsmanager_teamspiel_modus', 'tsm') . ' ON tsm.teamspiel_modus_id = v.modus_id')
->where('v.saison_id = ' . (int)$season->saison_id)
->group('v.veranstaltung_id, v.bezeichnung, v.erster_tag, v.letzter_tag')
->order('v.erster_tag, v.veranstaltung_id');
$db->setQuery($veranstaltungSql);
$veranstaltungen = $db->loadObjectList();
foreach ($veranstaltungen as $veranstaltung) {
$modus = array_map('trim', explode(',', $veranstaltung->modus));
$eventNode = [
'name' => (string)$veranstaltung->bezeichnung,
'disciplines' => [
[
'name' => 'Teamspiel',
'shortName' => 'TS',
'stages' => [
[
'name' => 'Stage A',
'groups' => [],
],
],
],
],
];
$groupNode = [
'name' => 'Group A',
'tournamentMode' => 'unknown',
'state' => 'PLANNED',
'rounds' => [],
];
$begegnungSql = $db->getQuery(true)
->select([
'b.begegnung_id',
'b.heim_team_id',
'b.gast_team_id',
'b.zeitpunkt',
'b.spieltag',
'b.spieltag_titel',
'b.spiel_nr',
])
->from($db->quoteName('#__sportsmanager_begegnung', 'b'))
->innerJoin($db->quoteName('#__sportsmanager_team', 'th') . ' ON th.team_id = b.heim_team_id')
->innerJoin($db->quoteName('#__sportsmanager_team', 'tg') . ' ON tg.team_id = b.gast_team_id')
->where('th.veranstaltung_id = ' . (int)$veranstaltung->veranstaltung_id)
->order('COALESCE(b.spieltag, 9999) ASC, b.zeitpunkt ASC, b.begegnung_id ASC');
$db->setQuery($begegnungSql);
$begegnungen = $db->loadObjectList();
$groupDates = [];
$roundsByKey = [];
foreach ($begegnungen as $begegnung) {
$homeTeamId = (int)$begegnung->heim_team_id;
$awayTeamId = (int)$begegnung->gast_team_id;
if (!isset($this->teamCache[$homeTeamId])) {
$db->setQuery(
$db->getQuery(true)
->select(['team_id', 'teamname'])
->from($db->quoteName('#__sportsmanager_team'))
->where('team_id = ' . $homeTeamId)
);
$this->teamCache[$homeTeamId] = $db->loadObject();
}
if (!isset($this->teamCache[$awayTeamId])) {
$db->setQuery(
$db->getQuery(true)
->select(['team_id', 'teamname'])
->from($db->quoteName('#__sportsmanager_team'))
->where('team_id = ' . $awayTeamId)
);
$this->teamCache[$awayTeamId] = $db->loadObject();
}
$homeTeam = $this->teamCache[$homeTeamId];
$awayTeam = $this->teamCache[$awayTeamId];
$roundIndex = $begegnung->spieltag ?? 1;
$roundKey = (string)$roundIndex;
if (!isset($roundsByKey[$roundKey])) {
$roundsByKey[$roundKey] = [
'index' => $roundIndex,
'name' => 'Round ' . $roundIndex,
'matchdays' => [],
];
}
$teamspielSql = $db->getQuery(true)
->select([
'ts.teamspiel_id',
'ts.teamspiel_nummer',
'ts.heim_spieler_1_id',
'ts.heim_spieler_2_id',
'ts.gast_spieler_1_id',
'ts.gast_spieler_2_id',
'ts.teamspiel_heim_punkte',
'ts.teamspiel_gast_punkte',
'ts.teamspiel_heim_spielpunkte',
'ts.teamspiel_gast_spielpunkte',
'ts.ergebnis_detailliert',
])
->from($db->quoteName('#__sportsmanager_teamspiel', 'ts'))
->where('ts.begegnung_id = ' . (int)$begegnung->begegnung_id)
->order('ts.teamspiel_nummer ASC, ts.teamspiel_id ASC');
$db->setQuery($teamspielSql);
$teamspiele = $db->loadObjectList();
$matchdayMatches = [];
$teamspiele = $this->groupMatches($modus, $teamspiele);
foreach ($teamspiele as $group) {
if (empty($group['sets'])) {
continue;
}
$ts = $group['sets'][0];
// use modus here
$homePlayers = [];
$awayPlayers = [];
$homePlayers[] = $this->getPersonForSpieler($db, (int)$ts->heim_spieler_1_id, null, $this->playerCache);
if (!empty($ts->heim_spieler_2_id)) {
$homePlayers[] = $this->getPersonForSpieler($db, (int)$ts->heim_spieler_2_id, null, $this->playerCache);
}
$awayPlayers[] = $this->getPersonForSpieler($db, (int)$ts->gast_spieler_1_id, null, $this->playerCache);
if (!empty($ts->gast_spieler_2_id)) {
$awayPlayers[] = $this->getPersonForSpieler($db, (int)$ts->gast_spieler_2_id, null, $this->playerCache);
}
$startDate = $this->isoUtc($begegnung->zeitpunkt, $this->sourceTz, $this->outputTz);
$endDate = $this->isoUtc($begegnung->zeitpunkt, $this->sourceTz, $this->outputTz);
$detail = [];
foreach ($group['sets'] as $set) {
$detail[] = $set->ergebnis_detailliert ?? null;
}
$matchdayMatches[] = $this->buildMatch(
$homePlayers,
$awayPlayers,
$startDate,
$endDate,
($ts->teamspiel_heim_punkte !== null || $ts->teamspiel_gast_punkte !== null) ? 1 : null,
$detail,
'TEAM'
);
}
$matchdayName = trim((string)$begegnung->spieltag_titel) !== ''
? (string)$begegnung->spieltag_titel
: ('Spieltag ' . $roundIndex);
$roundsByKey[$roundKey]['matchdays'][] = [
'name' => $matchdayName,
'startDate' => $this->isoUtc($begegnung->zeitpunkt, $this->sourceTz, $this->outputTz),
'endDate' => $this->isoUtc($begegnung->zeitpunkt, $this->sourceTz, $this->outputTz),
'teamHome' => ['name' => $homeTeam->teamname ?? ('Team ' . $homeTeamId)],
'teamAway' => ['name' => $awayTeam->teamname ?? ('Team ' . $awayTeamId)],
'matches' => $matchdayMatches,
];
$groupDates[] = substr((string)$begegnung->zeitpunkt, 0, 10);
}
if (!empty($groupDates)) {
$groupNode['state'] = $this->determineFinishedState(max($groupDates));
}
ksort($roundsByKey, SORT_NATURAL);
foreach ($roundsByKey as $round) {
$groupNode['rounds'][] = $round;
}
$eventNode['disciplines'][0]['stages'][0]['groups'][] = $groupNode;
$seasonNode['events'][] = $eventNode;
}
$export['seasons'][] = $seasonNode;
}
$json = json_encode($export, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
if ($json === false) {
throw new RuntimeException('JSON encoding failed: ' . json_last_error_msg());
}
if ($this->outputFile) {
file_put_contents($this->outputFile, $json . PHP_EOL);
}
if (PHP_SAPI !== 'cli') {
header('Content-Type: application/json; charset=utf-8');
}
echo 'Successfully created export file: ' . $this->outputFile;
}
}
@@ -45,11 +45,6 @@
default=""
label="COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_CATEGORIES"
description="COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_CATEGORIES_DESC" />
<field name="zusatzparameter"
type="text"
default=""
label="COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_EXTRA_PARAMS"
description="COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_EXTRA_PARAMS_DESC" />
</fieldset>
</fields>
</metadata>
@@ -112,7 +112,6 @@ static function veranstaltungenHeader($titel, $beschreibung, $saisons, $filter_s
}
if (($praesentation == 0 && count($saisons) > 0) || $ticker_anzeigen) {
?>
<script>function smChangeSaison(v){var u=new URL(window.location.href);u.searchParams.set('filter_saison_id',v);window.location.href=u.toString();}</script>
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
<div class="uk-overflow-auto">
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
@@ -124,14 +123,14 @@ static function veranstaltungenHeader($titel, $beschreibung, $saisons, $filter_s
<label for="filter_saison_id"><?php echo Text::_('COM_SPORTSMANAGER_SEASON'); ?>
:</label>
<select class="uk-select uk-form-width-medium" name="filter_saison_id"
id="filter_saison_id" size="1" onChange="smChangeSaison(this.value);">
id="filter_saison_id" size="1" onChange="document.adminForm.submit();">
<?php
foreach ($saisons as $saison)
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
?>
</select>
<input type="submit" name="ok" value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
class="button uk-button uk-button-primary" onclick="smChangeSaison(document.getElementById('filter_saison_id').value); return false;"/>
class="button uk-button uk-button-primary"/>
</td>
<td>&nbsp;&nbsp;&nbsp;</td>
<?php
@@ -226,7 +225,6 @@ static function veranstaltungHeaderAlone($veranstaltung, $vorherige_veranstaltun
<?php
if (($showSeasons && count($seasons) > 1)) {
?>
<script>function smChangeSaisonAlone(v){var u=new URL(window.location.href);u.searchParams.set('filter_saison_id',v);u.searchParams.set('task','veranstaltungen');u.searchParams.delete('veranstaltungid');window.location.href=u.toString();}</script>
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
<div class="uk-overflow-auto">
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
@@ -235,14 +233,14 @@ static function veranstaltungHeaderAlone($veranstaltung, $vorherige_veranstaltun
<label for="filter_saison_id"><?php echo Text::_('COM_SPORTSMANAGER_SEASON'); ?>
:</label>
<select class="uk-select uk-form-width-medium" name="filter_saison_id"
id="filter_saison_id" size="1" onChange="smChangeSaisonAlone(this.value);">
id="filter_saison_id" size="1" onChange="document.adminForm.submit();">
<?php
foreach ($seasons as $season)
echo "<option value=\"" . $season->saison_id . "\" " . ($filter_saison_id == $season->saison_id ? "selected" : "") . ">" . htmlentities_utf8($season->saisonbezeichnung) . "</option>";
?>
</select>
<input type="submit" name="ok" value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
class="button uk-button uk-button-primary" onclick="smChangeSaisonAlone(document.getElementById('filter_saison_id').value); return false;"/>
class="button uk-button uk-button-primary"/>
</td>
<td>&nbsp;&nbsp;&nbsp;</td>
</tr>
@@ -319,7 +317,6 @@ static function turniereHeader($beschreibung, $saisons, $filter_saison_id): void
}
if (count($saisons) > 0) {
?>
<script>function smChangeSaison(v){var u=new URL(window.location.href);u.searchParams.set('filter_saison_id',v);window.location.href=u.toString();}</script>
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
<div class="uk-overflow-auto">
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
@@ -327,14 +324,14 @@ static function turniereHeader($beschreibung, $saisons, $filter_saison_id): void
<td nowrap>
<label for="filter_saison_id"><?php echo Text::_('COM_SPORTSMANAGER_SEASON'); ?>:</label>
<select class="uk-select uk-form-width-medium" name="filter_saison_id" id="filter_saison_id"
size="1" onChange="smChangeSaison(this.value);">
size="1" onChange="document.adminForm.submit();">
<?php
foreach ($saisons as $saison)
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
?>
</select>
<input type="submit" name="ok" value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
class="button uk-button uk-button-primary" onclick="smChangeSaison(document.getElementById('filter_saison_id').value); return false;"/>
class="button uk-button uk-button-primary"/>
</td>
</tr>
</table>
@@ -2153,7 +2150,6 @@ static function tabelleEigeneAnzeigen($veranstaltung, $teams, $alleine_angezeigt
}
if (count($saisons) > 0) {
?>
<script>function smChangeSaison(v){var u=new URL(window.location.href);u.searchParams.set('filter_saison_id',v);window.location.href=u.toString();}</script>
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
<div class="uk-overflow-auto">
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
@@ -2162,7 +2158,7 @@ static function tabelleEigeneAnzeigen($veranstaltung, $teams, $alleine_angezeigt
<label for="filter_saison_id"><?php echo Text::_('COM_SPORTSMANAGER_SEASON'); ?>
:</label>
<select class="uk-select uk-form-width-medium" name="filter_saison_id"
id="filter_saison_id" size="1" onChange="smChangeSaison(this.value);">
id="filter_saison_id" size="1" onChange="document.adminForm.submit();">
<?php
foreach ($saisons as $saison)
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
@@ -2170,7 +2166,7 @@ static function tabelleEigeneAnzeigen($veranstaltung, $teams, $alleine_angezeigt
</select>
<input type="submit" name="ok"
value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
class="button uk-button uk-button-primary" onclick="smChangeSaison(document.getElementById('filter_saison_id').value); return false;"/>
class="button uk-button uk-button-primary"/>
</td>
</tr>
</table>
@@ -2664,47 +2660,13 @@ global $params;
else
echo htmlentities_utf8($team->name);
$anschrift = $team->strasse . (!empty($team->strasse) && (!empty($team->plz) || !empty($team->ortsname) || !empty($team->ortsteil)) ? ", " : "") . $team->plz . (!empty($team->plz) ? " " : "") . $team->ortsname . (!empty($team->ortsname) && !empty($team->ortsteil) ? "-" : "") . $team->ortsteil;
if (!empty($anschrift))
echo "<br /><a href=\"https://www.google.com/maps/search/?api=1&query=" . urlencode($anschrift) . "\" target=\"_blank\" rel=\"noopener\">" . htmlentities_utf8($anschrift) . "</a>";
echo "<br />" . htmlentities_utf8($anschrift);
if (!empty($team->telefon))
echo "<br />" . htmlentities_utf8($team->telefon);
?>
</td>
</tr>
<?php
if (!empty($team->zusatzinfo)) {
?>
<tr>
<td nowrap style="vertical-align: top">
<strong>Weitere Infos:</strong></td>
<td>
<?php echo nl2br(htmlentities_utf8($team->zusatzinfo)); ?>
</td>
</tr>
<?php
}
if (!empty($team->ruhetage)) {
?>
<tr>
<td nowrap style="vertical-align: top">
<strong>Ruhetag:</strong></td>
<td nowrap>
<?php echo htmlentities_utf8($team->ruhetage); ?>
</td>
</tr>
<?php
}
if (!empty($team->trainingstage)) {
?>
<tr>
<td nowrap style="vertical-align: top">
<strong>Training:</strong></td>
<td nowrap>
<?php echo htmlentities_utf8($team->trainingstage); ?>
</td>
</tr>
<?php
}
}
if ($team->nichtraucherschutz != 0) {
?>
@@ -4200,8 +4162,8 @@ static function halloffame($titel, $beschreibung, $rows): 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 }
<div
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo htmlentities_utf8($titel); ?></div><?php }
if (!empty($beschreibung)) {
?>
<div class="uk-overflow-auto">
@@ -4251,490 +4213,13 @@ static function halloffame($titel, $beschreibung, $rows): void
<?php
}
static function halloffameNachJahrGruppiert($titel, $beschreibung, $disziplinen, $jahresDaten, $platzierung = '', $alleSpielerInfo = [], $alleVereineInfo = []): void
static function halloffameDetails($titel, $beschreibung, $rows, $halloffame): 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($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, $alleVereineInfo, 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, $alleVereineInfo, 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, $alleVereineInfo, 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, $alleVereineInfo, 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, $alleVereineInfo, 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, $alleVereineInfo, 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 = [], $alleVereineInfo = []): 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 }
<div
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo htmlentities_utf8($titel); ?></div><?php }
if (!empty($beschreibung)) {
?>
<div class="uk-overflow-auto">
@@ -4750,124 +4235,11 @@ static function halloffameDetails($titel, $beschreibung, $rows, $halloffame, $pl
echo "<H3>" . htmlentities_utf8($halloffame->halloffame) . "</H3>";
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">
<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'); ?>">
<?php if ($platzierung === 'inzeilen') { ?>
<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 if (!$nurPlatz1) { ?>
<th style="text-align:center; width:100px;" nowrap>
<strong><?php echo Text::_('COM_SPORTSMANAGER_PLACE'); ?></strong>
</th>
<?php } ?>
<th style="text-align:center;" colspan="<?php echo $halloffame->spielform == 2 ? 4 : 2; ?>" 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 ($rows as $row) {
$rowclass = "sectiontableentry" . ($k + 1) . $params->get('pageclass_sfx');
$k = ($k + 1) % 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, $alleVereineInfo, 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, $alleVereineInfo, 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, $alleVereineInfo, 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>
@@ -4878,15 +4250,10 @@ static function halloffameDetails($titel, $beschreibung, $rows, $halloffame, $pl
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) { ?>
<th style="text-align:center;" colspan="2" nowrap>
<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
@@ -4896,32 +4263,10 @@ static function halloffameDetails($titel, $beschreibung, $rows, $halloffame, $pl
$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, $alleVereineInfo, 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, $alleVereineInfo, htmlentities_utf8($row->spieler2_1)); ?>
</td>
</tr>
<?php
} else if ($halloffame->spielform == 2) {
if ($halloffame->spielform == 2) {
?>
<!-- Erste Zeile -->
<tr class="<?php echo $rowclass; ?>" style="border-top-width: 3px;">
<tr class="<?php echo $rowclass; ?>">
<td rowspan="2" nowrap style="text-align:center;">
<?php echo $row->jahr; ?>
@@ -4934,10 +4279,10 @@ static function halloffameDetails($titel, $beschreibung, $rows, $halloffame, $pl
$spieler1 = "spieler1_" . $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, $halloffame->geschaetztes_geschlecht)); ?>
<?php echo bildHTML("spieler", $row->$spieler1_id, 45, 60, 0, 0, 'border="0"'); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo halloffameNameLink('spieler', $row->$spieler1_id, $alleSpielerInfo, $alleVereineInfo, htmlentities_utf8($row->$spieler1)); ?>
<?php echo htmlentities_utf8($row->$spieler1); ?>
</td>
<?php } ?>
</tr>
@@ -4950,17 +4295,17 @@ static function halloffameDetails($titel, $beschreibung, $rows, $halloffame, $pl
$spieler2 = "spieler2_" . $i;
?>
<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, $halloffame->geschaetztes_geschlecht)); ?>
<?php echo bildHTML("spieler", $row->$spieler2_id, 45, 60, 0, 0, 'border="0"'); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo halloffameNameLink('spieler', $row->$spieler2_id, $alleSpielerInfo, $alleVereineInfo, htmlentities_utf8($row->$spieler2)); ?>
<?php echo htmlentities_utf8($row->$spieler2); ?>
</td>
<?php } ?>
</tr>
<?php
} else {
?>
<tr class="<?php echo $rowclass; ?>" style="border-top-width: 3px;">
<tr class="<?php echo $rowclass; ?>">
<td nowrap style="text-align:center;">
<?php echo $row->jahr; ?>
</td>
@@ -4982,24 +4327,17 @@ static function halloffameDetails($titel, $beschreibung, $rows, $halloffame, $pl
}
?>
<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, $halloffame->geschaetztes_geschlecht) : ''); ?>
<?php echo bildHTML($type, $row->$id, 45, 60, 0, 0, 'border="0"'); ?>
</td>
<td nowrap style="text-align:left; width:300px;">
<?php echo halloffameNameLink($type, $row->$id, $alleSpielerInfo, $alleVereineInfo, htmlentities_utf8($row->$txt)); ?>
<?php echo 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
}
}
} ?>
?>
</table>
<?php
}
@@ -6715,7 +6053,6 @@ static function spielerstatistikenHeader($titel, $beschreibung, $saisons, $filte
}
if (!empty($saisons) || !empty($spiele) || !empty($teams)) {
?>
<script>function smChangeSaison(v){var u=new URL(window.location.href);u.searchParams.set('filter_saison_id',v);window.location.href=u.toString();}</script>
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
<div class="uk-overflow-auto">
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
@@ -6727,7 +6064,7 @@ static function spielerstatistikenHeader($titel, $beschreibung, $saisons, $filte
:</label>
<select class="uk-select uk-form-width-small" name="filter_saison_id"
id="filter_saison_id" size="1"
onChange="smChangeSaison(this.value);">
onChange="document.adminForm.submit();">
<?php
foreach ($saisons as $saison)
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
@@ -7086,7 +6423,6 @@ static function individualwettbewerbHeader($titel, $beschreibung, $saisons, $fil
}
if (count($saisons) > 0) {
?>
<script>function smChangeSaison(v){var u=new URL(window.location.href);u.searchParams.set('filter_saison_id',v);window.location.href=u.toString();}</script>
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
<div class="uk-overflow-auto">
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
@@ -7097,7 +6433,7 @@ static function individualwettbewerbHeader($titel, $beschreibung, $saisons, $fil
:</label>
<select class="uk-select uk-form-width-medium" name="filter_saison_id"
id="filter_saison_id" size="1"
onChange="smChangeSaison(this.value);">
onChange="document.adminForm.submit();">
<?php
foreach ($saisons as $saison)
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
@@ -7105,7 +6441,7 @@ static function individualwettbewerbHeader($titel, $beschreibung, $saisons, $fil
</select>
<input type="submit" name="ok"
value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
class="button uk-button uk-button-primary" onclick="smChangeSaison(document.getElementById('filter_saison_id').value); return false;"/>
class="button uk-button uk-button-primary"/>
</td>
</tr>
</table>
@@ -7917,7 +7253,6 @@ static function ranglistenHeader($titel, $beschreibung, $saisons, $filter_saison
}
if (count($saisons) > 0) {
?>
<script>function smChangeSaison(v){var u=new URL(window.location.href);u.searchParams.set('filter_saison_id',v);window.location.href=u.toString();}</script>
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
<div class="uk-overflow-auto">
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
@@ -7928,7 +7263,7 @@ static function ranglistenHeader($titel, $beschreibung, $saisons, $filter_saison
:</label>
<select class="uk-select uk-form-width-small" name="filter_saison_id"
id="filter_saison_id" size="1"
onChange="smChangeSaison(this.value);">
onChange="document.adminForm.submit();">
<?php
foreach ($saisons as $saison)
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
@@ -7936,7 +7271,7 @@ static function ranglistenHeader($titel, $beschreibung, $saisons, $filter_saison
</select>
<input type="submit" name="ok"
value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
class="button uk-button uk-button-primary" onclick="smChangeSaison(document.getElementById('filter_saison_id').value); return false;"/>
class="button uk-button uk-button-primary"/>
</td>
</tr>
</table>
@@ -145,6 +145,12 @@ class HTML_sportsmanager_admin
</td>
<?php
$Spalte_Nr = self::checkZeilenumbruch($Spalte_Nr, $max_Spalten);
?>
<td style="padding-right: 15px" nowrap>
<a href="<?php echo SportsManagerURL('&task=admin_sportshub'); ?>"><?php echo 'Sportshub'; ?></a>
</td>
<?php
$Spalte_Nr = self::checkZeilenumbruch($Spalte_Nr, $max_Spalten);
}
if (benutzerZugriff("termine_aendern")) {
?>
@@ -4436,17 +4442,6 @@ class HTML_sportsmanager_admin
value="<?php if ($row != null) echo htmlentities_utf8($row->ruhetage); ?>"/>
</td>
</tr>
<tr>
<td nowrap style="width: 20%; text-align: right; vertical-align: top">
<label
for="zusatzinfo"><?php echo Text::_('COM_SPORTSMANAGER_ADDITIONAL_INFO'); ?>
:</label>
</td>
<td nowrap>
<textarea name="zusatzinfo" id="zusatzinfo" cols="60"
rows="8"><?php if ($row != null) echo htmlentities_utf8($row->zusatzinfo); ?></textarea>
</td>
</tr>
<tr>
<td nowrap style="width: 20%; text-align: right; vertical-align: top">
<label
@@ -8178,7 +8173,6 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
<?php
if ($rows != null) {
$einspaltigesDoppel = ($halloffame->spielform == 2 && !$halloffame->platz2_zeigen && !$halloffame->platz3_zeigen);
?>
<div class="uk-overflow-auto">
<table style='border-collapse: collapse;'
@@ -8194,7 +8188,7 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
if ($i == 2 && !$halloffame->platz2_zeigen) continue;
if ($i == 3 && !$halloffame->platz3_zeigen) continue;
?>
<th style="text-align:center;" colspan="<?php echo $einspaltigesDoppel ? 4 : 2; ?>" nowrap>
<th style="text-align:center;" colspan="2" nowrap>
<strong><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $i; ?></strong>
</th>
<?php } ?>
@@ -8210,42 +8204,7 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
$rowclass = "sectiontableentry" . ($k + 1) . $params->get('pageclass_sfx');
$k = ($k + 1) % 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) {
if ($halloffame->spielform == 2) {
?>
<!-- Erste Zeile -->
@@ -8357,58 +8316,11 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
static function adminEditHalloffameMitglied($row,$halloffame,$vereine,$spieler,$jahre): void
{
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
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>
<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"
enctype="multipart/form-data">
<div class="uk-overflow-auto">
@@ -8427,13 +8339,6 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
}
?>
</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>
</tr>
<?php
@@ -8441,35 +8346,26 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
if ($halloffame->spielform == 1){
$index_vereinid = "verein_id_" . $p;
$index_team = "teamname_" . $p;
$index_teamspieler = "teamspieler_" . $p;
?>
<tr class="halloffame-platz-zeile">
<tr>
<td nowrap style="width: 20%; text-align: right">
<label for="verein1_<?php echo $p; ?>"><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $p; ?>
:</label>
</td>
<td nowrap>
<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;"></select>
<script type="text/javascript">
halloffameOptionenFuellen('verein_id_<?php echo $p; ?>', 'halloffame-vereine-options', '<?php echo $row != null ? (int) $row->$index_vereinid : 0; ?>');
</script>
id="verein_id_<?php echo $p; ?>" size="1" style="width: 370px;">
<?php
echo "<option value=\"0\"></option>";
foreach ($vereine as $v)
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;"
name="teamname_<?php echo $p; ?>" id="verein_<?php echo $p; ?>" size="50" maxlength="64"
value="<?php echo $row != null ? htmlentities_utf8($row->$index_team) : ''; ?>"/>
</td>
</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
}
@@ -8479,27 +8375,33 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
$index_spieler2id = "spieler2_id_" . $p;
$index_spieler2 = "spieler2_" . $p;
?>
<tr class="halloffame-platz-zeile">
<tr>
<td nowrap style="width: 20%; text-align: right">
<label for="player1_<?php echo $p; ?>"><?php echo Text::_('COM_SPORTSMANAGER_PLACE') . " " . $p; ?>
:</label>
</td>
<td nowrap>
<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;"></select>
<script type="text/javascript">
halloffameOptionenFuellen('player1_id_<?php echo $p; ?>', 'halloffame-spieler-options', '<?php echo $row != null ? (int) $row->$index_spieler1id : 0; ?>');
</script>
id="player1_id_<?php echo $p; ?>" size="1" style="width: 370px;">
<?php
echo "<option value=\"0\"></option>";
foreach ($spieler as $s)
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;"
name="spieler1_<?php echo $p; ?>" id="player1_<?php echo $p; ?>" size="50" maxlength="64"
value="<?php echo $row != null ? htmlentities_utf8($row->$index_spieler1) : ''; ?>"/>
<?PHP if ($halloffame->spielform == 2){ ?>
<br>
<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;"></select>
<script type="text/javascript">
halloffameOptionenFuellen('player2_id_<?php echo $p; ?>', 'halloffame-spieler-options', '<?php echo $row != null ? (int) $row->$index_spieler2id : 0; ?>');
</script>
id="player2_id_<?php echo $p; ?>" size="1" style="width: 370px;">
<?php
echo "<option value=\"0\"></option>";
foreach ($spieler as $s)
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;"
name="spieler2_<?php echo $p; ?>" id="player2_<?php echo $p; ?>" size="50" maxlength="64"
value="<?php echo $row != null ? htmlentities_utf8($row->$index_spieler2) : ''; ?>"/>
@@ -8522,9 +8424,6 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
<input type="hidden" name="halloffame_id" value="<?php echo $halloffame->halloffame_id; ?>"/>
<input type="hidden" name="spielform" value="<?php echo $halloffame->spielform; ?>"/>
</form>
<script type="text/javascript">
halloffameNichtAusgespieltUmschalten(document.getElementById('nicht_ausgespielt').checked);
</script>
<?php
}
@@ -11948,9 +11847,8 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
$spiel_einzel = $spieltypen[$i - 1][0] != "D";
if (($spiel_einzel && $spielpunkte_wertung_einzel == 2) || (!$spiel_einzel && $spielpunkte_wertung_doppel == 2))
continue;
// Number(): .value ist eine Zeichenkette, "10" > "9" wäre sonst unwahr
echo " punkte_heim = document.adminForm.spiel_" . $i . "_heim_punkte.value != '' ? Number(document.adminForm.spiel_" . $i . "_heim_punkte.value) : 0;\n"
. " punkte_gast = document.adminForm.spiel_" . $i . "_gast_punkte.value != '' ? Number(document.adminForm.spiel_" . $i . "_gast_punkte.value) : 0;\n"
echo " punkte_heim = document.adminForm.spiel_" . $i . "_heim_punkte.value != '' ? document.adminForm.spiel_" . $i . "_heim_punkte.value : 0;\n"
. " punkte_gast = document.adminForm.spiel_" . $i . "_gast_punkte.value != '' ? document.adminForm.spiel_" . $i . "_gast_punkte.value : 0;\n"
. " if (punkte_heim > punkte_gast)\n"
. " spielpunkte_heim += " . ($spiel_einzel ? "spielpunkte_sieg_einzel" : "spielpunkte_sieg_doppel") . ";\n"
. " else if (punkte_heim < punkte_gast)\n"
@@ -12950,12 +12848,6 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
{
global $params;
?>
<script type="text/javascript">
function anzeige_aktualisieren() {
document.getElementById("export_row").style.display = document.adminForm.exportformat.value !== "jsondatei" ? '' : 'none';
}
window.addEventListener("pageshow", anzeige_aktualisieren);
</script>
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
<div class="uk-overflow-auto">
<table style="width: 500px">
@@ -12975,7 +12867,7 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
</select>
</td>
</tr>
<tr id="export_row">
<tr>
<td nowrap style="text-align: right">
<label for="export">Exportieren</label>
</td>
@@ -12993,9 +12885,8 @@ static function adminVerbandsorganMitglieder($rows,$verbandsorgan): void
<label for="exportformat">Exportformat</label>
</td>
<td nowrap>
<select class="uk-select uk-form-width-large" style='width: 320px;' name="exportformat" id="exportformat" size="1" onchange="anzeige_aktualisieren();">
<select class="uk-select uk-form-width-large" style='width: 320px;' name="exportformat" id="exportformat" size="1">
<option value='csvdatei'>CSV-Datei</option>
<option value='jsondatei'>JSON-Datei</option>
</select>
</td>
</tr>
@@ -395,8 +395,6 @@ COM_SPORTSMANAGER_BEATEN="Ausgetreten"
COM_SPORTSMANAGER_HIDE="Verstecken"
COM_SPORTSMANAGER_PASSIVE="Passiv"
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_DOUBLE_SEED="Elo-Startwert Doppel"
COM_SPORTSMANAGER_PLAYER_EXPORT="Spieler: Exportieren"
@@ -1089,7 +1087,6 @@ COM_SPORTSMANAGER_MATCH_SWAPPING_HELP="Bei Heimrechttausch gleichen Termin eintr
COM_SPORTSMANAGER_NOT_VALID_TIME="Ung&uuml;ltige Uhrzeit"
COM_SPORTSMANAGER_REALLY_MATCH_RESCHEDULING="Willst Du diesen Spielverlegung wirklich entfernen?"
COM_SPORTSMANAGER_REST_DAYS="Ruhetage"
COM_SPORTSMANAGER_ADDITIONAL_INFO="Zusatzinfo"
COM_SPORTSMANAGER_TRAINING_DAYS="Trainingstage"
COM_SPORTSMANAGER_NOT_ACTUALIZED_DATA="Nicht aktualisierte Daten"
COM_SPORTSMANAGER_ASSOCIATION_BODIES="Verbandsorgane"
@@ -1110,10 +1107,6 @@ 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_YEARS="Jahre"
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_REALLY_SWAP_MATCH="Willst Du wirklich das Heimrecht tauschen?"
COM_SPORTSMANAGER_SWAP_MATCH="Heimrechttausch"
@@ -1122,6 +1115,4 @@ COM_SPORTSMANAGER_MATCH_REPORT_DELETED="Spielbericht gel&ouml;scht"
COM_SPORTSMANAGER_MATCH_REPORT_WAS_DELETED="Der Spielbericht wurde erfolgreich gel&ouml;scht!"
COM_SPORTSMANAGER_MATCH_REPORT_CORRECTED="Spielberichtskorrektur"
COM_SPORTSMANAGER_MIN_MATCHES="Mindestzahl Spiele"
COM_SPORTSMANAGER_SELECT_ALL="Alle"
COM_SPORTSMANAGER_MAIL_SEND_ERROR="Die Benachrichtigungs-E-Mail zum Ergebnis konnte nicht versendet werden."
COM_SPORTSMANAGER_TERMIN_MAIL_SEND_ERROR="Mindestens eine Benachrichtigungs-E-Mail zum Termin konnte nicht versendet werden."
COM_SPORTSMANAGER_SELECT_ALL="Alle"
@@ -395,8 +395,6 @@ COM_SPORTSMANAGER_BEATEN="Excreted"
COM_SPORTSMANAGER_HIDE="Hide"
COM_SPORTSMANAGER_PASSIVE="Passive"
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_DOUBLE_SEED="Elo starting value doubles"
COM_SPORTSMANAGER_PLAYER_EXPORT="Players: Export"
@@ -1089,7 +1087,6 @@ COM_SPORTSMANAGER_MATCH_SWAPPING_HELP="If home advantage is swapped, enter the s
COM_SPORTSMANAGER_NOT_VALID_TIME="Not valid time"
COM_SPORTSMANAGER_REALLY_MATCH_RESCHEDULING="Do you really want to remove this match rescheduling?"
COM_SPORTSMANAGER_REST_DAYS="Rest days"
COM_SPORTSMANAGER_ADDITIONAL_INFO="Additional info"
COM_SPORTSMANAGER_TRAINING_DAYS="Training days"
COM_SPORTSMANAGER_NOT_ACTUALIZED_DATA="Data not updated"
COM_SPORTSMANAGER_ASSOCIATION_BODIES="Association bodies"
@@ -1110,10 +1107,6 @@ 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_YEARS="Years"
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_REALLY_SWAP_MATCH="Do you really want to swap the home advantage?"
COM_SPORTSMANAGER_SWAP_MATCH="Swap home advantage"
@@ -1122,6 +1115,4 @@ COM_SPORTSMANAGER_MATCH_REPORT_DELETED="Match report deleted"
COM_SPORTSMANAGER_MATCH_REPORT_WAS_DELETED="The match report has been successfully deleted!"
COM_SPORTSMANAGER_MATCH_REPORT_CORRECTED="Match report corrected"
COM_SPORTSMANAGER_MIN_MATCHES="Min count matches"
COM_SPORTSMANAGER_SELECT_ALL="All"
COM_SPORTSMANAGER_MAIL_SEND_ERROR="The notification e-mail for the result could not be sent."
COM_SPORTSMANAGER_TERMIN_MAIL_SEND_ERROR="At least one notification e-mail for the appointment could not be sent."
COM_SPORTSMANAGER_SELECT_ALL="All"
+1 -10
View File
@@ -94,12 +94,6 @@ return new class () implements InstallerScriptInterface
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');
return true;
@@ -680,7 +674,6 @@ return new class () implements InstallerScriptInterface
. "\n `telefon` varchar(64) DEFAULT NULL,"
. "\n `email` varchar(64) DEFAULT NULL,"
. "\n `ruhetage` varchar(64) DEFAULT NULL,"
. "\n `zusatzinfo` text DEFAULT NULL,"
. "\n `beschreibung` varchar(500) DEFAULT NULL,"
. "\n `status` tinyint(1) NOT NULL DEFAULT '0',"
. "\n PRIMARY KEY (`spielort_id`)"
@@ -1258,11 +1251,9 @@ return new class () implements InstallerScriptInterface
. "\n `mitglied_halloffame_id` int(11) NOT NULL AUTO_INCREMENT,"
. "\n `halloffame_id` int(11) NOT NULL,"
. "\n `jahr` int(4) DEFAULT NULL,"
. "\n `nicht_ausgespielt` tinyint(1) NOT NULL DEFAULT '0',"
. "\n `platz` int(11) DEFAULT NULL,"
. "\n `verein_id` int(11) DEFAULT NULL,"
. "\n `teamname` varchar(64) DEFAULT NULL,"
. "\n `teamspieler` text DEFAULT NULL,"
. "\n `spieler1_id` int(11) DEFAULT NULL,"
. "\n `spieler1` varchar(64) DEFAULT NULL,"
. "\n `spieler2_id` int(11) DEFAULT NULL,"
@@ -1283,7 +1274,7 @@ return new class () implements InstallerScriptInterface
$db->setQuery( $query );
if (!$db->execute()) { die($db->stderr(true)); }
$query = "INSERT IGNORE #__sportsmanager_einstellungen SET name = 'datenbank_version', wert = '121';";
$query = "INSERT IGNORE #__sportsmanager_einstellungen SET name = 'datenbank_version', wert = '120';";
$db->setQuery( $query );
if (!$db->execute()) { die($db->stderr(true)); }