From 12e1f4326d523360fefd5485e5cabe77a8999298 Mon Sep 17 00:00:00 2001 From: Adrien RENARD Date: Fri, 22 Aug 2025 12:51:51 +0200 Subject: [PATCH] Ajout datetime GIT repo version --- functions/functions.php | 8 ++++++-- public_html_admin/templates/structure/topBar.tpl | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/functions/functions.php b/functions/functions.php index 8de8015..85f1ecd 100644 --- a/functions/functions.php +++ b/functions/functions.php @@ -3,9 +3,9 @@ // SMARTY DISPLAY // function display() { + $GLOBALS['smarty'] -> assign('gitVS',getGitVersion()); $GLOBALS['smarty'] -> assign('debug',isset($GLOBALS['debug']) ? $GLOBALS['debug'] : false); $GLOBALS['smarty'] -> assign('errors',isset($GLOBALS['errors']) ? $GLOBALS['errors'] : false); - $GLOBALS['smarty'] -> assign('gitVS',getGitVersion()); $GLOBALS['smarty'] -> assign('jsFiles',$GLOBALS['jsFiles']); $GLOBALS['smarty'] -> assign('cssFiles',$GLOBALS['cssFiles']); @@ -85,8 +85,10 @@ function getGitVersion() { exec('git describe --always',$version_mini_hash); exec('git rev-list HEAD | wc -l',$version_number); exec('git log -1',$line); + exec('git log -1 --format=%cd --date=iso',$date); $version['short'] = "v1.".trim($version_number[0]).".".$version_mini_hash[0]; $version['full'] = "v1.".trim($version_number[0]).".$version_mini_hash[0] (".str_replace('commit ','',$line[0]).")"; + $version['date'] = formatDate($date[0], 'iso', 'datetime'); return $version; } @@ -190,6 +192,7 @@ function strtoupperFirstLetter($str) { 'mysql_datetime' => "Y-m-d H:i:s", 'strdate' => "Y-m-d", 'strdatetime' => "Y-m-d_H.i.s", + 'iso' => "Y-m-d H:i:s P", 'time' => "H:i", 'print_time' => "H:i", 'mois' => "m-d" @@ -204,10 +207,11 @@ function dateFormatHasDate($format) { || $format=='mysql_datetime' || $format=='strdate' || $format=='strdatetime' + || $format=='iso' || $format=='timestamp'; } function dateFormatHasTime($format) { - return $format=='datetime' || $format=='mysql_datetime' || $format=='strdatetime' || $format=='timestamp'; + return $format=='datetime' || $format=='mysql_datetime' || $format=='strdatetime' || $format=='iso' || $format=='timestamp'; } function parseDate($dateTxt='', $format="mysql_datetime", $moment=false, $dateTimeZoneTxt = "Europe/Paris") { diff --git a/public_html_admin/templates/structure/topBar.tpl b/public_html_admin/templates/structure/topBar.tpl index 091e6d7..6c0338f 100644 --- a/public_html_admin/templates/structure/topBar.tpl +++ b/public_html_admin/templates/structure/topBar.tpl @@ -37,7 +37,7 @@
  • déconnection
  • - GIT vs. : {$gitVS.short} + GIT vs. : {$gitVS.short}
    {$gitVS.date}