Skip to content

Commit

Permalink
FIX Dolibarr#19537 - List sorted by ref in adherents list
Browse files Browse the repository at this point in the history
  • Loading branch information
daraelmin committed Nov 20, 2022
1 parent f4b1d31 commit 062350a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions htdocs/core/db/DoliDB.class.php
Expand Up @@ -246,8 +246,13 @@ public function order($sortfield = null, $sortorder = null)
foreach ($fields as $val) {
if (!$return) $return .= ' ORDER BY ';
else $return .= ', ';

$return .= preg_replace('/[^0-9a-z_\.]/i', '', $val); // Add field

if (strpos($val,'ref') !== false ){
$return .= "lpad(".preg_replace('/[^0-9a-z_\.]/i', '', $val).", 30, '0')";
$val='';
} else {
$return .= preg_replace('/[^0-9a-z_\.]/i', '', $val); // Add field
}

$tmpsortorder = (empty($orders[$i]) ? '' : trim($orders[$i]));

Expand Down

0 comments on commit 062350a

Please sign in to comment.