From 83a3f8db2f790623fb65aafaa67930d947b3a16b Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 10 Jul 2003 18:57:25 +0000 Subject: [PATCH] =?UTF-8?q?Modif=20tri=20par=20d=E9faut=20(cette=20fois=20?= =?UTF-8?q?c'est=20bon=20;-)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/clients.php3 | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/clients.php3 b/htdocs/comm/clients.php3 index 994a6489a59..4b7baef4c44 100644 --- a/htdocs/comm/clients.php3 +++ b/htdocs/comm/clients.php3 @@ -36,16 +36,8 @@ if ($user->societe_id > 0) $socidp = $user->societe_id; } - $db = new Db(); -if ($sortorder == "") { - $sortorder="ASC"; -} -if ($sortfield == "") { - $sortfield="nom"; -} - if ($action=='add_action') { /* * Vient de actioncomm.php3 @@ -186,8 +178,17 @@ if ($user->societe_id) if ($socname) { $sql .= " AND lower(s.nom) like '%".strtolower($socname)."%'"; - $sortfield = "s.datec"; - $sortorder = "DESC"; + $sortfield = "lower(s.nom)"; + $sortorder = "ASC"; +} + +if ($sortorder == "") +{ + $sortorder="DESC"; +} +if ($sortfield == "") +{ + $sortfield="s.datec"; } $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset);