X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FGenericTranslations.pm;h=263c827afc0d9c3dc38becd06ed0b134a6eb3e23;hb=f05bd96b031d7d4ffaf4804704684ae929a0890a;hp=5592af2b0fbcb3897dace91454978de750105874;hpb=4dbcf68099d51d441cd7d292dab862fc04cdcc98;p=kivitendo-erp.git diff --git a/SL/GenericTranslations.pm b/SL/GenericTranslations.pm index 5592af2b0..263c827af 100644 --- a/SL/GenericTranslations.pm +++ b/SL/GenericTranslations.pm @@ -1,6 +1,9 @@ package GenericTranslations; use SL::DBUtils; +use SL::DB; + +use strict; sub get { $main::lxdebug->enter_sub(); @@ -88,8 +91,16 @@ sub list { } sub save { + my ($self, %params) = @_; $main::lxdebug->enter_sub(); + my $rc = SL::DB->client->with_transaction(\&_save, $self, %params); + + $::lxdebug->leave_sub; + return $rc; +} + +sub _save { my $self = shift; my %params = @_; @@ -98,7 +109,7 @@ sub save { my $myconfig = \%main::myconfig; my $form = $main::form; - my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig); + my $dbh = $params{dbh} || SL::DB->client->dbh; $params{translation} =~ s/^\s+//; $params{translation} =~ s/\s+$//; @@ -137,9 +148,7 @@ sub save { do_query($form, $dbh, $q_insert, @v_insert); } - $dbh->commit() unless ($params{dbh}); - - $main::lxdebug->leave_sub(); + return 1; }