dolibarr/htdocs/pre.inc.php

175 lines
5.2 KiB
PHP
Raw Normal View History

2004-10-20 23:06:45 +02:00
<?php
2004-01-31 12:54:02 +01:00
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 <EFBFBD>ric Seigne <erics@rycks.com>
* Copyright (C) 2004 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
*/
2003-09-11 22:18:51 +02:00
require ("./main.inc.php");
2002-04-30 12:56:25 +02:00
function llxHeader($head = "") {
2004-07-13 23:25:53 +02:00
global $user, $conf, $langs;
$user->getrights('societe');
$user->getrights('propale');
$user->getrights('facture');
2002-04-30 12:56:25 +02:00
2002-05-04 01:01:45 +02:00
top_menu($head);
2002-04-30 12:56:25 +02:00
2002-05-09 16:57:48 +02:00
$menu = new Menu();
2002-04-30 17:36:13 +02:00
if ($conf->societe->enabled)
2002-12-20 00:17:19 +01:00
{
$langs->load("companies");
$menu->add(DOL_URL_ROOT."/societe.php", $langs->trans("Companies"));
2002-12-30 21:41:28 +01:00
if ($user->rights->societe->creer)
2002-12-30 21:41:28 +01:00
{
2004-10-23 16:26:36 +02:00
$menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create", $langs->trans("MenuNewCompany"));
2002-12-30 21:41:28 +01: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
2003-03-13 19:27:26 +01:00
if ($conf->commercial->enabled )
2002-12-20 00:13:48 +01:00
{
$langs->load("commercial");
$menu->add(DOL_URL_ROOT."/comm/index.php",$langs->trans("Commercial"));
2002-05-06 21:10:48 +02:00
$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"));
$menu->add_submenu(DOL_URL_ROOT."/comm/mailing.php","Mailing");
2003-08-06 11:25:40 +02:00
if ($user->rights->propale->lire)
$menu->add_submenu(DOL_URL_ROOT."/comm/propal.php", "Prop. commerciales");
2002-12-20 00:17:19 +01:00
}
2002-04-30 12:56:25 +02:00
2003-03-13 19:27:26 +01:00
if ($conf->compta->enabled )
2002-12-12 17:29:47 +01:00
{
$langs->load("compta");
$menu->add(DOL_URL_ROOT."/compta/index.php", $langs->trans("Accountancy"));
2002-05-04 01:01:45 +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
2002-12-12 17:29:47 +01:00
if ($conf->fichinter->enabled )
{
$menu->add(DOL_URL_ROOT."/fichinter/index.php", "Fiches d'intervention");
2002-12-12 17:29:47 +01:00
}
2002-04-30 12:56:25 +02:00
if ($conf->produit->enabled || $conf->service->enabled)
2002-12-20 00:04:02 +01:00
{
$langs->load("products");
2004-07-12 16:25:38 +02:00
$chaine="";
if ($conf->produit->enabled) { $chaine.= $langs->trans("Products"); }
2004-07-12 16:25:38 +02:00
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
if ($conf->boutique->enabled)
{
if ($conf->boutique->livre->enabled)
{
$menu->add_submenu(DOL_URL_ROOT."/boutique/livre/index.php", "Livres");
2003-03-13 19:27:26 +01:00
}
if ($conf->boutique->album->enabled)
{
$menu->add_submenu(DOL_URL_ROOT."/product/album/index.php", "Albums");
2003-03-13 19:27:26 +01:00
}
}
2002-12-20 00:04:02 +01:00
}
2002-04-30 12:56:25 +02:00
2002-12-20 00:04:02 +01:00
if ($conf->adherent->enabled )
{
$langs->load("members");
$menu->add(DOL_URL_ROOT."/adherents/index.php", $langs->trans("Members"));
2002-12-20 00:04:02 +01:00
}
2002-12-12 17:29:47 +01:00
2003-03-11 17:24:49 +01:00
if ($conf->commande->enabled)
{
2004-08-02 04:41:23 +02:00
$langs->load("orders");
$menu->add(DOL_URL_ROOT."/commande/index.php", $langs->trans("Orders"));
2004-07-27 18:30:19 +02:00
if ($conf->expedition->enabled) {
2004-08-02 04:41:23 +02:00
$menu->add_submenu(DOL_URL_ROOT."/expedition/index.php", $langs->trans("Sendings"));
}
2003-03-11 17:24:49 +01:00
}
2004-09-10 16:30:51 +02:00
if ($conf->telephonie->enabled) // EXPERIMENTAL -> RODO
{
$menu->add(DOL_URL_ROOT."/telephonie/index.php", "T<EFBFBD>l<EFBFBD>phonie");
}
if ($conf->don->enabled)
{
2003-10-14 11:50:37 +02:00
$menu->add(DOL_URL_ROOT."/compta/dons/index.php", "Dons");
}
2002-12-19 19:55:38 +01:00
if ($conf->fournisseur->enabled)
{
$langs->load("suppliers");
$menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers"));
}
2002-04-30 12:56:25 +02:00
2003-03-23 16:50:59 +01:00
if ($conf->voyage && $user->societe_id == 0)
2002-12-19 19:55:38 +01:00
{
2002-05-27 21:21:36 +02:00
2003-08-25 12:09:27 +02:00
$menu->add(DOL_URL_ROOT."/compta/voyage/index.php","Voyages");
2002-05-27 21:21:36 +02:00
2003-08-25 12:09:27 +02:00
$menu->add_submenu(DOL_URL_ROOT."/compta/voyage/index.php","Voyages");
2003-09-11 22:18:51 +02:00
$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
2002-12-20 00:04:02 +01:00
if ($conf->domaine->enabled )
{
$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
if ($conf->postnuke->enabled)
2003-06-05 17:02:06 +02:00
{
$menu->add(DOL_URL_ROOT."/postnuke/articles/index.php", "Editorial");
2003-06-18 16:12:24 +02:00
}
if ($conf->rapport->enabled)
{
$menu->add(DOL_URL_ROOT."/rapport/", "Rapports");
}
$menu->add(DOL_URL_ROOT."/user/index.php", $langs->trans("Users"));
2003-06-18 16:12:24 +02:00
if ($user->admin)
{
$menu->add(DOL_URL_ROOT."/admin/index.php", $langs->trans("Setup"));
2003-06-05 17:02:06 +02:00
}
2002-05-27 21:21:36 +02:00
/*
*
*/
2002-05-09 16:57:48 +02:00
left_menu($menu->liste);
2002-04-30 12:56:25 +02:00
}
?>