X-Git-Url: http://wagnertech.de/git?p=kivitendo-erp.git;a=blobdiff_plain;f=SL%2FDB%2FShop.pm;fp=SL%2FDB%2FShop.pm;h=bcae3214d31ab7427ba25092b0016318a7f561e7;hp=63f988f03a608763ba9415911a40c57555cfba86;hb=b293ff8ad52fc76ba0c44783e3982418114d6b08;hpb=d4925a8b60f04674885e30d9316dc0263f8b9a84 diff --git a/SL/DB/Shop.pm b/SL/DB/Shop.pm index 63f988f03..bcae3214d 100644 --- a/SL/DB/Shop.pm +++ b/SL/DB/Shop.pm @@ -16,10 +16,26 @@ sub validate { my ($self) = @_; my @errors; - + # critical checks push @errors, $::locale->text('The description is missing.') unless $self->{description}; - push @errors, $::locale->text('The path is missing.') unless $self->{path}; - + push @errors, $::locale->text('The path is missing.') unless $self->{path}; + push @errors, $::locale->text('The Host Name is missing') unless $self->{server}; + push @errors, $::locale->text('The Host Name seems invalid') unless $self->{server} =~ m/[0-9A-Za-z].\.[0-9A-Za-z]/; + push @errors, $::locale->text('The Protocol for Host Name seems invalid (expected: http:// or https://)!') + if ($self->{server} =~ m/:/ && $self->{server} !~ m/(^https:\/\/|^http:\/\/)/); + push @errors, $::locale->text('The Proxy Name seems invalid') . $self->{proxy} . ':' unless !$self->{proxy} || $self->{proxy} =~ m/[0-9A-Za-z].\.[0-9A-Za-z]/; + push @errors, $::locale->text('Orders to fetch neeeds a positive Integer') + unless $self->{orders_to_fetch} > 0; + + # not yet implemented checks + if ($self->{connector} eq 'shopware6') { + push @errors, $::locale->text('Transaction Description is not yet implemented') if $self->{transaction_description}; + push @errors, $::locale->text('Shipping cost article is not implemented') if $self->{shipping_costs_parts_id}; + push @errors, $::locale->text('Fetch from last order number is not implemented') if $self->{last_order_number}; + } else { + push @errors, $::locale->text('Use Long Description from Parts is only for Shopware6 implemented') + if $self->{use_part_longdescription}; + } return @errors; }