View | Details | Raw Unified | Return to bug 9468
Collapse All | Expand All

(-)a/C4/Koha.pm (-9 / +11 lines)
Lines 187-204 build a HTML select with the following code : Link Here
187
=cut
187
=cut
188
188
189
sub GetSupportList{
189
sub GetSupportList{
190
	my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes");
190
    my ( $params ) = @_;
191
    my $use_SuggestionsHideItemTypes = $params->{SuggestionsHideItemTypes};
191
192
192
     my $hidden_item_types = join( ',', map{ qq{'$_'} } split(qq{ }, C4::Context->preference("SuggestionsHideItemTypes") ) );
193
    my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes");
193
       my $hide_sql = $hidden_item_types ? "WHERE itemtype NOT IN ( $hidden_item_types )" : qq{};
194
194
195
	if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {  
195
	if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {  
196
		my $query = qq|
196
197
			SELECT *
197
        my $where;
198
                   FROM itemtypes
198
        if ( $use_SuggestionsHideItemTypes ) {
199
                 $hide_sql
199
            my $hidden_item_types = join( ',', map{ qq{'$_'} } split(q{ }, C4::Context->preference("SuggestionsHideItemTypes") ) );
200
                      ORDER BY description
200
            $where = $hidden_item_types ? "WHERE itemtype NOT IN ( $hidden_item_types )" : qq{};
201
		|;
201
        }
202
203
        my $query = qq{ SELECT * FROM itemtypes $where ORDER BY description };
202
		my $sth = C4::Context->dbh->prepare($query);
204
		my $sth = C4::Context->dbh->prepare($query);
203
		$sth->execute;
205
		$sth->execute;
204
		return $sth->fetchall_arrayref({});
206
		return $sth->fetchall_arrayref({});
(-)a/opac/opac-suggestions.pl (-2 / +1 lines)
Lines 100-106 if ( $op eq "delete_confirm" ) { Link Here
100
    exit;
100
    exit;
101
}
101
}
102
map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop;
102
map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop;
103
my $supportlist=GetSupportList();
103
my $supportlist = GetSupportList( { SuggestionsHideItemTypes => 1 } );
104
foreach my $support(@$supportlist){
104
foreach my $support(@$supportlist){
105
	if ($$support{'imageurl'}){
105
	if ($$support{'imageurl'}){
106
		$$support{'imageurl'}= getitemtypeimagelocation( 'opac', $$support{'imageurl'} );
106
		$$support{'imageurl'}= getitemtypeimagelocation( 'opac', $$support{'imageurl'} );
107
- 

Return to bug 9468