From b480348d9ec96ad777203cb43709ace32a5eab71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Andr=C3=A9=20Santoni?= Date: Fri, 28 Aug 2009 23:47:53 +0200 Subject: [PATCH] (bug #3560) This add a filter to search by itemtype The value builder for 4XX should be able to filter results by itemtype. --- cataloguing/value_builder/unimarc_field_4XX.pl | 6 ++++++ .../value_builder/unimarc_field_4XX.tmpl | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl index a55ceef941..195fb5ce78 100755 --- a/cataloguing/value_builder/unimarc_field_4XX.pl +++ b/cataloguing/value_builder/unimarc_field_4XX.pl @@ -31,6 +31,7 @@ use C4::Biblio; use C4::Koha; use MARC::Record; use C4::Branch; # GetBranches +use C4::ItemType; sub plugin_parameters { my ( $dbh, $record, $tagslib, $i, $tabloop ) = @_; @@ -327,9 +328,11 @@ sub plugin { } 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); @@ -530,10 +533,13 @@ sub plugin { # } # $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, ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tmpl index cbcb961d20..253e8a386a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tmpl @@ -112,7 +112,18 @@ "> - +
+ +

-- 2.39.5