From 0cd5658ca1bb80e0946995922f34c772ab3e6829 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 10 Dec 2010 11:03:35 +0000 Subject: [PATCH] * calendar: make configurable the number of users, until day- or weekview are consolidated; 5 is set as default --- calendar/inc/class.calendar_bo.inc.php | 8 +++++++- calendar/inc/class.calendar_uiviews.inc.php | 6 +++--- calendar/templates/default/config.tpl | 4 ++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/calendar/inc/class.calendar_bo.inc.php b/calendar/inc/class.calendar_bo.inc.php index 09135182e8..e9564b3338 100644 --- a/calendar/inc/class.calendar_bo.inc.php +++ b/calendar/inc/class.calendar_bo.inc.php @@ -181,6 +181,12 @@ class calendar_bo */ public $require_acl_invite = false; + /** + * if the number of selected users for a view exeeds this number a view is consolidated (5 is set as default) + * @var int + */ + public $calview_no_consolidate = 5; + /** * Constructor */ @@ -225,7 +231,7 @@ class calendar_bo //echo "registered resources="; _debug_array($this->resources); $this->config = config::read('calendar'); // only used for horizont, regular calendar config is under phpgwapi - + $this->calview_no_consolidate = ($GLOBALS['egw_info']['server']['calview_no_consolidate']?$GLOBALS['egw_info']['server']['calview_no_consolidate']:5); $this->require_acl_invite = $GLOBALS['egw_info']['server']['require_acl_invite']; $this->categories = new categories($this->user,'calendar'); diff --git a/calendar/inc/class.calendar_uiviews.inc.php b/calendar/inc/class.calendar_uiviews.inc.php index f186451692..e11f74850e 100644 --- a/calendar/inc/class.calendar_uiviews.inc.php +++ b/calendar/inc/class.calendar_uiviews.inc.php @@ -759,7 +759,7 @@ class calendar_uiviews extends calendar_ui $users = $this->search_params['users']; if (!is_array($users)) $users = array($users); - if (count($users) == 1 || count($users) > 5) // for more then 3 users, show all in one row + if (count($users) == 1 || count($users) > $this->bo->calview_no_consolidate) // for more then X users, show all in one row { $content = $this->timeGridWidget($this->tagWholeDayOnTop($this->bo->search($search_params)),$this->cal_prefs['interval']); } @@ -812,8 +812,8 @@ class calendar_uiviews extends calendar_ui $users = $this->search_params['users']; if (!is_array($users)) $users = array($users); - // for more then 5 users, show all in one row - if (count($users) == 1 || count($users) > 5) + // for more then X users, show all in one row + if (count($users) == 1 || count($users) > $this->bo->calview_no_consolidate) { $dayEvents =& $this->bo->search($this->search_params); $owner = 0; diff --git a/calendar/templates/default/config.tpl b/calendar/templates/default/config.tpl index 3add169e08..ecfe80ee4e 100644 --- a/calendar/templates/default/config.tpl +++ b/calendar/templates/default/config.tpl @@ -56,6 +56,10 @@ + + {lang_While_selecting_up_to_X_users_day-_and_weekview_is_not_consolidated_(5_is_used_when_not_set)}: + +  {lang_History_logging}