Skip to content

Commit

Permalink
Updated add button to use minutes and local user time
Browse files Browse the repository at this point in the history
  • Loading branch information
W1W1-M committed Mar 15, 2024
1 parent b23e627 commit 6ed25bb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions htdocs/comm/action/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 : '')));
}
Expand Down Expand Up @@ -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 : ''));
}

Expand Down

0 comments on commit 6ed25bb

Please sign in to comment.