X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a59f11b0bc1e3ce6d98f704a061be0c09e23086f..bc0e2edad8e8f94f85f2a59ceb784b8eb0cda97c:/SL/Controller/Order.pm?ds=sidebyside diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 12c689e1c..06a9f74cb 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -4,7 +4,7 @@ use strict; use parent qw(SL::Controller::Base); use SL::Helper::Flash qw(flash_later); -use SL::Presenter; +use SL::Presenter::Tag qw(select_tag); use SL::Locale::String qw(t8); use SL::SessionFile::Random; use SL::PriceSource; @@ -211,13 +211,18 @@ sub action_print { } } if ($self->order->ordnumber && $::instance_conf->get_doc_storage) { - SL::File->store( object_id => $self->order->id, + eval { + SL::File->save(object_id => $self->order->id, object_type => $self->type, mime_type => 'application/pdf', source => 'created', file_type => 'document', file_name => $pdf_filename, file_contents => $pdf); + 1; + } or do { + $self->js->flash('error', t8('Storing PDF in storage backend failed: #1', $@)); + } } $self->js->render; } @@ -766,12 +771,12 @@ sub _check_auth { sub build_contact_select { my ($self) = @_; - $self->p->select_tag('order.cp_id', [ $self->order->{$self->cv}->contacts ], - value_key => 'cp_id', - title_key => 'full_name_dep', - default => $self->order->cp_id, - with_empty => 1, - style => 'width: 300px', + select_tag('order.cp_id', [ $self->order->{$self->cv}->contacts ], + value_key => 'cp_id', + title_key => 'full_name_dep', + default => $self->order->cp_id, + with_empty => 1, + style => 'width: 300px', ); } @@ -781,12 +786,12 @@ sub build_contact_select { sub build_shipto_select { my ($self) = @_; - $self->p->select_tag('order.shipto_id', [ $self->order->{$self->cv}->shipto ], - value_key => 'shipto_id', - title_key => 'displayable_id', - default => $self->order->shipto_id, - with_empty => 1, - style => 'width: 300px', + select_tag('order.shipto_id', [ $self->order->{$self->cv}->shipto ], + value_key => 'shipto_id', + title_key => 'displayable_id', + default => $self->order->shipto_id, + with_empty => 1, + style => 'width: 300px', ); } @@ -1088,7 +1093,6 @@ sub _pre_render { type => $self->type, number => $self->order->ordnumber, ); - my $webdav_path = $webdav->webdav_path; my @all_objects = $webdav->get_all_objects; @{ $self->{template_args}->{WEBDAV} } = map { { name => $_->filename, type => t8('File'), @@ -1117,7 +1121,6 @@ sub _setup_edit_action_bar { action => [ t8('Save and Delivery Order'), call => [ 'kivi.Order.save_and_delivery_order', $::instance_conf->get_order_warn_duplicate_parts ], - accesskey => 'enter', ], ], # end of combobox "Save"