From aae0a190cc593b97fad6a1a2ad782940d8e31ad2 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 16 Aug 2011 12:29:06 +0200 Subject: [PATCH] =?utf8?q?Maske=20'Artikel=20nicht=20in=20DB;=20neu=20anle?= =?utf8?q?gen=3F'=20auch=20funktionierenden=20'Zur=C3=BCck'-Button=20anzei?= =?utf8?q?gen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/ic.pl | 22 ++++++++++++++++++++-- templates/webpages/generic/new_item.html | 6 +++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 2b35c7087..215ec16ab 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -32,7 +32,7 @@ #====================================================================== use POSIX qw(strftime); -use List::Util qw(max); +use List::Util qw(first max); use List::MoreUtils qw(any); use SL::AM; @@ -117,7 +117,7 @@ sub search { $form->get_lists('partsgroup' => 'ALL_PARTSGROUPS'); print $form->parse_html_template('ic/search', { %is_xyz, - dateformat => $myconfig{dateformat}, + dateformat => $myconfig{dateformat}, limit => $myconfig{vclimit}, }); $lxdebug->leave_sub(); @@ -2042,4 +2042,22 @@ sub ajax_autocomplete { $main::lxdebug->leave_sub(); } +sub back_to_record { + _check_io_auth(); + + $::auth->restore_form_from_session($::form->{previousform}, clobber => 1); + $::form->{rowcount}--; + $::form->{action} = 'display_form'; + $::form->{callback} = $::form->{script} . '?' . join('&', map { $::form->escape($_) . '=' . $::form->escape($::form->{$_}) } sort keys %{ $::form }); + $::form->redirect; +} + sub continue { call_sub($form->{"nextsub"}); } + +sub dispatcher { + my $action = first { $::form->{"action_${_}"} } qw(add back_to_record); + $::form->error($::locale->text('No action defined.')) unless $action; + + $::form->{dispatched_action} = $action; + call_sub($action); +} diff --git a/templates/webpages/generic/new_item.html b/templates/webpages/generic/new_item.html index 1d3104a6d..3d6fbe08f 100644 --- a/templates/webpages/generic/new_item.html +++ b/templates/webpages/generic/new_item.html @@ -3,7 +3,6 @@

[% 'Item not on file!' | $T8 %] -

[% 'What type of item is this?' | $T8 %]

@@ -18,8 +17,9 @@ [%- END %] - - + + +
-- 2.20.1