Merge pull request #127 from Deutscher-Tischfussballbund/chore/version-from-tags

chore: create version in sportsmanager from git tag
This commit is contained in:
MarvinF
2025-08-11 17:43:27 +02:00
committed by GitHub
4 changed files with 54 additions and 19 deletions
@@ -15,7 +15,6 @@ use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Version;
defined('_JEXEC') or die('Restricted access');
const SPORTS_MANAGER_VERSION = "2.0.3";
function laufzeitInit(): void
{
@@ -56,6 +55,7 @@ else if (isset($_REQUEST['filter_saison_id']))
global $content;
global $task;
global $params;
$app = Factory::getContainer()->get(SiteApplication::class);
$jInput = $app->input;
$task = $jInput->getCmd('task');
@@ -0,0 +1,6 @@
<?php // do not change this file, this is automatically updated while building releases, see .github/workflows/build_release.yml
defined('_JEXEC') or die;
return [
'version' => 'DEV',
'date' => '2025-08-05',
];
@@ -12,7 +12,8 @@ defined('_JEXEC') or die('Restricted access');
require_once JPATH_SITE . '/components/com_sportsmanager/views/sportsmanager/view_tools.php';
require_once JPATH_SITE . '/components/com_sportsmanager/util/image.php';
function formatTimediff( $timestamp1, $timestamp2, $verbose ) {
function formatTimediff( $timestamp1, $timestamp2, $verbose ): string
{
if (empty($timestamp1) || empty($timestamp2)) {
return "";
} else {
@@ -27,7 +28,8 @@ function formatTimediff( $timestamp1, $timestamp2, $verbose ) {
}
}
function formatTeamName( $team_name, $team_id, $highlight_team_id ) {
function formatTeamName( $team_name, $team_id, $highlight_team_id ): string
{
if ($team_id == $highlight_team_id) {
return "<b><i>" . htmlentities_utf8($team_name) . "</i></b>";
} else {
@@ -37,10 +39,25 @@ function formatTeamName( $team_name, $team_id, $highlight_team_id ) {
class HTML_sportsmanager_admin
{
private static $versionData = null;
private static function loadVersionData(): void
{
if (self::$versionData === null) {
self::$versionData = include JPATH_SITE . '/components/com_sportsmanager/util/version.php';
}
}
public static function getVersion(): string
{
self::loadVersionData();
return self::$versionData['version'] ?? 'DEV';
}
static function adminUebersicht($veranstaltungen, $spielerstatistiken, $turniere, $ranglisten, $individualwettbewerbe, $statistik, $saisons, $filter_saison_id, $externe_datenbank): void
{
function checkZeilenumbruch($Spalte_Nr, $max_Spalten)
{
function checkZeilenumbruch($Spalte_Nr, $max_Spalten): int
{
$Spalte_Nr++;
if ($Spalte_Nr >= $max_Spalten){
echo "</tr>\n<tr>\n";
@@ -48,12 +65,12 @@ class HTML_sportsmanager_admin
}
return $Spalte_Nr;
}
global $params;
?>
<div class="componentheading<?php echo $params->get('pageclass_sfx'); ?>" style='font-weight: bold;'>
<a href="https://github.com/Deutscher-Tischfussballbund/" target="_blank">
Sports Manager <?php echo SPORTS_MANAGER_VERSION; ?> </a>
Sports Manager <?php echo self::getVersion(); ?> </a>
</div>
<table>
<tr>
@@ -4925,7 +4942,7 @@ class HTML_sportsmanager_admin
static function adminKategorien($kategorien): void
{
global $params;
?>
<div
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo Text::_('COM_SPORTSMANAGER_CATEGORIES'); ?></div>
@@ -8729,11 +8746,11 @@ class HTML_sportsmanager_admin
<td nowrap
style="text-align: center"><?php if ($ergebnis_vorhanden) echo $row->heim_spielpunkte . " : " . $row->gast_spielpunkte; else echo "_ : _" ?><?php if ($row->unbestaetigtes_ergebnis_id != null) echo "<br /><small>" . ($row->zwischenergebnis ? "live" : "unbest&auml;tigt") . "</small>"; ?></td>
<td nowrap align="center">
<?php echo
formatTimediff($row->termin_spiel, $row->ergebnis_vorgeschlagen, false)
<?php echo
formatTimediff($row->termin_spiel, $row->ergebnis_vorgeschlagen, false)
. " / "
. formatTimediff($row->ergebnis_vorgeschlagen, $row->ergebnis_akzeptiert, false);
?>
. formatTimediff($row->ergebnis_vorgeschlagen, $row->ergebnis_akzeptiert, false);
?>
</td>
<td nowrap><small><a
href="<?php echo SportsManagerURL('&task=admin_begegnung_heimtausch&veranstaltungid=' . $veranstaltung->veranstaltung_id . '&id=' . $row->begegnung_id); ?>"><?php echo Text::_('COM_SPORTSMANAGER_HOME_EXCHANGE'); ?></a></small>