Fix: Liens sur partie produits incorrect dans menu default
This commit is contained in:
parent
5c80c27f50
commit
2e776e7a89
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -18,7 +18,6 @@
|
|||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
* $Source$
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -89,7 +88,7 @@ function llxHeader($head = "", $title="", $addons='') {
|
|||||||
{
|
{
|
||||||
if ($user->rights->produit->lire)
|
if ($user->rights->produit->lire)
|
||||||
{
|
{
|
||||||
$menu->add(DOL_URL_ROOT."/fourn/product/", $langs->trans("Products"));
|
$menu->add(DOL_URL_ROOT."/product/", $langs->trans("Products"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -65,14 +65,14 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer)
|
|||||||
{
|
{
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
|
|
||||||
$product->ref = stripslashes($_POST["ref"]);
|
$product->ref = $_POST["ref"];
|
||||||
$product->libelle = stripslashes($_POST["libelle"]);
|
$product->libelle = $_POST["libelle"];
|
||||||
$product->price = stripslashes($_POST["price"]);
|
$product->price = $_POST["price"];
|
||||||
$product->tva_tx = $_POST["tva_tx"];
|
$product->tva_tx = $_POST["tva_tx"];
|
||||||
$product->type = $_POST["type"];
|
$product->type = $_POST["type"];
|
||||||
$product->status = $_POST["statut"];
|
$product->status = $_POST["statut"];
|
||||||
$product->description = stripslashes($_POST["desc"]);
|
$product->description = $_POST["desc"];
|
||||||
$product->note = stripslashes($_POST["note"]);
|
$product->note = $_POST["note"];
|
||||||
$product->duration_value = $_POST["duration_value"];
|
$product->duration_value = $_POST["duration_value"];
|
||||||
$product->duration_unit = $_POST["duration_unit"];
|
$product->duration_unit = $_POST["duration_unit"];
|
||||||
$product->seuil_stock_alerte = $_POST["seuil_stock_alerte"];
|
$product->seuil_stock_alerte = $_POST["seuil_stock_alerte"];
|
||||||
@ -88,9 +88,7 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $value != $current_lang )
|
if ( $value != $current_lang ) $e_product = $product;
|
||||||
|
|
||||||
$e_product = $product;
|
|
||||||
|
|
||||||
$id = $product->create($user);
|
$id = $product->create($user);
|
||||||
|
|
||||||
@ -101,12 +99,9 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($id == -3)
|
$mesg='<div class="error">'.$product->error.'</div>';
|
||||||
{
|
$_GET["action"] = "create";
|
||||||
$_error = 1;
|
$_GET["type"] = $_POST["type"];
|
||||||
$_GET["action"] = "create";
|
|
||||||
$_GET["type"] = $_POST["type"];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,13 +113,13 @@ if ($_POST["action"] == 'update' &&
|
|||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
if ($product->fetch($_POST["id"]))
|
if ($product->fetch($_POST["id"]))
|
||||||
{
|
{
|
||||||
$product->ref = stripslashes($_POST["ref"]);
|
$product->ref = $_POST["ref"];
|
||||||
$product->libelle = stripslashes($_POST["libelle"]);
|
$product->libelle = $_POST["libelle"];
|
||||||
if ( isset( $_POST["price"] ) )
|
if ( isset( $_POST["price"] ) )
|
||||||
$product->price = stripslashes($_POST["price"]);
|
$product->price = $_POST["price"];
|
||||||
$product->tva_tx = $_POST["tva_tx"];
|
$product->tva_tx = $_POST["tva_tx"];
|
||||||
$product->description = stripslashes($_POST["desc"]);
|
$product->description = $_POST["desc"];
|
||||||
$product->note = stripslashes($_POST["note"]);
|
$product->note = $_POST["note"];
|
||||||
$product->status = $_POST["statut"];
|
$product->status = $_POST["statut"];
|
||||||
$product->seuil_stock_alerte = $_POST["seuil_stock_alerte"];
|
$product->seuil_stock_alerte = $_POST["seuil_stock_alerte"];
|
||||||
$product->duration_value = $_POST["duration_value"];
|
$product->duration_value = $_POST["duration_value"];
|
||||||
@ -330,6 +325,9 @@ $html = new Form($db);
|
|||||||
if ($_GET["action"] == 'create' && $user->rights->produit->creer)
|
if ($_GET["action"] == 'create' && $user->rights->produit->creer)
|
||||||
{
|
{
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
|
|
||||||
|
if ($mesg) print "$mesg\n";
|
||||||
|
|
||||||
if ($_error == 1)
|
if ($_error == 1)
|
||||||
{
|
{
|
||||||
$product = $e_product;
|
$product = $e_product;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -18,14 +18,13 @@
|
|||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
* $Source$
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
\file htdocs/product/pre.inc.php
|
\file htdocs/product/pre.inc.php
|
||||||
\ingroup product,service
|
\ingroup product,service
|
||||||
\brief Fichier gestionnaire du menu gauche des produits et services
|
\brief Fichier gestionnaire du menu gauche des produits et services
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
|
|
||||||
@ -37,76 +36,71 @@ $user->getrights('facture');
|
|||||||
|
|
||||||
function llxHeader($head = "", $urlp = "", $title="")
|
function llxHeader($head = "", $urlp = "", $title="")
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs;
|
global $user, $conf, $langs;
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
$user->getrights("produit");
|
$user->getrights("produit");
|
||||||
|
|
||||||
top_menu($head, $title);
|
top_menu($head, $title);
|
||||||
|
|
||||||
$menu = new Menu();
|
$menu = new Menu();
|
||||||
|
|
||||||
if ($conf->produit->enabled)
|
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)
|
|
||||||
{
|
{
|
||||||
$menu->add_submenu(DOL_URL_ROOT."/product/fiche.php?action=create&type=0", $langs->trans("NewProduct"));
|
$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)
|
||||||
|
{
|
||||||
|
$menu->add_submenu(DOL_URL_ROOT."/product/fiche.php?action=create&type=0", $langs->trans("NewProduct"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if ($conf->service->enabled)
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
$menu->add_submenu(DOL_URL_ROOT."/product/fiche.php?action=create&type=1", $langs->trans("NewService"));
|
$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)
|
||||||
|
{
|
||||||
|
$menu->add_submenu(DOL_URL_ROOT."/product/fiche.php?action=create&type=1", $langs->trans("NewService"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if ($conf->boutique->enabled)
|
||||||
if ($conf->boutique->enabled)
|
{
|
||||||
{
|
$menu->add(DOL_URL_ROOT."/product/osc-liste.php", "Osc");
|
||||||
$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_submenu(DOL_URL_ROOT."/product/osc-liste.php?reqstock=epuise", "Produits Epuisés");
|
|
||||||
|
$menu->add(DOL_URL_ROOT."/product/osc-reviews.php", $langs->trans("Criticals"));
|
||||||
$menu->add(DOL_URL_ROOT."/product/osc-reviews.php", $langs->trans("Criticals"));
|
|
||||||
|
$menu->add_submenu(DOL_URL_ROOT."/product/osc-productsbyreviews.php", "Meilleurs produits");
|
||||||
$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/album/", "Albums");
|
$menu->add(DOL_URL_ROOT."/product/groupart/", "Groupes/Artistes");
|
||||||
$menu->add(DOL_URL_ROOT."/product/groupart/", "Groupes/Artistes");
|
|
||||||
|
$menu->add(DOL_URL_ROOT."/product/categorie/", $langs->trans("Categories"));
|
||||||
$menu->add(DOL_URL_ROOT."/product/categorie/", $langs->trans("Categories"));
|
}
|
||||||
}
|
|
||||||
|
if ($conf->fournisseur->enabled) {
|
||||||
if ($conf->fournisseur->enabled) {
|
$langs->load("suppliers");
|
||||||
$langs->load("suppliers");
|
$menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers"));
|
||||||
$menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers"));
|
}
|
||||||
}
|
|
||||||
|
$menu->add(DOL_URL_ROOT."/product/stats/", $langs->trans("Statistics"));
|
||||||
$menu->add(DOL_URL_ROOT."/product/stats/", $langs->trans("Statistics"));
|
if ($conf->propal->enabled)
|
||||||
if ($conf->propal->enabled)
|
{
|
||||||
{
|
$menu->add_submenu(DOL_URL_ROOT."/product/popuprop.php", $langs->trans("Popularity"));
|
||||||
$menu->add_submenu(DOL_URL_ROOT."/product/popuprop.php", $langs->trans("Popularity"));
|
}
|
||||||
}
|
|
||||||
|
if ($conf->stock->enabled)
|
||||||
if ($conf->stock->enabled)
|
{
|
||||||
{
|
$menu->add(DOL_URL_ROOT."/product/stock/", $langs->trans("Stock"));
|
||||||
$menu->add(DOL_URL_ROOT."/product/stock/", $langs->trans("Stock"));
|
}
|
||||||
}
|
|
||||||
|
if ($conf->categorie->enabled)
|
||||||
if ($conf->categorie->enabled)
|
{
|
||||||
{
|
$menu->add(DOL_URL_ROOT."/categories/", $langs->trans("Categories"));
|
||||||
$menu->add(DOL_URL_ROOT."/categories/", $langs->trans("Categories"));
|
}
|
||||||
}
|
|
||||||
|
left_menu($menu->liste);
|
||||||
left_menu($menu->liste);
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -18,10 +18,9 @@
|
|||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
* $Source$
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
\file htdocs/product/stats/pre.inc.php
|
\file htdocs/product/stats/pre.inc.php
|
||||||
\ingroup product,service
|
\ingroup product,service
|
||||||
\brief Fichier gestionnaire du menu gauche des statistiques de produits et services
|
\brief Fichier gestionnaire du menu gauche des statistiques de produits et services
|
||||||
@ -34,73 +33,73 @@ require(DOL_DOCUMENT_ROOT."/bargraph.class.php");
|
|||||||
|
|
||||||
function llxHeader($head = "", $urlp = "", $title="")
|
function llxHeader($head = "", $urlp = "", $title="")
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs;
|
global $user, $conf, $langs;
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
$user->getrights("produit");
|
$user->getrights("produit");
|
||||||
|
|
||||||
top_menu($head, $title);
|
|
||||||
|
|
||||||
$menu = new Menu();
|
|
||||||
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
$menu->add_submenu(DOL_URL_ROOT."/product/fiche.php?action=create&type=0", $langs->trans("NewProduct"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($conf->service->enabled)
|
top_menu($head, $title);
|
||||||
{
|
|
||||||
$menu->add(DOL_URL_ROOT."/product/index.php?type=1", $langs->trans("Services"));
|
$menu = new Menu();
|
||||||
$menu->add_submenu(DOL_URL_ROOT."/product/liste.php?type=1", $langs->trans("List"));
|
|
||||||
if ($user->societe_id == 0 && $user->rights->produit->creer)
|
if ($conf->produit->enabled)
|
||||||
{
|
{
|
||||||
$menu->add_submenu(DOL_URL_ROOT."/product/fiche.php?action=create&type=1", $langs->trans("NewService"));
|
$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)
|
||||||
if ($conf->boutique->enabled)
|
{
|
||||||
{
|
$menu->add_submenu(DOL_URL_ROOT."/product/fiche.php?action=create&type=0", $langs->trans("NewProduct"));
|
||||||
|
}
|
||||||
$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");
|
|
||||||
|
if ($conf->service->enabled)
|
||||||
|
{
|
||||||
$menu->add(DOL_URL_ROOT."/product/osc-reviews.php", "Critiques");
|
$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"));
|
||||||
$menu->add_submenu(DOL_URL_ROOT."/product/osc-productsbyreviews.php", "Meilleurs produits");
|
if ($user->societe_id == 0 && $user->rights->produit->creer)
|
||||||
|
{
|
||||||
$menu->add(DOL_URL_ROOT."/product/album/", "Albums");
|
$menu->add_submenu(DOL_URL_ROOT."/product/fiche.php?action=create&type=1", $langs->trans("NewService"));
|
||||||
$menu->add(DOL_URL_ROOT."/product/groupart/", "Groupes/Artistes");
|
}
|
||||||
|
}
|
||||||
$menu->add(DOL_URL_ROOT."/product/categorie/", $langs->trans("Categories"));
|
|
||||||
}
|
if ($conf->boutique->enabled)
|
||||||
|
{
|
||||||
if ($conf->fournisseur->enabled) {
|
|
||||||
$langs->load("suppliers");
|
$menu->add(DOL_URL_ROOT."/product/osc-liste.php", "Osc");
|
||||||
$menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers"));
|
$menu->add_submenu(DOL_URL_ROOT."/product/osc-liste.php?reqstock=epuise", "Produits Epuisés");
|
||||||
}
|
|
||||||
|
|
||||||
$menu->add(DOL_URL_ROOT."/product/stats/", $langs->trans("Statistics"));
|
$menu->add(DOL_URL_ROOT."/product/osc-reviews.php", "Critiques");
|
||||||
if ($conf->propal->enabled)
|
|
||||||
{
|
$menu->add_submenu(DOL_URL_ROOT."/product/osc-productsbyreviews.php", "Meilleurs produits");
|
||||||
$menu->add_submenu(DOL_URL_ROOT."/product/popuprop.php", $langs->trans("Popularity"));
|
|
||||||
}
|
$menu->add(DOL_URL_ROOT."/product/album/", "Albums");
|
||||||
|
$menu->add(DOL_URL_ROOT."/product/groupart/", "Groupes/Artistes");
|
||||||
if ($conf->stock->enabled)
|
|
||||||
{
|
$menu->add(DOL_URL_ROOT."/product/categorie/", $langs->trans("Categories"));
|
||||||
$menu->add(DOL_URL_ROOT."/product/stock/", $langs->trans("Stock"));
|
}
|
||||||
}
|
|
||||||
|
if ($conf->fournisseur->enabled) {
|
||||||
left_menu($menu->liste);
|
$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);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user