From 9e3dd487c01dbdbf61c728b901ba1da588c4fde8 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 16 Apr 2007 15:45:48 +0000 Subject: [PATCH] Gestion de la liste de formats de livre --- htdocs/product/canvas/livre/livre-create.tpl | 7 ++++-- htdocs/product/canvas/livre/livre-edit.tpl | 5 ++-- htdocs/product/canvas/product.livre.class.php | 25 +++++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/htdocs/product/canvas/livre/livre-create.tpl b/htdocs/product/canvas/livre/livre-create.tpl index 0ca15996ede..74b0abbc54f 100644 --- a/htdocs/product/canvas/livre/livre-create.tpl +++ b/htdocs/product/canvas/livre/livre-create.tpl @@ -52,8 +52,11 @@ Format - + + + diff --git a/htdocs/product/canvas/livre/livre-edit.tpl b/htdocs/product/canvas/livre/livre-edit.tpl index 19c0d1c546a..b37a85c023a 100644 --- a/htdocs/product/canvas/livre/livre-edit.tpl +++ b/htdocs/product/canvas/livre/livre-edit.tpl @@ -58,8 +58,9 @@ Format - + diff --git a/htdocs/product/canvas/product.livre.class.php b/htdocs/product/canvas/product.livre.class.php index 4dcdf781816..1ea77f0c9a9 100644 --- a/htdocs/product/canvas/product.livre.class.php +++ b/htdocs/product/canvas/product.livre.class.php @@ -431,6 +431,10 @@ class ProductLivre extends Product $smarty->assign('prod_statuts_id', array(1,0) ); $smarty->assign('prod_statuts_value', array('En vente', 'Hors vente') ); + $this->GetAvailableFormat(); + + $smarty->assign('livre_available_formats', $this->available_formats); + if ($this->status==1) { $smarty->assign('prod_statut', 'En vente'); @@ -527,5 +531,26 @@ class ProductLivre extends Product print $sql; } } + + function GetAvailableFormat() + { + $this->available_formats = array(); + + $sql = "SELECT rowid,value FROM ".MAIN_DB_PREFIX."const "; + $sql.=" WHERE name LIKE 'EDITEUR_LIVRE_FORMAT_%';"; + + $resql = $this->db->query($sql); + + while ($obj = $this->db->fetch_object($resql) ) + { + $this->available_formats[$obj->rowid] = stripslashes($obj->value); + } + + $this->db->free($resql); + + return 0; + + } + } ?>