X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fbp.pl;h=654a267767d1913402b34d285a727f1189b5946b;hb=7011fd23ae5457ee62f14a3ff37af5a344f4041d;hp=edbd98486704eb39afd7e3a549d8016e359ba5ff;hpb=dc3cd296e62eb09a16fa694d9b3a7158e4cf63bf;p=kivitendo-erp.git diff --git a/bin/mozilla/bp.pl b/bin/mozilla/bp.pl index edbd98486..654a26776 100644 --- a/bin/mozilla/bp.pl +++ b/bin/mozilla/bp.pl @@ -33,6 +33,7 @@ use SL::BP; use Data::Dumper; +use List::Util qw(first); 1; @@ -348,7 +349,10 @@ sub print { $form->get_lists(printers => 'ALL_PRINTERS'); # use the command stored in the databse or fall back to $myconfig{printer} - my $selected_printer = (grep { $_->{id} eq $form->{printer} } @{ $form->{ALL_PRINTERS} })[0]->{'printer_command'} || $myconfig{printer}; + my $selected_printer = first { $_ } map ({ $_ ->{printer_command} } + grep { $_->{id} eq $form->{printer} } + @{ $form->{ALL_PRINTERS} }), + $myconfig{printer}; if ($form->{callback}) { map { $form->{callback} .= "&checked_$_=1" if $form->{"checked_$_"} }