X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FCommon.pm;h=9d7cdcbccd088ca37b8ac1b293fbfdcadc96d1cd;hb=75e721508b508648ffe2454f10cfe29ba8a359dd;hp=2aedb6f81d25ddfb42dbfff9df2482ac642d1dee;hpb=6d1df9ca24bbb8c03e10812ce4cf1b889d947470;p=kivitendo-erp.git diff --git a/SL/Common.pm b/SL/Common.pm index 2aedb6f81..9d7cdcbcc 100644 --- a/SL/Common.pm +++ b/SL/Common.pm @@ -435,4 +435,26 @@ sub save_email_status { $main::lxdebug->leave_sub(); } +sub check_params { + my $params = shift; + + foreach my $key (@_) { + if (!defined $params->{$key}) { + my $subroutine = (caller(1))[3]; + $main::form->error($main::locale->text("Missing parameter #1 in call to sub #2.", $key, $subroutine)); + } + } +} + +sub check_params_x { + my $params = shift; + + foreach my $key (@_) { + if (!exists $params->{$key}) { + my $subroutine = (caller(1))[3]; + $main::form->error($main::locale->text("Missing parameter #1 in call to sub #2.", $key, $subroutine)); + } + } +} + 1;