diff --git a/htdocs/product/canvas/livre/livre-edit.tpl b/htdocs/product/canvas/livre/livre-edit.tpl
index 1a261c887d1..19c0d1c546a 100644
--- a/htdocs/product/canvas/livre/livre-edit.tpl
+++ b/htdocs/product/canvas/livre/livre-edit.tpl
@@ -84,7 +84,12 @@
| Prix de revient |
- {$prod_pxrevient} |
+ {$prod_pxrevient} |
+ Prix reliure |
+
+
+ |
diff --git a/htdocs/product/canvas/livre/livre-view.tpl b/htdocs/product/canvas/livre/livre-view.tpl
index 8682cd6da0e..68a15a819c8 100644
--- a/htdocs/product/canvas/livre/livre-view.tpl
+++ b/htdocs/product/canvas/livre/livre-view.tpl
@@ -44,12 +44,15 @@
Prix au feuillet |
{$prod_pxfeuil} HT |
- Prix couverture |
+ Prix couverture |
{$prod_pxcouv} HT |
| Prix de revient |
- {$prod_pxrevient} HT |
+ {$prod_pxrevient} HT |
+
+ Prix reliure |
+ {$prod_pxreliure} HT |
| Prix de vente |
diff --git a/htdocs/product/canvas/livrecouverture/livrecouverture-view.tpl b/htdocs/product/canvas/livrecouverture/livrecouverture-view.tpl
index afe2ddec5c6..1429c997c37 100644
--- a/htdocs/product/canvas/livrecouverture/livrecouverture-view.tpl
+++ b/htdocs/product/canvas/livrecouverture/livrecouverture-view.tpl
@@ -2,15 +2,15 @@
| Référence |
- {$prod_ref} |
+ {$livre_ref} |
- {$fiche_cursor_prev}{$fiche_cursor_next}
+
|
- | Titre du livre |
- {$prod_label} |
+ Couverture du livre |
+ {$livre_label} |
@@ -36,26 +36,4 @@
-
-
- | Description |
- Photo |
-
-
-
- | {$prod_description|nl2br} |
- |
-
-
-
- | Note (non visible sur les factures, propals...)
- |
-
- | {$prod_note|nl2br} |
-
-
-
-
-
-
\ No newline at end of file
diff --git a/htdocs/product/canvas/product.livre.class.php b/htdocs/product/canvas/product.livre.class.php
index aac79f11751..d0e8d6e604b 100644
--- a/htdocs/product/canvas/product.livre.class.php
+++ b/htdocs/product/canvas/product.livre.class.php
@@ -54,6 +54,8 @@ class ProductLivre extends Product
$this->menu_new = 'NewBook';
$this->menu_add = 1;
$this->menu_clear = 1;
+
+ $this->no_button_copy = 1;
$this->menus[0][0] = DOL_URL_ROOT."/product/fiche.php?action=create&type=0&canvas=livre";
$this->menus[0][1] = 'NewBook';
@@ -399,10 +401,12 @@ class ProductLivre extends Product
$smarty->assign('prod_pxfeuil', $this->px_feuillet);
$smarty->assign('prod_pxcouv', $this->px_couverture);
-
+ $smarty->assign('livre_couverture_id', $this->couverture_id);
$smarty->assign('prod_weight', $this->weight);
$smarty->assign('prod_weight_units', $this->weight_units);
+ $smarty->assign('prod_pxreliure', $this->px_reliure);
+
$smarty->assign('prod_pxrevient', price($this->px_revient));
$smarty->assign('prod_pxvente', price($this->price_ttc));
diff --git a/htdocs/product/canvas/product.livrecouverture.class.php b/htdocs/product/canvas/product.livrecouverture.class.php
index b582660efba..0ad974fa546 100644
--- a/htdocs/product/canvas/product.livrecouverture.class.php
+++ b/htdocs/product/canvas/product.livrecouverture.class.php
@@ -51,6 +51,11 @@ class ProductLivreCouverture extends Product
$this->menu_new = '';
$this->menu_add = 0;
$this->menu_clear = 1;
+
+ $this->no_button_copy = 1;
+ $this->no_button_edit = 1;
+ $this->no_button_delete = 1;
+
}
/**
* \brief Creation
@@ -79,6 +84,25 @@ class ProductLivreCouverture extends Product
function FetchCanvas($id='', $ref='')
{
$result = $this->fetch($id,$ref);
+
+ if ($result >= 0)
+ {
+ $sql = "SELECT p.rowid,p.ref,p.label";
+ $sql.= " FROM ".MAIN_DB_PREFIX."product_cnv_livre as pl,".MAIN_DB_PREFIX."product as p";
+ $sql.= " WHERE pl.rowid=p.rowid AND pl.fk_couverture = '".$id."'";
+
+ $result = $this->db->query($sql) ;
+
+ if ( $result )
+ {
+ $result = $this->db->fetch_array();
+
+ $this->livre_id = $result["rowid"];
+ $this->livre_ref = $result["ref"];
+ $this->livre_label = stripslashes($result["label"]);
+ $this->db->free();
+ }
+ }
return $result;
}
@@ -96,11 +120,13 @@ class ProductLivreCouverture extends Product
* \brief Assigne les valeurs pour les templates Smarty
* \param smarty Instance de smarty
*/
- function assign_values(&$smarty)
+ function assign_smarty_values(&$smarty)
{
$smarty->assign('prod_id', $this->id);
- $smarty->assign('prod_ref', $this->ref);
- $smarty->assign('prod_label', $this->livre->libelle);
+ $smarty->assign('livre_id', $this->livre_id);
+ $smarty->assign('livre_ref', $this->livre_ref);
+ $smarty->assign('livre_label', $this->livre_label);
+
$smarty->assign('prod_note', $this->note);
$smarty->assign('prod_description', $this->description);
$smarty->assign('prod_canvas', $this->canvas);