From cefa8284196913f72656f77dbb5eeb9aafab9d92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Sep 2006 22:33:07 +0000 Subject: [PATCH] Fix: Ordre tri par defaut --- htdocs/product/liste.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index af01a2d55a7..4b7ca60b8cb 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -52,7 +52,7 @@ $type=trim($type); $sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"]; $sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"]; if (! $sortfield) $sortfield="p.ref"; -if (! $sortorder) $sortorder="DESC"; +if (! $sortorder) $sortorder="ASC"; $page = $_GET["page"]; $limit = $conf->liste_limit; $offset = $limit * $page ; @@ -144,10 +144,6 @@ if ($resql) { $envente = (isset($_GET["envente"])?$_GET["envente"]:$_POST["envente"]); } - else - { - $envente=1; - } if (isset($_GET["type"]) || isset($_POST["type"])) { @@ -254,7 +250,12 @@ if ($resql) print ''.dolibarr_print_date($objp->datem).''; if ($conf->service->enabled && $type != 0) { - print ''.$objp->duration.''; + print ''; + if (eregi('([0-9]+)y',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationYear"); + elseif (eregi('([0-9]+)m',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationMonth"); + elseif (eregi('([0-9]+)d',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationDay"); + else print $objp->duration; + print ''; } print ''.price($objp->price).''; print ''.$product_static->LibStatut($objp->statut,5).'';