From ed44821987d53ab84e6274ca7a8cfde842feb96f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 1 Mar 2010 09:37:12 +0000 Subject: [PATCH] Qual: First change to remove pre.inc.php --- htdocs/categories/categorie.php | 2 +- htdocs/categories/docreate.php | 19 ++++----- htdocs/categories/domodif.php | 23 +++++------ htdocs/categories/edit.php | 3 +- htdocs/categories/fiche.php | 2 +- htdocs/categories/index.php | 3 +- htdocs/categories/liste.php | 13 ++++--- htdocs/categories/photos.php | 4 +- htdocs/categories/pre.inc.php | 68 --------------------------------- htdocs/categories/viewcat.php | 3 +- 10 files changed, 39 insertions(+), 101 deletions(-) delete mode 100644 htdocs/categories/pre.inc.php diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 51bc8577e32..b470e896474 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -27,7 +27,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); $langs->load("categories"); diff --git a/htdocs/categories/docreate.php b/htdocs/categories/docreate.php index 9d572a55c74..bf959a9f3f9 100644 --- a/htdocs/categories/docreate.php +++ b/htdocs/categories/docreate.php @@ -20,13 +20,14 @@ */ /** - \file htdocs/categories/docreate.php - \ingroup category - \brief Page de creation categorie - \version $Revision$ -*/ + * \file htdocs/categories/docreate.php + * \ingroup category + * \brief Page de creation categorie + * \version $Revision$ + */ -require "./pre.inc.php"; +require("../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); $langs->load("categories"); @@ -58,11 +59,11 @@ $res = $categorie->create(); if ($res < 0) { - print "

Impossible d'ajouter la catégorie ".$categorie->label.".

"; + print "

Impossible d'ajouter la cat�gorie ".$categorie->label.".

"; } else { - print "

La catégorie ".$categorie->label." a été ajoutée avec succès.

"; + print "

La cat�gorie ".$categorie->label." a �t� ajout�e avec succ�s.

"; foreach ($cats_meres as $id) { @@ -71,7 +72,7 @@ $res = $categorie->create(); if ($res < 0) { - print "

Impossible d'associer la catégorie à \"".$mere->label."\" ($res).

"; + print "

Impossible d'associer la cat�gorie � \"".$mere->label."\" ($res).

"; } } } diff --git a/htdocs/categories/domodif.php b/htdocs/categories/domodif.php index 46e45a0d4cf..0e1f02ee812 100644 --- a/htdocs/categories/domodif.php +++ b/htdocs/categories/domodif.php @@ -23,7 +23,8 @@ \version $Revision$ */ -require "./pre.inc.php"; +require("../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); if (!isset ($_REQUEST["id"]) || !isset ($_REQUEST["nom"]) || !isset ($_REQUEST["description"])) accessforbidden(); @@ -47,10 +48,10 @@ $cat->label = $_REQUEST["nom"]; $cat->description = $_REQUEST["description"]; $new_cats_meres = isset ($_REQUEST['cats_meres']) ? $_REQUEST['cats_meres'] : array (); -// tableau d'id de catégories +// tableau d'id de categories $old_objs_meres = $cat->get_meres (); -// tableau d'objets catégorie +// tableau d'objets categorie $old_cats_meres = array (); foreach ($old_objs_meres as $old_obj_mere) @@ -58,8 +59,8 @@ foreach ($old_objs_meres as $old_obj_mere) $old_cats_meres[] = $old_obj_mere->id; } -$asupprimer = array (); // tableaux des catégories mères -$aajouter = array (); // à ajouter ou à supprimer +$asupprimer = array (); // tableaux des categories meres +$aajouter = array (); // a ajouter ou a supprimer foreach ($old_cats_meres as $old_cat) { @@ -80,22 +81,22 @@ foreach ($new_cats_meres as $new_cat) $res = $cat->update (); if ($res < 0) { - print "

Impossible de modifier la catégorie ".$cat->label.".

"; + print "

Impossible de modifier la categorie ".$cat->label.".

"; } else { - print "

La catégorie ".$cat->label." a été modifiée avec succès.

"; + print "

La categorie ".$cat->label." a ete modifiee avec succes.

"; foreach ($asupprimer as $old_mere) { $res = $old_mere->del_fille ($cat); if ($res < 0) { - print "

Impossible d'enlever la catégorie de \"".$old_mere->label."\" ($res).

\n"; + print "

