X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FCommon.pm;h=e63b698a18b4738018549a82ce6891f15b24d2cb;hb=0d1bb5102f01eb03da55bc87b52ac52cd7ae7534;hp=e86e6c42506c284ae5a71eca54b7abeeca682c6b;hpb=61cdba5d566357f3beabe0e7f3f0cb2d7bdccd73;p=kivitendo-erp.git diff --git a/SL/Common.pm b/SL/Common.pm index e86e6c425..e63b698a1 100644 --- a/SL/Common.pm +++ b/SL/Common.pm @@ -11,32 +11,12 @@ package Common; use utf8; use strict; +use Carp; use Time::HiRes qw(gettimeofday); use Data::Dumper; use SL::DBUtils; -use vars qw(@db_encodings %db_encoding_to_charset %charset_to_db_encoding); - -@db_encodings = ( - { "label" => "ASCII", "dbencoding" => "SQL_ASCII", "charset" => "ASCII" }, - { "label" => "UTF-8 Unicode", "dbencoding" => "UNICODE", "charset" => "UTF-8" }, - { "label" => "ISO 8859-1", "dbencoding" => "LATIN1", "charset" => "ISO-8859-1" }, - { "label" => "ISO 8859-2", "dbencoding" => "LATIN2", "charset" => "ISO-8859-2" }, - { "label" => "ISO 8859-3", "dbencoding" => "LATIN3", "charset" => "ISO-8859-3" }, - { "label" => "ISO 8859-4", "dbencoding" => "LATIN4", "charset" => "ISO-8859-4" }, - { "label" => "ISO 8859-5", "dbencoding" => "LATIN5", "charset" => "ISO-8859-5" }, - { "label" => "ISO 8859-15", "dbencoding" => "LATIN9", "charset" => "ISO-8859-15" }, - { "label" => "KOI8-R", "dbencoding" => "KOI8", "charset" => "KOI8-R" }, - { "label" => "Windows CP1251", "dbencoding" => "WIN", "charset" => "CP1251" }, - { "label" => "Windows CP866", "dbencoding" => "ALT", "charset" => "CP866" }, -); - -%db_encoding_to_charset = map { $_->{dbencoding}, $_->{charset} } @db_encodings; -%charset_to_db_encoding = map { $_->{charset}, $_->{dbencoding} } @db_encodings; - -use constant DEFAULT_CHARSET => 'ISO-8859-15'; - sub unique_id { my ($a, $b) = gettimeofday(); return "${a}-${b}-${$}"; @@ -85,7 +65,7 @@ sub retrieve_parts { } if ($form->{no_services}) { - $filter .= qq| AND (inventory_accno_id is not NULL or assembly=TRUE)|; # @mb hier nochmal optimieren ... nach kurzer ruecksprache alles i.o. + $filter .= qq| AND (inventory_accno_id is not NULL or assembly=TRUE)|; } substr($filter, 1, 3) = "WHERE" if ($filter); @@ -94,7 +74,8 @@ sub retrieve_parts { $order_dir = $order_dir ? "ASC" : "DESC"; my $query = - qq|SELECT id, partnumber, description, ean | . + qq|SELECT id, partnumber, description, ean, | . + qq| warehouse_id, bin_id | . qq|FROM parts $filter | . qq|ORDER BY $order_by $order_dir|; my $sth = $dbh->prepare($query); @@ -353,6 +334,8 @@ sub webdav_folder { return $main::lxdebug->leave_sub() unless ($::lx_office_conf{features}->{webdav} && $form->{id}); + croak "No client set in \$::auth" unless $::auth->client; + my ($path, $number); $form->{WEBDAV} = []; @@ -381,7 +364,7 @@ sub webdav_folder { $number =~ s|[/\\]|_|g; - $path = "webdav/${path}/${number}"; + $path = "webdav/" . $::auth->client->{id} . "/${path}/${number}"; if (!-d $path) { mkdir_with_parents($path); @@ -389,7 +372,6 @@ sub webdav_folder { } else { my $base_path = $ENV{'SCRIPT_NAME'}; $base_path =~ s|[^/]+$||; - # wo kommt der wert für dir her? es wird doch gar nichts übergeben? fix für strict my $dir jb 21.2. if (opendir my $dir, $path) { foreach my $file (sort { lc $a cmp lc $b } readdir $dir) { next if (($file eq '.') || ($file eq '..'));