From: Eric Bollengier Date: Mon, 4 Dec 2006 18:42:32 +0000 (+0000) Subject: ebl add mediatype filter to pool view X-Git-Tag: Release-2.0.0~167 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fd48169952bd9b1a5edc3d4a8b3bc680a9bf3098;p=bacula%2Fbacula ebl add mediatype filter to pool view git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3750 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/bweb/lang/fr/tpl/display_pool.tpl b/gui/bweb/lang/fr/tpl/display_pool.tpl index f6811979e4..fc5c5e5c99 100644 --- a/gui/bweb/lang/fr/tpl/display_pool.tpl +++ b/gui/bweb/lang/fr/tpl/display_pool.tpl @@ -6,6 +6,9 @@
+ + > +

Tips : Pour modifier les options d'un pool, vous devez éditer la configuration bacula et diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index 799653bcf2..336e63e286 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -2441,6 +2441,14 @@ GROUP BY Client.Name sub display_pool { my ($self, $poolname) = @_ ; + my $whereA = ''; + my $whereW = ''; + + my $arg = $self->get_form('jmediatypes', 'qmediatypes'); + if ($arg->{jmediatypes}) { + $whereW = "WHERE MediaType IN ($arg->{jmediatypes}) "; + $whereA = "AND MediaType IN ($arg->{jmediatypes}) "; + } # TODO : afficher les tailles et les dates @@ -2473,6 +2481,7 @@ FROM GROUP BY Media.MediaType, Media.PoolId, media_avg_size.volavg ) AS subq LEFT JOIN Pool ON (Pool.PoolId = subq.PoolId) +$whereW "; my $all = $self->dbh_selectall_hashref($query, 'name') ; @@ -2482,6 +2491,7 @@ SELECT Pool.Name AS name, sum(VolBytes) AS size FROM Media JOIN Pool ON (Media.PoolId = Pool.PoolId) WHERE Media.VolStatus IN ('Recycled', 'Purged') + $whereA GROUP BY Pool.Name; "; my $empty = $self->dbh_selectall_hashref($query, 'name'); @@ -2501,6 +2511,7 @@ GROUP BY Pool.Name; SELECT VolStatus AS volstatus, count(MediaId) AS nb FROM Media WHERE PoolId=$p->{poolid} + $whereA GROUP BY VolStatus "; my $content = $self->dbh_selectall_hashref($query, 'volstatus'); @@ -2511,6 +2522,7 @@ GROUP BY VolStatus $self->debug($all); $self->display({ ID => $cur_id++, + MediaType => $arg->{qmediatypes}, # [ { name => type1 } , { name => type2 } ] Pools => [ values %$all ]}, "display_pool.tpl"); } diff --git a/gui/bweb/tpl/display_pool.tpl b/gui/bweb/tpl/display_pool.tpl index 6285daf9f4..3148e0fe7d 100644 --- a/gui/bweb/tpl/display_pool.tpl +++ b/gui/bweb/tpl/display_pool.tpl @@ -6,6 +6,9 @@
+ + > +

Tips: To modify pool properties, you have to edit your bacula configuration