--- dolibarr/htdocs/comm/action/index.php 2008-03-03 05:00:15.000000000 +0100 +++ nouveauDolibarr/htdocs/comm/action/index.php 2008-03-19 17:01:18.000000000 +0100 @@ -109,6 +109,7 @@ echo ' '.$langs->trans("Sunday")."\n"; echo " \n"; +$userfilter=$user->id; for($iter_week = 0; $iter_week < 6 ; $iter_week++) { echo " \n"; @@ -120,7 +121,7 @@ { $style='cal_other_month'; echo ' '; - show_day_events ($db, $max_day_in_prev_month + $day, $prev_month, $prev_year, $style); + show_day_events ($db, $max_day_in_prev_month + $day, $prev_month, $prev_year, $style, $userfilter); echo " \n"; } /* Show days of the current month */ @@ -136,7 +137,7 @@ $style='cal_current_month'; echo ' '; - show_day_events ($db, $day, $month, $year, $style); + show_day_events ($db, $day, $month, $year, $style, $userfilter); echo " \n"; } /* Show days after the current month (next month) */ @@ -144,7 +145,7 @@ { $style='cal_other_month'; echo ' '; - show_day_events ($db, $day - $max_day_in_month, $next_month, $next_year, $style); + show_day_events ($db, $day - $max_day_in_month, $next_month, $next_year, $style, $userfilter); echo "\n"; } $day++; @@ -158,11 +159,78 @@ llxFooter('$Date: 2008/03/02 18:47:43 $ - $Revision: 1.62 $'); -function show_day_events($db, $day, $month, $year, $style) +function show_day_events($db, $day, $month, $year, $style,$userfilter) { print ''; print ''; - print ''; + print ''; print '
'.$day.'
 
'; + $sql = 'SELECT a.id,a.label,a.datep,a.percent,a.fk_user_author,a.fk_user_action,a.fk_user_done'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a'; + $addfilter=0; + if($_GET["filtera"]) + { + if(!$addfilter) + { + $sql.=' WHERE a.fk_user_author='.$userfilter; + } + else + { + $sql.=' OR a.fk_user_author='.$userfilter; + } + $addfilter=1; + } + if($_GET["filtert"]) + { + if(!$addfilter) + { + $sql.=' WHERE a.fk_user_action='.$userfilter; + } + else + { + $sql.=' OR a.fk_user_action='.$userfilter; + } + $addfilter=1; + } + if($_GET["filterd"]) + { + if(!$addfilter) + { + $sql.=' WHERE a.fk_user_done='.$userfilter; + } + else + { + $sql.=' OR a.fk_user_done='.$userfilter; + } + $addfilter=1; + } +//echo "$sql
"; +$resql=$db->query($sql); +if ($resql) +{ + $actionstatic=new ActionComm($db); + $societestatic=new Societe($db); + $num = $db->num_rows($resql); + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $dateaff=$actionstatic->datep=$obj->datep; + $annee = substr($dateaff, 0, 4); + $mois = substr($dateaff, 5, 2); + $jour = substr($dateaff, 8, 2); + if($day== $jour && $month==$mois && $year==$annee) + { + $actionstatic->id=$obj->id; + $actionstatic->libelle=$obj->label; + print $actionstatic->getNomUrl(1,10)."
".$actionstatic->LibStatut($obj->percent,4)."
"; + } + $i++; + } + //echo $num; + + +} + + print ' 
'; }