From: Jan Büren Date: Fri, 23 Jan 2015 15:17:18 +0000 (+0100) Subject: Konditional RecordLink save aufrufen (analog zu ar auch für oe) X-Git-Tag: release-3.2.0beta~42 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=78912e55533a48109adc11e798101b29e174728d;p=kivitendo-erp.git Konditional RecordLink save aufrufen (analog zu ar auch für oe) --- diff --git a/SL/IR.pm b/SL/IR.pm index 457c48162..0dd0ee8b2 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -757,14 +757,16 @@ SQL Common::webdav_folder($form); # Link this record to the records it was created from. - RecordLinks->create_links('dbh' => $dbh, - 'mode' => 'ids', - 'from_table' => 'oe', - 'from_ids' => $form->{convert_from_oe_ids}, - 'to_table' => 'ap', - 'to_id' => $form->{id}, - ); - delete $form->{convert_from_oe_ids}; + if ($form->{convert_from_oe_ids}) { + RecordLinks->create_links('dbh' => $dbh, + 'mode' => 'ids', + 'from_table' => 'oe', + 'from_ids' => $form->{convert_from_oe_ids}, + 'to_table' => 'ap', + 'to_id' => $form->{id}, + ); + delete $form->{convert_from_oe_ids}; + } my @convert_from_do_ids = map { $_ * 1 } grep { $_ } split m/\s+/, $form->{convert_from_do_ids}; if (scalar @convert_from_do_ids) { diff --git a/SL/IS.pm b/SL/IS.pm index e2358ea16..0d3cdf0bd 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1215,14 +1215,16 @@ SQL } # Link this record to the records it was created from. - RecordLinks->create_links('dbh' => $dbh, - 'mode' => 'ids', - 'from_table' => 'oe', - 'from_ids' => $form->{convert_from_oe_ids}, - 'to_table' => 'ar', - 'to_id' => $form->{id}, - ); - delete $form->{convert_from_oe_ids}; + if ($form->{convert_from_oe_ids}) { + RecordLinks->create_links('dbh' => $dbh, + 'mode' => 'ids', + 'from_table' => 'oe', + 'from_ids' => $form->{convert_from_oe_ids}, + 'to_table' => 'ar', + 'to_id' => $form->{id}, + ); + delete $form->{convert_from_oe_ids}; + } my @convert_from_do_ids = map { $_ * 1 } grep { $_ } split m/\s+/, $form->{convert_from_do_ids};