From f14d46ffe060d675d06a82a792fd7ce5734819fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Mar 2009 16:33:22 +0000 Subject: [PATCH] Fix: When expand on click on a day for a previous/next day, we must not change of month. --- htdocs/comm/action/index.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 37826a2fb1d..ad082d37094 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -417,7 +417,7 @@ if ($_GET["action"] != 'show_day') { $style='cal_other_month'; echo ' '; - show_day_events ($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $style, $actionarray, $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); + show_day_events ($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $month, $style, $actionarray, $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); echo " \n"; } /* Show days of the current month */ @@ -433,7 +433,7 @@ if ($_GET["action"] != 'show_day') $style='cal_current_month'; echo ' '; - show_day_events($db, $tmpday, $month, $year, $style, $actionarray, $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); + show_day_events($db, $tmpday, $month, $year, $month, $style, $actionarray, $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); echo " \n"; } /* Show days after the current month (next month) */ @@ -441,7 +441,7 @@ if ($_GET["action"] != 'show_day') { $style='cal_other_month'; echo ' '; - show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $style, $actionarray, $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); + show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $month, $style, $actionarray, $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); echo "\n"; } $tmpday++; @@ -469,7 +469,7 @@ else echo " \n"; echo " \n"; echo ' '; - show_day_events ($db, $_GET["day"], $month, $year, $style, $actionarray, 0, 0); + show_day_events ($db, $_GET["day"], $month, $year, $month, $style, $actionarray, 0, 0); echo "\n"; echo " \n"; echo ''; @@ -489,12 +489,13 @@ llxFooter('$Date$ - $Revision$'); * @param unknown_type $day Day * @param unknown_type $month Month * @param unknown_type $year Year + * @param unknown_type $monthshown Month shown in calendar view * @param unknown_type $style Style to use for this day * @param unknown_type $actionarray Array of actions * @param unknown_type $maxPrint Nb of actions to show each day on month view (0 means non limit) * @param unknown_type nbofchartoshow Nb of characters to show for event line */ -function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPrint=0, $nbofchartoshow=14) +function show_day_events($db, $day, $month, $year, $monthshown, $style, $actionarray, $maxPrint=0, $nbofchartoshow=14) { global $user, $conf, $langs; global $filtera, $filtert, $filted; @@ -590,7 +591,7 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri } else { - print ''.img_picto("all","1downarrow_selected.png").' ...'; + print ''.img_picto("all","1downarrow_selected.png").' ...'; print ' +'.(sizeof($actionarray[$daykey])-$maxPrint); print ''; break;