New: Les liens des commerciaux sont clicables

This commit is contained in:
Laurent Destailleur 2005-04-09 12:07:06 +00:00
parent 1bd7885fe0
commit 4684f8928c

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -19,11 +20,11 @@
* $Source$ * $Source$
*/ */
/*! /**
\file htdocs/societe/commerciaux.php \file htdocs/societe/commerciaux.php
\ingroup societe \ingroup societe
\brief Page d'affectations des commerciaux aux societes \brief Page d'affectations des commerciaux aux societes
\version $Revision$ \version $Revision$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -79,6 +80,7 @@ if($_GET["socid"] && $_GET["delcommid"])
} }
} }
llxHeader(); llxHeader();
if($_GET["socid"]) if($_GET["socid"])
@ -145,8 +147,7 @@ if($_GET["socid"])
print '<tr><td>'.$langs->trans("ParentCompany").'</td><td>'.$socm->nom_url.' ('.$socm->code_client.')<br />'.$socm->ville.'</td></tr>'; print '<tr><td>'.$langs->trans("ParentCompany").'</td><td>'.$socm->nom_url.' ('.$socm->code_client.')<br />'.$socm->ville.'</td></tr>';
} }
/* ********** */ // Liste les commerciaux
$sql = "SELECT u.rowid, u.name, u.firstname"; $sql = "SELECT u.rowid, u.name, u.firstname";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
$sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -154,27 +155,29 @@ if($_GET["socid"])
$sql .= " AND sc.fk_user = u.rowid"; $sql .= " AND sc.fk_user = u.rowid";
$sql .= " ORDER BY u.name ASC "; $sql .= " ORDER BY u.name ASC ";
print '<tr><td valign="top">'.$langs->trans("SalesRepresentative").'</td>'; print '<tr><td valign="top">'.$langs->trans("SalesRepresentatives").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
$result = $db->query($sql); $resql = $db->query($sql);
if ($result) if ($resql)
{ {
$num = $db->num_rows(); $num = $db->num_rows($resql);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object(); $obj = $db->fetch_object($resql);
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">';
print img_object($langs->trans("ShowUser"),"user").' ';
print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n"; print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n";
print '&nbsp;'; print '</a>&nbsp;';
print '<a href="commerciaux.php?socid='.$_GET["socid"].'&amp;delcommid='.$obj->rowid.'">'; print '<a href="commerciaux.php?socid='.$_GET["socid"].'&amp;delcommid='.$obj->rowid.'">';
print img_delete(); print img_delete();
print '</a><br>'; print '</a><br>';
$i++; $i++;
} }
$db->free(); $db->free($resql);
} }
else else
{ {
@ -199,14 +202,14 @@ if($_GET["socid"])
$langs->load("users"); $langs->load("users");
$title=$langs->trans("ListOfUsers"); $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 .= " FROM ".MAIN_DB_PREFIX."user as u";
$sql .= " ORDER BY u.name ASC "; $sql .= " ORDER BY u.name ASC ";
$result = $db->query($sql); $resql = $db->query($sql);
if ($result) if ($resql)
{ {
$num = $db->num_rows(); $num = $db->num_rows($resql);
$i = 0; $i = 0;
print_titre($title); print_titre($title);
@ -215,6 +218,7 @@ if($_GET["socid"])
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>'; print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Code").'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
@ -222,10 +226,14 @@ if($_GET["socid"])
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object(); $obj = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr $bc[$var]><td>"; print "<tr $bc[$var]><td>";
print stripslashes($obj->firstname)." " .stripslashes($obj->name)."</td>\n"; print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">';
print img_object($langs->trans("ShowUser"),"user").' ';
print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n";
print '</a>';
print '</td><td>'.$obj->code.'</td>';
print '<td><a href="commerciaux.php?socid='.$_GET["socid"].'&amp;commid='.$obj->rowid.'">'.$langs->trans("Add").'</a></td>'; print '<td><a href="commerciaux.php?socid='.$_GET["socid"].'&amp;commid='.$obj->rowid.'">'.$langs->trans("Add").'</a></td>';
print '</tr>'."\n"; print '</tr>'."\n";
@ -233,7 +241,7 @@ if($_GET["socid"])
} }
print "</table>"; print "</table>";
$db->free(); $db->free($resql);
} }
else else
{ {