Merge pull request #82 from Deutscher-Tischfussballbund/issues/73_missing-dropdown-in-league

fix: add season dropdown to events, even if there is just one event
This commit is contained in:
MarvinF
2025-06-30 18:57:10 +02:00
committed by GitHub
2 changed files with 40 additions and 12 deletions
@@ -1577,8 +1577,12 @@ function veranstaltung(): void
} }
} }
$showSeasons = false;
if (count($saisons) > 1) {
$showSeasons = true;
}
// Anzeigen // Anzeigen
HTML_sportsmanager::veranstaltungHeaderAlone($veranstaltung, $vorherige_veranstaltung_id, $naechste_veranstaltung_id); HTML_sportsmanager::veranstaltungHeaderAlone($veranstaltung, $vorherige_veranstaltung_id, $naechste_veranstaltung_id, $showSeasons, $saisons, $filter_saison_id);
if ($veranstaltung->tabellenwertung != 0) if ($veranstaltung->tabellenwertung != 0)
tabelle($veranstaltung, $spieltag, true); tabelle($veranstaltung, $spieltag, true);
@@ -140,13 +140,6 @@ static function veranstaltungenHeader($titel, $beschreibung, $saisons, $filter_s
<a href="<?php echo SportsManagerURL('&task=veranstaltungen_ticker&tmpl=component'); ?>" <a href="<?php echo SportsManagerURL('&task=veranstaltungen_ticker&tmpl=component'); ?>"
class="readon<?php echo $params->get('pageclass_sfx'); ?>"> class="readon<?php echo $params->get('pageclass_sfx'); ?>">
<?php echo Text::_('COM_SPORTSMANAGER_LIVE_TICKER'); ?> &hellip;</a><br/> <?php echo Text::_('COM_SPORTSMANAGER_LIVE_TICKER'); ?> &hellip;</a><br/>
<?php
/*
<a href="javascript:openwindow('<?php echo SportsManagerURL('&task=veranstaltungen_ticker&tmpl=component'); ?>',screen.width,725);" class="readon<?php echo $params->get( 'pageclass_sfx' ); ?>">
<?php echo Text::_( 'COM_SPORTSMANAGER_LIVE_TICKER' ); ?> &hellip;(no menu)</a>
*/
?>
</td> </td>
</tr> </tr>
</table> </table>
@@ -158,7 +151,7 @@ static function veranstaltungenHeader($titel, $beschreibung, $saisons, $filter_s
} }
} }
static function veranstaltungHeaderAlone($veranstaltung, $vorherige_veranstaltung_id, $naechste_veranstaltung_id): void static function veranstaltungHeaderAlone($veranstaltung, $vorherige_veranstaltung_id, $naechste_veranstaltung_id, $showSeasons = false, $seasons = [], $filter_saison_id = 0): void
{ {
global $params; global $params;
@@ -167,7 +160,7 @@ static function veranstaltungHeaderAlone($veranstaltung, $vorherige_veranstaltun
<tr> <tr>
<th style="width: 30px" class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>"></th> <th style="width: 30px" class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>"></th>
<th style="text-align: left" class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>"> <th style="text-align: left" class="sectiontableheader<?php echo $params->get('pageclass_sfx'); ?>">
<!--img src="images/M_images/arrow.png" border="0"/--> <a <a
href="<?php echo SportsManagerURL('&task=veranstaltungen#vid' . $veranstaltung->veranstaltung_id); ?>"> href="<?php echo SportsManagerURL('&task=veranstaltungen#vid' . $veranstaltung->veranstaltung_id); ?>">
<?php echo Text::_('COM_SPORTSMANAGER_COMPETITIONS'); ?></a> <?php echo Text::_('COM_SPORTSMANAGER_COMPETITIONS'); ?></a>
&gt; <?php echo htmlentities_utf8($veranstaltung->bezeichnung); ?> &gt; <?php echo htmlentities_utf8($veranstaltung->bezeichnung); ?>
@@ -226,9 +219,40 @@ static function veranstaltungHeaderAlone($veranstaltung, $vorherige_veranstaltun
?> ?>
</H2> </H2>
</div> </div>
</td> </td>
</tr> </tr>
</table> </table>
<?php
if (($showSeasons && count($seasons) > 1)) {
?>
<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'); ?>">
<tr>
<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="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"/>
</td>
<td>&nbsp;&nbsp;&nbsp;</td>
</tr>
</table>
</div>
<input type="hidden" name="task" value="veranstaltungen"/>
</form>
<span class="article_seperator<?php echo $params->get('pageclass_sfx'); ?>">&nbsp;</span>
<?php
}
?>
</div> </div>
<?php <?php
} }
@@ -1558,7 +1582,7 @@ global $params;
if (count($teams) > 0) { if (count($teams) > 0) {
if ($alleine_angezeigt && $veranstaltung->tabellenwertung >= -1 && $veranstaltung->tabellenwertung <= 11 && count($spieltage) > 1) { if ($alleine_angezeigt && $veranstaltung->tabellenwertung >= -1 && $veranstaltung->tabellenwertung <= 11 && count($spieltage) > 1) {
?> ?>
<form action="<?php echo SportsManagerURL(); ?>" method="post" name="adminForm" id="adminForm"> <form action="<?php echo SportsManagerURL(); ?>" method="post" name="matchDayForm" id="matchDayForm">
<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'); ?>">
<tr> <tr>
@@ -1566,7 +1590,7 @@ global $params;
<select <select
aria-label="<?php echo Text::_('COM_SPORTSMANAGER_ARIA_LABEL_MATCHDAY_SELECT'); ?>" aria-label="<?php echo Text::_('COM_SPORTSMANAGER_ARIA_LABEL_MATCHDAY_SELECT'); ?>"
class="uk-select uk-form-width-medium" name="spieltag" size="1" class="uk-select uk-form-width-medium" name="spieltag" size="1"
onChange="document.adminForm.submit();"> onChange="document.matchDayForm.submit();">
<?php <?php
foreach ($spieltage as $s) { foreach ($spieltage as $s) {
echo "<option value=\"" . $s->spieltag . "\"" . ($s->spieltag == $spieltag ? " selected" : "") . ">" . htmlentities_utf8(Rundenbezeichnung($s->spieltag, $veranstaltung->unterteilung == 0)) . "</option>"; echo "<option value=\"" . $s->spieltag . "\"" . ($s->spieltag == $spieltag ? " selected" : "") . ">" . htmlentities_utf8(Rundenbezeichnung($s->spieltag, $veranstaltung->unterteilung == 0)) . "</option>";