From: Sven Schöling Date: Wed, 5 Aug 2015 15:09:29 +0000 (+0200) Subject: make_record: Zusätzliche Formvariablen speichern. X-Git-Tag: release-3.3.0~34 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=b81ceec0ae27fd58adbb724ad99a6ee48a74af35;p=kivitendo-erp.git make_record: Zusätzliche Formvariablen speichern. --- diff --git a/SL/Controller/PriceSource.pm b/SL/Controller/PriceSource.pm index b7ee8bded..0c3eb877a 100644 --- a/SL/Controller/PriceSource.pm +++ b/SL/Controller/PriceSource.pm @@ -93,15 +93,18 @@ sub _make_record_item { : $class->new; for my $method (apply { s/_$row$// } grep { /_$row$/ } keys %$::form) { - next unless $obj->meta->column($method); - if ($obj->meta->column($method)->isa('Rose::DB::Object::Metadata::Column::Date')) { - $obj->${\"$method\_as_date"}($::form->{"$method\_$row"}); - } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) { - $obj->${\"$method\_as_number"}($::form->{"$method\_$row"}); - } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) { - $obj->$method(!!$::form->{$method}); + if ($obj->meta->column($method)) { + if ($obj->meta->column($method)->isa('Rose::DB::Object::Metadata::Column::Date')) { + $obj->${\"$method\_as_date"}($::form->{"$method\_$row"}); + } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) { + $obj->${\"$method\_as_number"}($::form->{"$method\_$row"}); + } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) { + $obj->$method(!!$::form->{$method}); + } else { + $obj->$method($::form->{"$method\_$row"}); + } } else { - $obj->$method($::form->{"$method\_$row"}); + $obj->{__additional_form_attributes}{$method} = $::form->{"$method\_$row"}; } } diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 460adef86..b9d2cc494 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -2044,15 +2044,18 @@ sub _make_record_item { : $class->new; for my $method (apply { s/_$row$// } grep { /_$row$/ } keys %$::form) { - next unless $obj->meta->column($method); - if ($obj->meta->column($method)->isa('Rose::DB::Object::Metadata::Column::Date')) { - $obj->${\"$method\_as_date"}($::form->{"$method\_$row"}); - } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) { - $obj->${\"$method\_as_number"}($::form->{"$method\_$row"}); - } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) { - $obj->$method(!!$::form->{$method}); + if ($obj->meta->column($method)) { + if ($obj->meta->column($method)->isa('Rose::DB::Object::Metadata::Column::Date')) { + $obj->${\"$method\_as_date"}($::form->{"$method\_$row"}); + } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) { + $obj->${\"$method\_as_number"}($::form->{"$method\_$row"}); + } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) { + $obj->$method(!!$::form->{$method}); + } else { + $obj->$method($::form->{"$method\_$row"}); + } } else { - $obj->$method($::form->{"$method\_$row"}); + $obj->{__additional_form_attributes}{$method} = $::form->{"$method\_$row"}; } }