From: Bernd Bleßmann Date: Tue, 18 May 2021 13:49:32 +0000 (+0200) Subject: Zeiterfassung: als gebucht markieren: Manager-Methode update_all statt Schleife X-Git-Tag: kivitendo-mebil_0.1-0~9^2~209 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4e18047a0c80ab7c6e6b95e6b6cb79cc0489a6cc;p=kivitendo-erp.git Zeiterfassung: als gebucht markieren: Manager-Methode update_all statt Schleife --- diff --git a/SL/Controller/TimeRecording.pm b/SL/Controller/TimeRecording.pm index 10870efd0..930f346d6 100644 --- a/SL/Controller/TimeRecording.pm +++ b/SL/Controller/TimeRecording.pm @@ -90,8 +90,10 @@ sub action_mark_as_booked { my ($self) = @_; if (scalar @{ $::form->{ids} }) { - my $trs = SL::DB::Manager::TimeRecording->get_all(query => [id => $::form->{ids}]); - $_->update_attributes(booked => 1) for @$trs; + SL::DB::Manager::TimeRecording->update_all( + set => { booked => 1 }, + where => [ id => $::form->{ids} ] + ); } $self->redirect_to(safe_callback());