From 33f7f2c7d2d890a80b40204f6ae9396d07b35fed Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 4 Mar 2021 15:02:46 +0100 Subject: [PATCH 1/2] Fix #16525 : new button manufacturing order --- htdocs/mrp/class/mo.class.php | 2 +- htdocs/mrp/mo_production.php | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index c5529e54884..3bad9a8a854 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -168,7 +168,7 @@ class Mo extends CommonObject /** * @var string Name of subtable line */ - public $table_element_line = 'mo_production'; + public $table_element_line = 'mrp_production'; /** * @var string Field with ID of parent key if this field has a parent diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 5b01aff6207..89122fdf680 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -48,7 +48,7 @@ $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'mocard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); -//$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOST('lineid', 'int'); $collapse = GETPOST('collapse', 'aZ09comma'); @@ -724,6 +724,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print ''; } + if ($permissiontodelete) { + print ''; + } print ''; if ($action == 'addconsumeline') { @@ -849,6 +852,17 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($conf->productbatch->enabled) { print ''; // Lot } + if ($permissiontodelete) { + $href = $_SERVER["PHP_SELF"]; + $href .= '?id='.$object->id; + $href .= '&action=deleteline'; + $href .= '&lineid='.$line->id; + print ''; + print ''; + print img_picto('', "delete"); + print ''; + print ''; + } print ''; // Show detailed of already consumed with js code to collapse From 87c1e85017de8ce2c8f7ee5c065170fb74fb15c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Mar 2021 16:10:50 +0100 Subject: [PATCH 2/2] Update mo_production.php --- htdocs/mrp/mo_production.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 89122fdf680..6f35f1f1a25 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -725,7 +725,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; } if ($permissiontodelete) { - print ''; + print ''; } print '';