From 4684f8928cd1a9495327b8c2f54fd11f0a0109da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Apr 2005 12:07:06 +0000 Subject: [PATCH] New: Les liens des commerciaux sont clicables --- htdocs/societe/commerciaux.php | 50 ++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php index 530d324345e..a64ef6e2d2f 100644 --- a/htdocs/societe/commerciaux.php +++ b/htdocs/societe/commerciaux.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 Laurent Destailleur * * 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 @@ -19,11 +20,11 @@ * $Source$ */ -/*! - \file htdocs/societe/commerciaux.php - \ingroup societe - \brief Page d'affectations des commerciaux aux societes - \version $Revision$ +/** + \file htdocs/societe/commerciaux.php + \ingroup societe + \brief Page d'affectations des commerciaux aux societes + \version $Revision$ */ require("./pre.inc.php"); @@ -79,6 +80,7 @@ if($_GET["socid"] && $_GET["delcommid"]) } } + llxHeader(); if($_GET["socid"]) @@ -145,8 +147,7 @@ if($_GET["socid"]) print ''.$langs->trans("ParentCompany").''.$socm->nom_url.' ('.$socm->code_client.')
'.$socm->ville.''; } - /* ********** */ - + // Liste les commerciaux $sql = "SELECT u.rowid, u.name, u.firstname"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -154,27 +155,29 @@ if($_GET["socid"]) $sql .= " AND sc.fk_user = u.rowid"; $sql .= " ORDER BY u.name ASC "; - print ''.$langs->trans("SalesRepresentative").''; + print ''.$langs->trans("SalesRepresentatives").''; print ''; - $result = $db->query($sql); - if ($result) + $resql = $db->query($sql); + if ($resql) { - $num = $db->num_rows(); + $num = $db->num_rows($resql); $i = 0; while ($i < $num) { - $obj = $db->fetch_object(); + $obj = $db->fetch_object($resql); + print ''; + print img_object($langs->trans("ShowUser"),"user").' '; print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n"; - print ' '; + print ' '; print ''; print img_delete(); print '
'; $i++; } - $db->free(); + $db->free($resql); } else { @@ -199,14 +202,14 @@ if($_GET["socid"]) $langs->load("users"); $title=$langs->trans("ListOfUsers"); - $sql = "SELECT u.rowid, u.name, u.firstname"; + $sql = "SELECT u.rowid, u.name, u.firstname, u.code"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " ORDER BY u.name ASC "; - $result = $db->query($sql); - if ($result) + $resql = $db->query($sql); + if ($resql) { - $num = $db->num_rows(); + $num = $db->num_rows($resql); $i = 0; print_titre($title); @@ -215,6 +218,7 @@ if($_GET["socid"]) print ''; print ''; print ''; + print ''; print ''; print "\n"; @@ -222,10 +226,14 @@ if($_GET["socid"]) while ($i < $num) { - $obj = $db->fetch_object(); + $obj = $db->fetch_object($resql); $var=!$var; print "\n"; + print ''; + print img_object($langs->trans("ShowUser"),"user").' '; + print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n"; + print ''; + print ''; print ''; print ''."\n"; @@ -233,7 +241,7 @@ if($_GET["socid"]) } print "
'.$langs->trans("Name").''.$langs->trans("Code").' 
"; - print stripslashes($obj->firstname)." " .stripslashes($obj->name)."'.$obj->code.''.$langs->trans("Add").'
"; - $db->free(); + $db->free($resql); } else {