* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -210,7 +210,7 @@ if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (
if($filtert>0||$usergroup>0)
{
$sql.=" AND (";
if($filtert>0)$sql.="(ar.fk_element = ".$filtert." OR a.fk_user_action=".$filtert.")";
if($filtert>0)$sql.="(ar.fk_element = ".$filtert." OR (ar.fk_element IS NULL AND a.fk_user_action=".$filtert."))";// The OR is for backward compatibility
if($usergroup>0)$sql.=($filtert>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup;