mirror of
https://github.com/Deutscher-Tischfussballbund/com_sportsmanager.git
synced 2026-06-10 06:27:52 +00:00
chore: create version in sportsmanager from git tag
This commit is contained in:
@@ -25,6 +25,18 @@ jobs:
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Get version from git tag
|
||||
run: echo "VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
||||
|
||||
- name: Update version.php
|
||||
run: |
|
||||
echo "<?php" > src/structure/components/com_sportsmanager/util/version.php
|
||||
echo "defined('_JEXEC') or die;" >> src/structure/components/com_sportsmanager/util/version.php
|
||||
echo "return [" >> src/structure/components/com_sportsmanager/util/version.php
|
||||
echo " 'version' => '${{ env.VERSION }}'," >> src/structure/components/com_sportsmanager/util/version.php
|
||||
echo " 'date' => '$(date +%F)'," >> src/structure/components/com_sportsmanager/util/version.php
|
||||
echo "];" >> src/structure/components/com_sportsmanager/util/version.php
|
||||
|
||||
- name: Generate release notes
|
||||
id: release_notes_extension
|
||||
uses: release-drafter/release-drafter@v6
|
||||
|
||||
@@ -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";
|
||||
@@ -53,7 +70,7 @@ class HTML_sportsmanager_admin
|
||||
?>
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user