X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIS.pm;h=b595616565fb1b17d9343915f177f58f28506f57;hb=e765448cae9f91754d3e93b377705f8533e0b842;hp=e59f2546dfdb13c35b67969a09baefa5409746a8;hpb=15682dc47316fcc2deab66730045cd38afec001f;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index e59f2546d..b59561656 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -36,6 +36,7 @@ package IS; use Data::Dumper; use SL::AM; +use SL::Common; use SL::DBUtils; sub invoice_details { @@ -1038,9 +1039,7 @@ Message: $form->{message}\r| if $form->{message}; # save printed, emailed and queued $form->save_status($dbh); - if ($form->{webdav}) { - &webdav_folder($myconfig, $form); - } + Common::webdav_folder($form) if ($main::webdav); my $rc = $dbh->commit; $dbh->disconnect; @@ -1658,9 +1657,7 @@ sub retrieve_invoice { } $sth->finish; - if ($form->{webdav}) { - &webdav_folder($myconfig, $form); - } + Common::webdav_folder($form) if ($main::webdav); } my $rc = $dbh->commit; @@ -2185,36 +2182,5 @@ sub get_pricegroups_for_parts { $main::lxdebug->leave_sub(); } -sub webdav_folder { - $main::lxdebug->enter_sub(); - - my ($myconfig, $form) = @_; - -SWITCH: { - $path = "webdav/rechnungen/" . $form->{invnumber}, last SWITCH - if ($form->{vc} eq "customer"); - $path = "webdav/einkaufsrechnungen/" . $form->{invnumber}, last SWITCH - if ($form->{vc} eq "vendor"); - } - - if (!-d $path) { - mkdir($path, 0770) or die "can't make directory $!\n"; - } else { - if ($form->{id}) { - @files = <$path/*>; - foreach $file (@files) { - $file =~ /\/([^\/]*)$/; - $fname = $1; - $ENV{'SCRIPT_NAME'} =~ /\/([^\/]*)\//; - $lxerp = $1; - $link = "http://" . $ENV{'SERVER_NAME'} . "/" . $lxerp . "/" . $file; - $form->{WEBDAV}{$fname} = $link; - } - } - } - - $main::lxdebug->leave_sub(); -} - 1;