Fix: linked object block : mutualize code, more simple
Fix: bad link
This commit is contained in:
parent
a21aef4f9f
commit
a052684a3a
@ -1,7 +1,7 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* 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
|
* 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
|
||||||
@ -151,7 +151,7 @@ if ($conf->fournisseur->enabled)
|
|||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td nowrap="nowrap">';
|
print '<td nowrap="nowrap">';
|
||||||
print "<a href=\"fiche.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>";
|
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++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -272,7 +272,7 @@ if ($resql)
|
|||||||
|
|
||||||
print '</td>';
|
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>'.dol_print_date($db->jdate($obj->datec)).'</td>';
|
||||||
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,5).'</td>';
|
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,5).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?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
|
* 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
|
||||||
@ -24,13 +24,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$langs = $GLOBALS['langs'];
|
$langs = $GLOBALS['langs'];
|
||||||
$somethingshown = $GLOBALS['somethingshown'];
|
|
||||||
$linkedObjectBlock = $GLOBALS['object']->linkedObjectBlock;
|
$linkedObjectBlock = $GLOBALS['object']->linkedObjectBlock;
|
||||||
$objectid = $GLOBALS['object']->objectid;
|
|
||||||
$num = count($objectid);
|
|
||||||
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
if ($somethingshown) { echo '<br>'; }
|
echo '<br>';
|
||||||
print_titre($langs->trans('RelatedOrders'));
|
print_titre($langs->trans('RelatedOrders'));
|
||||||
?>
|
?>
|
||||||
<table class="noborder" width="100%">
|
<table class="noborder" width="100%">
|
||||||
@ -42,19 +39,18 @@ print_titre($langs->trans('RelatedOrders'));
|
|||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
$var=true;
|
$var=true;
|
||||||
for ($i = 0 ; $i < $num ; $i++)
|
foreach($linkedObjectBlock as $object)
|
||||||
{
|
{
|
||||||
$linkedObjectBlock->fetch($objectid[$i]);
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
?>
|
?>
|
||||||
<tr <?php echo $bc[$var]; ?> ><td>
|
<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>
|
<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($linkedObjectBlock->date,'day'); ?></td>
|
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
|
||||||
<td align="right"><?php echo price($linkedObjectBlock->total_ht); ?></td>
|
<td align="right"><?php echo price($object->total_ht); ?></td>
|
||||||
<td align="right"><?php echo $linkedObjectBlock->getLibStatut(3); ?></td>
|
<td align="right"><?php echo $object->getLibStatut(3); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
$total = $total + $linkedObjectBlock->total_ht;
|
$total = $total + $object->total_ht;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?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
|
* 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
|
||||||
@ -24,13 +24,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$langs = $GLOBALS['langs'];
|
$langs = $GLOBALS['langs'];
|
||||||
$somethingshown = $GLOBALS['somethingshown'];
|
|
||||||
$linkedObjectBlock = $GLOBALS['object']->linkedObjectBlock;
|
$linkedObjectBlock = $GLOBALS['object']->linkedObjectBlock;
|
||||||
$objectid = $GLOBALS['object']->objectid;
|
|
||||||
$num = count($objectid);
|
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
if ($somethingshown) { echo '<br>'; }
|
echo '<br>';
|
||||||
if ($num > 1) print_titre($langs->trans("RelatedBills"));
|
if ($num > 1) print_titre($langs->trans("RelatedBills"));
|
||||||
else print_titre($langs->trans("RelatedBill"));
|
else print_titre($langs->trans("RelatedBill"));
|
||||||
?>
|
?>
|
||||||
@ -43,19 +40,18 @@ else print_titre($langs->trans("RelatedBill"));
|
|||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
$var=true;
|
$var=true;
|
||||||
for ($i = 0 ; $i < $num ; $i++)
|
foreach($linkedObjectBlock as $object)
|
||||||
{
|
{
|
||||||
$linkedObjectBlock->fetch($objectid[$i]);
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
?>
|
?>
|
||||||
<tr <?php echo $bc[$var]; ?> ><td>
|
<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>
|
<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($linkedObjectBlock->date,'day'); ?></td>
|
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
|
||||||
<td align="right"><?php echo price($linkedObjectBlock->total_ht); ?></td>
|
<td align="right"><?php echo price($object->total_ht); ?></td>
|
||||||
<td align="right"><?php echo $linkedObjectBlock->getLibStatut(3); ?></td>
|
<td align="right"><?php echo $object->getLibStatut(3); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
$total = $total + $linkedObjectBlock->total_ht;
|
$total = $total + $object->total_ht;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr class="liste_total">
|
<tr class="liste_total">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user