X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FCommon.pm;h=9c83c7d174de0b2cce7dbd5bf733f03da22f8b87;hb=8626a95d5b7c1a13b53ac8d3d486bf62be149885;hp=4cd1d35ed5d3b2543b5c9c807af68a9b376edcbe;hpb=fb4d2ffa6aae03b36e4db77be10c3d9dce4413f8;p=kivitendo-erp.git diff --git a/SL/Common.pm b/SL/Common.pm index 4cd1d35ed..9c83c7d17 100644 --- a/SL/Common.pm +++ b/SL/Common.pm @@ -280,6 +280,8 @@ sub webdav_folder { return $main::lxdebug->leave_sub() unless ($path && $number); + $number =~ s|[/\\]|_|g; + $path = "webdav/${path}/${number}"; if (!-d $path) { @@ -348,4 +350,23 @@ sub get_vc_details { return 1; } +sub get_shipto_by_id { + $main::lxdebug->enter_sub(); + + my ($self, $myconfig, $form, $shipto_id, $prefix) = @_; + + $prefix ||= ""; + + my $dbh = $form->dbconnect($myconfig); + + my $query = qq|SELECT * FROM shipto WHERE shipto_id = ?|; + my $ref = selectfirst_hashref_query($form, $dbh, $query, $shipto_id); + + map { $form->{"${prefix}${_}"} = $ref->{$_} } keys %{ $ref } if $ref; + + $dbh->disconnect(); + + $main::lxdebug->leave_sub(); +} + 1;