Skip to content
Permalink
Browse files

Fix crop for MO

  • Loading branch information
eldy committed Dec 2, 2019
1 parent 5cb0144 commit 7908e0cd266401f96aafde4d653884ac007cca0a
Showing with 14 additions and 2 deletions.
  1. +1 −1 htdocs/core/class/html.formfile.class.php
  2. +13 −1 htdocs/core/photos_resize.php
@@ -1099,7 +1099,7 @@ public function list_of_documents($filearray, $object, $modulepart, $param = '',
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
@@ -210,6 +210,17 @@
$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 @@
}
}
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 @@
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"]);
}

0 comments on commit 7908e0c

Please sign in to comment.
You can’t perform that action at this time.