Nettoyage

This commit is contained in:
Rodolphe Quiedeville 2005-08-25 15:07:01 +00:00
parent 8b9d2715e1
commit 38505ff8f3

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2005 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
@ -28,18 +28,13 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
if ($conf->contrat->enabled) {
require_once("../contrat/contrat.class.php"); if ($conf->contrat->enabled)
} require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
$langs->load("commercial"); $langs->load("commercial");
$langs->load("orders"); $langs->load("orders");
$user->getrights('propale');
$user->getrights('fichinter');
$user->getrights('commande');
$user->getrights('projet');
// Securité accès client // Securité accès client
$socidp=''; $socidp='';
if ($user->societe_id > 0) if ($user->societe_id > 0)
@ -51,7 +46,6 @@ $max=5;
llxHeader(); llxHeader();
/* /*
* Actions * Actions
*/ */
@ -91,7 +85,8 @@ print '<tr><td valign="top" width="30%" class="notopnoleft">';
/* /*
* Recherche Propal * Recherche Propal
*/ */
if ($conf->propal->enabled && $user->rights->propale->lire) { if ($conf->propal->enabled && $user->rights->propale->lire)
{
$var=false; $var=false;
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal.php">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -102,7 +97,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) {
print '<tr '.$bc[$var].'><td nowrap>'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>'; print '<tr '.$bc[$var].'><td nowrap>'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
print '</tr>'; print '</tr>';
print "</table></form>\n"; print "</table></form>\n";
print "<br>"; print "<br />\n";
} }
/* /*
@ -154,7 +149,8 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
$i++; $i++;
$total += $obj->price; $total += $obj->price;
} }
if ($total>0) { if ($total>0)
{
$var=!$var; $var=!$var;
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>"; print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>";
} }
@ -178,10 +174,11 @@ if ($conf->commande->enabled)
$sql .= " AND c.fk_soc = $socidp"; $sql .= " AND c.fk_soc = $socidp";
} }
if ( $db->query($sql) ) $resql = $db->query($sql);
if ($resql)
{ {
$total = 0; $total = 0;
$num = $db->num_rows(); $num = $db->num_rows($resql);
if ($num) if ($num)
{ {
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -193,14 +190,15 @@ if ($conf->commande->enabled)
while ($i < $num) while ($i < $num)
{ {
$var=!$var; $var=!$var;
$obj = $db->fetch_object(); $obj = $db->fetch_object($resql);
print "<tr $bc[$var]><td nowrap><a href=\"../commande/fiche.php?id=$obj->rowid\">".img_object($langs->trans("ShowOrder"),"order")." ".$obj->ref."</a></td>"; print "<tr $bc[$var]><td nowrap><a href=\"../commande/fiche.php?id=$obj->rowid\">".img_object($langs->trans("ShowOrder"),"order")." ".$obj->ref."</a></td>";
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.dolibarr_trunc($obj->nom,18).'</a></td>'; print '<td><a href="fiche.php?socid='.$obj->idp.'">'.dolibarr_trunc($obj->nom,18).'</a></td>';
print '<td align="right">'.price($obj->total_ttc).'</td></tr>'; print '<td align="right">'.price($obj->total_ttc).'</td></tr>';
$i++; $i++;
$total += $obj->total_ttc; $total += $obj->total_ttc;
} }
if ($total>0) { if ($total>0)
{
$var=!$var; $var=!$var;
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>"; print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>";
} }