From 576258ce26fd7b6e3f4d27d02dbe7fbe7b72314f Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 5 Apr 2005 10:44:10 +0000 Subject: [PATCH] Debut de test de validation sur les $_GET --- htdocs/fourn/commande/liste.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index b3094de0faa..398953f9652 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -23,27 +23,36 @@ /*! \file htdocs/fourn/commande/liste.php - \ingroup commande + \ingroup fournisseur \brief Liste des commandes fournisseurs \version $Revision$ */ require("./pre.inc.php"); -$page = $_GET["page"]; +$page = ( is_numeric($_GET["page"]) ? $_GET["page"] : 0 ); +$socid = ( is_numeric($_GET["socid"]) ? $_GET["socid"] : 0 ); $sortorder = $_GET["sortorder"]; $sortfield = $_GET["sortfield"]; -$socid = $_GET["socid"]; + +$title = $langs->trans("SuppliersOrders"); if (!$user->rights->fournisseur->commande->lire) accessforbidden(); -llxHeader('','Liste des commandes fournisseurs'); - -/* - * Sécurité accés client/fournisseur - */ +// Sécurité accés client/fournisseur if ($user->societe_id > 0) $socid = $user->societe_id; + +if ($socid > 0) +{ + $fourn = new Fournisseur($db); + $fourn->fetch($socid); + $title .= ' ('.$fourn->nom.')'; +} + +llxHeader('',$title); + + if ($sortorder == "") $sortorder="DESC"; if ($sortfield == "") $sortfield="cf.date_creation"; $offset = $conf->liste_limit * $page ; @@ -88,7 +97,7 @@ if ($resql) $i = 0; - print_barre_liste($langs->trans("SuppliersOrders"), $page, "liste.php", "", $sortfield, $sortorder, '', $num); + print_barre_liste($title, $page, "liste.php", "", $sortfield, $sortorder, '', $num); print ''; print '';