From 62b3d115425ab8c0a0810dcd6382f90f25bb0b4a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Nov 2008 18:39:19 +0000 Subject: [PATCH] Memory optimisation Add number of other events not shown in calendar for each day --- htdocs/comm/action/index.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index beef0b153c8..678f7c41bc0 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -509,8 +509,7 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri //$curtime = dolibarr_mktime (0, 0, 0, $month, $day, $year); $i=0; - $ok=true; - + foreach ($actionarray as $daykey => $notused) { $annee = date('Y',$daykey); @@ -520,7 +519,6 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri { foreach ($actionarray[$daykey] as $index => $action) { - if ($i < $maxPrint || $maxPrint == 0) { $ponct=($action->date_start_in_calendar == $action->date_end_in_calendar); @@ -579,12 +577,16 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri print ''; $i++; } - else if($ok) + else { - print ''.img_picto("all","1downarrow_selected.png").' ...'; - $ok=false; + print ''.img_picto("all","1downarrow_selected.png").' ...'; + print ' +'.(sizeof($actionarray[$daykey])-$maxPrint); + print ''; + break; + //$ok=false; // To avoid to show twice the link } } + break; } } if (! $i) print ' ';