Fix sort is lost on agenda/event of projects
This commit is contained in:
parent
477b9c8338
commit
9694a00179
@ -965,7 +965,7 @@ function show_actions_todo($conf,$langs,$db,$filterobj,$objcon='',$noprint=0,$ac
|
|||||||
* @return mixed Return html part or void if noprint is 1
|
* @return mixed Return html part or void if noprint is 1
|
||||||
* TODO change function to be able to list event linked to an object.
|
* TODO change function to be able to list event linked to an object.
|
||||||
*/
|
*/
|
||||||
function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done', $filters=array(), $sortfield='a.datep, a.id', $sortorder='DESC')
|
function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done', $filters=array(), $sortfield='a.datep,a.id', $sortorder='DESC')
|
||||||
{
|
{
|
||||||
global $bc,$user,$conf;
|
global $bc,$user,$conf;
|
||||||
global $form;
|
global $form;
|
||||||
@ -1183,7 +1183,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||||||
}
|
}
|
||||||
$out.=getTitleFieldOfList($langs->trans("Ref"), 0, $_SERVER["PHP_SELF"], 'a.id', '', $param, '', $sortfield, $sortorder);
|
$out.=getTitleFieldOfList($langs->trans("Ref"), 0, $_SERVER["PHP_SELF"], 'a.id', '', $param, '', $sortfield, $sortorder);
|
||||||
$out.='<td class="maxwidth100onsmartphone">'.$langs->trans("Label").'</td>';
|
$out.='<td class="maxwidth100onsmartphone">'.$langs->trans("Label").'</td>';
|
||||||
$out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep, a.id', '', $param, '', $sortfield, $sortorder);
|
$out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep,a.id', '', $param, '', $sortfield, $sortorder);
|
||||||
$out.='<td>'.$langs->trans("Type").'</td>';
|
$out.='<td>'.$langs->trans("Type").'</td>';
|
||||||
$out.='<td></td>';
|
$out.='<td></td>';
|
||||||
$out.='<td></td>';
|
$out.='<td></td>';
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user