X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=a30378123a01bf5370e87ad96aa4e526b420d582;hb=dfb76ebf04df9aed8ba63d7b51bc558d2928030e;hp=2b35c70878e29324f4ba76bdc4059a63e15064d1;hpb=83560c6383fec7a354753f3187c3677471ba8f06;p=kivitendo-erp.git diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 2b35c7087..a30378123 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(); @@ -1273,7 +1273,7 @@ sub generate_report { my %subtotals = map { $_ => 0 } ('onhand', @subtotal_columns); my %totals = map { $_ => 0 } @subtotal_columns; my $idx = 0; - my $same_item = $form->{parts}[0]{ $form->{sort} } if (scalar @{ $form->{parts} }); + my $same_item = @{ $form->{parts} } ? $form->{parts}[0]{ $form->{sort} } : undef; my $defaults = AM->get_defaults(); @@ -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); +}