From 274516f7127f541308e136c8babf11b67916d5ee Mon Sep 17 00:00:00 2001 From: sparkyx Date: Mon, 13 Jan 2025 08:36:20 +0100 Subject: [PATCH] Calendar : default periode = user's preference , add button "today" --- include/template/calendar.php | 23 ++++++++++++++++++++++- include/widget/agenda/agenda.php | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/include/template/calendar.php b/include/template/calendar.php index 645ac24cc..0f6876a6f 100644 --- a/include/template/calendar.php +++ b/include/template/calendar.php @@ -1,6 +1,18 @@ find_periode(date('d.m.Y')); + $today_hidden=\HtmlInput::hidden('today', $today_periode); +} catch (\Exception $e) { + $today_hidden=''; +} ?>
@@ -9,8 +21,17 @@ dossier::id(),'per_div','calendar_zoom_div','list',$notitle); echo HtmlInput::anchor(_('Liste'),''," onclick=\"{$js}\"") ; echo HtmlInput::button_action_add(); + echo $today_hidden; ?> - + + + + + + diff --git a/include/widget/agenda/agenda.php b/include/widget/agenda/agenda.php index db8fb7de7..e60198fda 100644 --- a/include/widget/agenda/agenda.php +++ b/include/widget/agenda/agenda.php @@ -39,7 +39,7 @@ class Agenda extends Widget global $g_user; /* others report */ $cal=new \Calendar(); - $cal->get_preference(); + $cal->default_periode=$g_user->get_periode(); $obj=sprintf("{gDossier:%d,invalue:'%s',outdiv:'%s','distype':'%s'}", \Dossier::id(),'per','calendar_zoom_div','cal');