From f5674f953a311cd642f0e28ac01a8a3882844d00 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Fri, 4 Apr 2008 11:16:01 +0200 Subject: [PATCH] reintroducing the limit on itemtype when searching a biblio in subscription add Signed-off-by: Joshua Ferraro --- .../serials/subscription-bib-search.tmpl | 14 +++++++ serials/subscription-bib-search.pl | 37 ++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tmpl index 548ef9b815..933c0a62cc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tmpl @@ -17,7 +17,21 @@ + + +

Limit type to: + +

+ + + + diff --git a/serials/subscription-bib-search.pl b/serials/subscription-bib-search.pl index bda92dde0d..3e8d7a97bd 100755 --- a/serials/subscription-bib-search.pl +++ b/serials/subscription-bib-search.pl @@ -71,6 +71,10 @@ my $query = $input->param('q'); # don't run the search if no search term ! if ($op eq "do_search" && $query) { + # add the itemtype limit if applicable + my $itemtypelimit = $input->param('itemtypelimit'); + $query .= " AND itype=$itemtypelimit" if $itemtypelimit; + $resultsperpage= $input->param('resultsperpage'); $resultsperpage = 19 if(!defined $resultsperpage); @@ -172,6 +176,22 @@ if ($op eq "do_search" && $query) { flagsrequired => {catalogue => 1, serials=>1}, debug => 1, }); + # load the itemtypes + my $itemtypes = GetItemTypes; + my @itemtypesloop; + my $selected=1; + my $cnt; + my $imgdir = getitemtypeimagesrc('intranet'); + foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) { + my %row =( + code => $thisitemtype, + selected => $selected, + description => $itemtypes->{$thisitemtype}->{'description'}, + ); + $selected = 0 if ($selected) ; + push @itemtypesloop, \%row; + } + $template->param(itemtypeloop => \@itemtypesloop); $template->param("no_query" => 1); } else { @@ -183,7 +203,22 @@ if ($op eq "do_search" && $query) { flagsrequired => {catalogue => 1, serials=>1}, debug => 1, }); - + # load the itemtypes + my $itemtypes = GetItemTypes; + my @itemtypesloop; + my $selected=1; + my $cnt; + my $imgdir = getitemtypeimagesrc('intranet'); + foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) { + my %row =( + code => $thisitemtype, + selected => $selected, + description => $itemtypes->{$thisitemtype}->{'description'}, + ); + $selected = 0 if ($selected) ; + push @itemtypesloop, \%row; + } + $template->param(itemtypeloop => \@itemtypesloop); $template->param("no_query" => 0); } -- 2.39.5