diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 9fa609d9d76..bc647c31999 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -69,6 +69,7 @@ $id = $origin_id; if (empty($origin_id)) $origin_id = GETPOST('origin_id','int'); // Id of order or propal if (empty($origin_id)) $origin_id = GETPOST('object_id','int'); // Id of order or propal $ref=GETPOST('ref','alpha'); +$line_id = GETPOST('lineid','int')?GETPOST('lineid','int'):''; // Security check $socid=''; @@ -596,6 +597,18 @@ if (empty($reshook)) } } + elseif ($action == 'deleteline' && ! empty($line_id)) + { + $object->fetch($id); + $line = new ExpeditionLigne($db); + $line->id = $line_id; + $result = $line->delete($user); + if($result >= 0) { + header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); + exit(); + } + } + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; // Actions to send emails @@ -1769,6 +1782,8 @@ else if ($id || $ref) print ''.$langs->trans("Batch").''; } + print ''; + print ''; print "\n"; $var=false; @@ -1992,6 +2007,18 @@ else if ($id || $ref) print ''; } } + + // edit-delete buttons + print ''; + print 'id . '">'; + print img_edit(); + print ''; + print ''; + print ''; + print 'id . '">'; + print img_delete(); + print ''; + print ''; print ""; // Display lines extrafields @@ -2003,8 +2030,6 @@ else if ($id || $ref) print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bc[$var], 'colspan'=>$colspan),$indiceAsked); print ''; } - - } // TODO Show also lines ordered but not delivered