X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fio.pl;h=0d7601ea6f9dd52539bd1f827454021894e00ae9;hb=493457086f727b713cca06c25c1c3bedb92185af;hp=1aa0248d0be8e17371acea54b77d2b158fa7b35d;hpb=e7f0039c14a102c5b263d92ca9b7792f122e28ae;p=kivitendo-erp.git diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 1aa0248d0..0d7601ea6 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -38,7 +38,7 @@ use Carp; use CGI; -use List::MoreUtils qw(uniq); +use List::MoreUtils qw(any uniq); use List::Util qw(min max first); use SL::CVar; @@ -49,6 +49,7 @@ use SL::IO; use SL::DB::Language; use SL::DB::Printer; +use SL::Helper::Flash; require "bin/mozilla/common.pl"; @@ -488,7 +489,7 @@ sub select_item { } @{ $::form->{item_list} }; # delete action variable - delete @{$::form}{qw(action item_list header)}; + delete @{$::form}{qw(action item_list)}; print $::form->parse_html_template('io/select_item', { PREVIOUS_FORM => $previous_form, MODE => $mode, @@ -802,6 +803,7 @@ sub validate_items { # check if items are valid if ($form->{rowcount} == 1) { + flash('warning', $::locale->text('The action you\'ve chosen has not been executed because the document does not contain any item yet.')); &update; ::end_of_request(); } @@ -978,7 +980,7 @@ sub edit_e_mail { my $attachment_filename = $form->generate_attachment_filename(); my $subject = $form->{subject} || $form->generate_email_subject(); - $form->{"fokus"} = $form->{"email"} ? "Form.subject" : "Form.email"; + $::request->{layout}->focus($form->{"email"} ? "#subject" : "#email"); $form->header; my (@dont_hide_key_list, %dont_hide_key, @hidden_keys); @@ -1087,11 +1089,12 @@ sub print_options { opthash("inline", $form->{SM}{inline}, $locale->text('In-line')) if ($form->{media} eq 'email'); + my $printable_templates = any { $::lx_office_conf{print_templates}->{$_} } qw(latex opendocument); push @MEDIA, grep $_, opthash("screen", $form->{OP}{screen}, $locale->text('Screen')), - ($form->{printers} && scalar @{ $form->{printers} } && $::lx_office_conf{print_templates}->{latex}) ? + ($printable_templates && $form->{printers} && scalar @{ $form->{printers} }) ? opthash("printer", $form->{OP}{printer}, $locale->text('Printer')) : undef, - ($::lx_office_conf{print_templates}->{latex} && !$options{no_queue}) ? + ($printable_templates && !$options{no_queue}) ? opthash("queue", $form->{OP}{queue}, $locale->text('Queue')) : undef if ($form->{media} ne 'email'); @@ -1468,7 +1471,7 @@ sub print_form { reformat_numbers($output_numberformat, 2, qw(invtotal ordtotal quototal subtotal linetotal listprice sellprice netprice discount - tax taxbase total paid), + tax taxbase total paid payment), grep({ /^(?:linetotal|nodiscount_linetotal|listprice|sellprice|netprice|taxbase|discount|p_discount|discount_sub|nodiscount_sub|paid|subtotal|total|tax)_\d+$/ } keys(%{$form}))); reformat_numbers($output_numberformat, undef, @@ -1536,23 +1539,27 @@ sub print_form { my $emailed = $form->{emailed}; if ($form->{media} eq 'queue') { - my %queued = map { s|.*/|| } split / /, $form->{queued}; + my %queued = map { s|.*[/\\]||; $_ } split / /, $form->{queued}; my $filename; my $suffix = ($form->{postscript}) ? '.ps' : '.pdf'; if ($filename = $queued{ $form->{formname} }) { - $form->{queued} =~ s/\Q$form->{formname} $filename\E//; unlink $::lx_office_conf{paths}->{spool} . "/$filename"; - $filename =~ s/\..*$//g; - $filename .= $suffix; - $form->{OUT} = $::lx_office_conf{paths}->{spool} . "/$filename"; - $form->{OUT_MODE} = '>'; + delete $queued{ $form->{formname} }; + + $form->{queued} = join ' ', %queued; + $filename =~ s/\..*$//g; + $filename .= $suffix; + $form->{OUT} = $::lx_office_conf{paths}->{spool} . "/$filename"; + $form->{OUT_MODE} = '>'; + } else { my $temp_fh; ($temp_fh, $filename) = File::Temp::tempfile( 'kivitendo-spoolXXXXXX', SUFFIX => "$suffix", - DIR => $::lx_office_conf{paths}->{spool}, + DIR => $::lx_office_conf{paths}->{spool}, + UNLINK => 0, ); close $temp_fh; $form->{OUT} = "$filename";