From eb97686eae815b9515ef090eac5e28d70e810f39 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 4 Dec 2006 18:00:43 +0000 Subject: [PATCH] Nouveau fichier --- .../canvas/product.livrecouverture.class.php | 98 +++++++++++++++++++ .../tables/llx_product_cnv_livre_contrat.sql | 37 +++++++ 2 files changed, 135 insertions(+) create mode 100644 htdocs/product/canvas/product.livrecouverture.class.php create mode 100644 mysql/tables/llx_product_cnv_livre_contrat.sql diff --git a/htdocs/product/canvas/product.livrecouverture.class.php b/htdocs/product/canvas/product.livrecouverture.class.php new file mode 100644 index 00000000000..f9c6c554aba --- /dev/null +++ b/htdocs/product/canvas/product.livrecouverture.class.php @@ -0,0 +1,98 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + */ + +/** + \file htdocs/product/canvas/product.livre.class.php + \ingroup produit + \brief Fichier de la classe des produits specifiques de type livre + \version $Revision$ +*/ + +/** + \class ProductLivreCouverture + \brief Classe permettant la gestion des livres, cette classe surcharge la classe produit +*/ + +class ProductLivreCouverture extends Product +{ + /** + * \brief Constructeur de la classe + * \param DB Handler accès base de données + * \param id Id produit (0 par defaut) + */ + function ProductLivreCouverture($DB=0, $id=0) + { + $this->db = $DB; + $this->id = $id ; + $this->canvas = "livrecouverture"; + $this->name = "livrecouverture"; + $this->description = "Gestion des couvertures des livres"; + $this->active = PRODUIT_SPECIAL_LIVRECOUVERTURE; + $this->menu_new = ''; + $this->menu_add = 0; + $this->menu_clear = 1; + } + /** + * \brief Creation + * \param id Id livre + */ + function CreateCanvas($user,$datas) + { + $this->db->begin(); + + $id = $this->create($user); + + return $this->id; + + } + /** + * \brief Supression + * \param id Id livre + */ + function DeleteCanvas($id) + { + return 0; + } + /** + * \brief Lecture des donnees dans la base + * \param id Id livre ('' par defaut) + * \param ref Reference du livre ('' par defaut) + */ + function FetchCanvas($id='', $ref='') + { + $result = $this->fetch($id,$ref); + + return $result; + } + /** + * \brief Mise a jour des donnees dans la base + * \param datas Tableau de donnees + */ + function UpdateCanvas($datas) + { + $error = 0; + return $error; + } + + + +} +?> diff --git a/mysql/tables/llx_product_cnv_livre_contrat.sql b/mysql/tables/llx_product_cnv_livre_contrat.sql new file mode 100644 index 00000000000..1433f4b3298 --- /dev/null +++ b/mysql/tables/llx_product_cnv_livre_contrat.sql @@ -0,0 +1,37 @@ +-- ============================================================================ +-- Copyright (C) 2006 Rodolphe Quiedeville +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_product_cnv_livre_contrat +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_cnv_livre integer, + + quantite integer, -- quantite achete + taux float(3,2), -- taux contractuel + + date_app datetime, -- date d'application + duree varchar(5) -- duree du contrat + +)type=innodb; + + +