diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index b59d47adb9e..306e5172e0e 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -863,7 +863,7 @@ class ActionComm extends CommonObject * @param string $limit Limit number of answers * @return array or string Error string if KO, array with actions if OK */ - static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='datep', $sortorder='DESC', $limit=0) + static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='a.datep', $sortorder='DESC', $limit=0) { global $conf, $langs; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 15a9b781290..579520f7647 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -166,7 +166,10 @@ class FormActions require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; - $listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement, '', '', '', ($max?($max+1):0)); + $sortfield='a.datep'; + $sortorder='DESC'; + + $listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement, '', $sortfield, $sortorder, ($max?($max+1):0)); if (! is_array($listofactions)) dol_print_error($this->db,'FailedToGetActions'); $num = count($listofactions); @@ -192,19 +195,19 @@ class FormActions $buttontoaddnewevent.= ''; print load_fiche_titre($title, $buttontoaddnewevent, ''); - $page=0; $param=''; $sortfield='a.datep'; + $page=0; $param=''; $total = 0; print '
'; print ''; print ''; - print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], '', $page, $param, ''); - print_liste_field_titre('Action', $_SERVER["PHP_SELF"], '', $page, $param, ''); - print_liste_field_titre('Type', $_SERVER["PHP_SELF"], '', $page, $param, ''); - print_liste_field_titre('Date', $_SERVER["PHP_SELF"], '', $page, $param, 'align="center"'); - print_liste_field_titre('By', $_SERVER["PHP_SELF"], '', $page, $param, ''); - print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $page, $param, 'align="right"'); + print getTitleFieldOfList('Ref', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1); + print getTitleFieldOfList('Action', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1); + print getTitleFieldOfList('Type', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1); + print getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', $page, $param, 'align="center"', $sortfield, $sortorder, '', 1); + print getTitleFieldOfList('By', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1); + print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', $page, $param, 'align="right"', $sortfield, $sortorder, '', 1); print ''; print "\n"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 90265b079aa..9952af3841d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3353,16 +3353,16 @@ function dol_print_error_email($prefixcode, $errormessage='') * @param string $field Field to use for new sorting * @param string $begin ("" by defaut) * @param string $moreparam Add more parameters on sort url links ("" by default) - * @param string $td Options of attribute td ("" by defaut, example: 'align="center"') + * @param string $moreattrib Options of attribute td ("" by defaut, example: 'align="center"') * @param string $sortfield Current field used to sort * @param string $sortorder Current sort order * @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag. * @param string $tooltip Tooltip * @return void */ -function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="", $prefix="", $tooltip="") +function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="") { - print getTitleFieldOfList($name, 0, $file, $field, $begin, $moreparam, $td, $sortfield, $sortorder, $prefix, 0, $tooltip); + print getTitleFieldOfList($name, 0, $file, $field, $begin, $moreparam, $moreattrib, $sortfield, $sortorder, $prefix, 0, $tooltip); } /**