Ajoute lien vers les fiches produits associés
This commit is contained in:
parent
cd7b7c847a
commit
29729d8f37
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2006 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>
|
||||||
@ -24,10 +24,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/product/sousproduits/fiche.php
|
\file htdocs/product/sousproduits/fiche.php
|
||||||
\ingroup product
|
\ingroup product
|
||||||
\brief Page de la fiche produit
|
\brief Page de la fiche produit
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
@ -35,12 +35,9 @@ require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php");
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
|
|
||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
$ref=isset($_GET["ref"])?$_GET["ref"]:$_POST["ref"];
|
$ref=isset($_GET["ref"])?$_GET["ref"]:$_POST["ref"];
|
||||||
$key=isset($_GET["key"])?$_GET["key"]:$_POST["key"];
|
$key=isset($_GET["key"])?$_GET["key"]:$_POST["key"];
|
||||||
@ -143,78 +140,77 @@ $html = new Form($db);
|
|||||||
if ($id || $ref)
|
if ($id || $ref)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( $result )
|
if ( $result )
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($action <> 'edit' &&$action <> 'search' && $action <> 're-edit')
|
if ($action <> 'edit' &&$action <> 'search' && $action <> 're-edit')
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* En mode visu
|
* En mode visu
|
||||||
*/
|
*/
|
||||||
$head=product_prepare_head($product);
|
$head=product_prepare_head($product);
|
||||||
$titre=$langs->trans("CardProduct".$product->type);
|
$titre=$langs->trans("CardProduct".$product->type);
|
||||||
dolibarr_fiche_head($head, 'subproduct', $titre);
|
dolibarr_fiche_head($head, 'subproduct', $titre);
|
||||||
|
|
||||||
|
|
||||||
print($mesg);
|
print($mesg);
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
|
|
||||||
$nblignes=6;
|
$nblignes=6;
|
||||||
if ($product->type == 0 && $conf->stock->enabled) $nblignes++;
|
if ($product->type == 0 && $conf->stock->enabled) $nblignes++;
|
||||||
if ($product->type == 1) $nblignes++;
|
if ($product->type == 1) $nblignes++;
|
||||||
|
|
||||||
// Reference
|
// Reference
|
||||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td>';
|
print '<td width="15%">'.$langs->trans("Ref").'</td><td>';
|
||||||
|
|
||||||
// Suivant/précédent
|
// Suivant/précédent
|
||||||
$product->load_previous_next_ref();
|
$product->load_previous_next_ref();
|
||||||
$previous_ref = $product->ref_previous?'<a href="?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
$previous_ref = $product->ref_previous?'<a href="?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
||||||
$next_ref = $product->ref_next?'<a href="?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
$next_ref = $product->ref_next?'<a href="?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
||||||
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
||||||
print '<a href="?id='.$product->id.'">'.$product->ref.'</a>';
|
print '<a href="?id='.$product->id.'">'.$product->ref.'</a>';
|
||||||
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
if ($product->is_photo_available($conf->produit->dir_output))
|
if ($product->is_photo_available($conf->produit->dir_output))
|
||||||
{
|
{
|
||||||
// Photo
|
// Photo
|
||||||
print '<td valign="middle" align="center" rowspan="'.$nblignes.'">';
|
print '<td valign="middle" align="center" rowspan="'.$nblignes.'">';
|
||||||
$nbphoto=$product->show_photos($conf->produit->dir_output,1,1,0);
|
$nbphoto=$product->show_photos($conf->produit->dir_output,1,1,0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Libelle
|
// Libelle
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>';
|
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$product->get_sousproduits_arbo ();
|
$product->get_sousproduits_arbo ();
|
||||||
print '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>'.sizeof($product->get_arbo_each_prod()).'</td>';
|
print '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>'.sizeof($product->get_arbo_each_prod()).'</td>';
|
||||||
|
|
||||||
// associations sousproduits
|
// associations sousproduits
|
||||||
$prods_arbo = $product->get_arbo_each_prod();
|
$prods_arbo = $product->get_arbo_each_prod();
|
||||||
if(sizeof($prods_arbo) > 0)
|
if(sizeof($prods_arbo) > 0)
|
||||||
|
{
|
||||||
|
print '<tr><td colspan="2">';
|
||||||
|
print '<b>'.$langs->trans("ProductAssociationList").'</b><br>';
|
||||||
|
foreach($prods_arbo as $key => $value)
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="2">';
|
print '- <a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$value[1].'">'.$value[0].'</a><br>';
|
||||||
print '<b>'.$langs->trans("ProductAssociationList").'</b><br>';
|
}
|
||||||
foreach($prods_arbo as $key => $value)
|
|
||||||
{
|
|
||||||
// print $value[1].' :: '.$value[0].'<br>';
|
|
||||||
print $value[0].'<br>';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
print "</div>\n";
|
print "</div>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user