diff --git a/www/pages/produktion.php b/www/pages/produktion.php index d910fc51..d3f9bf13 100644 --- a/www/pages/produktion.php +++ b/www/pages/produktion.php @@ -393,8 +393,14 @@ class Produktion { $this->app->DB->Update($sql); if ($id == 'NULL') { - $msg .= $this->app->erp->base64_url_encode("
Das Element wurde erfolgreich angelegt.
"); - header("Location: index.php?module=produktion&action=list&msg=$msg"); + + $id = $this->app->DB->GetInsertID(); + + if (!empty($id)) { + $msg .= $this->app->erp->base64_url_encode("
Das Element wurde erfolgreich angelegt.
"); + header("Location: index.php?module=produktion&action=edit&id=$id&msg=$msg"); + } + } else { $msg .= "
Die Einstellungen wurden erfolgreich übernommen.
"; }