diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 0d0fff35980..b8388b8fa7b 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -36,29 +36,29 @@ if ($conf->webcal->enabled) { require("../lib/webcal.class.php"); } +$langs->load("companies"); + $page=$_GET["page"]; $sortorder=$_GET["sortorder"]; $sortfield=$_GET["sortfield"]; -$langs->load("companies"); +if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) $sortfield="nom"; +if ($page == -1) { $page = 0 ; } +$offset = $conf->liste_limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + llxHeader(); -/* - * Sécurité accés client - */ +// Sécurité accés client if ($user->societe_id > 0) { $action = ''; $socidp = $user->societe_id; } -if ($sortorder == "") { - $sortorder="ASC"; -} -if ($sortfield == "") { - $sortfield="nom"; -} // \todo code encore utilisé ? if ($action=='add_action') { @@ -151,7 +151,6 @@ if ($action == 'stcomm') /* * Recherche * - * */ if ($mode == 'search') { if ($mode-search == 'soc') { @@ -168,19 +167,11 @@ if ($mode == 'search') { } } -if ($page == -1) { $page = 0 ; } - -$offset = $conf->liste_limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; - /* * Mode Liste * - * - * */ $sql = "SELECT s.idp, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta "; @@ -238,14 +229,6 @@ if ($result) print_barre_liste($langs->trans("ListOfCustomers"), $page, "clients.php","",$sortfield,$sortorder,'',$num); } - if ($sortorder == "DESC") - { - $sortorder="ASC"; - } - else - { - $sortorder="DESC"; - } print '
| '; + print "\n"; // Lignes des champs de filtre print ''; |