mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-09 07:28:43 +01:00
Some adjusting of calendar list sort order:
- All filters except Before default to sorting earlier events first (start date asc) - For all day events for the same date, non-blocking before blocking
This commit is contained in:
parent
ac9ca13a8f
commit
80e935fb0b
@ -256,7 +256,7 @@ class calendar_uilist extends calendar_ui
|
|||||||
if ($old_params['filter'] && $old_params['filter'] != $params['filter']) // filter changed => order accordingly
|
if ($old_params['filter'] && $old_params['filter'] != $params['filter']) // filter changed => order accordingly
|
||||||
{
|
{
|
||||||
$params['order'] = 'cal_start';
|
$params['order'] = 'cal_start';
|
||||||
$params['sort'] = $params['filter'] == 'after' ? 'ASC' : 'DESC';
|
$params['sort'] = $params['filter'] == 'before' ? 'DESC' : 'ASC';
|
||||||
}
|
}
|
||||||
if ($old_params['search'] != $params['search'])
|
if ($old_params['search'] != $params['search'])
|
||||||
{
|
{
|
||||||
@ -286,9 +286,12 @@ class calendar_uilist extends calendar_ui
|
|||||||
'query' => $params['search'],
|
'query' => $params['search'],
|
||||||
'offset' => (int) $params['start'],
|
'offset' => (int) $params['start'],
|
||||||
'num_rows'=> $params['num_rows'],
|
'num_rows'=> $params['num_rows'],
|
||||||
'order' => $params['order'] ? $params['order'].' '.$params['sort'] : 'cal_start',
|
'order' => $params['order'] ? $params['order'].' '.$params['sort'] : 'cal_start ASC',
|
||||||
'cfs' => $params['csv_export'] ? array() : $cfs,
|
'cfs' => $params['csv_export'] ? array() : $cfs,
|
||||||
);
|
);
|
||||||
|
// Non-blocking events above blocking
|
||||||
|
$search_params['order'] .= ', cal_non_blocking DESC';
|
||||||
|
|
||||||
switch($params['filter'])
|
switch($params['filter'])
|
||||||
{
|
{
|
||||||
case 'all':
|
case 'all':
|
||||||
|
@ -1217,6 +1217,15 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
|
|||||||
if(filter)
|
if(filter)
|
||||||
{
|
{
|
||||||
app.calendar.state.filter = filter.getValue();
|
app.calendar.state.filter = filter.getValue();
|
||||||
|
// Change sort order for before - this is just the UI, server does the query
|
||||||
|
if(app.calendar.state.filter == 'before')
|
||||||
|
{
|
||||||
|
view.getWidgetById('nm').sortBy('cal_start',false, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
view.getWidgetById('nm').sortBy('cal_start',true, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user