fix for search to return also the entries from sub-categoris, as sugested by Stephan Hilchenbach from the german list

This commit is contained in:
Ralf Becker 2004-04-04 22:52:24 +00:00
parent 4b7ced6e84
commit ba4ed68752

View File

@ -594,8 +594,18 @@
/* exact value (filtering based on tid, etc...) */
if($name == 'phpgwcontactcatid')
{
$aquery .= '(|(' . $name . '=*,' . $value . ',*)'.
'(' . $name . '=' . $value . '))';
if (!is_object($GLOBALS['phpgw']->categories))
{
$GLOBALS['phpgw']->categories = CreateObject('phpgwapi.categories');
}
$cats = $GLOBALS['phpgw']->categories->return_all_children((int)$value);
$aquery .= '(|';
foreach($cats as $cat)
{
$aquery .= '(' . $name . '=*,' . $cat . ',*)(' . $name . '=' . $cat . ')';
}
$aquery .= ')';
}
else
{