Fix: linked object block : mutualize code, more simple

Fix: bad link
This commit is contained in:
Regis Houssin 2011-05-09 07:15:17 +00:00
parent a21aef4f9f
commit a052684a3a
3 changed files with 19 additions and 27 deletions

View File

@ -1,7 +1,7 @@
<?PHP
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
*
* 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
@ -151,7 +151,7 @@ if ($conf->fournisseur->enabled)
print "<tr $bc[$var]>";
print '<td nowrap="nowrap">';
print "<a href=\"fiche.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>";
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>';
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>';
$i++;
}
}
@ -272,7 +272,7 @@ if ($resql)
print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
print '<td>'.dol_print_date($db->jdate($obj->datec)).'</td>';
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,5).'</td>';
print '</tr>';

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
*
* 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
@ -24,13 +24,10 @@
<?php
$langs = $GLOBALS['langs'];
$somethingshown = $GLOBALS['somethingshown'];
$linkedObjectBlock = $GLOBALS['object']->linkedObjectBlock;
$objectid = $GLOBALS['object']->objectid;
$num = count($objectid);
$langs->load("orders");
if ($somethingshown) { echo '<br>'; }
echo '<br>';
print_titre($langs->trans('RelatedOrders'));
?>
<table class="noborder" width="100%">
@ -42,19 +39,18 @@ print_titre($langs->trans('RelatedOrders'));
</tr>
<?php
$var=true;
for ($i = 0 ; $i < $num ; $i++)
foreach($linkedObjectBlock as $object)
{
$linkedObjectBlock->fetch($objectid[$i]);
$var=!$var;
?>
<tr <?php echo $bc[$var]; ?> ><td>
<a href="<?php echo DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$linkedObjectBlock->id ?>"><?php echo img_object($langs->trans("ShowOrder"),"order").' '.$linkedObjectBlock->ref; ?></a></td>
<td align="center"><?php echo dol_print_date($linkedObjectBlock->date,'day'); ?></td>
<td align="right"><?php echo price($linkedObjectBlock->total_ht); ?></td>
<td align="right"><?php echo $linkedObjectBlock->getLibStatut(3); ?></td>
<a href="<?php echo DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowOrder"),"order").' '.$object->ref; ?></a></td>
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
<td align="right"><?php echo price($object->total_ht); ?></td>
<td align="right"><?php echo $object->getLibStatut(3); ?></td>
</tr>
<?php
$total = $total + $linkedObjectBlock->total_ht;
$total = $total + $object->total_ht;
}
?>

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
*
* 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
@ -24,13 +24,10 @@
<?php
$langs = $GLOBALS['langs'];
$somethingshown = $GLOBALS['somethingshown'];
$linkedObjectBlock = $GLOBALS['object']->linkedObjectBlock;
$objectid = $GLOBALS['object']->objectid;
$num = count($objectid);
$langs->load("bills");
if ($somethingshown) { echo '<br>'; }
echo '<br>';
if ($num > 1) print_titre($langs->trans("RelatedBills"));
else print_titre($langs->trans("RelatedBill"));
?>
@ -43,19 +40,18 @@ else print_titre($langs->trans("RelatedBill"));
</tr>
<?php
$var=true;
for ($i = 0 ; $i < $num ; $i++)
foreach($linkedObjectBlock as $object)
{
$linkedObjectBlock->fetch($objectid[$i]);
$var=!$var;
?>
<tr <?php echo $bc[$var]; ?> ><td>
<a href="<?php echo DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$linkedObjectBlock->id ?>"><?php echo img_object($langs->trans("ShowBill"),"bill").' '.$linkedObjectBlock->ref; ?></a></td>
<td align="center"><?php echo dol_print_date($linkedObjectBlock->date,'day'); ?></td>
<td align="right"><?php echo price($linkedObjectBlock->total_ht); ?></td>
<td align="right"><?php echo $linkedObjectBlock->getLibStatut(3); ?></td>
<a href="<?php echo DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$object->id ?>"><?php echo img_object($langs->trans("ShowBill"),"bill").' '.$object->ref; ?></a></td>
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
<td align="right"><?php echo price($object->total_ht); ?></td>
<td align="right"><?php echo $object->getLibStatut(3); ?></td>
</tr>
<?php
$total = $total + $linkedObjectBlock->total_ht;
$total = $total + $object->total_ht;
}
?>
<tr class="liste_total">