$bweb->location_del();
} elsif ($action eq 'media') {
+ print "<div><table border='0'><tr><td valign='top'>\n";
+ my $fields = $bweb->get_form(qw/db_locations db_pools
+ qlocations qpools volstatus qre_media
+ limit qmediatypes db_mediatypes/);
+ $bweb->display($fields, "display_form_media.tpl");
+
+ print "</td><td valign='top'>";
$bweb->display_media();
+ print "</td></tr></table></div>";
} elsif ($action eq 'medias') {
$bweb->display_medias();
--- /dev/null
+<div class="otherboxtitle">
+ Filtre
+</div>
+<div class="otherbox">
+<form name='form1' action='?' method='GET'>
+<table border='0'>
+<tr>
+ <td valign='top'>
+ <h2>Type de Média</h2>
+ <select name='mediatype' class='formulaire'>
+ <option id='mediatype_all' value=''></option>
+<TMPL_LOOP NAME=db_mediatypes>
+ <option id='mediatype_<TMPL_VAR mediatype>'><TMPL_VAR mediatype></option>
+</TMPL_LOOP>
+ </select>
+ </td>
+</tr>
+<tr>
+ <td valign='top'>
+ <h2>Localisation</h2>
+ <select name='location' class='formulaire'>
+ <option id='location_all>' value=''></option>
+<TMPL_LOOP NAME=db_locations>
+ <option id='location_<TMPL_VAR location>'><TMPL_VAR location></option>
+</TMPL_LOOP>
+ </select>
+ </td>
+</tr>
+<tr>
+ <td valign='top'>
+ <h2>Statut</h2>
+ <select name='volstatus' class='formulaire'>
+ <option id='volstatus_All' value=''></option>
+ <option id='volstatus_Append' value='Append'>Append</option>
+ <option id='volstatus_Full' value='Full'>Full</option>
+ <option id='volstatus_Error' value='Error'>Error</option>
+ <option id='volstatus_Used' value='Used'>Used</option>
+ <option id='volstatus_Purged' value='Purged'>Purged</option>
+ </select>
+ </td>
+</tr>
+<tr>
+ <td valign='top'>
+ <h2>Pool</h2>
+ <select name='pool' class='formulaire'>
+ <option id='pool_all>' value=''></option>
+<TMPL_LOOP NAME=db_pools>
+ <option id='pool_<TMPL_VAR name>'><TMPL_VAR name></option>
+</TMPL_LOOP>
+ </select>
+ </td>
+</tr>
+ <tr>
+ <td valign='bottom'>
+ <h2>Label</h2>
+ <input type='text' name='re_media'
+ <TMPL_IF qre_media>value=<TMPL_VAR qre_media></TMPL_IF>
+ class='formulaire' size='8'>
+ </td>
+</tr>
+ <tr>
+ <td valign='bottom'>
+ <h2>Nombre d'éléments</h2>
+ <input type='text' name='limit' value='<TMPL_VAR limit>'
+ class='formulaire' size='4'>
+ </td>
+</tr>
+
+</table>
+ <input type="image" name='action' value='media' src='/bweb/update.png'>
+
+</form>
+</div>
+<script type="text/javascript" language="JavaScript">
+ <TMPL_IF volstatus>
+ document.getElementById('volstatus_<TMPL_VAR volstatus>').selected=true;
+ </TMPL_IF>
+
+ <TMPL_LOOP qmediatypes>
+ document.getElementById('mediatype_' + <TMPL_VAR name>).selected = true;
+ </TMPL_LOOP>
+
+ <TMPL_LOOP qpools>
+ document.getElementById('pool_' + <TMPL_VAR name>).selected = true;
+ </TMPL_LOOP>
+ <TMPL_LOOP qlocations>
+ document.getElementById('location_' + <TMPL_VAR name>).selected = true;
+ </TMPL_LOOP>
+
+</script>
+
$ret{$i} = $1;
}
} elsif ($i =~ /^j(\w+)s$/) { # quote join args
- my @value = CGI::param($1) ;
+ my @value = grep { ! /^\s*$/ } CGI::param($1) ;
if (@value) {
$ret{$i} = $self->dbh_join(@value) ;
}
} elsif ($i =~ /^q(\w+)s$/) { #[ 'arg1', 'arg2']
$ret{$i} = [ map { { name => $self->dbh_quote($_) } }
- CGI::param($1) ];
+ grep { ! /^\s*$/ } CGI::param($1) ];
} elsif (exists $opt_p{$i}) {
my $value = CGI::param($i) || '';
if ($value =~ /^([\w\d\.\/\s:\@\-]+)$/) {
my $limit = '';
if ($elt{clients}) {
- my @clients = CGI::param('client');
+ my @clients = grep { ! /^\s*$/ } CGI::param('client');
if (@clients) {
$ret{clients} = \@clients;
my $str = $self->dbh_join(@clients);
}
if ($elt{filesets}) {
- my @filesets = CGI::param('fileset');
+ my @filesets = grep { ! /^\s*$/ } CGI::param('fileset');
if (@filesets) {
$ret{filesets} = \@filesets;
my $str = $self->dbh_join(@filesets);
}
if ($elt{mediatypes}) {
- my @medias = CGI::param('mediatype');
+ my @medias = grep { ! /^\s*$/ } CGI::param('mediatype');
if (@medias) {
$ret{mediatypes} = \@medias;
my $str = $self->dbh_join(@medias);
}
}
+ if ($elt{volstatus}) {
+ my $status = CGI::param('volstatus') || '';
+ if ($status =~ /^(\w)$/) {
+ $ret{status} = $1;
+ $limit .= "AND Media.VolStatus = '$1' ";
+ }
+ }
+
if ($elt{locations}) {
- my @location = CGI::param('location') ;
+ my @location = grep { ! /^\s*$/ } CGI::param('location') ;
if (@location) {
$ret{locations} = \@location;
my $str = $self->dbh_join(@location);
}
if ($elt{pools}) {
- my @pool = CGI::param('pool') ;
+ my @pool = grep { ! /^\s*$/ } CGI::param('pool') ;
if (@pool) {
$ret{pools} = \@pool;
my $str = $self->dbh_join(@pool);
my ($where, %elt) = $self->get_param('pools',
'mediatypes',
+ 'volstatus',
'locations');
my $arg = $self->get_form('jmedias', 'qre_media');
--- /dev/null
+<div class="otherboxtitle">
+ Filter
+</div>
+<div class="otherbox">
+<form name='form1' action='?' method='GET'>
+<table border='0'>
+<tr>
+ <td valign='top'>
+ <h2>Media Type</h2>
+ <select name='mediatype' class='formulaire'>
+ <option id='mediatype_all' value=''></option>
+<TMPL_LOOP NAME=db_mediatypes>
+ <option id='mediatype_<TMPL_VAR mediatype>'><TMPL_VAR mediatype></option>
+</TMPL_LOOP>
+ </select>
+ </td>
+</tr>
+<tr>
+ <td valign='top'>
+ <h2>Location</h2>
+ <select name='location' class='formulaire'>
+ <option id='location_all>' value=''></option>
+<TMPL_LOOP NAME=db_locations>
+ <option id='location_<TMPL_VAR location>'><TMPL_VAR location></option>
+</TMPL_LOOP>
+ </select>
+ </td>
+</tr>
+<tr>
+ <td valign='top'>
+ <h2>Status</h2>
+ <select name='volstatus' class='formulaire'>
+ <option id='volstatus_All' value=''></option>
+ <option id='volstatus_Append' value='Append'>Append</option>
+ <option id='volstatus_Full' value='Full'>Full</option>
+ <option id='volstatus_Error' value='Error'>Error</option>
+ <option id='volstatus_Used' value='Used'>Used</option>
+ <option id='volstatus_Purged' value='Purged'>Purged</option>
+ </select>
+ </td>
+</tr>
+<tr>
+ <td valign='top'>
+ <h2>Pool</h2>
+ <select name='pool' class='formulaire'>
+ <option id='pool_all>' value=''></option>
+<TMPL_LOOP NAME=db_pools>
+ <option id='pool_<TMPL_VAR name>'><TMPL_VAR name></option>
+</TMPL_LOOP>
+ </select>
+ </td>
+</tr>
+ <tr>
+ <td valign='bottom'>
+ <h2>Name</h2>
+ <input type='text' name='re_media'
+ <TMPL_IF qre_media>value=<TMPL_VAR qre_media></TMPL_IF>
+ class='formulaire' size='8'>
+ </td>
+</tr>
+ <tr>
+ <td valign='bottom'>
+ <h2>Number of items</h2>
+ <input type='text' name='limit' value='<TMPL_VAR limit>'
+ class='formulaire' size='4'>
+ </td>
+</tr>
+
+</table>
+ <input type="image" name='action' value='media' src='/bweb/update.png'>
+
+</form>
+</div>
+<script type="text/javascript" language="JavaScript">
+ <TMPL_IF volstatus>
+ document.getElementById('volstatus_<TMPL_VAR volstatus>').selected=true;
+ </TMPL_IF>
+
+ <TMPL_LOOP qmediatypes>
+ document.getElementById('mediatype_' + <TMPL_VAR name>).selected = true;
+ </TMPL_LOOP>
+
+ <TMPL_LOOP qpools>
+ document.getElementById('pool_' + <TMPL_VAR name>).selected = true;
+ </TMPL_LOOP>
+ <TMPL_LOOP qlocations>
+ document.getElementById('location_' + <TMPL_VAR name>).selected = true;
+ </TMPL_LOOP>
+
+</script>
+
-<br/>
<div class='titlediv'>
<h1 class='newstitle'>
Media