From: Moritz Bunkus Date: Tue, 16 Aug 2011 10:29:06 +0000 (+0200) Subject: Maske 'Artikel nicht in DB; neu anlegen?' auch funktionierenden 'Zurück'-Button anzeigen X-Git-Tag: release-2.7.0beta1~334^2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=aae0a190cc593b97fad6a1a2ad782940d8e31ad2;p=kivitendo-erp.git Maske 'Artikel nicht in DB; neu anlegen?' auch funktionierenden 'Zurück'-Button anzeigen --- 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 %] - - + + +