From 6823b2387c624017541795d2af661ad356b467e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Andr=C3=A9=20Santoni?= Date: Thu, 27 Aug 2009 13:16:01 +0200 Subject: [PATCH] [3.0.x](bug #3560) This add a filter to search by itemtype The value builder for 4XX should be able to filter results by itemtype. Signed-off-by: Henri-Damien LAURENT --- 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.20.1