diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 829303d24b6..e7a81279faf 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 7727f936a8a..1bee0deef06 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 789f9d8d59d..82842241aba 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index afb4943938f..c2246e25e13 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 13a7c854e83..f35eef642aa 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); diff --git a/htdocs/product/stats/fiche.php b/htdocs/product/stats/fiche.php index d150b12fd49..ff192cde942 100644 --- a/htdocs/product/stats/fiche.php +++ b/htdocs/product/stats/fiche.php @@ -26,7 +26,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/dolgraph.class.php"); diff --git a/htdocs/product/stats/index.php b/htdocs/product/stats/index.php index 7739bbdc4c8..6f2563ee2d0 100644 --- a/htdocs/product/stats/index.php +++ b/htdocs/product/stats/index.php @@ -19,12 +19,12 @@ */ /** - \file htdocs/product/stats/index.php - \brief Page accueil statistiques produits - \version $Id$ -*/ + * \file htdocs/product/stats/index.php + * \brief Page accueil statistiques produits + * \version $Id$ + s*/ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); // Security check @@ -117,8 +117,8 @@ if ($conf->service->enabled) $sql = "SELECT count(*)"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " WHERE p.envente = 0"; - if (!$user->rights->produit->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; - if (!$user->rights->service->voir) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)'; + if (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; + if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)'; $sql.= " AND p.fk_product_type = '1'"; $sql.= " AND p.entity = ".$conf->entity; diff --git a/htdocs/product/stats/pre.inc.php b/htdocs/product/stats/pre.inc.php deleted file mode 100644 index e276470c119..00000000000 --- a/htdocs/product/stats/pre.inc.php +++ /dev/null @@ -1,102 +0,0 @@ - - * Copyright (C) 2004-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. - */ - -/** - \file htdocs/product/stats/pre.inc.php - \ingroup product,service - \brief Fichier gestionnaire du menu gauche des statistiques de produits et services - \version $Id$ -*/ - -require("../../main.inc.php"); - - -function llxHeader($head = "", $urlp = "", $title="") -{ - global $user, $conf, $langs; - $langs->load("products"); - - top_menu($head, $title); - - $menu = new Menu(); - - // Products - if ($conf->produit->enabled) - { - $menu->add(DOL_URL_ROOT."/product/index.php?type=0", $langs->trans("Products")); - $menu->add_submenu(DOL_URL_ROOT."/product/liste.php?type=0", $langs->trans("List")); - - if ($user->societe_id == 0 && ($user->rights->produit->creer || $user->rights->service->creer)) - { - $menu->add_submenu(DOL_URL_ROOT."/product/fiche.php?action=create&type=0", $langs->trans("NewProduct")); - } - } - - // Services - if ($conf->service->enabled) - { - $menu->add(DOL_URL_ROOT."/product/index.php?type=1", $langs->trans("Services")); - $menu->add_submenu(DOL_URL_ROOT."/product/liste.php?type=1", $langs->trans("List")); - if ($user->societe_id == 0 && ($user->rights->produit->creer || $user->rights->service->creer)) - { - $menu->add_submenu(DOL_URL_ROOT."/product/fiche.php?action=create&type=1", $langs->trans("NewService")); - } - } - - if ($conf->boutique->enabled) - { - - $menu->add(DOL_URL_ROOT."/product/osc-liste.php", "Osc"); - $menu->add_submenu(DOL_URL_ROOT."/product/osc-liste.php?reqstock=epuise", "Produits Epuis�s"); - - - $menu->add(DOL_URL_ROOT."/product/osc-reviews.php", "Critiques"); - - $menu->add_submenu(DOL_URL_ROOT."/product/osc-productsbyreviews.php", "Meilleurs produits"); - - $menu->add(DOL_URL_ROOT."/product/album/", "Albums"); - $menu->add(DOL_URL_ROOT."/product/groupart/", "Groupes/Artistes"); - - $menu->add(DOL_URL_ROOT."/product/categorie/", $langs->trans("Categories")); - } - - if ($conf->fournisseur->enabled) { - $langs->load("suppliers"); - $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); - } - - $menu->add(DOL_URL_ROOT."/product/stats/", $langs->trans("Statistics")); - if ($conf->propal->enabled) - { - $menu->add_submenu(DOL_URL_ROOT."/product/popuprop.php", $langs->trans("Popularity")); - } - - if ($conf->stock->enabled) - { - $menu->add(DOL_URL_ROOT."/product/stock/", $langs->trans("Stock")); - } - - if ($conf->categorie->enabled) - { - $menu->add(DOL_URL_ROOT."/categories/", $langs->trans("Categories")); - } - - left_menu($menu->liste); -} -?> diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 5b490c6aa07..04f456ef5f6 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -26,7 +26,7 @@ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); diff --git a/htdocs/product/stock/fiche-valo.php b/htdocs/product/stock/fiche-valo.php index b13bd4187c6..d4f19fe65aa 100644 --- a/htdocs/product/stock/fiche-valo.php +++ b/htdocs/product/stock/fiche-valo.php @@ -24,7 +24,8 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/stock.lib.php"); $langs->load("products"); diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index b9c433c0ea3..0f58b5151dd 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -26,10 +26,11 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php"); +require_once(DOL_DOCUMENT_ROOT."/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/stock.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/product.class.php"); $langs->load("products"); $langs->load("stocks"); diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index a269b0a1b96..3d283f2914c 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -27,8 +27,8 @@ * \version $Revision$ */ -require_once("./pre.inc.php"); -require_once("./entrepot.class.php"); +require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php"); $langs->load("stocks"); diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php index 45c0c69a0e2..7bc22b42a4d 100644 --- a/htdocs/product/stock/info.php +++ b/htdocs/product/stock/info.php @@ -23,7 +23,8 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/stock.lib.php"); diff --git a/htdocs/product/stock/liste.php b/htdocs/product/stock/liste.php index 7a7e14af43e..4a1e3a7693d 100644 --- a/htdocs/product/stock/liste.php +++ b/htdocs/product/stock/liste.php @@ -19,14 +19,14 @@ */ /** - \file htdocs/product/stock/liste.php - \ingroup stock - \brief Page liste des stocks - \version $Id$ -*/ + * \file htdocs/product/stock/liste.php + * \ingroup stock + * \brief Page liste des stocks + * \version $Id$ + */ -require("./pre.inc.php"); -require_once("./entrepot.class.php"); +require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php"); $langs->load("stocks"); diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 0c8a92a2dc8..f6143637e8e 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -25,11 +25,11 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/stock.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); $langs->load("products"); diff --git a/htdocs/product/stock/pre.inc.php b/htdocs/product/stock/pre.inc.php deleted file mode 100644 index 137a9a8d470..00000000000 --- a/htdocs/product/stock/pre.inc.php +++ /dev/null @@ -1,50 +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. - */ - -/** - * \file htdocs/product/stock/pre.inc.php - * \ingroup stock - * \brief Fichier gestionnaire du menu gauche de stocks - * \version $Id$ - */ - -require("../../main.inc.php"); -require("./entrepot.class.php"); - -function llxHeader($head="", $title="", $help_url="") -{ - global $langs,$conf,$user; - - top_menu($head, $title); - - $langs->load("stocks"); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/product/stock/", $langs->trans("Stock")); - - $menu->add_submenu(DOL_URL_ROOT."/product/stock/fiche.php?action=create", $langs->trans("MenuNewWarehouse")); - $menu->add_submenu(DOL_URL_ROOT."/product/stock/liste.php", $langs->trans("List")); - $menu->add_submenu(DOL_URL_ROOT."/product/stock/valo.php", $langs->trans("EnhancedValue")); - $menu->add_submenu(DOL_URL_ROOT."/product/reassort.php?type=0", $langs->trans("Restock")); - - $menu->add(DOL_URL_ROOT."/product/stock/mouvement.php", $langs->trans("Movements")); - left_menu($menu->liste, $help_url); -} -?> diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 21917537475..64c438a2330 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -27,9 +27,10 @@ * \version $Id$ */ -require("./pre.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); +require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); require_once(DOL_DOCUMENT_ROOT."/html.formproduct.class.php"); $langs->load("products"); diff --git a/htdocs/product/stock/user.php b/htdocs/product/stock/user.php index 2223a79caea..57f923082d9 100644 --- a/htdocs/product/stock/user.php +++ b/htdocs/product/stock/user.php @@ -26,7 +26,8 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/stock.lib.php"); diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php index 32c215971d7..351a9e1c446 100644 --- a/htdocs/product/stock/valo.php +++ b/htdocs/product/stock/valo.php @@ -25,8 +25,8 @@ * \version $Id$ */ -require("./pre.inc.php"); -require_once("./entrepot.class.php"); +require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php"); $langs->load("stocks");