* calendar: make configurable the number of users, until day- or weekview are consolidated; 5 is set as default

This commit is contained in:
Klaus Leithoff 2010-12-10 11:03:35 +00:00
parent 2b692f5830
commit 0cd5658ca1
3 changed files with 14 additions and 4 deletions

View File

@ -181,6 +181,12 @@ class calendar_bo
*/ */
public $require_acl_invite = false; 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 * Constructor
*/ */
@ -225,7 +231,7 @@ class calendar_bo
//echo "registered resources="; _debug_array($this->resources); //echo "registered resources="; _debug_array($this->resources);
$this->config = config::read('calendar'); // only used for horizont, regular calendar config is under phpgwapi $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->require_acl_invite = $GLOBALS['egw_info']['server']['require_acl_invite'];
$this->categories = new categories($this->user,'calendar'); $this->categories = new categories($this->user,'calendar');

View File

@ -759,7 +759,7 @@ class calendar_uiviews extends calendar_ui
$users = $this->search_params['users']; $users = $this->search_params['users'];
if (!is_array($users)) $users = array($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']); $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']; $users = $this->search_params['users'];
if (!is_array($users)) $users = array($users); if (!is_array($users)) $users = array($users);
// for more then 5 users, show all in one row // for more then X users, show all in one row
if (count($users) == 1 || count($users) > 5) if (count($users) == 1 || count($users) > $this->bo->calview_no_consolidate)
{ {
$dayEvents =& $this->bo->search($this->search_params); $dayEvents =& $this->bo->search($this->search_params);
$owner = 0; $owner = 0;

View File

@ -56,6 +56,10 @@
</select> </select>
</td> </td>
</tr> </tr>
<tr class="row_off">
<td>{lang_While_selecting_up_to_X_users_day-_and_weekview_is_not_consolidated_(5_is_used_when_not_set)}:</td>
<td><input name="newsettings[calview_no_consolidate]" value="{value_calview_no_consolidate}" size="10"></td>
</tr>
<tr class="th"> <tr class="th">
<td colspan="2">&nbsp;<b>{lang_History_logging}</b></td> <td colspan="2">&nbsp;<b>{lang_History_logging}</b></td>
</tr> </tr>