@@ -, +, @@ --- C4/Koha.pm | 20 +++++++++++--------- opac/opac-suggestions.pl | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) --- a/C4/Koha.pm +++ a/C4/Koha.pm @@ -187,18 +187,20 @@ build a HTML select with the following code : =cut sub GetSupportList{ - my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes"); + my ( $params ) = @_; + my $use_SuggestionsHideItemTypes = $params->{SuggestionsHideItemTypes}; - my $hidden_item_types = join( ',', map{ qq{'$_'} } split(qq{ }, C4::Context->preference("SuggestionsHideItemTypes") ) ); - my $hide_sql = $hidden_item_types ? "WHERE itemtype NOT IN ( $hidden_item_types )" : qq{}; + my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes"); if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { - my $query = qq| - SELECT * - FROM itemtypes - $hide_sql - ORDER BY description - |; + + my $where; + if ( $use_SuggestionsHideItemTypes ) { + my $hidden_item_types = join( ',', map{ qq{'$_'} } split(q{ }, C4::Context->preference("SuggestionsHideItemTypes") ) ); + $where = $hidden_item_types ? "WHERE itemtype NOT IN ( $hidden_item_types )" : qq{}; + } + + my $query = qq{ SELECT * FROM itemtypes $where ORDER BY description }; my $sth = C4::Context->dbh->prepare($query); $sth->execute; return $sth->fetchall_arrayref({}); --- a/opac/opac-suggestions.pl +++ a/opac/opac-suggestions.pl @@ -100,7 +100,7 @@ if ( $op eq "delete_confirm" ) { exit; } map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop; -my $supportlist=GetSupportList(); +my $supportlist = GetSupportList( { SuggestionsHideItemTypes => 1 } ); foreach my $support(@$supportlist){ if ($$support{'imageurl'}){ $$support{'imageurl'}= getitemtypeimagelocation( 'opac', $$support{'imageurl'} ); --