From 6ed25bb18da3adae32d7073095b88876bacf451e Mon Sep 17 00:00:00 2001 From: William Mead Date: Fri, 15 Mar 2024 16:10:40 +0100 Subject: [PATCH] Updated add button to use minutes and local user time --- htdocs/comm/action/index.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 68e6b4d71693c..eeb088dff65ee 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -547,8 +547,7 @@ $newparam .= '&month='.((int) $month).'&year='.((int) $tmpforcreatebutton['year']).'&mode='.urlencode($mode); - //$param='month='.$monthshown.'&year='.$year; - $hourminsec = dol_print_date(dol_mktime(10, 0, 0, 1, 1, 1970, 'gmt'), '%H', 'gmt').'0000'; // Set $hourminsec to '100000' to auto set hour to 10:00 at creation + $hourminsec = dol_print_date(dol_now(), '%H%M', 'tzserver').'00'; $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''))); } @@ -1815,7 +1814,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $urltocreate = ''; if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) { $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; - $hourminsec = '100000'; + $hourminsec = dol_print_date(dol_now(), '%H%M', 'tzserver').'00'; $urltocreate = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $year, $month, $day).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')); }