use C4::Koha;
use MARC::Record;
use C4::Branch; # GetBranches
+use C4::ItemType;
sub plugin_parameters {
my ( $dbh, $record, $tagslib, $i, $tabloop ) = @_;
}
elsif ( $op eq "do_search" ) {
my $search = $query->param('search');
+ my $itype = $query->param('itype');
my $startfrom = $query->param('startfrom');
my $resultsperpage = $query->param('resultsperpage') || 20;
my $orderby;
+ $search = 'kw,wrdl='.$search.' and mc-itemtype='.$itype if $itype;
my ( $errors, $results, $total_hits ) = SimpleSearch($search, $startfrom * $resultsperpage, $resultsperpage );
my $total = scalar(@$results);
# }
# $sth->finish;
+ my @itemtypes = C4::ItemType->all;
+
$template->param( #classlist => $classlist,
CGIitemtype => $CGIitemtype,
CGIbranch => $CGIbranch,
CGIPublisher => $CGIpublisher,
+ itypeloop => \@itemtypes,
index => $query->param('index'),
Search => 1,
);
<input type="hidden" name="result" value="unimarc field 4 <!--TMPL_VAR Name="index" -->">
<input type="hidden" name="op" value="do_search">
<label class="label100" for="searchbox">Any word</label>
- <input type="text" name="search" id="searchbox" size="35">
+ <input type="text" name="search" id="searchbox" size="35"><br />
+ <label for="itypeloop">Item type:</label>
+ <select name="itype">
+ <option value="">All Item Types</option>
+ <!-- TMPL_LOOP NAME="itypeloop" -->
+ <!-- TMPL_IF NAME="selected" -->
+ <option value="<!-- TMPL_VAR NAME="itemtype" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option>
+ <!-- TMPL_ELSE -->
+ <option value="<!-- TMPL_VAR NAME="itemtype" -->"><!-- TMPL_VAR NAME="description" --></option>
+ <!-- /TMPL_IF -->
+ <!-- /TMPL_LOOP -->
+ </select>
</p>
<p>
<input type="submit" value="Start search">