From c2efdba2dfa10e76937e4bdf5a18e5483d0cddb0 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 7 Sep 2017 11:43:52 +0200 Subject: [PATCH] =?utf8?q?Artikelstammdaten:=20kein=20Redirect=20auf=20?= =?utf8?q?=C2=BBneuen=20Artikel=20anlegen=C2=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Kommt man aus der Artikelsuche oder legt man einen neuen Artikel an, so wird beim Speichern nun kein Redirect mehr auf die Suchliste bzw. die Maske zum Neuanlegen eines Artikels gemacht, sondern auf die Bearbeiten-Maske des Artikels, der gerade bearbeitet bzw. angelegt wurde. Man bleibt also sozusagen im Artikel, den man gerade in der Hand hatte. Existierende Callbacks werden weiterhin honoriert, sprich kommt man aus anderen Masken, so kommt man beim Speichern auch in die andere Maske zurück. --- SL/Controller/Part.pm | 10 +--------- bin/mozilla/ic.pl | 2 +- templates/webpages/ic/search.html | 1 + 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index 461090bd9..66f873136 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -42,7 +42,6 @@ __PACKAGE__->run_before('check_part_id', only => [ qw(edit delete) ]); sub action_add_part { my ($self, %params) = @_; - $::form->{callback} = $self->url_for(action => 'add_part') unless $::form->{callback}; $self->part( SL::DB::Part->new_part ); $self->add; }; @@ -50,7 +49,6 @@ sub action_add_part { sub action_add_service { my ($self, %params) = @_; - $::form->{callback} = $self->url_for(action => 'add_service') unless $::form->{callback}; $self->part( SL::DB::Part->new_service ); $self->add; }; @@ -58,7 +56,6 @@ sub action_add_service { sub action_add_assembly { my ($self, %params) = @_; - $::form->{callback} = $self->url_for(action => 'add_assembly') unless $::form->{callback}; $self->part( SL::DB::Part->new_assembly ); $self->add; }; @@ -66,7 +63,6 @@ sub action_add_assembly { sub action_add_assortment { my ($self, %params) = @_; - $::form->{callback} = $self->url_for(action => 'add_assortment') unless $::form->{callback}; $self->part( SL::DB::Part->new_assortment ); $self->add; }; @@ -194,11 +190,7 @@ sub action_delete { if ( $::form->{callback} ) { $self->redirect_to($::form->unescape($::form->{callback})); } else { - my @redirect_params = ( - controller => 'controller.pl', - action => 'LoginScreen/user_login' - ); - $self->redirect_to(@redirect_params); + $self->redirect_to(controller => 'ic.pl', action => 'search', searchitems => 'article'); } } diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index d4ad5f14f..784cc1ad2 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -500,7 +500,7 @@ sub generate_report { $soldtotal = 0 if ($form->{sold}); } - my $edit_link = build_std_url('script=controller.pl', 'action=Part/edit', 'part.id=' . E($ref->{id}), 'callback'); + my $edit_link = build_std_url('script=controller.pl', 'action=Part/edit', 'part.id=' . E($ref->{id})); $row->{partnumber}->{link} = $edit_link; $row->{description}->{link} = $edit_link; diff --git a/templates/webpages/ic/search.html b/templates/webpages/ic/search.html index c77568072..e4996d363 100644 --- a/templates/webpages/ic/search.html +++ b/templates/webpages/ic/search.html @@ -4,6 +4,7 @@ [%- USE L %] [%- USE P %] [% SET style="width: 250px" %] +[%- PROCESS 'common/flash.html' %]

[% title %]

-- 2.20.1