dolibarr/htdocs/pre.inc.php

191 lines
6.2 KiB
PHP
Raw Normal View History

2004-10-20 23:06:45 +02:00
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 <EFBFBD>ric Seigne <erics@rycks.com>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
2002-04-30 12:56:25 +02:00
*
* 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.
*
2003-03-23 16:50:59 +01:00
* $Id$
* $Source$
2002-04-30 12:56:25 +02:00
*/
2005-08-11 22:04:45 +02:00
/**
\file htdocs/pre.inc.php
\brief Fichier gestionnaire du menu de gauche de l'accueil
\version $Revision$
*/
2003-09-11 22:18:51 +02:00
require ("./main.inc.php");
$user->getrights();
2002-04-30 12:56:25 +02:00
function llxHeader($head = "") {
2005-09-19 19:47:36 +02:00
global $user, $conf, $langs;
2002-04-30 12:56:25 +02:00
2005-09-19 19:47:36 +02:00
top_menu($head);
2002-04-30 12:56:25 +02:00
2005-09-19 19:47:36 +02:00
$menu = new Menu();
2002-04-30 17:36:13 +02:00
2005-09-19 19:47:36 +02:00
if ($conf->societe->enabled && $user->rights->societe->lire)
2002-12-20 00:17:19 +01:00
{
2005-09-19 19:47:36 +02:00
$langs->load("companies");
$menu->add(DOL_URL_ROOT."/societe.php", $langs->trans("Companies"));
if ($user->rights->societe->creer)
{
$menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create", $langs->trans("MenuNewCompany"));
}
2002-12-30 21:41:28 +01:00
2005-09-19 19:47:36 +02:00
if(is_dir("societe/groupe"))
{
$menu->add_submenu(DOL_URL_ROOT."/societe/groupe/index.php", $langs->trans("MenuSocGroup"));
}
$menu->add_submenu(DOL_URL_ROOT."/contact/index.php",$langs->trans("Contacts"));
2002-12-20 00:17:19 +01:00
}
2002-12-13 17:31:44 +01:00
2005-09-19 20:02:16 +02:00
if ($conf->commercial->enabled && $user->rights->commercial->lire)
2002-12-20 00:13:48 +01:00
{
2005-09-19 19:47:36 +02:00
$langs->load("commercial");
$menu->add(DOL_URL_ROOT."/comm/index.php",$langs->trans("Commercial"));
$menu->add_submenu(DOL_URL_ROOT."/comm/clients.php",$langs->trans("Customers"));
$menu->add_submenu(DOL_URL_ROOT."/comm/prospect/prospects.php",$langs->trans("Prospects"));
2002-05-06 21:10:48 +02:00
2005-09-19 19:47:36 +02:00
if ($user->rights->propale->lire)
{
$langs->load("propal");
$menu->add_submenu(DOL_URL_ROOT."/comm/propal.php", $langs->trans("Prop"));
}
2002-12-20 00:17:19 +01:00
}
2002-04-30 12:56:25 +02:00
2005-09-19 20:02:16 +02:00
if ($conf->compta->enabled && $user->rights->general->lire)
2002-12-12 17:29:47 +01:00
{
2005-09-19 19:47:36 +02:00
$langs->load("compta");
$menu->add(DOL_URL_ROOT."/compta/index.php", $langs->trans("Accountancy"));
2002-05-04 01:01:45 +02:00
2005-09-19 19:47:36 +02:00
if ($user->rights->facture->lire) {
$langs->load("bills");
$menu->add_submenu(DOL_URL_ROOT."/compta/facture.php", $langs->trans("Bills"));
}
2002-12-12 17:29:47 +01:00
}
2002-05-04 01:01:45 +02:00
2005-09-19 19:47:36 +02:00
if ($conf->fichinter->enabled && $user->rights->ficheinter->lire)
2002-12-12 17:29:47 +01:00
{
2005-09-19 19:47:36 +02:00
$langs->trans("interventions");
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
2002-12-12 17:29:47 +01:00
}
2002-04-30 12:56:25 +02:00
2005-09-19 19:47:36 +02:00
if (($conf->produit->enabled || $conf->service->enabled) && $user->rights->produit->lire)
2002-12-20 00:04:02 +01:00
{
2005-09-19 19:47:36 +02:00
$langs->load("products");
$chaine="";
if ($conf->produit->enabled) { $chaine.= $langs->trans("Products"); }
if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; }
if ($conf->service->enabled) { $chaine.= $langs->trans("Services"); }
$menu->add(DOL_URL_ROOT."/product/index.php", "$chaine");
2003-03-13 19:27:26 +01:00
2005-09-19 19:47:36 +02:00
if ($conf->boutique->enabled)
{
if ($conf->boutique->livre->enabled)
{
$menu->add_submenu(DOL_URL_ROOT."/boutique/livre/index.php", "Livres");
}
if ($conf->boutique->album->enabled)
{
$menu->add_submenu(DOL_URL_ROOT."/product/album/index.php", "Albums");
}
}
2002-12-20 00:04:02 +01:00
}
2002-04-30 12:56:25 +02:00
2005-09-19 19:47:36 +02:00
if ($conf->commande->enabled && $user->rights->commande->lire)
2003-03-11 17:24:49 +01:00
{
2005-09-19 19:47:36 +02:00
$langs->load("orders");
$menu->add(DOL_URL_ROOT."/commande/index.php", $langs->trans("Orders"));
}
2005-09-19 19:47:36 +02:00
if ($conf->expedition->enabled && $user->rights->expedition->lire)
{
$langs->load("sendings");
$menu->add(DOL_URL_ROOT."/expedition/index.php", $langs->trans("Sendings"));
}
2003-03-11 17:24:49 +01:00
2005-09-19 19:47:36 +02:00
if ($conf->mailing->enabled && $user->rights->mailing->lire)
{
2005-09-19 19:47:36 +02:00
$langs->load("mails");
$menu->add(DOL_URL_ROOT."/comm/mailing/index.php",$langs->trans("EMailings"));
}
2005-02-26 20:04:09 +01:00
2005-09-19 19:47:36 +02:00
if ($conf->telephonie->enabled)
2004-09-10 16:30:51 +02:00
{
2005-09-19 19:47:36 +02:00
$menu->add(DOL_URL_ROOT."/telephonie/index.php", "T<EFBFBD>l<EFBFBD>phonie");
2004-09-10 16:30:51 +02:00
}
2005-09-19 19:47:36 +02:00
if ($conf->don->enabled)
{
2005-09-19 19:47:36 +02:00
$menu->add(DOL_URL_ROOT."/compta/dons/index.php", $langs->trans("Donations"));
}
2002-12-19 19:55:38 +01:00
2005-09-19 19:47:36 +02:00
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire)
{
2005-09-19 19:47:36 +02:00
$langs->load("suppliers");
$menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers"));
}
2002-04-30 12:56:25 +02:00
2005-09-19 19:47:36 +02:00
if ($conf->voyage->enabled && $user->societe_id == 0)
2002-12-19 19:55:38 +01:00
{
2005-09-19 19:47:36 +02:00
$menu->add(DOL_URL_ROOT."/compta/voyage/index.php","Voyages");
$menu->add_submenu(DOL_URL_ROOT."/compta/voyage/index.php","Voyages");
$menu->add_submenu(DOL_URL_ROOT."/compta/voyage/reduc.php","Reduc");
2002-12-19 19:55:38 +01:00
}
2002-05-27 21:21:36 +02:00
2005-09-19 19:47:36 +02:00
if ($conf->domaine->enabled)
2002-12-20 00:04:02 +01:00
{
2005-09-19 19:47:36 +02:00
$menu->add(DOL_URL_ROOT."/domain/index.php", "Domaines");
2002-12-20 00:04:02 +01:00
}
2002-05-27 21:21:36 +02:00
2005-09-19 19:47:36 +02:00
if ($conf->postnuke->enabled)
2003-06-05 17:02:06 +02:00
{
2005-09-19 19:47:36 +02:00
$menu->add(DOL_URL_ROOT."/postnuke/articles/index.php", "Editorial");
2003-06-18 16:12:24 +02:00
}
2005-09-19 20:02:16 +02:00
if ($conf->bookmark->enabled && $user->rights->bookmark->lire)
2005-09-05 21:03:02 +02:00
{
2005-09-19 19:47:36 +02:00
$menu->add(DOL_URL_ROOT."/bookmarks/liste.php", $langs->trans("Bookmarks"));
2005-09-05 21:03:02 +02:00
}
2006-01-08 18:18:21 +01:00
if ($conf->export->enabled)
{
$langs->load("exports");
$menu->add(DOL_URL_ROOT."/exports/index.php", $langs->trans("Exports"));
}
2005-09-19 19:47:36 +02:00
if ($user->rights->user->user->lire || $user->admin)
{
2005-09-19 19:47:36 +02:00
$langs->load("users");
$menu->add(DOL_URL_ROOT."/user/home.php", $langs->trans("MenuUsersAndGroups"));
}
2005-09-19 19:47:36 +02:00
if ($user->admin)
{
$menu->add(DOL_URL_ROOT."/admin/index.php", $langs->trans("Setup"));
2003-06-05 17:02:06 +02:00
}
2005-04-13 13:36:35 +02:00
2005-09-19 19:47:36 +02:00
left_menu($menu->liste);
2002-04-30 12:56:25 +02:00
}
?>