]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl fix update of Media.LocationId field during label barcodes
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 20 Aug 2007 13:23:07 +0000 (13:23 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 20 Aug 2007 13:23:07 +0000 (13:23 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5380 91ce42f0-d328-0410-95d8-f526ca767f89

gui/bweb/lib/Bweb.pm

index 5d5dc701e28203d76f15baba62558ea538149e97..5f3c07ba13f7ff162228fa4d9eab832589f038ee 100644 (file)
@@ -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 "<h1>This command can take long time, be patient...</h1>";
     print "<pre>" ;
@@ -3383,6 +3369,17 @@ sub label_barcodes
                       slots => $slots) ;
     $b->close();
     print "</pre>";
+
+    $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