removed never implemented cats_no_subs common pref and always include sub-cats (no change as currently only one was selectable)

This commit is contained in:
Ralf Becker 2010-10-14 16:16:02 +00:00
parent 5c66c7d162
commit ddcc0e1f75
2 changed files with 6 additions and 15 deletions

View File

@ -296,9 +296,8 @@ class calendar_bo
* @param array $params array with the following keys
* start date startdate of the search/list, defaults to today
* end date enddate of the search/list, defaults to start + one day
* users mixed integer user-id or array of user-id's to use, defaults to the current user
* cat_id mixed category-id or array of cat-id's, defaults to all if unset, 0 or False
* Please note: only a single cat-id, will include all sub-cats (if the common-pref 'cats_no_subs' is False)
* users int|array integer user-id or array of user-id's to use, defaults to the current user
* cat_id int|array category-id or array of cat-id's (incl. all sub-categories), default 0 = all
* filter string all (not rejected), accepted, unknown, tentative, rejected or hideprivate
* query string pattern so search for, if unset or empty all matching entries are returned (no search)
* Please Note: a search never returns repeating events more then once AND does not honor start+end date !!!
@ -306,7 +305,7 @@ class calendar_bo
* (events spanning multiple days are returned each day again (!)) otherwise it returns one array with
* the events (default), not honored in a search ==> always returns an array of events!
* date_format string date-formats: 'ts'=timestamp (default), 'array'=array, or string with format for date
* offset boolean/int false (default) to return all entries or integer offset to return only a limited result
* offset boolean|int false (default) to return all entries or integer offset to return only a limited result
* enum_recuring boolean if true or not set (default) or daywise is set, each recurence of a recuring events is returned,
* otherwise the original recuring event (with the first start- + enddate) is returned
* num_rows int number of entries to return, default or if 0, max_entries from the prefs

View File

@ -274,7 +274,7 @@ class calendar_so
}
/**
* generate SQL to filter after a given category (evtl. incl. subcategories)
* generate SQL to filter after a given category (incl. subcategories)
*
* @param array|int $cat_id cat-id or array of cat-ids, or !$cat_id for none
* @return string SQL to include in the query
@ -284,14 +284,7 @@ class calendar_so
$sql = '';
if ($cat_id)
{
if (!is_array($cat_id) && !@$GLOBALS['egw_info']['user']['preferences']['common']['cats_no_subs'])
{
$cats = $GLOBALS['egw']->categories->return_all_children($cat_id);
}
else
{
$cats = is_array($cat_id) ? $cat_id : array($cat_id);
}
$cats = $GLOBALS['egw']->categories->return_all_children($cat_id);
array_walk($cats,create_function('&$val,$key','$val = (int) $val;'));
$sql = '(cal_category'.(count($cats) > 1 ? " IN ('".implode("','",$cats)."')" : '='.$this->db->quote((int)$cat_id));
@ -310,8 +303,7 @@ class calendar_so
* @param int $start startdate of the search/list (servertime)
* @param int $end enddate of the search/list (servertime)
* @param int|array $users user-id or array of user-id's, !$users means all entries regardless of users
* @param int $cat_id=0 mixed category-id or array of cat-id's, default 0 = all
* Please note: only a single cat-id, will include all sub-cats (if the common-pref 'cats_no_subs' is False)
* @param int|array $cat_id=0 mixed category-id or array of cat-id's (incl. all sub-categories), default 0 = all
* @param string $filter='all' string filter-name: all (not rejected), accepted, unknown, tentative, rejected or hideprivate (handled elsewhere!)
* @param int|boolean $offset=False offset for a limited query or False (default)
* @param int $num_rows=0 number of rows to return if offset set, default 0 = use default in user prefs