Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6550f507

Von Bernd Bleßmann vor fast 9 Jahren hinzugefügt

  • ID 6550f5070171fd6497754dec7d15dd2339e18909
  • Vorgänger 3914f665
  • Nachfolger 91abaf6c

Auftrags-Controller: Webdav

Unterschiede anzeigen:

SL/Controller/Order.pm
9 9
use SL::SessionFile::Random;
10 10
use SL::PriceSource;
11 11
use SL::Form;
12
use SL::Webdav;
12 13

  
13 14
use SL::DB::Order;
14 15
use SL::DB::Customer;
......
153 154

  
154 155
  my $pdf_filename = $form->generate_attachment_filename();
155 156

  
157
  # copy file to webdav folder
158
  if ($self->order->ordnumber && $::instance_conf->get_webdav_documents) {
159
    my $webdav = SL::Webdav->new(
160
      type     => $self->type,
161
      number   => $self->order->ordnumber,
162
    );
163
    my $webdav_file = SL::Webdav::File->new(
164
      webdav   => $webdav,
165
      filename => $pdf_filename,
166
    );
167
    eval {
168
      $webdav_file->store(data => \$pdf);
169
      1;
170
    } or do {
171
      $self->js->flash('error', t8('Storing PDF to webdav folder failed: #1', $@));
172
    }
173
  }
174

  
156 175
  $self->js
157 176
    ->run('download_pdf', $pdf_filename, $key)
158 177
    ->flash('info', t8('The PDF has been created'))->render($self);
......
651 670

  
652 671
  }
653 672

  
673
  if ($self->order->ordnumber && $::instance_conf->get_webdav) {
674
    my $webdav = SL::Webdav->new(
675
      type     => $self->type,
676
      number   => $self->order->ordnumber,
677
    );
678
    my $webdav_path = $webdav->webdav_path;
679
    my @all_objects = $webdav->get_all_objects;
680
    @{ $self->{template_args}->{WEBDAV} } = map { { name => $_->filename,
681
                                                    type => t8('File'),
682
                                                    link => File::Spec->catdir($webdav_path, $_->filename),
683
                                                } } @all_objects;
684
  }
685

  
654 686
  $::request->{layout}->use_javascript("${_}.js")  for qw(ckeditor/ckeditor ckeditor/adapters/jquery);
655 687
}
656 688

  

Auch abrufbar als: Unified diff