Fix: Plantage

This commit is contained in:
Laurent Destailleur 2005-09-11 17:30:48 +00:00
parent 5013f41623
commit dc057c576f
2 changed files with 101 additions and 98 deletions

View File

@ -18,7 +18,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** /**
@ -77,7 +76,6 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer)
$e_product = $product; $e_product = $product;
$id = $product->create($user); $id = $product->create($user);
if ($id > 0) if ($id > 0)
{ {
Header("Location: fiche.php?id=$id"); Header("Location: fiche.php?id=$id");
@ -86,6 +84,7 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer)
{ {
if ($id == -3) if ($id == -3)
{ {
$mesg='<div class="error">'.$product->error.'</div>';
$_error = 1; $_error = 1;
$_GET["action"] = "create"; $_GET["action"] = "create";
$_GET["type"] = $_POST["type"]; $_GET["type"] = $_POST["type"];
@ -199,6 +198,7 @@ if ($_POST["cancel"] == $langs->trans("Cancel"))
Header("Location: fiche.php?id=".$_POST["id"]); Header("Location: fiche.php?id=".$_POST["id"]);
} }
// Le produit n'est pas encore chargé a ce stade // Le produit n'est pas encore chargé a ce stade
llxHeader("","",$langs->trans("CardProduct0")); llxHeader("","",$langs->trans("CardProduct0"));
@ -227,6 +227,8 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
if ($mesg) print $mesg;
if ($conf->categorie->enabled) if ($conf->categorie->enabled)
{ {
print '<tr><td>'.$langs->trans("Categorie"); print '<tr><td>'.$langs->trans("Categorie");
@ -272,7 +274,7 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer)
print '</td></tr>'; print '</td></tr>';
} }
print '<tr><td>&nbsp;</td><td><input type="submit" value="'.$langs->trans("Create").'"></td></tr>'; print '<tr><td>&nbsp;</td><td><input type="submit" class="button" value="'.$langs->trans("Create").'"></td></tr>';
print '</table>'; print '</table>';
print '</form>'; print '</form>';
} }
@ -334,8 +336,8 @@ else
dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref); dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
if ($mesg) print($mesg);
print($mesg);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
if ($conf->categorie->enabled) if ($conf->categorie->enabled)

View File

@ -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) 2004 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2005 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,25 +18,25 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/*! /**
\file htdocs/product/pre.inc.php \file htdocs/fourn/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 fournisseurs
\version $Revision$ \version $Revision$
*/ */
require("../../main.inc.php"); require("../../main.inc.php");
require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.class.php"; require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.class.php");
require_once DOL_DOCUMENT_ROOT."/categories/categorie.class.php"; require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php");
$langs->load("suppliers"); $langs->load("suppliers");
$langs->load("products"); $langs->load("products");
$user->getrights("produit"); $user->getrights("produit");
function llxHeader($head = "", $title="", $help_url='',$addons='') function llxHeader($head = "", $title="", $help_url='',$addons='')
{ {
global $db, $user, $conf, $langs; global $db, $user, $conf, $langs;
@ -77,7 +77,7 @@ function llxHeader($head = "", $title="", $help_url='',$addons='')
$menu->add('liste.php','Top'); $menu->add('liste.php','Top');
if (isset($_REQUEST['catid'])) if (isset($_REQUEST['catid']) && $_REQUEST['catid'] != '')
{ {
$catid = $_REQUEST['catid']; $catid = $_REQUEST['catid'];
@ -111,4 +111,5 @@ function llxHeader($head = "", $title="", $help_url='',$addons='')
left_menu($menu->liste, $help_url); left_menu($menu->liste, $help_url);
} }
?> ?>