From 1b881e3daaafcc5d139718457e406e1ed1c812d2 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 14 Nov 2007 23:20:55 +0000 Subject: [PATCH] ebl Add some sql to get media Enabled and InChanger flags git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5933 91ce42f0-d328-0410-95d8-f526ca767f89 --- gui/bweb/cgi/bresto.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gui/bweb/cgi/bresto.pl b/gui/bweb/cgi/bresto.pl index 78c8c8db94..1acba67901 100755 --- a/gui/bweb/cgi/bresto.pl +++ b/gui/bweb/cgi/bresto.pl @@ -825,6 +825,25 @@ if ($action eq 'list_files') { @$files); print "]\n"; +} elsif ($action eq 'get_media') { + + my $jobid = join(',', @jobid); + my $fileid = join(',', grep { /^\d+$/ } CGI::param('fileid')); + +my $q=" + SELECT DISTINCT VolumeName, InChanger + FROM File, + ( -- Get all media from this job + SELECT MAX(FirstIndex), MIN(LastIndex), VolumeName, Inchanger + FROM JobMedia JOIN Media USING (MediaId) + WHERE JobId IN ($jobid) + GROUP BY VolumeName, InChanger + ) AS allmedia + WHERE File.FileId IN ($fileid) + AND File.FileIndex >= allmedia.FirstIndex + AND File.FileIndex <= allmedia.LastIndex; +"; + } -- 2.39.5