dolibarr/htdocs/fourn/pre.inc.php

101 lines
3.1 KiB
PHP
Raw Normal View History

<?php
2006-12-06 21:50:54 +01:00
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
2002-05-06 21:10:48 +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.
*
2002-05-29 17:18:01 +02:00
* $Id$
* $Source$
2002-05-06 21:10:48 +02:00
*/
2004-11-18 23:14:56 +01:00
2005-04-08 22:18:55 +02:00
/**
\file htdocs/fourn/pre.inc.php
\ingroup fournisseur,facture
\brief Fichier gestionnaire du menu fournisseurs
2004-11-18 23:14:56 +01:00
*/
2003-09-11 22:18:51 +02:00
require("../main.inc.php");
2005-04-11 17:07:57 +02:00
require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.class.php";
require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php";
2005-04-04 17:27:05 +02:00
$user->getrights('fournisseur');
2004-11-29 16:45:41 +01:00
function llxHeader($head = "", $title="", $addons='') {
global $user, $conf, $langs;
2004-11-29 16:45:41 +01:00
2004-11-30 22:16:09 +01:00
$langs->load("suppliers");
$langs->load("propal");
2002-05-06 21:10:48 +02:00
2004-09-04 14:38:11 +02:00
top_menu($head, $title);
2002-05-06 21:10:48 +02:00
2002-05-09 16:57:48 +02:00
$menu = new Menu();
2002-05-06 21:10:48 +02:00
2004-11-29 16:45:41 +01:00
if (is_array($addons))
{
//$menu->add($url, $libelle);
$menu->add($addons[0][0], $addons[0][1]);
}
2005-07-23 16:48:58 +02:00
if ($conf->fournisseur->enabled && $user->rights->societe->lire)
2003-03-23 19:21:06 +01:00
{
2005-04-08 17:35:08 +02:00
$menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers"));
// S<>curit<69> acc<63>s client
2005-07-23 16:48:58 +02:00
if ($user->societe_id == 0 && $user->rights->societe->creer)
{
2006-12-02 21:29:58 +01:00
$menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&amp;type=f",$langs->trans("NewSupplier"));
}
2006-12-06 21:50:54 +01:00
2006-12-09 22:04:30 +01:00
$menu->add_submenu(DOL_URL_ROOT."/fourn/liste.php",$langs->trans("List"));
2005-04-08 17:35:08 +02:00
2006-12-06 21:50:54 +01:00
if ($conf->societe->enabled )
{
$menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts"));
}
2004-11-18 23:14:56 +01:00
2006-12-06 21:50:54 +01:00
$menu->add_submenu(DOL_URL_ROOT."/fourn/stats.php",$langs->trans("Statistics"));
}
2005-04-04 18:12:28 +02:00
$langs->load("bills");
2005-07-23 16:48:58 +02:00
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)
2003-05-13 16:27:40 +02:00
{
2005-04-04 18:12:28 +02:00
$menu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"));
2003-03-23 19:21:06 +01:00
}
2005-07-23 16:48:58 +02:00
if ($user->rights->fournisseur->facture->lire)
{
$menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments"));
}
2005-04-04 18:12:28 +02:00
$langs->load("orders");
2005-07-23 16:48:58 +02:00
if ($user->rights->fournisseur->commande->lire)
{
$menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders"));
}
if ($conf->produit->enabled || $conf->service->enabled)
{
2005-07-23 16:48:58 +02:00
if ($user->rights->produit->lire)
{
$menu->add(DOL_URL_ROOT."/product/", $langs->trans("Products"));
2005-07-23 16:48:58 +02:00
}
}
2004-11-29 16:45:41 +01:00
2002-05-09 16:57:48 +02:00
left_menu($menu->liste);
2002-05-06 21:10:48 +02:00
}
?>