Fix sort is lost on agenda/event of projects

This commit is contained in:
Laurent Destailleur 2017-01-02 12:39:12 +01:00
parent 477b9c8338
commit 9694a00179
2 changed files with 15 additions and 3 deletions

View File

@ -35,6 +35,18 @@ $ref = GETPOST('ref','alpha');
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
$sortfield = GETPOST("sortfield","alpha");
$sortorder = GETPOST("sortorder");
$page = GETPOST("page");
$page = is_numeric($page) ? $page : 0;
$page = $page == -1 ? 0 : $page;
if (! $sortfield) $sortfield="a.datep,a.id";
if (! $sortorder) $sortorder="ASC";
$offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (GETPOST('actioncode','array')) if (GETPOST('actioncode','array'))
{ {
$actioncode=GETPOST('actioncode','array',3); $actioncode=GETPOST('actioncode','array',3);
@ -181,7 +193,7 @@ if (!empty($object->id))
// List of all actions // List of all actions
$filters=array(); $filters=array();
$filters['search_agenda_label']=$search_agenda_label; $filters['search_agenda_label']=$search_agenda_label;
show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters); show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder);
} }