mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-08 23:19:04 +01:00
Add sorting to match planner view grouping, so pagination gets the top rows first
This commit is contained in:
parent
abc9252069
commit
3aef0fe1a6
@ -892,6 +892,21 @@ class calendar_so
|
|||||||
" ON $this->cal_table.cal_id=$this->dates_table.cal_id ".$join;
|
" ON $this->cal_table.cal_id=$this->dates_table.cal_id ".$join;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for some special sorting, used by planner views
|
||||||
|
if($params['order'] == 'participants , cal_non_blocking DESC')
|
||||||
|
{
|
||||||
|
$order = ($GLOBALS['egw_info']['user']['preferences']['common']['account_display'] == 'lastname' ? 'n_family' : 'n_fileas');
|
||||||
|
$cols .= ",egw_addressbook.{$order}";
|
||||||
|
$join .= "LEFT JOIN egw_addressbook ON egw_addressbook.account_id = {$this->user_table}.cal_user_id";
|
||||||
|
$params['order'] = "$order, cal_non_blocking DESC";
|
||||||
|
}
|
||||||
|
else if ($params['order'] == 'categories , cal_non_blocking DESC')
|
||||||
|
{
|
||||||
|
$params['order'] = 'cat_name, cal_non_blocking DESC';
|
||||||
|
$cols .= ',egw_categories.cat_name';
|
||||||
|
$join .= "LEFT JOIN egw_categories ON egw_categories.cat_id = {$this->cal_table}.cal_category";
|
||||||
|
}
|
||||||
|
|
||||||
//$starttime = microtime(true);
|
//$starttime = microtime(true);
|
||||||
if ($useUnionQuery)
|
if ($useUnionQuery)
|
||||||
{
|
{
|
||||||
|
@ -2862,6 +2862,15 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
|
|||||||
framework.applications.calendar.sidemenuEntry.showAjaxLoader();
|
framework.applications.calendar.sidemenuEntry.showAjaxLoader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(state.view === 'planner' && state.sortby === 'user')
|
||||||
|
{
|
||||||
|
query.order = 'participants';
|
||||||
|
}
|
||||||
|
else if (state.view === 'planner' && state.sortby === 'category')
|
||||||
|
{
|
||||||
|
query.order = 'categories';
|
||||||
|
}
|
||||||
|
|
||||||
// Already in progress?
|
// Already in progress?
|
||||||
var query_string = JSON.stringify(query);
|
var query_string = JSON.stringify(query);
|
||||||
if(this._queries_in_progress.indexOf(query_string) != -1)
|
if(this._queries_in_progress.indexOf(query_string) != -1)
|
||||||
|
Loading…
Reference in New Issue
Block a user