From c7f4d360dc36653d8cfa2ada3d1c7433c4caf287 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 4 Dec 2006 18:04:15 +0000 Subject: [PATCH] Nouvel utilisateur --- htdocs/product/stock/user.php | 199 ++++++++++++++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 htdocs/product/stock/user.php diff --git a/htdocs/product/stock/user.php b/htdocs/product/stock/user.php new file mode 100644 index 00000000000..258a2b8eb39 --- /dev/null +++ b/htdocs/product/stock/user.php @@ -0,0 +1,199 @@ + + * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2005 Simon Tosser + * Copyright (C) 2005-2006 Regis Houssin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + */ + +/** + \file htdocs/product/stock/user.php + \ingroup stock + \brief Fiche gestion des utilisateurs des entrepots + \version $Revision$ +*/ + +require("./pre.inc.php"); + +$langs->load("products"); +$langs->load("stocks"); + +$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"; + +$mesg = ''; + + +/* + * Actions + */ + + + + + +/* +* Affichage fiche en mode création +* +*/ + +llxHeader("","",$langs->trans("WarehouseCard")); + +$form=new Form($db); + + + if ($_GET["id"]) + { + if ($mesg) print $mesg; + + $entrepot = new Entrepot($db); + $result = $entrepot->fetch($_GET["id"]); + if ($result < 0) + { + dolibarr_print_error($db); + } + + /* + * Affichage fiche + */ + if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') + { + + /* + * Affichage onglets + */ + $h = 0; + + $head[$h][0] = DOL_URL_ROOT.'/product/stock/fiche.php?id='.$entrepot->id; + $head[$h][1] = $langs->trans("WarehouseCard"); + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/product/stock/mouvement.php?id='.$entrepot->id; + $head[$h][1] = $langs->trans("StockMovements"); + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id; + $head[$h][1] = $langs->trans("Info"); + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/product/stock/user.php?id='.$entrepot->id; + $head[$h][1] = $langs->trans("Users"); + $hselected=$h; + $h++; + + dolibarr_fiche_head($head, $hselected, $langs->trans("Warehouse").': '.$entrepot->libelle); + + print ''; + + // Ref + print ''; + + print ''; + + // Description + print ''; + + print ''; + + print ''; + print ''; + + // Statut + print ''; + + print '"; + + print "
'.$langs->trans("Ref").''.$entrepot->libelle.'
'.$langs->trans("LocationSummary").''.$entrepot->lieu.'
'.$langs->trans("Description").''.nl2br($entrepot->description).'
'.$langs->trans('Address').''; + print $entrepot->address; + print '
'.$langs->trans('Zip').''.$entrepot->cp.''.$langs->trans('Town').''.$entrepot->ville.'
'.$langs->trans("Status").''.$entrepot->getLibStatut(4).'
'.$langs->trans("LastMovement").''; + print dolibarr_print_date($row[0]); + print "
"; + + print ''; + + + /* ************************************************************************** */ + /* */ + /* Barre d'action */ + /* */ + /* ************************************************************************** */ + + print "
\n"; + + print "
"; + + /* ************************************************************************** */ + /* */ + /* Affichage des utilisateurs de l'entrepot */ + /* */ + /* ************************************************************************** */ + print '
'; + + print ''; + print ""; + print_liste_field_titre($langs->trans("User"),"", "p.ref","&id=".$_GET['id'],"",'align="left"',$sortfield); + print_liste_field_titre($langs->trans("Label"),"", "p.label","&id=".$_GET['id'],"",'align="center"',$sortfield); + print_liste_field_titre($langs->trans("Units"),"", "ps.reel","&id=".$_GET['id'],"",'align="center"',$sortfield); + print ""; + $sql = "SELECT u.rowid as rowid, u.name, u.firstname, ue.send, ue.consult "; + $sql .= " FROM ".MAIN_DB_PREFIX."user_entrepot as ue, ".MAIN_DB_PREFIX."user as u "; + + $sql .= " WHERE ue.fk_user = u.rowid "; + $sql .= " AND ue.fk_entrepot = ".$entrepot->id; + + //$sql .= " ORDER BY " . $sortfield . " " . $sortorder; + //$sql .= $db->plimit($limit + 1 ,$offset); + + $resql = $db->query($sql) ; + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + $var=True; + while ($i < $num) + { + $objp = $db->fetch_object($resql); + + $var=!$var; + + print ""; + print ""; + print ''; + print ''; + print ""; + $i++; + } + $db->free($resql); + } + else + { + dolibarr_print_error($db); + } + print "
rowid\">"; + print img_object($langs->trans("ShowUser"),"user").' '.$objp->firstname. ' '.$objp->name; + print "'.$objp->consult.''.$objp->send.'
\n"; + } + } + +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?>