Impossible d'enlever la categorie de \"".$old_mere->label."\" ($res).

\n"; } else { - print "

La catégorie ne fait plus partie de ".$old_mere->label.".

\n"; + print "

La categorie ne fait plus partie de ".$old_mere->label.".

\n"; } } @@ -104,11 +105,11 @@ else $res = $new_mere->add_fille ($cat); if ($res < 0) { - print "

Impossible d'ajouter la catégorie à \"".$new_mere->label."\" ($res).

"; + print "

Impossible d'ajouter la categorie a \"".$new_mere->label."\" ($res).

"; } else { - print "

La catégorie fait maintenant partie de ".$new_mere->label.".

\n"; + print "

La categorie fait maintenant partie de ".$new_mere->label.".

\n"; } } } diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index d8186af1cd5..ea38852497a 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -26,7 +26,8 @@ * \version $Id$ */ -require "./pre.inc.php"; +require("../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); // If socid provided by ajax company selector if (! empty($_REQUEST['socid_id'])) diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index fcac046af54..9a9e45b2750 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -26,7 +26,7 @@ * \version $Id$ */ -require "./pre.inc.php"; +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); // If socid provided by ajax company selector diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index a605a34615b..9551cb14044 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -27,7 +27,8 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/treeview.lib.php"); $type=isset($_GET['type'])?$_GET['type']:$_POST['type']; diff --git a/htdocs/categories/liste.php b/htdocs/categories/liste.php index bfcf927a14d..0484b226b62 100644 --- a/htdocs/categories/liste.php +++ b/htdocs/categories/liste.php @@ -18,13 +18,14 @@ */ /** - \file htdocs/categories/liste.php - \ingroup category - \brief Page liste des categories - \version $Id$ -*/ + * \file htdocs/categories/liste.php + * \ingroup category + * \brief Page liste des categories + * \version $Id$ + */ -require "./pre.inc.php"; +require("../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); if (!$user->rights->categorie->lire) accessforbidden(); diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 2f662796251..30ff419faa6 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -26,8 +26,8 @@ * \version $Id$ */ -require("./pre.inc.php"); - +require("../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); $langs->load("category"); diff --git a/htdocs/categories/pre.inc.php b/htdocs/categories/pre.inc.php deleted file mode 100644 index 07a678be5aa..00000000000 --- a/htdocs/categories/pre.inc.php +++ /dev/null @@ -1,68 +0,0 @@ - - * Copyright (C) 2005 Davoleau Brice - * Copyright (C) 2005 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. - */ - -/** - \file htdocs/categories/pre.inc.php - \ingroup product,service - \brief Fichier gestionnaire du menu gauche des produits et services - \version $Id$ -*/ - -require "../main.inc.php"; -require_once DOL_DOCUMENT_ROOT."/categories/categorie.class.php"; - -$langs->load("categories"); - -function llxHeader ($head = "", $urlp = "", $title="") -{ - global $user, $conf, $langs; - - - top_menu($head, $title); - - $menu = new Menu(); - - if ($conf->categorie->enabled) - { - $langs->load("customers"); - $langs->load("suppliers"); - $menu->add(DOL_URL_ROOT."/categories/index.php?type=0", $langs->trans("ProductsCategoriesShort")); - $menu->add_submenu(DOL_URL_ROOT."/categories/liste.php?type=0", $langs->trans("List")); - if ($user->rights->categorie->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/categories/fiche.php?action=create&type=0", $langs->trans("NewCat")); - } - $menu->add(DOL_URL_ROOT."/categories/index.php?type=1", $langs->trans("SuppliersCategoriesShort")); - $menu->add_submenu(DOL_URL_ROOT."/categories/liste.php?type=1", $langs->trans("List")); - if ($user->rights->categorie->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/categories/fiche.php?action=create&type=1", $langs->trans("NewCat")); - } - $menu->add(DOL_URL_ROOT."/categories/index.php?type=2", $langs->trans("CustomersProspectsCategoriesShort")); - $menu->add_submenu(DOL_URL_ROOT."/categories/liste.php?type=2", $langs->trans("List")); - if ($user->rights->categorie->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/categories/fiche.php?action=create&type=2", $langs->trans("NewCat")); - } - } - - left_menu($menu->liste); -} -?> diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index eb518a1ba3c..5d58601971c 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -26,7 +26,8 @@ * \version $Revision$ */ -require("./pre.inc.php"); +require("../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); // Security check if (! $user->rights->categorie->lire)