diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index f2c00e2cf75..438f0ee22ca 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4725,6 +4725,7 @@ function picto_from_langcode($codelang)
* 'member' to add a tab in fundation member view
* 'categories_x' to add a tab in category view ('x': type of category (0=product, 1=supplier, 2=customer, 3=member)
* 'ecm' to add a tab for another ecm view
+ * 'stock' to add a tab for warehouse view
* @param string $mode 'add' to complete head, 'remove' to remove entries
* @return void
*/
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index 0bd061b4a0c..8d9ee5b6d64 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -467,14 +467,14 @@ else
if ($user->rights->stock->mouvement->creer)
{
- print '
';
+ print ' | ';
print img_picto($langs->trans("StockMovement"),'uparrow.png','class="hideonsmartphone"').' '.$langs->trans("StockMovement");
print " | ";
}
if ($user->rights->stock->creer)
{
- print '';
+ print ' | ';
print $langs->trans("StockCorrection");
print " | ";
}
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 57e4c2e7d98..044da6c9aa4 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -43,7 +43,7 @@ $langs->load("stocks");
$langs->load("sendings");
if (! empty($conf->productbatch->enabled)) $langs->load("productbatch");
-
+$backtopage=GETPOST('backtopage');
$action=GETPOST("action");
$cancel=GETPOST('cancel');
@@ -160,8 +160,16 @@ if ($action == "correct_stock" && ! $cancel)
if ($result > 0)
{
- header("Location: ".$_SERVER["PHP_SELF"]."?id=".$product->id);
- exit;
+ if ($backtopage)
+ {
+ header("Location: ".$backtopage);
+ exit;
+ }
+ else
+ {
+ header("Location: ".$_SERVER["PHP_SELF"]."?id=".$product->id);
+ exit;
+ }
}
else
{
@@ -292,8 +300,17 @@ if ($action == "transfert_stock" && ! $cancel)
if (! $error && $result1 >= 0 && $result2 >= 0)
{
$db->commit();
- header("Location: product.php?id=".$product->id);
- exit;
+
+ if ($backtopage)
+ {
+ header("Location: ".$backtopage);
+ exit;
+ }
+ else
+ {
+ header("Location: product.php?id=".$product->id);
+ exit;
+ }
}
else
{
@@ -594,6 +611,7 @@ if ($id > 0 || $ref)
print '