X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=64d09d1248b2f572a6feed499ee0d93857cc3527;hb=65b054be8038e3eeb3dd2c87ba52a82a843cfd4f;hp=b5af00359285ac5f83435f49150732875c3e7bc5;hpb=de009a3fee7e0471c3e095ce92d8708ff2b42597;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index b5af00359..64d09d124 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1436,7 +1436,7 @@ sub get_standard_dbh { undef $standard_dbh; } - $standard_dbh ||= $self->dbconnect_noauto($myconfig); + $standard_dbh ||= SL::DB->create(undef, 'KIVITENDO')->dbh; $main::lxdebug->leave_sub(2); @@ -2591,16 +2591,21 @@ sub all_vc { } sub new_lastmtime { - my ($self, $table, $option) = @_; + $main::lxdebug->enter_sub(); + + my ($self, $table, $provided_dbh) = @_; + my $dbh = $provided_dbh ? $provided_dbh : $self->get_standard_dbh; return unless $self->{id}; croak ("wrong call, no valid table defined") unless $table =~ /^(oe|ar|ap|delivery_orders|parts)$/; my $query = "SELECT mtime, itime FROM " . $table . " WHERE id = ?"; - my $ref = selectfirst_hashref_query($self, $self->get_standard_dbh, $query, $self->{id}); + my $ref = selectfirst_hashref_query($self, $dbh, $query, $self->{id}); $ref->{mtime} ||= $ref->{itime}; $self->{lastmtime} = $ref->{mtime}; $main::lxdebug->message(LXDebug->DEBUG2(),"new lastmtime=".$self->{lastmtime}); + + $main::lxdebug->leave_sub(); } sub mtime_ischanged {