mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-22 02:41:50 +02:00
Add implicit preference to remember user's last sort order.
Sort stored in favorites override this when the favorite is used.
This commit is contained in:
parent
80b99c67ec
commit
dcf34dd74c
@ -4347,6 +4347,10 @@ export class et2_nextmatch_sortheader extends et2_nextmatch_header implements et
|
|||||||
{
|
{
|
||||||
// Send default sort mode if not sorted, otherwise send undefined to calculate
|
// Send default sort mode if not sorted, otherwise send undefined to calculate
|
||||||
this.nextmatch.sortBy(this.id, this.sortmode == "none" ? !(this.options.sortmode.toUpperCase() == "DESC") : undefined);
|
this.nextmatch.sortBy(this.id, this.sortmode == "none" ? !(this.options.sortmode.toUpperCase() == "DESC") : undefined);
|
||||||
|
|
||||||
|
// Update sort preference
|
||||||
|
this.egw().set_preference(this.nextmatch._get_appname(), this.nextmatch.options.template + "_sort", this.nextmatch.activeFilters["sort"]);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +135,12 @@ class Nextmatch extends Etemplate\Widget
|
|||||||
list($app) = explode('.', $this->attrs['template']);
|
list($app) = explode('.', $this->attrs['template']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for sort preference. We only apply this on first load so it can be changed
|
||||||
|
if($GLOBALS['egw_info']['user']['preferences'][$app][$this->attrs['template'] . "_sort"])
|
||||||
|
{
|
||||||
|
$send_value['sort'] = $GLOBALS['egw_info']['user']['preferences'][$app][$this->attrs['template'] . "_sort"];
|
||||||
|
}
|
||||||
|
|
||||||
// Check for a favorite in URL
|
// Check for a favorite in URL
|
||||||
if(!empty($_GET['favorite']) && !empty($value['favorites']))
|
if(!empty($_GET['favorite']) && !empty($value['favorites']))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user