} elsif ($action eq 'media') {
print "<div><table border='0'><tr><td valign='top'>\n";
- my $fields = $bweb->get_form(qw/db_locations db_pools
+ my $fields = $bweb->get_form(qw/db_locations db_pools expired
qlocations qpools volstatus qre_media
limit qmediatypes db_mediatypes/);
$bweb->display($fields, "display_form_media.tpl");
<TMPL_IF qre_media>value=<TMPL_VAR qre_media></TMPL_IF>
class='formulaire' size='8'>
</td>
+</tr>
+ <tr>
+ <td valign='bottom'>
+ <h2>Expired media</h2>
+ <input type='checkbox' name='expired' <TMPL_IF expired> checked </TMPL_IF>
+ class='formulaire'>
+ </td>
</tr>
<tr>
<td valign='bottom'>
<TMPL_IF qre_media>value=<TMPL_VAR qre_media></TMPL_IF>
class='formulaire' size='8'>
</td>
+</tr>
+ <tr>
+ <td valign='bottom'>
+ <h2>Médias expirés</h2>
+ <input type='checkbox' name='expired' <TMPL_IF expired> checked </TMPL_IF>
+ class='formulaire'>
+ </td>
</tr>
<tr>
<td valign='bottom'>
type => 1,
poolrecycle => 1,
replace => 1,
+ expired => 1,
);
my %opt_p = ( # option with path
fileset=> 1,
'volstatus',
'locations');
- my $arg = $self->get_form('jmedias', 'qre_media');
+ my $arg = $self->get_form('jmedias', 'qre_media', 'expired');
if ($arg->{jmedias}) {
$where = "AND Media.VolumeName IN ($arg->{jmedias}) $where";
if ($arg->{qre_media}) {
$where = "AND Media.VolumeName $self->{sql}->{MATCH} $arg->{qre_media} $where";
}
+ if ($arg->{expired}) {
+ $where = "
+ AND VolStatus = 'Full'
+ AND ( $self->{sql}->{UNIX_TIMESTAMP}(Media.LastWritten)
+ + $self->{sql}->{TO_SEC}(Media.VolRetention)
+ ) < NOW() " . $where ;
+ }
my $query="
SELECT Media.VolumeName AS volumename,
$self->display({ ID => $cur_id++,
Pool => $elt{pool},
Location => $elt{location},
- Medias => [ values %$all ]
+ Medias => [ values %$all ],
},
"display_media.tpl");
}
<li><a href="bweb.pl?action=groups">Groups</a> </li>
</ul>
</li>
- <li>Jobs
+ <li style="padding: 0.25em 2em;">Jobs
<ul>
<li><a href="bweb.pl?action=run_job">Defined Jobs</a>
<li><a href="bweb.pl?action=job_group">Jobs by group</a>
<TMPL_IF qre_media>value=<TMPL_VAR qre_media></TMPL_IF>
class='formulaire' size='8'>
</td>
+</tr>
+ <tr>
+ <td valign='bottom'>
+ <h2>Expired media</h2>
+ <input type='checkbox' name='expired' <TMPL_IF expired> checked </TMPL_IF>
+ class='formulaire'>
+ </td>
+</tr>
</tr>
<tr>
<td valign='bottom'>