Fix: Pb ouverture/fermeture tableau

This commit is contained in:
Laurent Destailleur 2006-03-14 23:31:56 +00:00
parent b63fc1a50a
commit f690589ef6

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2005 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-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2006 Régis Houssin <regis.houssin@cap-networks.com> * Copyright (C) 2005-2006 Régis Houssin <regis.houssin@cap-networks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
@ -725,6 +725,7 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente)
print '<table width="100%" class="noborder">'; print '<table width="100%" class="noborder">';
// Propals // Propals
if($user->rights->propale->creer) if($user->rights->propale->creer)
{ {
@ -756,20 +757,22 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente)
if ($result) if ($result)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
if ($num) { print '<form method="POST" action="fiche.php?id='.$product->id.'">';
$i = 0;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
if ($num)
{
$i = 0;
$var=true; $var=true;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var=!$var; $var=!$var;
print '<form method="POST" action="fiche.php?id='.$product->id.'">';
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print "<td nowrap><a href=\"../comm/propal.php?propalid=$objp->propalid\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."</a></td>\n"; print "<td nowrap>";
print '<input type="hidden" name="action" value="addinpropal">';
print "<a href=\"../comm/propal.php?propalid=$objp->propalid\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."</a></td>\n";
print "<td><a href=\"../comm/fiche.php?socid=$objp->idp\">".dolibarr_trunc($objp->nom,18)."</a></td>\n"; print "<td><a href=\"../comm/fiche.php?socid=$objp->idp\">".dolibarr_trunc($objp->nom,18)."</a></td>\n";
print "<td nowrap=\"nowrap\">".dolibarr_print_date($objp->dp,"%d %b")."</td>\n"; print "<td nowrap=\"nowrap\">".dolibarr_print_date($objp->dp,"%d %b")."</td>\n";
print '<input type="hidden" name="action" value="addinpropal">';
print '<td><input type="hidden" name="propalid" value="'.$objp->propalid.'">'; print '<td><input type="hidden" name="propalid" value="'.$objp->propalid.'">';
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("Discount"); print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("Discount");
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%'; print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
@ -778,14 +781,16 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente)
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '</form>';
$i++; $i++;
} }
print "</table>";
} }
else { else {
print "<tr $bc[$var]><td>";
print $langs->trans("NoOpenedPropals"); print $langs->trans("NoOpenedPropals");
print "</td></tr>";
} }
print "</table>";
print '</form>';
$db->free($result); $db->free($result);
} }
@ -802,8 +807,9 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente)
$var=false; $var=false;
print '<form method="POST" action="fiche.php?id='.$product->id.'">'; print '<form method="POST" action="fiche.php?id='.$product->id.'">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr '.$bc[$var].'><td colspan="3">';
print '<input type="hidden" name="action" value="addinpropal">'; print '<input type="hidden" name="action" value="addinpropal">';
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("OtherPropals").'</td><td>'; print $langs->trans("OtherPropals").'</td><td>';
$html->select_array("propalid", $otherprop); $html->select_array("propalid", $otherprop);
print '</td></tr>'; print '</td></tr>';
print '<tr '.$bc[$var].'><td nowrap="nowrap" colspan="2">'.$langs->trans("Qty"); print '<tr '.$bc[$var].'><td nowrap="nowrap" colspan="2">'.$langs->trans("Qty");
@ -815,18 +821,19 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente)
print '</table>'; print '</table>';
print '</form>'; print '</form>';
} }
else { else
{
print $langs->trans("NoOtherOpenedPropals"); print $langs->trans("NoOtherOpenedPropals");
} }
}
print '</td>'; print '</td>';
}
print '</tr>'; print '</tr>';
} }
$commande = New Commande($db); $commande = New Commande($db);
print '<table width="100%" class="noborder">';
// Commande // Commande
if($user->rights->commande->creer) if($user->rights->commande->creer)
@ -869,10 +876,11 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente)
$objc = $db->fetch_object($result); $objc = $db->fetch_object($result);
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print "<td nowrap><a href=\"../commande/fiche.php?id=$objc->commandeid\">".img_object($langs->trans("ShowOrder"),"order")." ".$objc->ref."</a></td>\n"; print "<td nowrap>";
print '<input type="hidden" name="action" value="addincommande">';
print "<a href=\"../commande/fiche.php?id=$objc->commandeid\">".img_object($langs->trans("ShowOrder"),"order")." ".$objc->ref."</a></td>\n";
print "<td><a href=\"../comm/fiche.php?socid=$objc->idp\">".dolibarr_trunc($objc->nom,18)."</a></td>\n"; print "<td><a href=\"../comm/fiche.php?socid=$objc->idp\">".dolibarr_trunc($objc->nom,18)."</a></td>\n";
print "<td nowrap=\"nowrap\">".dolibarr_print_date($objc->dc,"%d %b")."</td>\n"; print "<td nowrap=\"nowrap\">".dolibarr_print_date($objc->dc,"%d %b")."</td>\n";
print '<input type="hidden" name="action" value="addincommande">';
print '<td><input type="hidden" name="commandeid" value="'.$objc->commandeid.'">'; print '<td><input type="hidden" name="commandeid" value="'.$objc->commandeid.'">';
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("Discount"); print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("Discount");
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%'; print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
@ -907,8 +915,9 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente)
$var=false; $var=false;
print '<form method="POST" action="fiche.php?id='.$product->id.'">'; print '<form method="POST" action="fiche.php?id='.$product->id.'">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr '.$bc[$var].'><td colspan="3">';
print '<input type="hidden" name="action" value="addincommande">'; print '<input type="hidden" name="action" value="addincommande">';
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("OtherOrders").'</td><td>'; print $langs->trans("OtherOrders").'</td><td>';
$html->select_array("commandeid", $othercom); $html->select_array("commandeid", $othercom);
print '</td></tr>'; print '</td></tr>';
print '<tr '.$bc[$var].'><td colspan="2">'.$langs->trans("Qty"); print '<tr '.$bc[$var].'><td colspan="2">'.$langs->trans("Qty");
@ -961,20 +970,22 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
$var=true; $var=true;
if ($num) {
$i = 0;
print '<table class="noborder" width="100%">';
print '<form method="POST" action="fiche.php?id='.$product->id.'">'; print '<form method="POST" action="fiche.php?id='.$product->id.'">';
print '<table class="noborder" width="100%">';
if ($num)
{
$i = 0;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print "<td nowrap><a href=\"../compta/facture.php?facid=$objp->factureid\">".img_object($langs->trans("ShowBills"),"bill")." ".$objp->facnumber."</a></td>\n"; print "<td nowrap>";
print '<input type="hidden" name="action" value="addinfacture">';
print "<a href=\"../compta/facture.php?facid=$objp->factureid\">".img_object($langs->trans("ShowBills"),"bill")." ".$objp->facnumber."</a></td>\n";
print "<td><a href=\"../comm/fiche.php?socid=$objp->idp\">".dolibarr_trunc($objp->nom,18)."</a></td>\n"; print "<td><a href=\"../comm/fiche.php?socid=$objp->idp\">".dolibarr_trunc($objp->nom,18)."</a></td>\n";
print "<td nowrap=\"nowrap\">".dolibarr_print_date($objp->df,"%d %b")."</td>\n"; print "<td nowrap=\"nowrap\">".dolibarr_print_date($objp->df,"%d %b")."</td>\n";
print '<input type="hidden" name="action" value="addinfacture">';
print '<td><input type="hidden" name="factureid" value="'.$objp->factureid.'">'; print '<td><input type="hidden" name="factureid" value="'.$objp->factureid.'">';
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("Discount"); print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("Discount");
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%'; print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
@ -1032,6 +1043,7 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente)
print "<td><a href=\"../comm/fiche.php?socid=$objp->idp\">$objp->nom</a></td>\n"; print "<td><a href=\"../comm/fiche.php?socid=$objp->idp\">$objp->nom</a></td>\n";
print "<td colspan=\"2\">".$langs->trans("Qty"); print "<td colspan=\"2\">".$langs->trans("Qty");
print '<input type="hidden" name="action" value="addinfacture">'; print '<input type="hidden" name="action" value="addinfacture">';
print "</td>";
print '<td><input type="hidden" name="factureid" value="'.$objp->factureid.'">'; print '<td><input type="hidden" name="factureid" value="'.$objp->factureid.'">';
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("Discount"); print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("Discount");
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%'; print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';