diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 55b8f5666b2..3b2a7fcb872 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1099,7 +1099,7 @@ class FormFile
if ($disablecrop == -1)
{
$disablecrop = 1;
- if (in_array($modulepart, array('bank', 'bom', 'expensereport', 'holiday', 'member', 'project', 'product', 'produit', 'service', 'societe', 'tax', 'ticket', 'user'))) $disablecrop = 0;
+ if (in_array($modulepart, array('bank', 'bom', 'expensereport', 'holiday', 'member', 'mrp', 'project', 'product', 'produit', 'service', 'societe', 'tax', 'ticket', 'user'))) $disablecrop = 0;
}
// Define relative path used to store the file
diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php
index 181bd1d84f1..eeff5007c55 100644
--- a/htdocs/core/photos_resize.php
+++ b/htdocs/core/photos_resize.php
@@ -210,6 +210,17 @@ elseif ($modulepart == 'bom')
$dir = $conf->$modulepart->dir_output; // By default
}
}
+elseif ($modulepart == 'mrp')
+{
+ require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
+ $object = new MO($db);
+ if ($id > 0)
+ {
+ $result = $object->fetch($id);
+ if ($result <= 0) dol_print_error($db, 'Failed to load object');
+ $dir = $conf->$modulepart->dir_output; // By default
+ }
+}
elseif ($modulepart == 'bank')
{
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
@@ -222,7 +233,7 @@ elseif ($modulepart == 'bank')
}
}
else {
- print 'Action crop for modulepart = '.$modulepart.' is not supported yet.';
+ print 'Action crop for modulepart = '.$modulepart.' is not supported yet by photos_resize.php.';
}
if (empty($backtourl))
@@ -237,6 +248,7 @@ if (empty($backtourl))
elseif (in_array($modulepart, array('ticket'))) $backtourl = DOL_URL_ROOT."/ticket/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
elseif (in_array($modulepart, array('user'))) $backtourl = DOL_URL_ROOT."/user/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
elseif (in_array($modulepart, array('bank'))) $backtourl = DOL_URL_ROOT."/compta/bank/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
+ elseif (in_array($modulepart, array('mrp'))) $backtourl = DOL_URL_ROOT."/mrp/mo_document.php?id=".$id.'&file='.urldecode($_POST["file"]);
else $backtourl = DOL_URL_ROOT."/".$modulepart."/".$modulepart."_document.php?id=".$id.'&file='.urldecode($_POST["file"]);
}