From ddcc0e1f75cc1c7ecad648aadfb18859c0610f95 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 14 Oct 2010 16:16:02 +0000 Subject: [PATCH] removed never implemented cats_no_subs common pref and always include sub-cats (no change as currently only one was selectable) --- calendar/inc/class.calendar_bo.inc.php | 7 +++---- calendar/inc/class.calendar_so.inc.php | 14 +++----------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/calendar/inc/class.calendar_bo.inc.php b/calendar/inc/class.calendar_bo.inc.php index 38152365aa..5f4e3c7580 100644 --- a/calendar/inc/class.calendar_bo.inc.php +++ b/calendar/inc/class.calendar_bo.inc.php @@ -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 diff --git a/calendar/inc/class.calendar_so.inc.php b/calendar/inc/class.calendar_so.inc.php index 5e6841906b..4f78ad8729 100644 --- a/calendar/inc/class.calendar_so.inc.php +++ b/calendar/inc/class.calendar_so.inc.php @@ -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