From: Eric Bollengier Date: Mon, 20 Aug 2007 13:23:07 +0000 (+0000) Subject: ebl fix update of Media.LocationId field during label barcodes X-Git-Tag: Release-2.2.1~43 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=32ad831139bfd3a3c0cc90433248f5401eeb3677;p=bacula%2Fbacula ebl fix update of Media.LocationId field during label barcodes git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5380 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index 5d5dc701e2..5f3c07ba13 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -3360,20 +3360,6 @@ sub label_barcodes $t += 60*scalar( @{ $arg->{slots} }) ; } - $self->dbh_do(" - UPDATE Media - SET LocationId = (SELECT LocationId - FROM Location - WHERE Location = '$arg->{ach}'), - - RecyclePoolId = (SELECT PoolId - FROM Pool - WHERE Name = 'Scratch') - - WHERE (LocationId = 0 OR LocationId IS NULL) - $slots_sql -"); - my $b = new Bconsole(pref => $self->{info}, timeout => $t,log_stdout => 1); print "

This command can take long time, be patient...

"; print "
" ;
@@ -3383,6 +3369,17 @@ sub label_barcodes
 		       slots => $slots) ;
     $b->close();
     print "
"; + + $self->dbh_do(" + UPDATE Media + SET LocationId = (SELECT LocationId + FROM Location + WHERE Location = '$arg->{ach}') + + WHERE (LocationId = 0 OR LocationId IS NULL) + $slots_sql +"); + } sub purge