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
|
\ingroup stock
|
||||||
\brief Page fiche entrepot
|
\brief Page fiche entrepot
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
@ -30,6 +31,7 @@
|
|||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
|
$langs->load("stocks");
|
||||||
|
|
||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
@ -38,15 +40,21 @@ $mesg = '';
|
|||||||
|
|
||||||
if ($_POST["action"] == 'add')
|
if ($_POST["action"] == 'add')
|
||||||
{
|
{
|
||||||
$entrepot = new Entrepot($db);
|
$entrepot = new Entrepot($db);
|
||||||
|
|
||||||
$entrepot->ref = $_POST["ref"];
|
$entrepot->ref = trim($_POST["ref"]);
|
||||||
$entrepot->libelle = $_POST["libelle"];
|
$entrepot->libelle = trim($_POST["libelle"]);
|
||||||
$entrepot->description = $_POST["desc"];
|
$entrepot->description = trim($_POST["desc"]);
|
||||||
$entrepot->statut = $_POST["statut"];
|
$entrepot->statut = $_POST["statut"];
|
||||||
|
|
||||||
$id = $entrepot->create($user);
|
if ($entrepot->libelle) {
|
||||||
Header("Location: fiche.php?id=$id");
|
$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"))
|
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"))
|
if ($_GET["cancel"] == $langs->trans("Cancel"))
|
||||||
{
|
{
|
||||||
@ -97,6 +107,10 @@ if ($_GET["action"] == 'create')
|
|||||||
print '<input type="hidden" name="type" value="'.$type.'">'."\n";
|
print '<input type="hidden" name="type" value="'.$type.'">'."\n";
|
||||||
print_titre($langs->trans("NewWarehouse"));
|
print_titre($langs->trans("NewWarehouse"));
|
||||||
|
|
||||||
|
if ($mesg) {
|
||||||
|
print $mesg;
|
||||||
|
}
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
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%">'.$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>';
|
print '<tr><td width="20%" valign="top">'.$langs->trans("Description").'</td><td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user