mirror of
https://github.com/Deutscher-Tischfussballbund/com_sportsmanager.git
synced 2026-09-11 18:41:50 +00:00
Persist season selection in URL instead of cookie-only
Season filter dropdowns in all frontend views (Mannschaftswettbewerbe, Turniere, Teams, Spielerstatistiken, Individualwettbewerbe, Ranglisten) now navigate via JS URL update (window.location with searchParams) instead of submitting a POST form. This puts filter_saison_id in the URL, making season-filtered views bookmarkable and shareable. The PHP backend already reads filter_saison_id from $_REQUEST (covers GET), and the cookie is still set as fallback for links that don't carry the param. For veranstaltungHeaderAlone (single competition detail view), the JS also resets task=veranstaltungen and removes veranstaltungid on season change, matching the previous form-based behaviour of navigating back to the list. https://claude.ai/code/session_01VyKCAgyEfixxR6RhAkBSEL
This commit is contained in:
@@ -112,6 +112,7 @@ static function veranstaltungenHeader($titel, $beschreibung, $saisons, $filter_s
|
|||||||
}
|
}
|
||||||
if (($praesentation == 0 && count($saisons) > 0) || $ticker_anzeigen) {
|
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">
|
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
|
||||||
<div class="uk-overflow-auto">
|
<div class="uk-overflow-auto">
|
||||||
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
|
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
|
||||||
@@ -123,14 +124,14 @@ static function veranstaltungenHeader($titel, $beschreibung, $saisons, $filter_s
|
|||||||
<label for="filter_saison_id"><?php echo Text::_('COM_SPORTSMANAGER_SEASON'); ?>
|
<label for="filter_saison_id"><?php echo Text::_('COM_SPORTSMANAGER_SEASON'); ?>
|
||||||
:</label>
|
:</label>
|
||||||
<select class="uk-select uk-form-width-medium" name="filter_saison_id"
|
<select class="uk-select uk-form-width-medium" name="filter_saison_id"
|
||||||
id="filter_saison_id" size="1" onChange="document.adminForm.submit();">
|
id="filter_saison_id" size="1" onChange="smChangeSaison(this.value);">
|
||||||
<?php
|
<?php
|
||||||
foreach ($saisons as $saison)
|
foreach ($saisons as $saison)
|
||||||
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
|
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
<input type="submit" name="ok" value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
|
<input type="submit" name="ok" value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
|
||||||
class="button uk-button uk-button-primary"/>
|
class="button uk-button uk-button-primary" onclick="smChangeSaison(document.getElementById('filter_saison_id').value); return false;"/>
|
||||||
</td>
|
</td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<?php
|
<?php
|
||||||
@@ -225,6 +226,7 @@ static function veranstaltungHeaderAlone($veranstaltung, $vorherige_veranstaltun
|
|||||||
<?php
|
<?php
|
||||||
if (($showSeasons && count($seasons) > 1)) {
|
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">
|
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
|
||||||
<div class="uk-overflow-auto">
|
<div class="uk-overflow-auto">
|
||||||
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
|
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
|
||||||
@@ -233,14 +235,14 @@ static function veranstaltungHeaderAlone($veranstaltung, $vorherige_veranstaltun
|
|||||||
<label for="filter_saison_id"><?php echo Text::_('COM_SPORTSMANAGER_SEASON'); ?>
|
<label for="filter_saison_id"><?php echo Text::_('COM_SPORTSMANAGER_SEASON'); ?>
|
||||||
:</label>
|
:</label>
|
||||||
<select class="uk-select uk-form-width-medium" name="filter_saison_id"
|
<select class="uk-select uk-form-width-medium" name="filter_saison_id"
|
||||||
id="filter_saison_id" size="1" onChange="document.adminForm.submit();">
|
id="filter_saison_id" size="1" onChange="smChangeSaisonAlone(this.value);">
|
||||||
<?php
|
<?php
|
||||||
foreach ($seasons as $season)
|
foreach ($seasons as $season)
|
||||||
echo "<option value=\"" . $season->saison_id . "\" " . ($filter_saison_id == $season->saison_id ? "selected" : "") . ">" . htmlentities_utf8($season->saisonbezeichnung) . "</option>";
|
echo "<option value=\"" . $season->saison_id . "\" " . ($filter_saison_id == $season->saison_id ? "selected" : "") . ">" . htmlentities_utf8($season->saisonbezeichnung) . "</option>";
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
<input type="submit" name="ok" value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
|
<input type="submit" name="ok" value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
|
||||||
class="button uk-button uk-button-primary"/>
|
class="button uk-button uk-button-primary" onclick="smChangeSaisonAlone(document.getElementById('filter_saison_id').value); return false;"/>
|
||||||
</td>
|
</td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -317,6 +319,7 @@ static function turniereHeader($beschreibung, $saisons, $filter_saison_id): void
|
|||||||
}
|
}
|
||||||
if (count($saisons) > 0) {
|
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">
|
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
|
||||||
<div class="uk-overflow-auto">
|
<div class="uk-overflow-auto">
|
||||||
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
|
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
|
||||||
@@ -324,14 +327,14 @@ static function turniereHeader($beschreibung, $saisons, $filter_saison_id): void
|
|||||||
<td nowrap>
|
<td nowrap>
|
||||||
<label for="filter_saison_id"><?php echo Text::_('COM_SPORTSMANAGER_SEASON'); ?>:</label>
|
<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"
|
<select class="uk-select uk-form-width-medium" name="filter_saison_id" id="filter_saison_id"
|
||||||
size="1" onChange="document.adminForm.submit();">
|
size="1" onChange="smChangeSaison(this.value);">
|
||||||
<?php
|
<?php
|
||||||
foreach ($saisons as $saison)
|
foreach ($saisons as $saison)
|
||||||
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
|
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
<input type="submit" name="ok" value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
|
<input type="submit" name="ok" value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
|
||||||
class="button uk-button uk-button-primary"/>
|
class="button uk-button uk-button-primary" onclick="smChangeSaison(document.getElementById('filter_saison_id').value); return false;"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -2150,6 +2153,7 @@ static function tabelleEigeneAnzeigen($veranstaltung, $teams, $alleine_angezeigt
|
|||||||
}
|
}
|
||||||
if (count($saisons) > 0) {
|
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">
|
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
|
||||||
<div class="uk-overflow-auto">
|
<div class="uk-overflow-auto">
|
||||||
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
|
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
|
||||||
@@ -2158,7 +2162,7 @@ static function tabelleEigeneAnzeigen($veranstaltung, $teams, $alleine_angezeigt
|
|||||||
<label for="filter_saison_id"><?php echo Text::_('COM_SPORTSMANAGER_SEASON'); ?>
|
<label for="filter_saison_id"><?php echo Text::_('COM_SPORTSMANAGER_SEASON'); ?>
|
||||||
:</label>
|
:</label>
|
||||||
<select class="uk-select uk-form-width-medium" name="filter_saison_id"
|
<select class="uk-select uk-form-width-medium" name="filter_saison_id"
|
||||||
id="filter_saison_id" size="1" onChange="document.adminForm.submit();">
|
id="filter_saison_id" size="1" onChange="smChangeSaison(this.value);">
|
||||||
<?php
|
<?php
|
||||||
foreach ($saisons as $saison)
|
foreach ($saisons as $saison)
|
||||||
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
|
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
|
||||||
@@ -2166,7 +2170,7 @@ static function tabelleEigeneAnzeigen($veranstaltung, $teams, $alleine_angezeigt
|
|||||||
</select>
|
</select>
|
||||||
<input type="submit" name="ok"
|
<input type="submit" name="ok"
|
||||||
value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
|
value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
|
||||||
class="button uk-button uk-button-primary"/>
|
class="button uk-button uk-button-primary" onclick="smChangeSaison(document.getElementById('filter_saison_id').value); return false;"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -6053,6 +6057,7 @@ static function spielerstatistikenHeader($titel, $beschreibung, $saisons, $filte
|
|||||||
}
|
}
|
||||||
if (!empty($saisons) || !empty($spiele) || !empty($teams)) {
|
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">
|
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
|
||||||
<div class="uk-overflow-auto">
|
<div class="uk-overflow-auto">
|
||||||
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
|
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
|
||||||
@@ -6064,7 +6069,7 @@ static function spielerstatistikenHeader($titel, $beschreibung, $saisons, $filte
|
|||||||
:</label>
|
:</label>
|
||||||
<select class="uk-select uk-form-width-small" name="filter_saison_id"
|
<select class="uk-select uk-form-width-small" name="filter_saison_id"
|
||||||
id="filter_saison_id" size="1"
|
id="filter_saison_id" size="1"
|
||||||
onChange="document.adminForm.submit();">
|
onChange="smChangeSaison(this.value);">
|
||||||
<?php
|
<?php
|
||||||
foreach ($saisons as $saison)
|
foreach ($saisons as $saison)
|
||||||
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
|
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
|
||||||
@@ -6423,6 +6428,7 @@ static function individualwettbewerbHeader($titel, $beschreibung, $saisons, $fil
|
|||||||
}
|
}
|
||||||
if (count($saisons) > 0) {
|
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">
|
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
|
||||||
<div class="uk-overflow-auto">
|
<div class="uk-overflow-auto">
|
||||||
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
|
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
|
||||||
@@ -6433,7 +6439,7 @@ static function individualwettbewerbHeader($titel, $beschreibung, $saisons, $fil
|
|||||||
:</label>
|
:</label>
|
||||||
<select class="uk-select uk-form-width-medium" name="filter_saison_id"
|
<select class="uk-select uk-form-width-medium" name="filter_saison_id"
|
||||||
id="filter_saison_id" size="1"
|
id="filter_saison_id" size="1"
|
||||||
onChange="document.adminForm.submit();">
|
onChange="smChangeSaison(this.value);">
|
||||||
<?php
|
<?php
|
||||||
foreach ($saisons as $saison)
|
foreach ($saisons as $saison)
|
||||||
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
|
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
|
||||||
@@ -6441,7 +6447,7 @@ static function individualwettbewerbHeader($titel, $beschreibung, $saisons, $fil
|
|||||||
</select>
|
</select>
|
||||||
<input type="submit" name="ok"
|
<input type="submit" name="ok"
|
||||||
value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
|
value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
|
||||||
class="button uk-button uk-button-primary"/>
|
class="button uk-button uk-button-primary" onclick="smChangeSaison(document.getElementById('filter_saison_id').value); return false;"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -7253,6 +7259,7 @@ static function ranglistenHeader($titel, $beschreibung, $saisons, $filter_saison
|
|||||||
}
|
}
|
||||||
if (count($saisons) > 0) {
|
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">
|
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm">
|
||||||
<div class="uk-overflow-auto">
|
<div class="uk-overflow-auto">
|
||||||
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
|
<table class="uk-table contentpaneopen<?php echo $params->get('pageclass_sfx'); ?>">
|
||||||
@@ -7263,7 +7270,7 @@ static function ranglistenHeader($titel, $beschreibung, $saisons, $filter_saison
|
|||||||
:</label>
|
:</label>
|
||||||
<select class="uk-select uk-form-width-small" name="filter_saison_id"
|
<select class="uk-select uk-form-width-small" name="filter_saison_id"
|
||||||
id="filter_saison_id" size="1"
|
id="filter_saison_id" size="1"
|
||||||
onChange="document.adminForm.submit();">
|
onChange="smChangeSaison(this.value);">
|
||||||
<?php
|
<?php
|
||||||
foreach ($saisons as $saison)
|
foreach ($saisons as $saison)
|
||||||
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
|
echo "<option value=\"" . $saison->saison_id . "\" " . ($filter_saison_id == $saison->saison_id ? "selected" : "") . ">" . htmlentities_utf8($saison->saisonbezeichnung) . "</option>";
|
||||||
@@ -7271,7 +7278,7 @@ static function ranglistenHeader($titel, $beschreibung, $saisons, $filter_saison
|
|||||||
</select>
|
</select>
|
||||||
<input type="submit" name="ok"
|
<input type="submit" name="ok"
|
||||||
value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
|
value="<?php echo Text::_('COM_SPORTSMANAGER_GO'); ?>"
|
||||||
class="button uk-button uk-button-primary"/>
|
class="button uk-button uk-button-primary" onclick="smChangeSaison(document.getElementById('filter_saison_id').value); return false;"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user