From 02aff93fa7b99328e1e2dee9ff5bd60bc85cd436 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2006 13:03:21 +0000 Subject: [PATCH] Qual: Suppression fichiers obsoletes --- htdocs/boutique/auteur/auteur.class.php | 219 ------- htdocs/boutique/auteur/fiche.php | 187 ------ htdocs/boutique/auteur/index.php | 74 --- htdocs/boutique/auteur/pre.inc.php | 58 -- htdocs/boutique/client/pre.inc.php | 2 + htdocs/boutique/commande/index.php | 9 +- htdocs/boutique/commande/pre.inc.php | 2 + htdocs/boutique/critiques/bestproduct.php | 7 +- htdocs/boutique/critiques/index.php | 3 +- htdocs/boutique/critiques/pre.inc.php | 3 +- htdocs/boutique/editeur/editeur.class.php | 185 ------ htdocs/boutique/editeur/fiche.php | 181 ------ htdocs/boutique/editeur/index.php | 74 --- htdocs/boutique/editeur/pre.inc.php | 59 -- htdocs/boutique/livre/fiche.php | 428 ------------- htdocs/boutique/livre/index.php | 109 ---- htdocs/boutique/livre/livre.class.php | 570 ------------------ htdocs/boutique/livre/pre.inc.php | 71 --- htdocs/boutique/livre/vignettes.php | 114 ---- htdocs/boutique/newsletter/fiche.php | 275 --------- htdocs/boutique/newsletter/index.php | 83 --- .../boutique/newsletter/newsletter.class.php | 217 ------- htdocs/boutique/newsletter/pre.inc.php | 55 -- htdocs/boutique/promotion/index.php | 18 +- htdocs/boutique/promotion/pre.inc.php | 3 +- 25 files changed, 36 insertions(+), 2970 deletions(-) delete mode 100644 htdocs/boutique/auteur/auteur.class.php delete mode 100644 htdocs/boutique/auteur/fiche.php delete mode 100644 htdocs/boutique/auteur/index.php delete mode 100644 htdocs/boutique/auteur/pre.inc.php delete mode 100644 htdocs/boutique/editeur/editeur.class.php delete mode 100644 htdocs/boutique/editeur/fiche.php delete mode 100644 htdocs/boutique/editeur/index.php delete mode 100644 htdocs/boutique/editeur/pre.inc.php delete mode 100644 htdocs/boutique/livre/fiche.php delete mode 100644 htdocs/boutique/livre/index.php delete mode 100644 htdocs/boutique/livre/livre.class.php delete mode 100644 htdocs/boutique/livre/pre.inc.php delete mode 100644 htdocs/boutique/livre/vignettes.php delete mode 100644 htdocs/boutique/newsletter/fiche.php delete mode 100644 htdocs/boutique/newsletter/index.php delete mode 100644 htdocs/boutique/newsletter/newsletter.class.php delete mode 100644 htdocs/boutique/newsletter/pre.inc.php diff --git a/htdocs/boutique/auteur/auteur.class.php b/htdocs/boutique/auteur/auteur.class.php deleted file mode 100644 index 6accc6c15ab..00000000000 --- a/htdocs/boutique/auteur/auteur.class.php +++ /dev/null @@ -1,219 +0,0 @@ - - * - * 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/boutique/auteur/auteur.class.php - \brief Classe permettant de gèrer des auteurs - \author Rodolphe Quideville - \version $Revision$ -*/ - -/*! \class Auteur - \brief Classe permettant de gèrer des auteurs -*/ - -class Auteur { - var $db ; - - var $id ; - var $nom; - - function Auteur($DB, $id=0) { - $this->db = $DB; - $this->id = $id ; - } - - /* - * - * - * - */ - - function create($user) { - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."auteur (fk_user_author) VALUES (".$user->id.")"; - - if ($this->db->query($sql) ) - { - $id = $this->db->last_insert_id(MAIN_DB_PREFIX."auteur"); - - if ( $this->update($id, $user) ) - { - return $id; - } - } - - } - - /* - * - * - */ - - function liste_array () - { - $ga = array(); - - $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."auteur ORDER BY nom"; - - if ($this->db->query($sql) ) - { - $nump = $this->db->num_rows(); - - if ($nump) - { - $i = 0; - while ($i < $nump) - { - $obj = $this->db->fetch_object(); - - $ga[$obj->rowid] = $obj->nom; - $i++; - } - } - return $ga; - } - else - { - print $this->db->error(); - } - - } - /* - * - * - * - */ - - function update($id, $user) - { - - $sql = "UPDATE ".MAIN_DB_PREFIX."auteur "; - $sql .= " SET nom = '" . trim($this->nom) ."'"; - - $sql .= " WHERE rowid = " . $id; - - if ( $this->db->query($sql) ) { - return 1; - } else { - print $this->db->error() . ' in ' . $sql; - } - } - - /* - * - * - * - */ - - function liste_livre($id_type='', $status=0) - { - $ga = array(); - if ($id_type == 'oscid') - { - $sql = "SELECT a.oscid, "; - } - else - { - $sql = "SELECT a.rowid, "; - } - $sql .= " a.title FROM ".MAIN_DB_PREFIX."livre as a, ".MAIN_DB_PREFIX."livre_to_auteur as l"; - $sql .= " WHERE a.rowid = l.fk_livre AND l.fk_auteur = ".$this->id; - if ($status) - { - $sql .= " AND a.status = 1"; - } - $sql .= " ORDER BY a.title"; - - if ($this->db->query($sql) ) - { - $nump = $this->db->num_rows(); - - if ($nump) - { - $i = 0; - while ($i < $nump) - { - $row = $this->db->fetch_row($i); - - $ga[$row[0]] = $row[1]; - $i++; - } - } - return $ga; - } - else - { - print $this->db->error(); - } - } - - /* - * - * - * - */ - - function fetch ($id) { - - $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."auteur WHERE rowid = $id"; - - $result = $this->db->query($sql) ; - - if ( $result ) - { - $result = $this->db->fetch_array(); - - $this->id = $result["rowid"]; - $this->nom = stripslashes($result["nom"]); - - $this->db->free(); - } - else - { - print $this->db->error(); - } - - return $result; - } - - - /* - * - * - */ - - function delete() { - - $livres = $this->liste_livre(); - - if (sizeof($livres) == 0) - { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."auteur WHERE rowid = $this->id "; - $return = $this->db->query($sql) ; - } - - - } - - -} -?> diff --git a/htdocs/boutique/auteur/fiche.php b/htdocs/boutique/auteur/fiche.php deleted file mode 100644 index e6184a7476e..00000000000 --- a/htdocs/boutique/auteur/fiche.php +++ /dev/null @@ -1,187 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * - * 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$ - * - */ - -require("./pre.inc.php"); - -if ($action == 'add') { - $auteur = new Auteur($db); - - $auteur->nom = $nom; - - $id = $auteur->create($user); -} - -if ($action == 'addga') { - $auteur = new Auteur($db); - - $auteur->linkga($id, $ga); -} - -if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes) -{ - $auteur = new Auteur($db); - $result = $auteur->fetch($id); - $auteur->delete(); - Header("Location: index.php"); -} - - -if ($action == 'update' && !$cancel) { - $auteur = new Auteur($db); - - $auteur->nom = $nom; - - $auteur->update($id, $user); -} - -llxHeader(); - - - -/* - * - * - */ -if ($action == 'create') -{ - - print "
\n"; - print ''; - - print '
Nouvel Auteur

'; - - print ''; - print ""; - print ''; - print ''; - print '
Nom
 
'; - print '
'; - - -} -else -{ - if ($id) - { - - $auteur = new Auteur($db); - $result = $auteur->fetch($id); - - if ( $result ) - { - - $livres = $auteur->liste_livre(); - - /* - * Confirmation de la suppression de l'auteur - * - */ - - if ($action == 'delete') - { - $htmls = new Form($db); - $htmls->form_confirm("fiche.php?id=$id","Supprimer un auteur","Etes-vous sur de vouloir supprimer cet auteur ?","confirm_delete"); - } - - /* - * Edition - * - */ - - - if ($action == 'edit') - { - print '
Edition de la fiche Auteur : '.$auteur->nom.'

'; - - print "
\n"; - print ''; - - print ''; - print ""; - print ''; - - print ''; - - print ''; - - print '
Nom
 

'; - - } - - print '
Fiche Auteur : '.$auteur->nom.'

'; - - print ''; - print ""; - print ''; - - print '"; - - print "
Nom'.$auteur->nom.'
Livres'; - - foreach ($livres as $key => $value) - { - print ''.$value."
\n"; - } - print "
"; - - - - } - else - { - print "Fetch failed"; - } - - - } - else - { - print "Error"; - } -} - -/* ************************************************************************** */ -/* */ -/* Barre d'action */ -/* */ -/* ************************************************************************** */ - - print '
'; - - if ($action != 'create') - { - print ''.$langs->trans("Edit").''; - } - - if(sizeof($livres)==0 && $id) - { - print ''.$langs->trans("Delete").''; - } - - print '
'; - - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/boutique/auteur/index.php b/htdocs/boutique/auteur/index.php deleted file mode 100644 index fd5ceafe973..00000000000 --- a/htdocs/boutique/auteur/index.php +++ /dev/null @@ -1,74 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * - * 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$ - * - */ - -require("./pre.inc.php"); - -llxHeader(); - -if ($sortfield == "") { - $sortfield="lower(e.nom)"; -} -if ($sortorder == "") { - $sortorder="ASC"; -} - - -if ($page == -1) { $page = 0 ; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; - -print_barre_liste("Liste des Auteurs", $page, "index.php"); - -$sql = "SELECT e.rowid, e.nom FROM ".MAIN_DB_PREFIX."auteur as e"; - -$sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); - -if ( $db->query($sql) ) { - $num = $db->num_rows(); - $i = 0; - print ""; - print ""; - print_liste_field_titre("Nom","index.php", "e.nom"); - print "\n"; - $var=True; - while ($i < $num) { - $objp = $db->fetch_object(); - $var=!$var; - print ""; - print "\n"; - print "\n"; - $i++; - } - print "
rowid\">$objp->nom
"; - $db->free(); -} -else -{ - dolibarr_print_error($db); -} - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/boutique/auteur/pre.inc.php b/htdocs/boutique/auteur/pre.inc.php deleted file mode 100644 index 31378ae86e9..00000000000 --- a/htdocs/boutique/auteur/pre.inc.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * 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$ - * - */ -require("../../main.inc.php"); -require("../livre/livre.class.php"); -require("./auteur.class.php"); - -function llxHeader($head = "", $urlp = "") { - global $user, $conf; - - /* - * - * - */ - top_menu($head); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/boutique/livre/", "Livres"); - - $menu->add_submenu(DOL_URL_ROOT."/boutique/livre/fiche.php?&action=create","Nouvel ouvrage"); - - $menu->add(DOL_URL_ROOT."/boutique/auteur/", "Auteurs"); - - $menu->add_submenu(DOL_URL_ROOT."/boutique/auteur/fiche.php?&action=create","Nouvel auteur"); - - $menu->add(DOL_URL_ROOT."/boutique/editeur/", "Editeurs"); - - $menu->add_submenu(DOL_URL_ROOT."/boutique/editeur/fiche.php?&action=create","Nouvel éditeur"); - - $menu->add(DOL_URL_ROOT."/product/categorie/", "Catégories"); - - left_menu($menu->liste); - /* - * - * - */ - -} -?> diff --git a/htdocs/boutique/client/pre.inc.php b/htdocs/boutique/client/pre.inc.php index 76e9a759ed2..8e0cf074a3e 100644 --- a/htdocs/boutique/client/pre.inc.php +++ b/htdocs/boutique/client/pre.inc.php @@ -42,6 +42,8 @@ function llxHeader($head = "", $urlp = "") $menu->add(DOL_URL_ROOT."/boutique/index.php", $langs->trans("OSCommerceShop")); $menu->add_submenu(DOL_URL_ROOT."/boutique/produits/osc-liste.php", $langs->trans("Products")); $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/index.php", $langs->trans("Critiques")); + $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/bestproduct.php", "Meilleurs produits",2); + $menu->add_submenu(DOL_URL_ROOT."/boutique/promotion/index.php", $langs->trans("Promotion")); $menu->add_submenu(DOL_URL_ROOT."/boutique/client/", $langs->trans("Customers")); $menu->add_submenu(DOL_URL_ROOT."/boutique/commande/", $langs->trans("Orders")); diff --git a/htdocs/boutique/commande/index.php b/htdocs/boutique/commande/index.php index 8bd782890f4..515e520c4a5 100644 --- a/htdocs/boutique/commande/index.php +++ b/htdocs/boutique/commande/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur + * Copyright (C) 2006 Laurent Destailleur * * 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 @@ -21,6 +21,13 @@ * */ +/** + \file htdocs/boutique/commande/index.php + \ingroup boutique + \brief Page gestion commandes OSCommerce + \version $Revision$ +*/ + require("./pre.inc.php"); llxHeader(); diff --git a/htdocs/boutique/commande/pre.inc.php b/htdocs/boutique/commande/pre.inc.php index f9d09384f65..272a6138165 100644 --- a/htdocs/boutique/commande/pre.inc.php +++ b/htdocs/boutique/commande/pre.inc.php @@ -41,6 +41,8 @@ function llxHeader($head = "", $urlp = "") $menu->add(DOL_URL_ROOT."/boutique/index.php", $langs->trans("OSCommerceShop")); $menu->add_submenu(DOL_URL_ROOT."/boutique/produits/osc-liste.php", $langs->trans("Products")); $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/index.php", $langs->trans("Critiques")); + $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/bestproduct.php", "Meilleurs produits",2); + $menu->add_submenu(DOL_URL_ROOT."/boutique/promotion/index.php", $langs->trans("Promotion")); $menu->add_submenu(DOL_URL_ROOT."/boutique/client/", $langs->trans("Customers")); $menu->add_submenu(DOL_URL_ROOT."/boutique/commande/", $langs->trans("Orders")); diff --git a/htdocs/boutique/critiques/bestproduct.php b/htdocs/boutique/critiques/bestproduct.php index cb299dbc295..6a147a97eaf 100644 --- a/htdocs/boutique/critiques/bestproduct.php +++ b/htdocs/boutique/critiques/bestproduct.php @@ -1,6 +1,7 @@ - * Copyright (C) 2003 Éric Seigne + * Copyright (C) 2003 Éric Seigne + * Copyright (C) 2006 Laurent Destailleur * * 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 @@ -82,6 +83,10 @@ if ($resql) } $db->free(); } +else +{ + dolibarr_print_error($db); +} print ""; diff --git a/htdocs/boutique/critiques/index.php b/htdocs/boutique/critiques/index.php index 63c021b69f9..999ce5c7f10 100644 --- a/htdocs/boutique/critiques/index.php +++ b/htdocs/boutique/critiques/index.php @@ -1,5 +1,6 @@ + * Copyright (C) 2006 Laurent Destailleur * * 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 @@ -22,7 +23,7 @@ /** \file htdocs/boutique/critiques/fiche.php \ingroup boutique - \brief Page gestion critiques OS Commerce + \brief Page gestion critiques OSCommerce \version $Revision$ */ diff --git a/htdocs/boutique/critiques/pre.inc.php b/htdocs/boutique/critiques/pre.inc.php index 1de7068ee46..982040881c2 100644 --- a/htdocs/boutique/critiques/pre.inc.php +++ b/htdocs/boutique/critiques/pre.inc.php @@ -32,7 +32,8 @@ require_once(DOL_DOCUMENT_ROOT."/boutique/critiques/critique.class.php"); function llxHeader($head = "", $urlp = "") { - global $user, $conf; + global $user,$conf, $langs; + $langs->load("shop"); top_menu($head); diff --git a/htdocs/boutique/editeur/editeur.class.php b/htdocs/boutique/editeur/editeur.class.php deleted file mode 100644 index c846ece1710..00000000000 --- a/htdocs/boutique/editeur/editeur.class.php +++ /dev/null @@ -1,185 +0,0 @@ - - * - * 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$ - * - */ - -class Editeur { - var $db ; - - var $id ; - var $nom; - - function Editeur($DB, $id=0) { - $this->db = $DB; - $this->id = $id ; - } - /* - * - * - * - */ - function create($user) { - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."editeur (fk_user_author) VALUES (".$user->id.")"; - - if ($this->db->query($sql) ) - { - $id = $this->db->last_insert_id(MAIN_DB_PREFIX."editeur"); - - if ( $this->update($id, $user) ) - { - return $id; - } - } - - } - - /* - * - * - */ - function liste_array () - { - $ga = array(); - - $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."editeur ORDER BY nom"; - - if ($this->db->query($sql) ) - { - $nump = $this->db->num_rows(); - - if ($nump) - { - $i = 0; - while ($i < $nump) - { - $obj = $this->db->fetch_object(); - - $ga[$obj->rowid] = $obj->nom; - $i++; - } - } - return $ga; - } - else - { - print $this->db->error(); - } - - } - /* - * - * - * - */ - function update($id, $user) - { - - $sql = "UPDATE ".MAIN_DB_PREFIX."editeur "; - $sql .= " SET nom = '" . trim($this->nom) ."'"; - - $sql .= " WHERE rowid = " . $id; - - if ( $this->db->query($sql) ) { - return 1; - } else { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - * - */ - function fetch ($id) { - - $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."editeur WHERE rowid = $id"; - - $result = $this->db->query($sql) ; - - if ( $result ) - { - $result = $this->db->fetch_array(); - - $this->id = $result["rowid"]; - $this->nom = stripslashes($result["nom"]); - - $this->db->free(); - } - else - { - print $this->db->error(); - } - - return $result; - } - /* - * - * - * - */ - function liste_livre() - { - $ga = array(); - - $sql = "SELECT a.rowid, a.title FROM ".MAIN_DB_PREFIX."livre as a"; - $sql .= " WHERE a.fk_editeur = ".$this->id; - $sql .= " ORDER BY a.title"; - - if ($this->db->query($sql) ) - { - $nump = $this->db->num_rows(); - - if ($nump) - { - $i = 0; - while ($i < $nump) - { - $obj = $this->db->fetch_object(); - - $ga[$obj->rowid] = $obj->title; - $i++; - } - } - return $ga; - } - else - { - print $this->db->error(); - } - } - /* - * - * - */ - function delete() { - - $livres = $this->liste_livre(); - - if (sizeof($livres) == 0) - { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."editeur WHERE rowid = $this->id "; - $return = $this->db->query($sql) ; - } - - - } -} -?> diff --git a/htdocs/boutique/editeur/fiche.php b/htdocs/boutique/editeur/fiche.php deleted file mode 100644 index 2c9ab2ea99d..00000000000 --- a/htdocs/boutique/editeur/fiche.php +++ /dev/null @@ -1,181 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * - * 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$ - * - */ - -require("./pre.inc.php"); - -if ($action == 'add') { - $editeur = new Editeur($db); - - $editeur->nom = $nom; - - $id = $editeur->create($user); -} - -if ($action == 'addga') { - $editeur = new Editeur($db); - - $editeur->linkga($id, $ga); -} - -if ($action == 'update' && !$cancel) -{ - $editeur = new Editeur($db); - - $editeur->nom = $nom; - - $editeur->update($id, $user); -} - -if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes) -{ - $editeur = new Editeur($db); - $result = $editeur->fetch($id); - $editeur->delete(); - Header("Location: index.php"); -} - -llxHeader(); - -/* - * - * - */ -if ($action == 'create') -{ - - print "
\n"; - print ''; - - print '
Nouvel Editeur

'; - - print ''; - print ""; - print ''; - print ''; - print '
Nom
 
'; - print '
'; - - -} -else -{ - if ($id) - { - - $editeur = new Editeur($db); - $result = $editeur->fetch($id); - - if ( $result ) - { - $livres = $editeur->liste_livre(); - - /* - * Confirmation de la suppression de l'editeur - * - */ - - if ($action == 'delete') - { - $htmls = new Form($db); - $htmls->form_confirm("fiche.php?id=$id","Supprimer un éditeur","Etes-vous sur de vouloir supprimer cet éditeur ?","confirm_delete"); - } - - /* - * Edition de la fiche - * - */ - - if ($action == 'edit') - { - print '
Edition de la fiche Editeur : '.$editeur->titre.'

'; - - print "
\n"; - print ''; - - print ''; - print ""; - print ''; - - print ''; - - print ''; - - print '
Nom
 

'; - - } - - print '
Fiche Editeur : '.$editeur->titre.'

'; - - print ''; - print ""; - print ''; - - print '"; - - print "
Nom'.$editeur->nom.'
Livres'; - - foreach ($livres as $key => $value) - { - print ''.$value."
\n"; - } - print "
"; - - - - } - else - { - print "Fetch failed"; - } - - - } - else - { - print "Error"; - } -} - -/* ************************************************************************** */ -/* */ -/* Barre d'action */ -/* */ -/* ************************************************************************** */ - -print '
'; -if ($action != 'create') -{ - print ''.$langs->trans("Edit").''; -} - -if(sizeof($livres)==0 && $id) -{ - print ''.$langs->trans("Delete").''; -} -print '
'; - - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/boutique/editeur/index.php b/htdocs/boutique/editeur/index.php deleted file mode 100644 index 4b88f04a6c9..00000000000 --- a/htdocs/boutique/editeur/index.php +++ /dev/null @@ -1,74 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * - * 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$ - * - */ - -require("./pre.inc.php"); - -llxHeader(); - -if ($sortfield == "") { - $sortfield="lower(e.nom)"; -} -if ($sortorder == "") { - $sortorder="ASC"; -} - - -if ($page == -1) { $page = 0 ; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; - -print_barre_liste("Liste des Editeurs", $page, "index.php"); - -$sql = "SELECT e.rowid, e.nom FROM ".MAIN_DB_PREFIX."editeur as e"; - -$sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); - -if ( $db->query($sql) ) { - $num = $db->num_rows(); - $i = 0; - print ""; - print ""; - print_liste_field_titre($langs->trans("Name"),"index.php", "e.nom"); - print "\n"; - $var=True; - while ($i < $num) { - $objp = $db->fetch_object(); - $var=!$var; - print ""; - print "\n"; - print "\n"; - $i++; - } - print "
rowid\">$objp->nom
"; - $db->free(); -} -else -{ - print $db->error(); -} - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/boutique/editeur/pre.inc.php b/htdocs/boutique/editeur/pre.inc.php deleted file mode 100644 index ed23801b1b4..00000000000 --- a/htdocs/boutique/editeur/pre.inc.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * 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$ - * - */ -require("../../main.inc.php"); -require("../livre/livre.class.php"); -require("./editeur.class.php"); - -function llxHeader($head = "", $urlp = "") { - global $user, $conf; - - /* - * - * - */ - top_menu($head); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/boutique/livre/", "Livres"); - - $menu->add_submenu(DOL_URL_ROOT."/boutique/livre/fiche.php?&action=create","Nouvel ouvrage"); - - $menu->add(DOL_URL_ROOT."/boutique/auteur/", "Auteurs"); - - $menu->add_submenu(DOL_URL_ROOT."/boutique/auteur/fiche.php?&action=create","Nouvel auteur"); - - $menu->add(DOL_URL_ROOT."/boutique/editeur/", "Editeurs"); - - $menu->add_submenu(DOL_URL_ROOT."/boutique/editeur/fiche.php?&action=create","Nouvel éditeur"); - - $menu->add(DOL_URL_ROOT."/product/categorie/", "Catégories"); - - - left_menu($menu->liste); - /* - * - * - */ - -} -?> diff --git a/htdocs/boutique/livre/fiche.php b/htdocs/boutique/livre/fiche.php deleted file mode 100644 index 15ce078ee7c..00000000000 --- a/htdocs/boutique/livre/fiche.php +++ /dev/null @@ -1,428 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * - * 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$ - * - */ - -require("./pre.inc.php"); - -if ( $_POST["sendit"] ) -{ - global $local_file, $error_msg; - - $upload_dir = OSC_CATALOG_DIRECTORY."/images/"; - - if (! is_dir($upload_dir)) - { - umask(0); - mkdir($upload_dir, 0755); - } - - if (doliMoveFileUpload($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'])) - { - print "Le fichier est valide, et a été téléchargé avec succès.\n"; - //print_r($_FILES); - } - else - { - echo "Le fichier n'a pas été téléchargé"; - // print_r($_FILES); - } - - if ($id or $oscid) - { - $livre = new Livre($db); - - if ($id) - { - $result = $livre->fetch($id, 0); - $livre->update_image($_FILES['userfile']['name']); - $livre->updateosc($user); - } - } -} - - -if ($action == 'add') -{ - $livre = new Livre($db); - - $livre->titre = $titre; - $livre->ref = $ref; - $livre->price = $price; - $livre->annee = $annee; - $livre->editeurid = $editeurid; - $livre->description = $desc; - $livre->frais_de_port = $_POST["fdp"]; - - $id = $livre->create($user); -} - -if ($action == 'addga') -{ - $livre = new Livre($db); - $livre->linkga($id, $coauteurid); -} - -if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes") -{ - $livre = new Livre($db); - $livre->fetch($id); - $livre->delete(); - Header("Location: index.php"); -} - - -if ($action == 'linkcat') -{ - $livre = new Livre($db); - $livre->fetch($id); - $livre->linkcategorie( $catid); -} - -if ($action == 'delcat') -{ - $livre = new Livre($db); - $livre->fetch($id); - $livre->unlinkcategorie($catid); -} - -if ($action == 'delauteur' && $auteurid) -{ - $livre = new Livre($db); - $livre->fetch($id); - $livre->auteur_unlink($auteurid); -} - -if ($action == "status") -{ - $livre = new Livre($db); - $livre->fetch($id); - if ($livre->update_status($status)) - { - - } -} - -if ($action == 'update' && !$cancel) -{ - $livre = new Livre($db); - - $livre->titre = $titre; - $livre->ref = $ref; - $livre->price = $price; - $livre->frais_de_port = $_POST["fdp"]; - $livre->annee = $annee; - $livre->editeurid = $editeurid; - $livre->description = $desc; - - if ($livre->update($id, $user)) - { - $result = $livre->fetch($id); - $livre->updateosc($user); - } - else - { - $action = 'edit'; - } -} - -if ($action == 'updateosc') -{ - $livre = new Livre($db); - $result = $livre->fetch($id); - - $livre->updateosc($user); -} - -/* - * - * - */ - -llxHeader(); - -if ($action == 'create') -{ - - print "
\n"; - print ""; - - print '
Nouvel ouvrage

'; - - print ''; - print ""; - print ''; - print ''; - print ''; - - print ''; - - $htmls = new Form($db); - $edits = new Editeur($db); - - print ""; - - print '"; - print ''; - print '
Référence
Titre
'.$langs->trans("Price").'
Frais de port
Editeur"; - $htmls->select_array("editeurid", $edits->liste_array(), $livre->editeurid); - print "
'.$langs->trans("Description").''; - print '
 
'; - print '
'; - - -} -else -{ - if ($id or $oscid) - { - $livre = new Livre($db); - - if ($id) - { - $result = $livre->fetch($id, 0); - } - if ($oscid) - { - $result = $livre->fetch(0, $oscid); - $id = $livre->id; - } - - if ( $result ) - { - $htmls = new Form($db); - $auteurs = $livre->liste_auteur(); - - - /* - * Confirmation de la suppression de l'adhérent - * - */ - - if ($action == 'delete') - { - $htmls = new Form($db); - $htmls->form_confirm("fiche.php?id=$id","Supprimer un ouvrage","Etes-vous sur de vouloir supprimer cet ouvrage ?","confirm_delete"); - } - - - if ($action == 'edit') - { - print '
Edition de la fiche Livre : '.$livre->titre.'

'; - - print "
\n"; - print ""; - - print ''; - print ""; - print ''; - print ''; - - print '\n"; - - print '"; - - print ''; - - print ''; - print ''; - print ''; - - $htmls = new Form($db); - $edits = new Editeur($db); - - print ""; - - print '"; - - - print ''; - print ""; - - print ''; - - $auteur = new Auteur($db); - - print "\n"; - print ""; - - print ''; - print ""; - - print "\n"; - print ''; - - $listecat = new Categorie($db); - print ''; - print ""; - print "\n"; - - print '\n"; - - print '
'.$langs->trans("Ref").''.$langs->trans("Description").'
'.$langs->trans("Status").''.$livre->status_text; - if ($livre->status == 0) - { - print '
Changer'; - } - else - { - print '
Changer'; - } - print "
Titre
Année
'.$langs->trans("Price").'
Frais de port
Editeur"; - $htmls->select_array("editeurid", $edits->liste_array(), $livre->editeurid); - print "
Auteur(s)'; - - foreach ($auteurs as $key => $value) - { - print ''; - print 'Supprimer '; - print ''.$value."
\n"; - } - print "
 
Auteur(s)'; - $htmls->select_array("coauteurid", $auteur->liste_array()); - print ' 
Catégories'; - $htmls->select_array("catid", $listecat->liste_array()); - print ' 
Vignette'; - echo '
'; - print ''; - print '
'; - print ''; - print '
'; - print '
'; - print "

'; - - } - - /* - * Affichage - */ - - print '
Fiche Livre : '.$livre->titre.'

'; - - print ''; - print ""; - print ''; - print ''; - print ''; - print '\n"; - print '"; - - print '"; - - print "\n"; - print "\n"; - - print ''; - print '"; - print ''; - print ''; - } - else - { - print 'non'; - } - print "
'.$langs->trans("Ref").''.$livre->ref.''.$langs->trans("Description").'Catégories
'.$langs->trans("Status").''.$livre->status_text; - if ($livre->status == 0) - { - print '
Changer'; - } - else - { - print '
Changer'; - } - print "
'.nl2br($livre->description); - - $img = OSC_CATALOG_DIRECTORY."images/".$livre->image; - - if(file_exists($img)) - { - print '

'; - } - print "

'; - $livre->listcategorie(); - print "
Titre$livre->titre
Annee$livre->annee
Editeur'; - - if ($livre->editeurid) - { - $editeur = new Editeur($db); - $editeur->fetch($livre->editeurid); - print $editeur->nom; - } - print '
Auteur(s)'; - - foreach ($auteurs as $key => $value) - { - print ''; - print $value."
\n"; - } - print "
'.$langs->trans("Price").''.price($livre->price).'
Frais de port'; - if ($livre->frais_de_port) - { - print 'oui
"; - } - else - { - print "Fetch failed"; - } - - - } - else - { - print "Error"; - } -} - -/* ************************************************************************** */ -/* */ -/* Barre d'action */ -/* */ -/* ************************************************************************** */ - -print '
'; -if ($action != 'create') -{ - print ''.$langs->trans("Edit").''; -} - -print ''.$langs->trans("Delete").''; -print '
'; - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/boutique/livre/index.php b/htdocs/boutique/livre/index.php deleted file mode 100644 index 94ef024eda6..00000000000 --- a/htdocs/boutique/livre/index.php +++ /dev/null @@ -1,109 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * - * 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$ - * - */ - -require("./pre.inc.php"); - -llxHeader(); - -if ($sortfield == "") -{ - $sortfield="lower(l.title)"; -} -if ($sortorder == "") -{ - $sortorder="ASC"; -} - -if ($page == -1) { $page = 0 ; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; - -$form = '
'. -''. -''. -'Titre :  '. -'
'; - - -print_barre_liste("Liste des Livres", $page, "index.php", "", $sortfield, $sortorder, $form); - -$sql = "SELECT l.rowid, l.title, l.oscid, l.ref, l.status FROM ".MAIN_DB_PREFIX."livre as l"; - -if ($searchvalue) -{ - $sql .= " WHERE l.title like '%$searchvalue%'"; -} - -$sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); - -if ( $db->query($sql) ) -{ - $num = $db->num_rows(); - $i = 0; - print ""; - print ""; - print_liste_field_titre($langs->trans("Ref"),"index.php", "l.ref"); - print_liste_field_titre($langs->trans("Title"),"index.php", "l.title"); - print ''; - print "\n"; - $var=True; - while ($i < $num) { - $objp = $db->fetch_object(); - $var=!$var; - print ""; - - print '\n"; - print "\n"; - - - if ($objp->status == 1) - { - print ''; - print ''; - print ''; - } - else - { - print ''; - print ''; - print ''; - } - - print "\n"; - $i++; - } - print "
 
Fiche livre '; - - print "rowid\">$objp->refrowid\">$objp->titleFiche en ligne 
"; - $db->free(); -} -else -{ - dolibarr_print_error($db); -} - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/boutique/livre/livre.class.php b/htdocs/boutique/livre/livre.class.php deleted file mode 100644 index eb1a8bb8ddb..00000000000 --- a/htdocs/boutique/livre/livre.class.php +++ /dev/null @@ -1,570 +0,0 @@ - - * Copyright (C) 2003 Éric Seigne - * - * 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$ - * - */ - -class Livre { - var $db ; - - var $id ; - var $oscid ; - var $ref; - var $price; - var $annee; - var $editeurid; - var $titre; - var $image; - var $description; - var $price ; - var $status ; - - function Livre($DB, $id=0) { - $this->db = $DB; - $this->id = $id ; - } - /* - * - * - * - */ - function create($user) { - - if (strlen($this->annee)) - { - $this->annee = 0; - } - - $sql = "INSERT INTO ".OSC_DB_NAME.".products (products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_date_added) "; - $sql .= "VALUES ('', '', 'Array', '', null, '', '0', '0', '8', now())"; - - if ($this->db->query($sql) ) - { - $idosc = $this->db->last_insert_id(OSC_DB_NAME.".products"); - - $sql = "INSERT INTO ".OSC_DB_NAME.".products_to_categories (products_id, categories_id) VALUES ($idosc, 0)"; - - if ($this->db->query($sql) ) - { - - $sql = "INSERT INTO ".OSC_DB_NAME.".products_description (products_name, products_description, products_url, products_id, language_id) VALUES ('".trim($this->titre)."', '".trim($this->description)."', '', $idosc, '".OSC_LANGUAGE_ID."')"; - - if ($this->db->query($sql) ) - { - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."livre (oscid, fk_user_author, date_ajout) VALUES ($idosc, ".$user->id.", now())"; - - if ($this->db->query($sql) ) - { - $id = $this->db->last_insert_id(MAIN_DB_PREFIX."livre"); - - if ( $this->update($id, $user) ) - { - return $id; - } - } - else - { - print $this->db->error() . ' in ' . $sql; - } - - } - else - { - print $this->db->error() . ' in ' . $sql; - } - - } - else - { - print $this->db->error() . ' in ' . $sql; - } - - } - else - { - print $this->db->error() . ' in ' . $sql; - } - - } - - /* - * - * - * - */ - function linkga($id, $gaid) - { - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."livre_to_auteur (fk_livre, fk_auteur) VALUES ($id, $gaid)"; - - if ( $this->db->query($sql) ) - { - return 1; - } - else - { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - */ - function liste_auteur() - { - $ga = array(); - - $sql = "SELECT a.rowid, a.nom FROM ".MAIN_DB_PREFIX."auteur as a, ".MAIN_DB_PREFIX."livre_to_auteur as l"; - $sql .= " WHERE a.rowid = l.fk_auteur AND l.fk_livre = ".$this->id; - $sql .= " ORDER BY a.nom"; - - if ($this->db->query($sql) ) - { - $nump = $this->db->num_rows(); - - if ($nump) - { - $i = 0; - while ($i < $nump) - { - $obj = $this->db->fetch_object(); - - $ga[$obj->rowid] = $obj->nom; - $i++; - } - } - return $ga; - } - else - { - print $this->db->error(); - } - } - /* - * - * - */ - function auteur_unlink($auteur_id) - { - - $sql = "DELETE FROM ".MAIN_DB_PREFIX."livre_to_auteur "; - - $sql .= " WHERE fk_livre=".$this->id; - $sql .= " AND fk_auteur=".$auteur_id; - - if ( $this->db->query($sql) ) - { - return 1; - } - else - { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - */ - function unlinkcategorie($categories_id) - { - - $sql = "DELETE FROM ".OSC_DB_NAME.".products_to_categories "; - - $sql .= " WHERE products_id=".$this->oscid; - $sql .= " AND categories_id=".$categories_id; - - if ( $this->db->query($sql) ) - { - return 1; - } - else - { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - */ - function linkcategorie($categories_id) - { - - $sql = "INSERT INTO ".OSC_DB_NAME.".products_to_categories "; - - $sql .= " (products_id, categories_id)"; - $sql .= " VALUES (".$this->oscid.",".$categories_id.")"; - - if ( $this->db->query($sql) ) - { - return 1; - } - else - { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - */ - function listcategorie() - { - global $conf; - - $listecat = new Categorie($this->db); - $cats = $listecat->liste_array(); - - $pcat = array(); - - $sql = "SELECT products_id, categories_id"; - $sql .= " FROM ".OSC_DB_NAME.".products_to_categories "; - $sql .= " WHERE products_id = " . $this->oscid; - - if ($this->db->query($sql) ) - { - $nump = $this->db->num_rows(); - - if ($nump) - { - $i = 0; - while ($i < $nump) - { - $obj = $this->db->fetch_object(); - $pcat[$i] = $obj->categories_id; - $i++; - } - } - } - - foreach ($cats as $key => $value) - { - $test = 0; - for ($i = 0 ; $i < $nump ; $i++) - { - if ($pcat[$i] == $key) - { - $test = 1; - } - } - if ($test) - { - print ''; - print 'Supprimer'; - print "$value
"; - } - else - { - print 'Supprimer'; - print "$value
"; - } - } - } - /* - * - * - */ - function update_status($status) - { - $sql = "UPDATE ".OSC_DB_NAME.".products "; - $sql .= " SET products_status = ".$status; - $sql .= " WHERE products_id = " . $this->oscid; - - if ( $this->db->query($sql) ) - { - $sql = "UPDATE ".MAIN_DB_PREFIX."livre "; - $sql .= " SET status = ".$status; - $sql .= " WHERE rowid = " . $this->id; - - if ( $this->db->query($sql) ) - { - return 1; - } - - } - else - { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - * - */ - function updateosc($noupdate_other=0) - { - $desc = trim(addslashes($this->description)); - $desc .= "

"; - - $auteurs = array(); - $auteurs = $this->liste_auteur(); - - - if (sizeof($auteurs)>0) - { - $desc .= 'Auteur(s) :

    '; - - reset($auteurs); - foreach ($auteurs as $key => $value) - { - $auteursid = $key; - $auteur = new Auteur($this->db); - $result = $auteur->fetch($auteursid); - - if ( $result ) - { - $livraut = array(); - $livraut = $auteur->liste_livre('oscid', 1); - - $desc .= '
  • '.addslashes($auteur->nom); - - if (sizeof($livraut) > 1) - { - - $desc .= " : "; - - foreach ($livraut as $lakey => $lavalue) - { - if ($lakey <> $this->oscid) - { - if (!$noupdate_other) - { - $lix = new Livre($this->db); - $lix->fetch(0, $lakey); - $lix->updateosc(1); - } - - $desc .= ''.addslashes($lavalue) . " "; - } - } - } - - $desc .= "
  • "; - } - } - $desc .= "
"; - } - else - { - - } - - - $desc .= '
Année de parution : '.$this->annee; - - - $editeur = new Editeur($this->db); - $result = $editeur->fetch($this->editeurid); - if (result) - { - $desc .= '
Editeur : ' . addslashes($editeur->nom); - } - - - $sql = "UPDATE ".OSC_DB_NAME.".products_description "; - - $sql .= " SET products_name = '".addslashes($this->titre)."'"; - - $sql .= ", products_description = '$desc'"; - - $sql .= " WHERE products_id = " . $this->oscid; - - $this->image = $this->ref.".jpg"; - - if(! file_exists(OSC_CATALOG_DIRECTORY."images/".$this->ref.".jpg")) - { - $this->image = OSC_IMAGE_DEFAULT; - } - - if ( $this->db->query($sql) ) - { - $sql = "UPDATE ".OSC_DB_NAME.".products "; - $sql .= "SET products_model = '".$this->ref."'"; - $sql .= ", products_image = '".$this->image."'"; - $sql .= ", products_price = ".price2num($this->price).""; - if ($this->frais_de_port) - { - $sql .= ", products_weight = ".price2num($this->price).""; - } - else - { - $sql .= ", products_weight = -1"; - } - - $sql .= " WHERE products_id = " . $this->oscid; - - if ( $this->db->query($sql) ) - { - return 1; - } - else - { - print $this->db->error() . ' in
' . $sql; - } - } - else - { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - */ - - /* - * - * - */ - function update($id, $user) - { - - if (strlen($this->annee)==0) - { - $this->annee = 0; - } - - $sql = "UPDATE ".MAIN_DB_PREFIX."livre "; - $sql .= " SET title = '" . trim($this->titre) ."'"; - $sql .= ", ref = '" . trim($this->ref) ."'"; - $sql .= ", prix = " . price2num($this->price).""; - $sql .= ", annee = " . $this->annee ; - $sql .= ", fk_editeur = " . $this->editeurid ; - $sql .= ", description = '" . trim($this->description) ."'"; - $sql .= ", frais_de_port = " . $this->frais_de_port .""; - - $sql .= " WHERE rowid = " . $id; - - if ( $this->db->query($sql) ) - { - return 1; - } - else - { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - * - */ - function fetch ($id, $oscid=0) { - - $sql = "SELECT rowid, fk_editeur, ref, prix, annee, oscid, title, description, frais_de_port FROM ".MAIN_DB_PREFIX."livre"; - if ($id) - { - $sql .= " WHERE rowid = $id"; - } - if ($oscid) - { - $sql .= " WHERE oscid = $oscid"; - } - - $result = $this->db->query($sql) ; - - if ( $result ) - { - $result = $this->db->fetch_array(); - - $this->id = $result["rowid"]; - $this->ref = $result["ref"]; - $this->price = $result["prix"]; - $this->frais_de_port = $result["frais_de_port"]; - $this->annee = $result["annee"]; - $this->editeurid = $result["fk_editeur"]; - $this->titre = stripslashes($result["title"]); - $this->description = stripslashes($result["description"]); - $this->oscid = $result["oscid"]; - - $this->db->free(); - - - $sql = "SELECT products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_date_added"; - $sql .= " FROM ".OSC_DB_NAME.".products WHERE products_id = " . $this->oscid; - - $result = $this->db->query($sql) ; - - if ( $result ) - { - $result = $this->db->fetch_array(); - - $this->status = $result["products_status"]; - $this->image = $result["products_image"]; - - if ($this->status) - { - $this->status_text = "En vente"; - } - else - { - $this->status_text = "Cet article n'est pas en vente"; - } - - $this->db->free(); - } - else - { - print $this->db->error(); - } - } - else - { - print $this->db->error(); - } - - return $result; - } - /* - * - * - */ - function update_image($file_name) - { - $sql = "UPDATE ".OSC_DB_NAME.".products SET products_image='".$file_name."'"; - $sql .= " WHERE products_id = " . $this->oscid; - - $result = $this->db->query($sql) ; - - if ( $result ) - { - } - } - - /* - * - * - */ - function delete() - { - $sql = "DELETE FROM ".OSC_DB_NAME.".products WHERE products_id = ".$this->oscid; - $result = $this->db->query($sql) ; - $sql = "DELETE FROM ".OSC_DB_NAME.".products_to_categories WHERE products_id = ".$this->oscid; - $result = $this->db->query($sql) ; - $sql = "DELETE FROM ".OSC_DB_NAME.".products_description WHERE products_id = ".$this->oscid; - $result = $this->db->query($sql) ; - $sql = "DELETE FROM ".MAIN_DB_PREFIX."livre WHERE rowid = ".$this->id; - $result = $this->db->query($sql) ; - } - - -} -?> diff --git a/htdocs/boutique/livre/pre.inc.php b/htdocs/boutique/livre/pre.inc.php deleted file mode 100644 index 4f82a1a7605..00000000000 --- a/htdocs/boutique/livre/pre.inc.php +++ /dev/null @@ -1,71 +0,0 @@ - - * Copyright (C) 2006 Laurent Destailleur - * - * 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/boutique/livre/pre.inc.php - \brief Fichier gestionnaire du menu de gauche - \version $Revision$ -*/ - -require("../../main.inc.php"); -require("./livre.class.php"); -require("../editeur/editeur.class.php"); -require("../auteur/auteur.class.php"); - -function llxHeader($head = "", $urlp = "") -{ - global $user, $conf; - - /* - * - * - */ - top_menu($head); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/boutique/livre/", "Livres"); - - $menu->add_submenu(DOL_URL_ROOT."/boutique/livre/fiche.php?&action=create","Nouvel ouvrage"); - - $menu->add_submenu(DOL_URL_ROOT."/boutique/livre/vignettes.php","Vignettes manquantes"); - - $menu->add(DOL_URL_ROOT."/boutique/auteur/", "Auteurs"); - - $menu->add_submenu(DOL_URL_ROOT."/boutique/auteur/fiche.php?&action=create","Nouvel auteur"); - - $menu->add(DOL_URL_ROOT."/boutique/editeur/", "Editeurs"); - - $menu->add_submenu(DOL_URL_ROOT."/boutique/editeur/fiche.php?&action=create","Nouvel éditeur"); - - $menu->add(DOL_URL_ROOT."/product/categorie/", "Catégories"); - - $menu->add(DOL_URL_ROOT."/product/promotion/", "Promotions"); - - if (defined("MAIN_MODULE_POSTNUKE") && MAIN_MODULE_POSTNUKE) - { - $menu->add(DOL_URL_ROOT."/postnuke/articles/", "Editorial"); - } - - left_menu($menu->liste); -} -?> diff --git a/htdocs/boutique/livre/vignettes.php b/htdocs/boutique/livre/vignettes.php deleted file mode 100644 index bdcb630d176..00000000000 --- a/htdocs/boutique/livre/vignettes.php +++ /dev/null @@ -1,114 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * - * 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$ - * - */ - -require("./pre.inc.php"); - -llxHeader(); - -if ($sortfield == "") -{ - $sortfield="lower(l.ref)"; -} -if ($sortorder == "") -{ - $sortorder="ASC"; -} - -if ($page == -1) { $page = 0 ; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; - -$form = '
'. -''. -''. -'Titre :  '. -'
'; - - -print_barre_liste("Liste des vignettes manquantes", $page, "vignettes.php", "", $sortfield, $sortorder, $form); - -$sql = "SELECT l.rowid, l.title, l.oscid, l.ref, l.status FROM ".MAIN_DB_PREFIX."livre as l"; - -if ($searchvalue) -{ - $sql .= " WHERE l.title like '%$searchvalue%'"; -} - -$sql .= " ORDER BY $sortfield $sortorder "; -//$sql .= $db->plimit( $limit ,$offset); - -if ( $db->query($sql) ) -{ - $num = $db->num_rows(); - $i = 0; - print ""; - print ""; - print_liste_field_titre($langs->trans("Ref"),"vignettes.php", "l.ref"); - print_liste_field_titre($langs->trans("Title"),"vignettes.php", "l.title"); - print ''; - print "\n"; - $var=True; - while ($i < $num) { - $objp = $db->fetch_object(); - - if(! file_exists(OSC_CATALOG_DIRECTORY."images/".$objp->ref.".jpg")) - { - $var=!$var; - print ""; - print '\n"; - print "\n"; - - - if ($objp->status == 1) - { - print ''; - print ''; - print ''; - - } - else - { - print ''; - print ''; - print ''; - } - - print "\n"; - - } - $i++; - } - print "
 
Fiche livre '; - - print "rowid\">$objp->refrowid\">$objp->titleFiche en ligne 
"; - $db->free(); -} -else -{ - dolibarr_print_error($db); -} - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/boutique/newsletter/fiche.php b/htdocs/boutique/newsletter/fiche.php deleted file mode 100644 index c018fc1348d..00000000000 --- a/htdocs/boutique/newsletter/fiche.php +++ /dev/null @@ -1,275 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * - * 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/boutique/newsletter/fiche.php - \ingroup boutique - \brief Fiche newsletter - \version $Revision$ -*/ - -require("./pre.inc.php"); - -if ($_POST["action"] == 'add') { - $newsletter = new Newsletter($db); - - $newsletter->email_subject = $_POST["email_subject"]; - $newsletter->email_from_name = $_POST["email_from_name"]; - $newsletter->email_from_email = $_POST["email_from_email"]; - $newsletter->email_replyto = $_POST["email_replyto"]; - $newsletter->email_body = $_POST["email_body"]; - - $id = $newsletter->create($user); -} - -if ($_POST["action"] == 'addga') { - $newsletter = new Newsletter($db); - - $newsletter->linkga($id, $ga); -} - -if ($_POST["action"] == 'update' && !$cancel) -{ - $newsletter = new Newsletter($db); - - $newsletter->email_subject = $_POST["email_subject"]; - $newsletter->email_from_name = $_POST["email_from_name"]; - $newsletter->email_from_email = $_POST["email_from_email"]; - $newsletter->email_replyto = $_POST["email_replyto"]; - $newsletter->email_body = $_POST["email_body"]; - - $newsletter->update($id, $user); -} - -if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes) -{ - $newsletter = new Newsletter($db); - $result = $newsletter->fetch($id); - $newsletter->delete(); - Header("Location: index.php"); -} - -if ($_POST["action"] == 'confirm_valid' && $_POST["confirm"] == yes) -{ - $newsletter = new Newsletter($db); - $result = $newsletter->fetch($id); - $newsletter->validate($user); -} - -if ($_POST["action"] == 'confirm_send' && $_POST["confirm"] == yes) -{ - $newsletter = new Newsletter($db); - $result = $newsletter->fetch($id); - $newsletter->send($user); -} - - -llxHeader(); - -/* - * - * - */ -if ($action == 'create') -{ - - print "
\n"; - print ''; - - print '
Nouvelle Newsletter

'; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
Emetteur nom
Emetteur email
Email de réponse (facultatif)
Sujet
Cible
Texte
'; - print '
'; - -} -else -{ - if ($id) - { - - $newsletter = new Newsletter($db); - $result = $newsletter->fetch($id); - - if ( $result ) - { - - /* - * Confirmation de la suppression de la newsletter - * - */ - if ($action == 'delete') - { - $htmls = new Form($db); - $htmls->form_confirm("fiche.php?id=$id","Supprimer une newsletter","Etes-vous sur de vouloir supprimer cet newsletter ?","confirm_delete"); - } - - /* - * Confirmation de la validation - * - */ - if ($action == 'valid') - { - $htmls = new Form($db); - $htmls->form_confirm('fiche.php?id='.$id,"Valider une newsletter","Etes-vous sûr de vouloir valider cette newsletter ?"); - } - /* - * - * - */ - if ($action == 'send') - { - - print '
'; - print ''; - print ''; - - print ''; - - print '\n"; - print ''; - print '
Envoi de newsletter
Etes-vous sur de vouloir envoyer cette newsletter ?'; - $htmls = new Form($db); - - $htmls->selectyesno("confirm","no"); - - print "
'; - print "
\n"; - } - - /* - * Edition de la fiche - * - */ - - - if ($action == 'edit') - { - print '
Edition de la fiche Newsletter : '.$newsletter->titre.'

'; - - print "
\n"; - print ''; - - print ''; - - print ''; - print ''; - print ''; - - print ""; - print ''; - print ''; - - print ''; - - print ''; - - print ''; - - print '
Emetteur nom
Emetteur email
Email de réponse
Sujet
Texte
 

'; - - } - - /* - * Affichage de la fiche - * - */ - - print '
Fiche Newsletter : '.$newsletter->titre.'

'; - - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - - print "
Emetteur nom'.$newsletter->email_from_name.'
Emetteur email'.$newsletter->email_from_email.'
Email de réponse'.$newsletter->email_replyto.'
Nom'.$newsletter->email_subject.'
Texte'.nl2br($newsletter->email_body).'
"; - - if ($newsletter->status == 3) - { - print "
"; - print ''; - - print ''; - print ''; - - print ''; - print ''; - print "
Début de l\'envoi'.strftime("%d %B %Y %H:%M:%S",$newsletter->date_send_begin).'Nombre de mails envoyés'.$newsletter->nbsent.'
Fin de l\'envoi'.strftime("%d %B %Y %H:%M:%S",$newsletter->date_send_end).'Nombre de mails en erreur'.$newsletter->nberror.'
"; - } - - } - else - { - print "Fetch failed"; - } - - - } - else - { - print "Error"; - } -} - -/* ************************************************************************** */ -/* */ -/* Barre d'action */ -/* */ -/* ************************************************************************** */ - -print '
'; -if ($newsletter->status == 0) -{ - print ''.$langs->trans("Edit").''; -} - -if ($newsletter->status == 0 && $id) -{ - print ''.$langs->trans("Valid").''; -} - -if ($newsletter->status == 1) -{ - print ''.$langs->trans("Send").''; -} - -if($id && $newsletter->status == 0) -{ - print ''.$langs->trans("Delete").''; -} -print '
'; - - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/boutique/newsletter/index.php b/htdocs/boutique/newsletter/index.php deleted file mode 100644 index 4953267e280..00000000000 --- a/htdocs/boutique/newsletter/index.php +++ /dev/null @@ -1,83 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * - * 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$ - * - */ - -require("./pre.inc.php"); - -llxHeader(); - -if ($sortfield == "") { - $sortfield="datec"; -} -if ($sortorder == "") { - $sortorder="DESC"; -} - - -if ($page == -1) { $page = 0 ; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; - -print_barre_liste("Liste des Newsletter", $page, "index.php"); - -$sql = "SELECT rowid, email_subject, email_from_name, email_from_email, email_replyto, email_body, target, sql_target, status, date_send_request, date_send_begin, date_send_end, nbsent"; -$sql .= " FROM ".MAIN_DB_PREFIX."newsletter"; -$sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); - -if ( $db->query($sql) ) -{ - $num = $db->num_rows(); - $i = 0; - print ""; - print ""; - print_liste_field_titre($langs->trans("Subject"),"index.php", "email_subject"); - print ''; - print ''; - print "\n"; - $var=True; - while ($i < $num) - { - $objp = $db->fetch_object(); - $var=!$var; - print ""; - - print '\n"; - print ''; - print ''; - print "\n"; - $i++; - } - print "
'.$langs->trans("Status").'Nb envois
Fiche '; - - print "rowid\">$objp->email_subject'.$objp->status.''.$objp->nbsent.'
"; - $db->free(); -} -else -{ - dolibarr_print_error($db); -} - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/boutique/newsletter/newsletter.class.php b/htdocs/boutique/newsletter/newsletter.class.php deleted file mode 100644 index c43c7c49d30..00000000000 --- a/htdocs/boutique/newsletter/newsletter.class.php +++ /dev/null @@ -1,217 +0,0 @@ - - * - * 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$ - * - */ - -class Newsletter { - var $db ; - - var $id ; - var $email_from_name; - var $email_from_email; - var $email_replyto; - var $email_body; - var $status; - - function Newsletter($DB, $id=0) { - $this->db = $DB; - $this->id = $id ; - - $statustext[0] = "Rédaction"; - $statustext[1] = "Validé"; - $statustext[2] = "Envoi en cours"; - $statustext[3] = "Envoyé"; - $statustext[4] = "Non envoyé (erreur)"; - - } - /* - * - * - * - */ - function create($user) { - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."newsletter (fk_user_author, datec, nbsent) VALUES (".$user->id.",now(), 0)"; - - if ($this->db->query($sql) ) - { - $id = $this->db->last_insert_id(MAIN_DB_PREFIX."newsletter"); - - if ( $this->update($id, $user) ) - { - return $id; - } - } - } - - /* - * - * - */ - function update($id, $user) - { - - if (strlen(trim($this->email_replyto))==0) - { - $this->email_replyto = $this->email_from_email; - } - $this->target = 1; - - $this->target_sql = $this->build_sql($this->target); - - $sql = "UPDATE ".MAIN_DB_PREFIX."newsletter "; - $sql .= " SET email_subject = '" . trim($this->email_subject) ."'"; - $sql .= ", email_from_name = '" . trim($this->email_from_name) ."'"; - $sql .= ", email_from_email = '" . trim($this->email_from_email) ."'"; - $sql .= ", email_replyto = '" . trim($this->email_replyto) ."'"; - $sql .= ", email_body= '" . trim($this->email_body) ."'"; - $sql .= ", target = ".$this->target; - $sql .= ", sql_target = '".$this->target_sql."'"; - $sql .= " WHERE rowid = " . $id; - - if ( $this->db->query($sql) ) { - return 1; - } else { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - * - */ - function fetch ($id) { - - $sql = "SELECT rowid, email_subject, email_from_name, email_from_email, email_replyto, email_body, target, sql_target, status, date_send_request,".$this->db->pdate("date_send_begin")." as date_send_begin,".$this->db->pdate("date_send_end")." as date_send_end, nbsent, nberror"; - $sql .= " FROM ".MAIN_DB_PREFIX."newsletter WHERE rowid=$id"; - - $result = $this->db->query($sql) ; - - if ( $result ) - { - $result = $this->db->fetch_array(); - - $this->id = $result["rowid"]; - $this->email_subject = stripslashes($result["email_subject"]); - $this->email_from_name = stripslashes($result["email_from_name"]); - $this->email_from_email = stripslashes($result["email_from_email"]); - $this->email_replyto = stripslashes($result["email_replyto"]); - $this->email_body = stripslashes($result["email_body"]); - $this->status = $result["status"]; - $this->nbsent = $result["nbsent"]; - $this->nberror = $result["nberror"]; - $this->date_send_end = $result["date_send_end"]; - $this->date_send_begin = $result["date_send_begin"]; - - $this->status_text = $statustext[$this->status]; - - $this->db->free(); - } - else - { - print $this->db->error(); - } - - return $result; - } - /* - * - * - * - */ - function liste_array () - { - $ga = array(); - - $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."editeur ORDER BY nom"; - - if ($this->db->query($sql) ) - { - $nump = $this->db->num_rows(); - - if ($nump) - { - $i = 0; - while ($i < $nump) - { - $obj = $this->db->fetch_object(); - - $ga[$obj->rowid] = $obj->nom; - $i++; - } - } - return $ga; - } - else - { - print $this->db->error(); - } - - } - /* - * - * - * - */ - function validate($user) { - - $sql = "UPDATE ".MAIN_DB_PREFIX."newsletter SET status=1, fk_user_valid = $user->id WHERE rowid = $this->id"; - $return = $this->db->query($sql) ; - - } - /* - * - * - */ - function send($user) { - - $sql = "UPDATE ".MAIN_DB_PREFIX."newsletter SET status=2, date_send_request=now() WHERE rowid = $this->id"; - $return = $this->db->query($sql) ; - - } - /* - * - * - */ - function build_sql($target) - { - if ($target == 1) - { - - $sql = "SELECT c.customers_lastname as name, c.customers_firstname as firstname, c.customers_email_address as email"; - $sql .= " FROM ".OSC_DB_NAME.".customers as c"; - $sql .= " WHERE c.customers_newsletter=1"; - - } - - return $sql; - } - /* - * - * - */ - function delete() { - - $sql = "DELETE FROM ".MAIN_DB_PREFIX."newsletter WHERE rowid = $this->id "; - $return = $this->db->query($sql) ; - - } -} -?> diff --git a/htdocs/boutique/newsletter/pre.inc.php b/htdocs/boutique/newsletter/pre.inc.php deleted file mode 100644 index fbc55caa15b..00000000000 --- a/htdocs/boutique/newsletter/pre.inc.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * 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$ - * - */ -require("../../main.inc.php"); -require("./newsletter.class.php"); - -function llxHeader($head = "", $urlp = "") { - global $user, $conf; - - /* - * - * - */ - top_menu($head); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/boutique/client/", "Clients"); - - $menu->add(DOL_URL_ROOT."/boutique/commande/", "Commandes"); - - $menu->add(DOL_URL_ROOT."/boutique/notification/", "Notifications"); - - $menu->add_submenu(DOL_URL_ROOT."/boutique/notification/produits.php", "Produits"); - - $menu->add(DOL_URL_ROOT."/boutique/newsletter/", "Newsletter"); - - $menu->add_submenu(DOL_URL_ROOT."/boutique/newsletter/fiche.php?action=create", "Nouvelle newsletter"); - - left_menu($menu->liste); - /* - * - * - */ - -} -?> diff --git a/htdocs/boutique/promotion/index.php b/htdocs/boutique/promotion/index.php index 3d57cb176b5..0d0c3d5ed06 100644 --- a/htdocs/boutique/promotion/index.php +++ b/htdocs/boutique/promotion/index.php @@ -18,9 +18,15 @@ * * $Id$ * $Source$ - * */ +/** + \file htdocs/boutique/promotions/fiche.php + \ingroup boutique + \brief Page gestion promotions OSCommerce + \version $Revision$ +*/ + require("./pre.inc.php"); llxHeader(); @@ -60,9 +66,10 @@ $sql .= " WHERE s.products_id = pd.products_id AND pd.products_id = p.products_i $sql .= " ORDER BY $sortfield $sortorder "; $sql .= $db->plimit( $limit ,$offset); -if ( $db->query($sql) ) +$resql=$db->query($sql); +if ($resql) { - $num = $db->num_rows(); + $num = $db->num_rows($resql); $i = 0; print ''; print ""; @@ -107,11 +114,10 @@ if ( $db->query($sql) ) } else { - print $db->error(); + dolibarr_print_error($db); } $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); - +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/boutique/promotion/pre.inc.php b/htdocs/boutique/promotion/pre.inc.php index b35a4c04141..057356368bc 100644 --- a/htdocs/boutique/promotion/pre.inc.php +++ b/htdocs/boutique/promotion/pre.inc.php @@ -32,7 +32,8 @@ require("./promotion.class.php"); function llxHeader($head = "", $urlp = "") { - global $user, $conf; + global $user,$conf, $langs; + $langs->load("shop"); top_menu($head);