Fix for bug 2212: Searching with Itemtype limit doesn't work

The issue was that the index for itemtype is different depending
on whether you're using item-level or bib-level itemtypes. This
patch detects the system choice and sets the index properly
This commit is contained in:
Joshua Ferraro 2008-06-18 13:57:22 -05:00
parent 6c9b83fbdc
commit fee2ddc086
2 changed files with 6 additions and 2 deletions

View file

@ -219,6 +219,8 @@ $template->param(branchloop => \@branch_loop, searchdomainloop => $categories);
# load the Type stuff
# load the Type stuff
my $itemtypes = GetItemTypes;
# the index parameter is different for item-level itemtypes
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype';
my @itemtypesloop;
my $selected=1;
my $cnt;
@ -228,7 +230,7 @@ my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes");
if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) {
my %row =( number=>$cnt++,
imageurl=> $itemtypes->{$thisitemtype}->{'imageurl'}?($imgdir."/".$itemtypes->{$thisitemtype}->{'imageurl'}):"",
ccl => 'itemtype',
ccl => $itype_or_itemtype,
code => $thisitemtype,
selected => $selected,
description => $itemtypes->{$thisitemtype}->{'description'},

View file

@ -127,6 +127,8 @@ $template->param(branchloop => \@branch_loop, searchdomainloop => $categories);
# load the Type stuff
my $itemtypes = GetItemTypes;
# the index parameter is different for item-level itemtypes
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype';
my @itemtypesloop;
my $selected=1;
my $cnt;
@ -137,7 +139,7 @@ if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {
foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) {
my %row =( number=>$cnt++,
imageurl=> $itemtypes->{$thisitemtype}->{'imageurl'}?($imgdir."/".$itemtypes->{$thisitemtype}->{'imageurl'}):"",
ccl => 'itemtype',
ccl => $itype_or_itemtype,
code => $thisitemtype,
selected => $selected,
description => $itemtypes->{$thisitemtype}->{'description'},