X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FCommon.pm;h=fe2196df1cf8a681bc6af88aad48483006005483;hb=550a75a67c8cd48abdb0e92dc4b2f49c6a1d0879;hp=8bc0d1484d72c45437a53e73c3c40121b87f2f1a;hpb=8c7e44938a661e035f62840e1e177353240ace5d;p=kivitendo-erp.git diff --git a/SL/Common.pm b/SL/Common.pm index 8bc0d1484..fe2196df1 100644 --- a/SL/Common.pm +++ b/SL/Common.pm @@ -61,6 +61,12 @@ sub retrieve_parts { if ($form->{no_assemblies}) { $filter .= qq| AND (NOT COALESCE(assembly, 'f'))|; } + if ($form->{assemblies}) { + $filter .= qq| AND assembly='t'|; # alles was assembly ist rausgeben erweiterung für bin/mozilla/wh.pl -> transfer_assembly_update_part +# eigentlich möchte ich diesen filter abbilden: +# select distinct partnumber from parts inner join assembly on (parts.id = assembly.id) where assembly='t'; +# und so common ist die anweisung gar nicht. wie wäre es mit auslagern in WH.pm? -> get_all_working_assemblies? jb 21.2.2009 + } if ($form->{no_services}) { $filter .= qq| AND (COALESCE(inventory_accno_id, 0) > 0)|; @@ -363,8 +369,8 @@ sub webdav_folder { my $base_path = substr($ENV{'SCRIPT_NAME'}, 1); $base_path =~ s|[^/]+$||; $base_path =~ s|/$||; - - if (opendir $dir, $path) { + # 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 '..')); @@ -511,9 +517,23 @@ sub check_params { my $params = shift; foreach my $key (@_) { - if (!defined $params->{$key}) { + if ((ref $key eq '') && !defined $params->{$key}) { my $subroutine = (caller(1))[3]; $main::form->error($main::locale->text("Missing parameter #1 in call to sub #2.", $key, $subroutine)); + + } elsif (ref $key eq 'ARRAY') { + my $found = 0; + foreach my $subkey (@{ $key }) { + if (defined $params->{$subkey}) { + $found = 1; + last; + } + } + + if (!$found) { + my $subroutine = (caller(1))[3]; + $main::form->error($main::locale->text("Missing parameter (at least one of #1) in call to sub #2.", join(', ', @{ $key }), $subroutine)); + } } } } @@ -522,9 +542,23 @@ sub check_params_x { my $params = shift; foreach my $key (@_) { - if (!exists $params->{$key}) { + if ((ref $key eq '') && !exists $params->{$key}) { my $subroutine = (caller(1))[3]; $main::form->error($main::locale->text("Missing parameter #1 in call to sub #2.", $key, $subroutine)); + + } elsif (ref $key eq 'ARRAY') { + my $found = 0; + foreach my $subkey (@{ $key }) { + if (exists $params->{$subkey}) { + $found = 1; + last; + } + } + + if (!$found) { + my $subroutine = (caller(1))[3]; + $main::form->error($main::locale->text("Missing parameter (at least one of #1) in call to sub #2.", join(', ', @{ $key }), $subroutine)); + } } } }