From: Bernd Bleßmann Date: Tue, 19 Jan 2021 11:29:37 +0000 (+0100) Subject: Zeiterfassung: richtige Parameter f. Hintergrund-Job prüfen … X-Git-Tag: kivitendo-mebil_0.1-0~9^2~300 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=06fea22a5378d52ec870e76f83670f2191f1092b;p=kivitendo-erp.git Zeiterfassung: richtige Parameter f. Hintergrund-Job prüfen … und - Hash mit validen Parametern umbenannt - exists statt trueish - "die" statt "croak" --- diff --git a/SL/BackgroundJob/ConvertTimeRecordings.pm b/SL/BackgroundJob/ConvertTimeRecordings.pm index 2df2d8026..30b99f499 100644 --- a/SL/BackgroundJob/ConvertTimeRecordings.pm +++ b/SL/BackgroundJob/ConvertTimeRecordings.pm @@ -21,9 +21,9 @@ use Rose::Object::MakeMethods::Generic ( ); # valid parameters -> better as class members with rose generic set/get -my %params = ( - fromdate => '', - todate => '', +my %valid_params = ( + from_date => '', + to_date => '', customernumbers => '', part_id => '', rounding => 1, @@ -48,7 +48,7 @@ sub run { # check user input param names foreach my $param (keys %{ $data }) { - croak "Not a valid key: $param" unless $params{$param}; + die "Not a valid parameter: $param" unless exists $valid_params{$param}; } # TODO check user input param values - (defaults are assigned later)