';
+ print "";
+
+ $nblignes=6;
+ if ($product->type == 0 && $conf->stock->enabled) $nblignes++;
+ if ($product->type == 1) $nblignes++;
+
+ // Reference
+ print '| '.$langs->trans("Ref").' | ';
+ $product->load_previous_next_ref();
+ $previous_ref = $product->ref_previous?'ref_previous.'">'.img_previous().'':'';
+ $next_ref = $product->ref_next?'ref_next.'">'.img_next().'':'';
+ if ($previous_ref || $next_ref) print '';
+ print ' | ';
+
+ if ($product->is_photo_available($conf->produit->dir_output))
{
- // Photo
- print '';
- $nbphoto=$product->show_photos($conf->produit->dir_output,1,1,0);
- print ' | ';
+ // Photo
+ print '';
+ $nbphoto=$product->show_photos($conf->produit->dir_output,1,1,0);
+ print ' | ';
}
-
- print '
';
-
- // Libelle
- print '| '.$langs->trans("Label").' | '.$product->libelle.' | ';
- print '
';
-
- // MultiPrix
- if($conf->global->PRODUIT_MULTIPRICES == 1)
- {
- print '| '.$langs->trans("SellingPrice").' 1 | '.price($product->price).' | ';
- print '
';
- for($i=2;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++)
- {
- print '| '.$langs->trans("SellingPrice").' '.$i.' | '.price($product->multiprices["$i"]).' | ';
- print '
';
- }
- }
- // Prix
- else
- {
- print '| '.$langs->trans("SellingPrice").' | '.price($product->price).' | ';
- print '
';
- }
-
- // Statut
- print '| '.$langs->trans("Status").' | ';
- print $product->getLibStatut(2);
- print ' |
';
-
- // TVA
-
- print '| '.$langs->trans("VATRate").' | '.$product->tva_tx.'% |
';
-
- // Stock
- if ($product->type == 0 && $conf->stock->enabled)
+
+ print '';
+
+ $smarty->display('fiche-view.tpl');
+
+ // Statut
+ print '| '.$langs->trans("Status").' | ';
+ print $product->getLibStatut(2);
+ print ' |
';
+
+ // TVA
+
+ print '| '.$langs->trans("VATRate").' | '.$product->tva_tx.'% |
';
+
+ // Description
+ print '| '.$langs->trans("Description").' | '.nl2br($product->description).' |
';
+
+ // Durée
+ if ($product->type == 1)
{
- print '| '.$langs->trans("Stock").' | ';
- if ($product->no_stock)
+ print '
| '.$langs->trans("Duration").' | '.$product->duration_value.' ';
+
+ if ($product->duration_value > 1)
{
- print " | Pas de définition de stock pour ce produit";
+ $dur=array("d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years"));
}
- else
+ else {
+ $dur=array("d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year"));
+ }
+ print $langs->trans($dur[$product->duration_unit])." ";
+
+ print ' |
';
+ }
+
+ // Note
+ print '| '.$langs->trans("Note").' | '.nl2br($product->note).' |
';
+ print "
\n";
+ print "\n\n";
+ }
+
+
+ if ($_GET["action"] <> 'edit' && $product->canvas == '')
+ {
+ /*
+ * En mode visu
+ */
+
+ $head=product_prepare_head($product);
+ $titre=$langs->trans("CardProduct".$product->type);
+ dolibarr_fiche_head($head, 'card', $titre);
+ print "\n\n";
+ // Confirmation de la suppression de la facture
+ if ($_GET["action"] == 'delete')
+ {
+ $html = new Form($db);
+ $html->form_confirm("fiche.php?id=".$product->id,$langs->trans("DeleteProduct"),$langs->trans("ConfirmDeleteProduct"),"confirm_delete");
+ print "';
+ print "";
+
+ $nblignes=6;
+ if ($product->type == 0 && $conf->stock->enabled) $nblignes++;
+ if ($product->type == 1) $nblignes++;
+
+ // Reference
+ print '| '.$langs->trans("Ref").' | ';
+ $product->load_previous_next_ref();
+ $previous_ref = $product->ref_previous?'ref_previous.'">'.img_previous().'':'';
+ $next_ref = $product->ref_next?'ref_next.'">'.img_next().'':'';
+ if ($previous_ref || $next_ref) print '';
+ print ' | ';
+
+ if ($product->is_photo_available($conf->produit->dir_output))
+ {
+ // Photo
+ print '';
+ $nbphoto=$product->show_photos($conf->produit->dir_output,1,1,0);
+ print ' | ';
+ }
+
+ print '
';
+
+ // Libelle
+ print '| '.$langs->trans("Label").' | '.$product->libelle.' | ';
+ print '
';
+
+ // MultiPrix
+ if($conf->global->PRODUIT_MULTIPRICES == 1)
+ {
+ print '| '.$langs->trans("SellingPrice").' 1 | '.price($product->price).' | ';
+ print '
';
+ for($i=2;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++)
+ {
+ print '| '.$langs->trans("SellingPrice").' '.$i.' | '.price($product->multiprices["$i"]).' | ';
+ print '
';
+ }
+ }
+ // Prix
+ else
+ {
+ print '| '.$langs->trans("SellingPrice").' | '.price($product->price).' | ';
+ print '
';
+ }
+
+ // Statut
+ print '| '.$langs->trans("Status").' | ';
+ print $product->getLibStatut(2);
+ print ' |
';
+
+ // TVA
+
+ print '| '.$langs->trans("VATRate").' | '.$product->tva_tx.'% |
';
+
+ // Stock
+ if ($product->type == 0 && $conf->stock->enabled)
+ {
+ print '| '.$langs->trans("Stock").' | ';
+ if ($product->no_stock)
{
- if ($product->stock_reel <= $product->seuil_stock_alerte)
+ print "Pas de définition de stock pour ce produit";
+ }
+ else
+ {
+ if ($product->stock_reel <= $product->seuil_stock_alerte)
{
- print ' | '.$product->stock_reel.' Seuil : '.$product->seuil_stock_alerte;
+ print ' | '.$product->stock_reel.' Seuil : '.$product->seuil_stock_alerte;
}
- else
+ else
{
- print " | ".$product->stock_reel;
+ print " | ".$product->stock_reel;
}
}
- print ' |
';
+ print '';
}
-
+
// Description
- print '| '.$langs->trans("Description").' | '.nl2br($product->description).' |
';
-
- // Durée
- if ($product->type == 1)
+ print '| '.$langs->trans("Description").' | '.nl2br($product->description).' |
';
+
+ // Durée
+ if ($product->type == 1)
{
- print '| '.$langs->trans("Duration").' | '.$product->duration_value.' ';
-
- if ($product->duration_value > 1)
+ print ' |
| '.$langs->trans("Duration").' | '.$product->duration_value.' ';
+
+ if ($product->duration_value > 1)
{
- $dur=array("d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years"));
+ $dur=array("d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years"));
}
- else {
- $dur=array("d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year"));
- }
- print $langs->trans($dur[$product->duration_unit])." ";
-
- print ' |
';
+ else {
+ $dur=array("d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year"));
+ }
+ print $langs->trans($dur[$product->duration_unit])." ";
+
+ print '';
}
-
- // Note
- print '| '.$langs->trans("Note").' | '.nl2br($product->note).' |
';
-
- print "
\n";
-
- print "\n";
+
+ // Note
+ print '