From: Eric Bollengier Date: Thu, 5 Jul 2007 14:43:33 +0000 (+0000) Subject: ebl update label barcodes function X-Git-Tag: Release-2.2.0~195 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b2848159df1fd406d1726fdeefb6465a443c1c39;p=bacula%2Fbacula ebl update label barcodes function git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5123 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index 85d3414431..be13e0fa14 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -3337,36 +3337,37 @@ sub label_barcodes } my $slots = ''; + my $slots_sql = ''; my $t = 300 ; if ($arg->{slots}) { $slots = join(",", @{ $arg->{slots} }); + $slots_sql = " AND Slot IN ($slots) "; $t += 60*scalar( @{ $arg->{slots} }) ; } - my $b = new Bconsole(pref => $self->{info}, timeout => $t,log_stdout => 1); - print "

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

"; - print "
" ;
-    $b->label_barcodes(storage => $storage,
-		       drive => $arg->{drive},
-		       pool  => 'Scratch',
-		       slots => $slots) ;
-    $b->close();
-    print "
"; - $self->dbh_do(" UPDATE Media SET LocationId = (SELECT LocationId FROM Location WHERE Location = '$arg->{ach}'), - RecyclePoolId = PoolId - - WHERE Media.PoolId = (SELECT PoolId + RecyclePoolId = (SELECT PoolId FROM Pool WHERE Name = 'Scratch') - AND (LocationId = 0 OR LocationId IS NULL) + + 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 "
" ;
+    $b->label_barcodes(storage => $storage,
+		       drive => $arg->{drive},
+		       pool  => 'Scratch',
+		       slots => $slots) ;
+    $b->close();
+    print "
"; } sub purge