fix broken category search, selected cat=1 always, when only one category wasselected, as (int) of an array does not give the required/expected result

This commit is contained in:
Klaus Leithoff 2011-07-19 07:32:28 +00:00
parent fe9e16d845
commit 5529618ba1

View File

@ -344,7 +344,7 @@ class calendar_so
{
$cats = $GLOBALS['egw']->categories->return_all_children($cat_id);
array_walk($cats,create_function('&$val,$key','$val = (int) $val;'));
if (is_array($cat_id) && count($cat_id)==1) $cat_id = $cat_id[0];
$sql = '(cal_category'.(count($cats) > 1 ? " IN ('".implode("','",$cats)."')" : '='.$this->db->quote((int)$cat_id));
foreach($cats as $cat)
{