mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 08:34:29 +01:00
Move consolidation limit from config to preference, and split it into two for day & week views
This commit is contained in:
parent
a13f9cd3c9
commit
ffad978c81
@ -207,12 +207,6 @@ class calendar_bo
|
||||
*/
|
||||
public $require_acl_invite = null;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Warnings to show in regular UI
|
||||
*
|
||||
@ -264,7 +258,6 @@ 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');
|
||||
|
@ -171,6 +171,10 @@ class calendar_hooks
|
||||
$muliple_weeks[$i] = lang('%1 weeks',$i);
|
||||
}
|
||||
|
||||
for ($i = 2; $i <= 9; $i++)
|
||||
{
|
||||
$consolidated[$i] = $i;
|
||||
}
|
||||
$intervals = array(
|
||||
5 => '5',
|
||||
10 => '10',
|
||||
@ -283,6 +287,22 @@ class calendar_hooks
|
||||
'admin' => False,
|
||||
'default'=> 30,
|
||||
),
|
||||
'day_consolidate' => array(
|
||||
'type' => 'select',
|
||||
'label' => 'Minimum number of users for showing day view as consolidated.',
|
||||
'name' => 'day_consolidate',
|
||||
'values'=> $consolidated,
|
||||
'help' => 'How many seperate calendars to show before merging them together',
|
||||
'default'=> 5
|
||||
),
|
||||
'week_consolidate' => array(
|
||||
'type' => 'select',
|
||||
'label' => 'Minimum number of users for showing week view as consolidated.',
|
||||
'name' => 'week_consolidate',
|
||||
'values'=> $consolidated,
|
||||
'help' => 'How many seperate calendars to show before merging them together',
|
||||
'default'=> 3
|
||||
),
|
||||
'display_holidays_event' => array(
|
||||
'type' => 'select',
|
||||
'label' => 'Display holidays or birthdays as events in dayview',
|
||||
|
@ -663,7 +663,7 @@ class calendar_uiviews extends calendar_ui
|
||||
|
||||
// Always do 7 days for a week so scrolling works properly
|
||||
$this->last = ($days == 4 ? $this->last : $search_params['end'] = strtotime("+$days days",$this->first) - 1);
|
||||
if (count($users) == 1 || count($users) > $this->bo->calview_no_consolidate) // for more then X users, show all in one row
|
||||
if (count($users) == 1 || count($users) > $this->cal_prefs['week_consolidate']) // for more then X users, show all in one row
|
||||
{
|
||||
$content['view'][] = (array)$this->tagWholeDayOnTop($this->bo->search($search_params)) +
|
||||
array('owner' => $users);
|
||||
@ -719,7 +719,7 @@ class calendar_uiviews extends calendar_ui
|
||||
if (!is_array($users)) $users = array($users);
|
||||
|
||||
// for more then X users, show all in one row
|
||||
if (count($users) == 1 || count($users) > $this->bo->calview_no_consolidate)
|
||||
if (count($users) == 1 || count($users) > $this->cal_prefs['day_consolidate'])
|
||||
{
|
||||
$dayEvents =& $this->bo->search($this->search_params);
|
||||
$owner = 0;
|
||||
|
@ -272,7 +272,8 @@ app.classes.calendar = AppJS.extend(
|
||||
{
|
||||
var multiple_owner = typeof this.state.owner != 'string' &&
|
||||
this.state.owner.length > 1 &&
|
||||
this.state.owner.length < parseInt(this.egw.config('calview_no_consolidate','phpgwapi') || 5);
|
||||
(this.state.view == 'day' && this.state.owner.length <= parseInt(this.egw.preference('day_consolidate','calendar')) ||
|
||||
this.state.view == 'week' && this.state.owner.length <= parseInt(this.egw.preference('week_consolidate','calendar')));
|
||||
|
||||
// Make sure it's a string
|
||||
if(_id) _id = ''+_id;
|
||||
@ -453,8 +454,10 @@ app.classes.calendar = AppJS.extend(
|
||||
}
|
||||
|
||||
// Enable or disable
|
||||
if((state.view == 'day' || state.view == 'week') &&
|
||||
state.owner.length > 1 && state.owner.length < egw.config('calview_no_consolidate','phpgwapi'))
|
||||
if(state.owner.length > 1 && (
|
||||
state.view == 'day' && state.owner.length <= parseInt(egw.preference('day_consolidate','calendar')) ||
|
||||
state.view == 'week' && state.owner.length <= parseInt(egw.preference('week_consolidate','calendar'))
|
||||
))
|
||||
{
|
||||
sortable.sortable('enable')
|
||||
.sortable("refresh")
|
||||
@ -1816,10 +1819,21 @@ app.classes.calendar = AppJS.extend(
|
||||
|
||||
|
||||
// Show the correct number of grids
|
||||
var grid_count = state.state.view === 'weekN' ? parseInt(this.egw.preference('multiple_weeks','calendar')) || 3 :
|
||||
state.state.view === 'month' ? 0 : // Calculate based on weeks in the month
|
||||
state.state.owner.length > (this.egw.config('calview_no_consolidate','phpgwapi') || 5) ? 1 : state.state.owner.length;
|
||||
|
||||
var grid_count = 0;
|
||||
switch(state.state.view)
|
||||
{
|
||||
case 'day':
|
||||
grid_count = state.state.owner.length > parseInt(this.egw.preference('day_consolidate','calendar')) ? 1 : state.state.owner.length;
|
||||
break;
|
||||
case 'week':
|
||||
grid_count = state.state.owner.length > parseInt(this.egw.preference('week_consolidate','calendar')) ? 1 : state.state.owner.length;
|
||||
break;
|
||||
case 'weekN':
|
||||
grid_count = parseInt(this.egw.preference('multiple_weeks','calendar')) || 3;
|
||||
break;
|
||||
// Month is calculated individually for the month
|
||||
}
|
||||
|
||||
var grid = view.etemplates[0].widgetContainer.getWidgetById('view');
|
||||
|
||||
/*
|
||||
|
@ -51,10 +51,6 @@
|
||||
</select>
|
||||
</td>
|
||||
</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="row_on">
|
||||
<td> {lang_Allow_users_to_prevent_change_notifications_('Do_not_notify')}:</td>
|
||||
<td>
|
||||
|
@ -394,7 +394,7 @@ div.calendar {
|
||||
height: 16px;
|
||||
background-size: 12px auto !important;
|
||||
margin-left: 32px;
|
||||
padding: 0px;
|
||||
padding-top: 0px;
|
||||
}
|
||||
#calendar-edit #calendar-edit_id {
|
||||
float: right;
|
||||
@ -1202,10 +1202,10 @@ button#series {
|
||||
-o-transition-timing-function: linear;
|
||||
transition-timing-function: linear;
|
||||
background-color: #b4b4b4;
|
||||
padding-left: 30px !important;
|
||||
background-position: 6px center !important;
|
||||
background-repeat: no-repeat !important;
|
||||
background-size: 20px auto !important;
|
||||
padding-left: 30px;
|
||||
background-position: 6px center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 20px auto;
|
||||
/*.Button_size_h32_auto;*/
|
||||
height: 24px;
|
||||
}
|
||||
@ -1259,10 +1259,10 @@ button#exception {
|
||||
-o-transition-timing-function: linear;
|
||||
transition-timing-function: linear;
|
||||
background-color: #b4b4b4;
|
||||
padding-left: 30px !important;
|
||||
background-position: 6px center !important;
|
||||
background-repeat: no-repeat !important;
|
||||
background-size: 20px auto !important;
|
||||
padding-left: 30px;
|
||||
background-position: 6px center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 20px auto;
|
||||
/*.Button_size_h32_auto;*/
|
||||
height: 24px;
|
||||
}
|
||||
|
@ -444,7 +444,7 @@ div.calendar { position: relative; }
|
||||
height: 16px;
|
||||
background-size: 12px auto !important;
|
||||
margin-left: 32px;
|
||||
padding: 0px;
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
// ID
|
||||
|
Loading…
Reference in New Issue
Block a user