Fix: Plantage si le libell du stock n'tait pa renseign
This commit is contained in:
parent
f95475ea23
commit
1aa43a8dbc
13
htdocs/langs/en_US/stocks.lang
Normal file
13
htdocs/langs/en_US/stocks.lang
Normal file
@ -0,0 +1,13 @@
|
||||
# Dolibarr language file - en_US - stocks
|
||||
WarehouseCard=Warehouse card
|
||||
Warehouse=Warehouse
|
||||
NewWarehouse=New warehouse
|
||||
WarehouseOpened=Warehouse opened
|
||||
WarehouseClosed=Warehouse closed
|
||||
Stock=Stock
|
||||
Stocks=Stocks
|
||||
Movement=Movement
|
||||
Movements=Movements
|
||||
CorrectStock=Correct stock
|
||||
ListOfStockMovements=List of stock movements
|
||||
ErrorWarehouseLabelRequired=Warehouse label is required
|
||||
13
htdocs/langs/fr_FR/stocks.lang
Normal file
13
htdocs/langs/fr_FR/stocks.lang
Normal file
@ -0,0 +1,13 @@
|
||||
# Dolibarr language file - fr_FR - stocks
|
||||
WarehouseCard=Fiche entrepôt
|
||||
Warehouse=Entrepôt
|
||||
NewWarehouse=Nouvel entrepôt
|
||||
WarehouseOpened=Entrepôt ouvert
|
||||
WarehouseClosed=Entrepôt fermé
|
||||
Stock=Stock
|
||||
Stocks=Stocks
|
||||
Movement=Mouvement
|
||||
Movements=Mouvements
|
||||
CorrectStock=Corriger stock
|
||||
ListOfStockMovements=Liste des mouvements de stock
|
||||
ErrorWarehouseLabelRequired=Le libellé de l'entrepôt est obligatoire
|
||||
@ -21,7 +21,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/** \file htdocs/product/stock/fiche.php
|
||||
/**
|
||||
\file htdocs/product/stock/fiche.php
|
||||
\ingroup stock
|
||||
\brief Page fiche entrepot
|
||||
\version $Revision$
|
||||
@ -30,6 +31,7 @@
|
||||
require("./pre.inc.php");
|
||||
|
||||
$langs->load("products");
|
||||
$langs->load("stocks");
|
||||
|
||||
|
||||
$mesg = '';
|
||||
@ -38,15 +40,21 @@ $mesg = '';
|
||||
|
||||
if ($_POST["action"] == 'add')
|
||||
{
|
||||
$entrepot = new Entrepot($db);
|
||||
|
||||
$entrepot->ref = $_POST["ref"];
|
||||
$entrepot->libelle = $_POST["libelle"];
|
||||
$entrepot->description = $_POST["desc"];
|
||||
$entrepot->statut = $_POST["statut"];
|
||||
|
||||
$id = $entrepot->create($user);
|
||||
Header("Location: fiche.php?id=$id");
|
||||
$entrepot = new Entrepot($db);
|
||||
|
||||
$entrepot->ref = trim($_POST["ref"]);
|
||||
$entrepot->libelle = trim($_POST["libelle"]);
|
||||
$entrepot->description = trim($_POST["desc"]);
|
||||
$entrepot->statut = $_POST["statut"];
|
||||
|
||||
if ($entrepot->libelle) {
|
||||
$id = $entrepot->create($user);
|
||||
Header("Location: fiche.php?id=$id");
|
||||
}
|
||||
else {
|
||||
$mesg="<div class='error'>".$langs->trans("ErrorWarehouseLabelRequired")."</div>";
|
||||
$_GET["action"]="create"; // Force retour sur page création
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
@ -77,7 +85,9 @@ if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
}
|
||||
|
||||
|
||||
llxHeader("","","Fiche entrepôt");
|
||||
|
||||
llxHeader("","",$langs->trans("WarehouseCard"));
|
||||
|
||||
|
||||
if ($_GET["cancel"] == $langs->trans("Cancel"))
|
||||
{
|
||||
@ -96,7 +106,11 @@ if ($_GET["action"] == 'create')
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="type" value="'.$type.'">'."\n";
|
||||
print_titre($langs->trans("NewWarehouse"));
|
||||
|
||||
|
||||
if ($mesg) {
|
||||
print $mesg;
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="20%">'.$langs->trans("Label").'</td><td><input name="libelle" size="40" value=""></td></tr>';
|
||||
print '<tr><td width="20%" valign="top">'.$langs->trans("Description").'</td><td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user