From b7dbf4cbba934764ffb43bdb0fd2abe05816ca73 Mon Sep 17 00:00:00 2001 From: Christian Binder Date: Thu, 2 Nov 2006 21:33:00 +0000 Subject: [PATCH] Re-activated filter in calendar views with two states: all or hideprivate --- calendar/inc/class.bocal.inc.php | 4 ++-- calendar/inc/class.socal.inc.php | 2 +- calendar/inc/class.uical.inc.php | 18 +++++++----------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/calendar/inc/class.bocal.inc.php b/calendar/inc/class.bocal.inc.php index a6ddf57dde..d2c4c0b789 100644 --- a/calendar/inc/class.bocal.inc.php +++ b/calendar/inc/class.bocal.inc.php @@ -232,7 +232,7 @@ class bocal * 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) - * filter string space delimited filter-names, atm. 'all' or 'private' + * filter string filter-name, atm. 'all' 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 !!! * dayswise boolean on True it returns an array with YYYYMMDD strings as keys and an array with events @@ -350,7 +350,7 @@ class bocal { $events[$id] = $event; } - if (!$this->check_perms(EGW_ACL_READ,$event)) + if (!$this->check_perms(EGW_ACL_READ,$event) || (!$event['public'] && $filter == 'hideprivate')) { $this->clear_private_infos($events[$id],$users); } diff --git a/calendar/inc/class.socal.inc.php b/calendar/inc/class.socal.inc.php index 9fed5a80de..64dd0773d0 100644 --- a/calendar/inc/class.socal.inc.php +++ b/calendar/inc/class.socal.inc.php @@ -265,7 +265,7 @@ class socal * @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 string $filter='' string space delimited filter-names, NOT used atm. + * @param string $filter='' string filter-name, atm. all or hideprivate * @param string $query='' 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 !!! * @param int/bool $offset=False offset for a limited query or False (default) diff --git a/calendar/inc/class.uical.inc.php b/calendar/inc/class.uical.inc.php index 296475b0e2..c18b4598a9 100644 --- a/calendar/inc/class.uical.inc.php +++ b/calendar/inc/class.uical.inc.php @@ -104,7 +104,7 @@ class uical */ var $cat_id; /** - * @var int $filter session-state: selected filter, NOT used at the moment (was all or private) + * @var int $filter session-state: selected filter, at the moment all or hideprivate */ var $filter; /** @@ -249,7 +249,7 @@ class uical * - cat_id: the selected category * - owner: the owner of the displayed calendar * - save_owner: the overriden owner of the planner - * - filter: the used filter: no filter / all or only privat, NOT used atm. + * - filter: the used filter: all or hideprivate * - sortby: category or user of planner * - view: the actual view, where dialogs should return to or which they refresh * @param set_states array to manualy set / change one of the states, default NULL = use $_REQUEST @@ -650,15 +650,11 @@ class uical $file[$n]['text'] = $this->html->form(False,$base_hidden_vars,'/index.php',array('menuaction' => $_GET['menuaction'])) . $file[$n]['text']; - // Filter all or private -/* NOT used at the moment - if(is_numeric($this->owner) && $this->bo->check_perms(EGW_ACL_PRIVATE,0,$this->owner)) - { - $file[] = $this->_select_box('Filter','filter', - ''."\n". - ''."\n"); - } -*/ + // Filter all or hideprivate + $file[] = $this->_select_box('Filter','filter', + ''."\n". + ''."\n"); + // Calendarselection: User or Group if(count($this->bo->grants) > 0 && $this->accountsel->account_selection != 'none') {