X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fio.pl;h=0ca15d4e26e465f7b507df7ca621a2aea86c8de8;hb=c82a3685c7f6d02b0b60d944778de9f7d469a6c6;hp=99b61f31e72eaf37c4abb5dc80018fe86c92e08c;hpb=c6b2257945060625bcb86fa7e2efd27c737480ff;p=kivitendo-erp.git diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 99b61f31e..0ca15d4e2 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -47,6 +47,7 @@ use SL::CT; use SL::IC; use SL::IO; +use SL::DB::Default; use SL::DB::Language; use SL::DB::Printer; use SL::Helper::Flash; @@ -102,7 +103,7 @@ use Data::Dumper; sub _check_io_auth { $main::auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | ' . - 'purchase_delivery_order_edit | sales_delivery_order_edit'); + 'purchase_delivery_order_edit | sales_delivery_order_edit | part_service_assembly_details'); } ######################################## @@ -995,7 +996,6 @@ sub edit_e_mail { my $attachment_filename = $form->generate_attachment_filename(); my $subject = $form->{subject} || $form->generate_email_subject(); - $::request->{layout}->focus($form->{"email"} ? "#subject" : "#email"); $form->header; my (@dont_hide_key_list, %dont_hide_key, @hidden_keys); @@ -1224,6 +1224,10 @@ sub print_form { _check_io_auth(); + my $defaults = SL::DB::Default->get; + $form->error($::locale->text('No print templates have been created for this client yet. Please do so in the client configuration.')) if !$defaults->templates; + $form->{templates} = $defaults->templates; + my ($old_form) = @_; my $inv = "inv"; @@ -1438,8 +1442,8 @@ sub print_form { if ($shipto) { if ( $form->{formname} eq 'purchase_order' || $form->{formname} eq 'request_quotation') { - $form->{shiptoname} = $myconfig{company}; - $form->{shiptostreet} = $myconfig{address}; + $form->{shiptoname} = $defaults->company; + $form->{shiptostreet} = $defaults->address; } else { map { $form->{"shipto$_"} = $form->{$_} } @a; } @@ -1447,8 +1451,6 @@ sub print_form { $form->{notes} =~ s/^\s+//g; - $form->{templates} = "$myconfig{templates}"; - delete $form->{printer_command}; $form->{language} = $form->get_template_language(\%myconfig); @@ -1528,7 +1530,7 @@ sub print_form { push @template_files, "$form->{formname}.$extension"; push @template_files, "default.$extension"; @template_files = uniq @template_files; - $form->{IN} = first { -f "$myconfig{templates}/$_" } @template_files; + $form->{IN} = first { -f ($defaults->templates . "/$_") } @template_files; if (!defined $form->{IN}) { $::form->error($::locale->text('Cannot find matching template for this print request. Please contact your template maintainer. I tried these: #1.', join ', ', map { "'$_'"} @template_files));