diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 274ba8fbb90..4047c522200 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -27,7 +27,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("./pre.inc.php"); // We use pre.inc.php to have a dynamic menu require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php"); require_once(DOL_DOCUMENT_ROOT."/societe.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index edb093977fc..b17bb9b5122 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require('./pre.inc.php'); +require("./pre.inc.php"); // We use pre.inc.php to have a dynamic menu require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT.'/paiement.class.php'); require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/remisecheque.class.php'); diff --git a/htdocs/fichinter/apercu.php b/htdocs/fichinter/apercu.php index 4e6ae07f299..9a67d2860bc 100644 --- a/htdocs/fichinter/apercu.php +++ b/htdocs/fichinter/apercu.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fichinter.lib.php"); require_once(DOL_DOCUMENT_ROOT.'/fichinter/fichinter.class.php'); if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/projet/project.class.php"); diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php index c234c8da2b2..e9ebb7812c3 100644 --- a/htdocs/fichinter/contact.php +++ b/htdocs/fichinter/contact.php @@ -24,7 +24,7 @@ * \version $Id$ */ -require ("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/fichinter/fichinter.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fichinter.lib.php"); diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 1244baee525..d9c7093dbfd 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -27,7 +27,7 @@ * \version $Id$ */ -require('./pre.inc.php'); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/fichinter/fichinter.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fichinter.lib.php"); diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index e8f96683ce7..b5155d777a1 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/fichinter/fichinter.class.php"); require_once(DOL_DOCUMENT_ROOT."/includes/modules/fichinter/modules_fichinter.php"); diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index a6f3f97cf19..7fdd27a692d 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/contact/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/fichinter/fichinter.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); diff --git a/htdocs/fichinter/info.php b/htdocs/fichinter/info.php index 0c44b7f7b72..ac31f8c3ad1 100644 --- a/htdocs/fichinter/info.php +++ b/htdocs/fichinter/info.php @@ -24,7 +24,7 @@ * \version $Id$ */ -require('./pre.inc.php'); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); require_once(DOL_DOCUMENT_ROOT."/fichinter/fichinter.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fichinter.lib.php"); diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php index ae95aa27fc1..a2aa079b3b3 100644 --- a/htdocs/fichinter/note.php +++ b/htdocs/fichinter/note.php @@ -23,7 +23,7 @@ * \version $Id$ */ -require('./pre.inc.php'); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/fichinter/fichinter.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fichinter.lib.php"); diff --git a/htdocs/fichinter/pre.inc.php b/htdocs/fichinter/pre.inc.php deleted file mode 100644 index 3c31955f2c8..00000000000 --- a/htdocs/fichinter/pre.inc.php +++ /dev/null @@ -1,40 +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$ - */ - -require("../main.inc.php"); - -$langs->load("interventions"); - -function llxHeader($head = "", $urlp = "") -{ - global $user, $conf, $langs; - - top_menu($head); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/comm/clients.php", $langs->trans("Customers")); - $menu->add("index.php", $langs->trans("Interventions")); - - left_menu($menu->liste); -} - - -?> diff --git a/htdocs/fichinter/rapport.php b/htdocs/fichinter/rapport.php index 616bc1262a4..8418be4b25b 100644 --- a/htdocs/fichinter/rapport.php +++ b/htdocs/fichinter/rapport.php @@ -20,7 +20,7 @@ * $Id$ */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/contact/contact.class.php"); // Security check diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index 707fa5fed84..9a8c15a1818 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require ("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.commande.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact/contact.class.php"); require_once DOL_DOCUMENT_ROOT."/lib/fourn.lib.php"; diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 8983aad1902..fa56fd95b0f 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -26,7 +26,7 @@ * \version $Id$ */ -require('./pre.inc.php'); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/includes/modules/supplier_order/modules_commandefournisseur.php'); require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fourn.lib.php"); diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index f64b3f40d69..46ab96a9434 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -26,7 +26,7 @@ * \version $Id$ */ -require('./pre.inc.php'); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/order.lib.php'); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fourn.lib.php"); diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index db05ede3643..90e4dbdb2a9 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -26,7 +26,7 @@ * \version $Id$ */ -require('./pre.inc.php'); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/html.formorder.class.php"); require_once(DOL_DOCUMENT_ROOT.'/includes/modules/supplier_order/modules_commandefournisseur.php'); diff --git a/htdocs/fourn/commande/history.php b/htdocs/fourn/commande/history.php index 58b297653ee..715b9b12577 100644 --- a/htdocs/fourn/commande/history.php +++ b/htdocs/fourn/commande/history.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fourn.lib.php"); $langs->load("orders"); diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 9eeab916ae6..904f98b8e4e 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -25,7 +25,7 @@ * \version $Revision$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/contact/contact.class.php"); // Security check diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index 54148f2c1c3..58496cbcabe 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); $langs->load("orders"); diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index 886800f6e88..5805088b31c 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fourn.lib.php"); $langs->load("orders"); diff --git a/htdocs/fourn/commande/pre.inc.php b/htdocs/fourn/commande/pre.inc.php deleted file mode 100644 index 805b082a564..00000000000 --- a/htdocs/fourn/commande/pre.inc.php +++ /dev/null @@ -1,69 +0,0 @@ - - * Copyright (C) 2004-2005 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/fourn/commande/pre.inc.php - * \ingroup compta - * \brief Fichier gestionnaire du menu commandes fournisseurs - * \version $Id$ - */ - -require("../../main.inc.php"); -$langs->load("orders"); -$langs->load("suppliers"); -$langs->load("companies"); - -require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.class.php"); -require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.commande.class.php"); - -function llxHeader($head = "", $title = "", $help_url='', $addons='') -{ - global $user, $langs; - $langs->load("orders"); - - - top_menu($head, $title); - - $menu = new Menu(); - - if (is_array($addons)) - { - $menu->add($addons[0][0], $addons[0][1]); - } - if ($user->societe_id == 0 && $user->rights->societe->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); - $menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts")); - } - - $langs->load("bills"); - if ($user->rights->fournisseur->facture->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills")); - } - if ($user->rights->fournisseur->commande->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/commande/", $langs->trans("Orders")); - $menu->add_submenu(DOL_URL_ROOT."/fourn/commande/liste.php", $langs->trans("List")); - } - - left_menu($menu->liste,$help_url); -} - -?> diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php index 7a592d8661d..6c3aa016563 100644 --- a/htdocs/fourn/contact.php +++ b/htdocs/fourn/contact.php @@ -25,14 +25,19 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../main.inc.php"); $langs->load("companies"); + +/* + * View + */ + llxHeader(); /* - * Sécurité accés client + * S�curit� acc�s client */ if ($user->societe_id > 0) { diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index 3513db19436..e038ec0a9f8 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require ("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact/contact.class.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/fourn.lib.php'); diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index f39b56b9780..c167ad761a6 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -26,7 +26,7 @@ * \version $Id$ */ -require('./pre.inc.php'); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.facture.class.php'); require_once(DOL_DOCUMENT_ROOT.'/lib/fourn.lib.php'); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 79328d99bc7..a3439f92bf5 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -27,7 +27,7 @@ * \version $Id$ */ -require_once('./pre.inc.php'); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT.'/fourn/facture/paiementfourn.class.php'); require_once(DOL_DOCUMENT_ROOT.'/lib/fourn.lib.php'); diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index b31724f3d87..680a84ceca9 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/paiement.class.php"); @@ -58,7 +58,7 @@ llxHeader('',$langs->trans("BillsSuppliersUnpaid")); $facturestatic=new FactureFournisseur($db); $companystatic=new Societe($db); - + /*************************************************************************** * * * Mode Liste * diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index 9344b377bf2..831e81f58f3 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); if (!$user->rights->fournisseur->facture->lire) accessforbidden(); diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index f2347274536..a1db46e605d 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require('./pre.inc.php'); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/fourn.lib.php'); diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 4465db388eb..0150f3a6871 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/fourn.lib.php'); $langs->load('bills'); diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 33c66c388fc..d0c0dd6253b 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -27,7 +27,7 @@ * \version $Id$ */ -require('./pre.inc.php'); +require("../../main.inc.php"); require(DOL_DOCUMENT_ROOT.'/fourn/facture/paiementfourn.class.php'); $langs->load('companies'); diff --git a/htdocs/fourn/facture/pre.inc.php b/htdocs/fourn/facture/pre.inc.php deleted file mode 100644 index 8e201fc7561..00000000000 --- a/htdocs/fourn/facture/pre.inc.php +++ /dev/null @@ -1,155 +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/fourn/facture/pre.inc.php - \ingroup fournisseur,facture - \brief Fichier gestionnaire du menu factures fournisseurs - \version $Id$ -*/ - -require("../../main.inc.php"); -require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.class.php"; -require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"; - -function llxHeader($head = '', $title = '', $help_url='') -{ - global $user, $conf, $langs; - - $langs->load("suppliers"); - $langs->load("propal"); - - top_menu($head, $title); - - $menu = new Menu(); - - - if ($conf->fournisseur->enabled) - { - if ($user->rights->societe->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); - } - - // S�curit� acc�s client - if ($user->societe_id == 0 && $user->rights->societe->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&type=f",$langs->trans("NewSupplier")); - } - } - - if ($conf->societe->enabled) - { - if ($user->rights->societe->lire) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts")); - } - } - - - $langs->load("bills"); - if ($user->rights->fournisseur->facture->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill")); - } - if ($user->rights->fournisseur->facture->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills")); - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/impayees.php",$langs->trans("Unpaid")); - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments")); - } - - - $langs->load("orders"); - if ($user->rights->fournisseur->commande->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders")); - } - - $langs->load("products"); - if ($conf->produit->enabled || $conf->service->enabled) - { - $menu->add(DOL_URL_ROOT."/product/liste.php?type=0", $langs->trans("Products")); - } - - - $menu = new Menu(); - - - if (is_array($addons)) - { - $menu->add($addons[0][0], $addons[0][1]); - } - - - if ($conf->fournisseur->enabled) - { - if ($user->rights->societe->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); - } - - // S�curit� acc�s client - if ($user->societe_id == 0 && $user->rights->societe->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&type=f",$langs->trans("NewSupplier")); - } - } - - if ($conf->societe->enabled) - { - if ($user->rights->societe->lire) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts")); - } - } - - - $langs->load("bills"); - if ($user->rights->fournisseur->facture->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills")); - } - - - if ($user->rights->fournisseur->facture->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill")); - } - if ($user->rights->fournisseur->facture->lire) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments")); - } - - - if ($user->rights->fournisseur->commande->lire) - { - $langs->load("orders"); - $menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders")); - } - - - if ($conf->produit->enabled || $conf->service->enabled) - { - $menu->add(DOL_URL_ROOT."/product/liste.php?type=0", $langs->trans("Products")); - } - - left_menu($menu->liste, $help_url); -} -?> diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 7946528a6ce..8d33175d9f5 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -27,7 +27,7 @@ * \version $Id$ */ -require('./pre.inc.php'); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/contact/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index e8fa8f63911..1a0d1980392 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.commande.class.php'); require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.facture.class.php'); require_once(DOL_DOCUMENT_ROOT.'/categories/categorie.class.php'); @@ -104,7 +104,7 @@ else if ($conf->fournisseur->enabled) { $langs->load("orders"); - + $sql = "SELECT cf.rowid, cf.ref, cf.total_ttc"; $sql.= ", s.nom, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf"; diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php index a9b2a080ab7..5202431071f 100644 --- a/htdocs/fourn/liste.php +++ b/htdocs/fourn/liste.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php"); $langs->load("suppliers"); diff --git a/htdocs/fourn/paiement/fiche.php b/htdocs/fourn/paiement/fiche.php index c4a84e8e519..88910281642 100644 --- a/htdocs/fourn/paiement/fiche.php +++ b/htdocs/fourn/paiement/fiche.php @@ -27,8 +27,7 @@ */ -require('./pre.inc.php'); - +require("../../main.inc.php"); require(DOL_DOCUMENT_ROOT.'/fourn/facture/paiementfourn.class.php'); diff --git a/htdocs/fourn/paiement/info.php b/htdocs/fourn/paiement/info.php index 9a3cf81089f..4649e3ffb9f 100644 --- a/htdocs/fourn/paiement/info.php +++ b/htdocs/fourn/paiement/info.php @@ -24,7 +24,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); require_once(DOL_DOCUMENT_ROOT."/fourn/facture/paiementfourn.class.php"); diff --git a/htdocs/fourn/paiement/pre.inc.php b/htdocs/fourn/paiement/pre.inc.php deleted file mode 100644 index 288950affb7..00000000000 --- a/htdocs/fourn/paiement/pre.inc.php +++ /dev/null @@ -1,105 +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. - */ - -/** - \file htdocs/fourn/paiement/pre.inc.php - \ingroup fournisseur,facture - \brief Fichier gestionnaire du menu paiements factures fournisseurs - \version $Id$ -*/ - -require("../../main.inc.php"); -require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.class.php"; -require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"; - -function llxHeader($head = "", $title = "", $addons='') { - global $user, $conf, $langs; - - $langs->load("suppliers"); - $langs->load("propal"); - - top_menu($head, $title); - - $menu = new Menu(); - - - if (is_array($addons)) - { - //$menu->add($url, $libelle); - - $menu->add($addons[0][0], $addons[0][1]); - } - - - if ($conf->fournisseur->enabled) - { - if ($user->rights->societe->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); - } - - // S�curit� acc�s client - if ($user->societe_id == 0 && $user->rights->societe->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&type=f",$langs->trans("NewSupplier")); - } - } - - if ($conf->societe->enabled) - { - if ($user->rights->societe->lire) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts")); - } - } - - - $langs->load("bills"); - if ($user->rights->fournisseur->facture->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills")); - } - - - if ($user->rights->fournisseur->facture->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill")); - } - if ($user->rights->fournisseur->facture->lire) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments")); - } - - - $langs->load("orders"); - if ($user->rights->fournisseur->commande->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders")); - } - - - if ($conf->produit->enabled || $conf->service->enabled) - { - $menu->add(DOL_URL_ROOT."/product/liste.php?type=0", $langs->trans("Products")); - } - - left_menu($menu->liste); -} - - -?> diff --git a/htdocs/fourn/pre.inc.php b/htdocs/fourn/pre.inc.php deleted file mode 100644 index 31efe8c3bce..00000000000 --- a/htdocs/fourn/pre.inc.php +++ /dev/null @@ -1,97 +0,0 @@ - - * Copyright (C) 2005-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$ - */ - -/** - \file htdocs/fourn/pre.inc.php - \ingroup fournisseur,facture - \brief Fichier gestionnaire du menu fournisseurs - */ - -require("../main.inc.php"); -require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.class.php"; -require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"; - - - -function llxHeader($head = '', $title='', $help_url='') -{ - global $user, $conf, $langs; - - $langs->load("suppliers"); - $langs->load("propal"); - - top_menu($head, $title); - - $menu = new Menu(); - - if ($conf->fournisseur->enabled && $user->rights->societe->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); - - // S�curit� acc�s client - if ($user->societe_id == 0 && $user->rights->societe->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&type=f",$langs->trans("NewSupplier")); - } - - $menu->add_submenu(DOL_URL_ROOT."/fourn/liste.php",$langs->trans("List")); - - if ($conf->societe->enabled ) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts")); - } - - $menu->add_submenu(DOL_URL_ROOT."/fourn/stats.php",$langs->trans("Statistics")); - } - - $langs->load("bills"); - if ($user->societe_id == 0 && $user->rights->fournisseur->facture->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills")); - } - if ($user->societe_id == 0 && $user->rights->fournisseur->facture->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill")); - } - if ($user->rights->fournisseur->facture->lire) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments")); - } - $langs->load("orders"); - if ($user->rights->fournisseur->commande->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders")); - } - if (($conf->produit->enabled && $user->rights->produit->lire) || ($conf->service->enabled && $user->rights->service->lire)) - { - $menu->add(DOL_URL_ROOT."/product/", $langs->trans("Products")); - } - - if ($conf->categorie->enabled) - { - $langs->load("categories"); - // Cat�gories fournisseurs - $menu->add(DOL_URL_ROOT."/categories/index.php?leftmenu=cat&type=1", $langs->trans("SuppliersCategoriesShort"), 0); - } - - left_menu($menu->liste, $help_url); -} -?> diff --git a/htdocs/fourn/product/categorie.php b/htdocs/fourn/product/categorie.php index 28c113a7ec1..cb7905fe806 100644 --- a/htdocs/fourn/product/categorie.php +++ b/htdocs/fourn/product/categorie.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/product/product.class.php"); $langs->load("categories"); diff --git a/htdocs/fourn/product/fourn.php b/htdocs/fourn/product/fourn.php index 16cba392c30..e369686b46f 100644 --- a/htdocs/fourn/product/fourn.php +++ b/htdocs/fourn/product/fourn.php @@ -23,10 +23,10 @@ * \version $Id$ */ -require("./pre.inc.php"); - +require("../../main.inc.php"); require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.product.class.php"; + if (!$user->rights->produit->lire && !$user->rights->service->lire) accessforbidden(); if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) diff --git a/htdocs/fourn/product/index.php b/htdocs/fourn/product/index.php index b8be16c3b82..7b1964429e1 100644 --- a/htdocs/fourn/product/index.php +++ b/htdocs/fourn/product/index.php @@ -24,8 +24,9 @@ \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); +// Security check if (!$user->rights->produit->lire && !$user->rights->service->lire) accessforbidden(); diff --git a/htdocs/fourn/product/liste.php b/htdocs/fourn/product/liste.php index f0aee52e39b..4a94b37b4b9 100644 --- a/htdocs/fourn/product/liste.php +++ b/htdocs/fourn/product/liste.php @@ -25,7 +25,7 @@ \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/product/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/societe.class.php"); diff --git a/htdocs/fourn/product/photos.php b/htdocs/fourn/product/photos.php index 111103d6359..17b367fc4e4 100644 --- a/htdocs/fourn/product/photos.php +++ b/htdocs/fourn/product/photos.php @@ -24,7 +24,7 @@ \version $Id$ */ -require("./pre.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/product/product.class.php"); diff --git a/htdocs/fourn/product/pre.inc.php b/htdocs/fourn/product/pre.inc.php deleted file mode 100644 index fe6d2f90e26..00000000000 --- a/htdocs/fourn/product/pre.inc.php +++ /dev/null @@ -1,103 +0,0 @@ - - * Copyright (C) 2004-2005 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/fourn/product/pre.inc.php - \ingroup product,service - \brief Fichier gestionnaire du menu gauche des produits et services fournisseurs - \version $Id$ -*/ - -require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.class.php"); -require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); - -$langs->load("suppliers"); -$langs->load("products"); - - -function llxHeader($head = "", $title="", $help_url='',$addons='') -{ - global $db, $user, $conf, $langs; - - - top_menu($head, $title); - - $menu = new Menu(); - - if (is_array($addons)) - { - //$menu->add($url, $libelle); - $menu->add($addons[0][0], $addons[0][1]); - } - - if ($conf->produit->enabled) - { - $menu->add(DOL_URL_ROOT."/fourn/product/", $langs->trans("Products")); - $menu->add_submenu(DOL_URL_ROOT."/fourn/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."/fourn/product/fiche.php?action=create&type=0", $langs->trans("NewProduct")); - } - } - - if ($conf->categorie->enabled) - { - $menu->add(DOL_URL_ROOT."/categories/", $langs->trans("Categories")); - } - - $menu->add('liste.php','Top'); - - if (isset($_REQUEST['catid']) && $_REQUEST['catid']) - { - $catid = $_REQUEST['catid']; - - $c = new Categorie ($db, $catid); - - $menu->add('liste.php?catid='.$c->id, $c->label); - - $cats = $c->get_filles(); - - if (sizeof ($cats) > 0) - { - foreach ($cats as $cat) - { - $menu->add_submenu('liste.php?catid='.$cat->id, $cat->label); - } - } - } - else - { - $c = new Categorie ($db); - $cats = $c->get_main_categories(); - - if (sizeof ($cats) > 0) - { - foreach ($cats as $cat) - { - $menu->add_submenu('liste.php?catid='.$cat->id, $cat->label); - } - } - } - - left_menu($menu->liste, $help_url); -} - -?> diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php index e766656da98..3898baa97f4 100644 --- a/htdocs/fourn/recap-fourn.php +++ b/htdocs/fourn/recap-fourn.php @@ -24,7 +24,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/compta/facture/facture.class.php"); diff --git a/htdocs/fourn/stats.php b/htdocs/fourn/stats.php index 34a1a4330bd..0ccb13399f4 100644 --- a/htdocs/fourn/stats.php +++ b/htdocs/fourn/stats.php @@ -27,7 +27,7 @@ \version $Revision$ */ -require("./pre.inc.php"); +require("../main.inc.php"); $langs->load("suppliers"); $langs->load("orders"); diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index cdfbaa92185..29af4fdc935 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -25,7 +25,7 @@ * \author Laurent Destailleur */ -require("./pre.inc.php"); +require("./pre.inc.php"); // We use pre.inc.php to have a dynamic menu require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/treeview.lib.php"); diff --git a/htdocs/includes/menus/barre_left/eldy.lib.php b/htdocs/includes/menus/barre_left/eldy.lib.php index 06797f69f4e..bd4205ede4a 100644 --- a/htdocs/includes/menus/barre_left/eldy.lib.php +++ b/htdocs/includes/menus/barre_left/eldy.lib.php @@ -550,7 +550,6 @@ function print_left_eldy_menu($db,$menu_array) if ($leftmenu=="ca") $newmenu->add(DOL_URL_ROOT."/compta/stats/prev.php?leftmenu=ca","Pr�visionnel",2,$user->rights->compta->resultat->lire); if ($leftmenu=="ca") $newmenu->add(DOL_URL_ROOT."/compta/stats/comp.php?leftmenu=ca","Transform�",2,$user->rights->compta->resultat->lire); } - if ($leftmenu=="ca") $newmenu->add(DOL_URL_ROOT."/compta/stats/exercices.php?leftmenu=ca",$langs->trans("Evolution"),2,$user->rights->compta->resultat->lire); */ if ($leftmenu=="ca") $newmenu->add(DOL_URL_ROOT."/compta/stats/casoc.php?leftmenu=ca",$langs->trans("ByCompanies"),2,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire); if ($leftmenu=="ca") $newmenu->add(DOL_URL_ROOT."/compta/stats/cabyuser.php?leftmenu=ca",$langs->trans("ByUsers"),2,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);