diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php
index 7f84b773c15..be219b72c7b 100644
--- a/htdocs/product/fiche.php
+++ b/htdocs/product/fiche.php
@@ -513,12 +513,14 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer)
{
//RODO
$smarty->template_dir = DOL_DOCUMENT_ROOT.'/product/canvas/'.$_GET["canvas"].'/';
- $smarty->display($product->canvas.'-create.tpl');
+ $smarty->display($_GET["canvas"].'-create.tpl');
}
}
/**
+ *
* Fiche produit
+ *
*/
if ($_GET["id"] || $_GET["ref"])
{
@@ -558,109 +560,71 @@ if ($_GET["id"] || $_GET["ref"])
if ( $result )
{
+ if ($_GET["action"] <> 'edit')
+ {
+ $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 "
\n";
+ }
+
+ print($mesg);
+
+ $product->load_previous_next_ref();
+ $previous_ref = $product->ref_previous?'ref_previous.'">'.img_previous().'':'';
+ $next_ref = $product->ref_next?'ref_next.'">'.img_next().'':'';
+ }
if ($_GET["action"] <> 'edit' && $product->canvas <> '')
{
/*
* Smarty 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 "
\n";
- }
+ $smarty->assign('fiche_cursor_prev',$previous_ref);
+ $smarty->assign('fiche_cursor_next',$next_ref);
- print($mesg);
-
- 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 '
';
-
+ // Photo
+ //$nbphoto=$product->show_photos($conf->produit->dir_output,1,1,0);
+
$smarty->display($product->canvas.'-view.tpl');
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 "
\n";
- }
-
- print($mesg);
-
- print '';
- print "";
-
- $nblignes=6;
- if ($product->type == 0 && $conf->stock->enabled) $nblignes++;
- if ($product->type == 1) $nblignes++;
-
+ print '';
+
// 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 ' | ';
+
+ $nblignes=6;
+ if ($product->type == 0 && $conf->stock->enabled) $nblignes++;
+ if ($product->type == 1) $nblignes++;
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 '
';
+ print '| '.$langs->trans("Label").' | '.$product->libelle.' |
';
// MultiPrix
if($conf->global->PRODUIT_MULTIPRICES == 1)
@@ -678,15 +642,13 @@ if ($_GET["id"] || $_GET["ref"])
{
print '| '.$langs->trans("SellingPrice").' | '.price($product->price).' | ';
print '
';
- }
-
+ }
// Statut
print '| '.$langs->trans("Status").' | ';
print $product->getLibStatut(2);
print ' |
';
- // TVA
-
+ // TVA
print '| '.$langs->trans("VATRate").' | '.$product->tva_tx.'% |
';
// Stock
@@ -717,8 +679,7 @@ if ($_GET["id"] || $_GET["ref"])
// Durée
if ($product->type == 1)
{
- print '| '.$langs->trans("Duration").' | '.$product->duration_value.' ';
-
+ 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"));
@@ -732,10 +693,8 @@ if ($_GET["id"] || $_GET["ref"])
}
// Note
- print ' |
| '.$langs->trans("Note").' | '.nl2br($product->note).' |
';
-
- print "
\n";
-
+ print '
| '.$langs->trans("Note").' | '.nl2br($product->note).' |
';
+ print "
\n";
print "\n\n";
}
}